一键导入
update-pull-request
Updates an existing PR body by modifying MUTABLE blocks and appending to APPEND-ONLY blocks. Use when transitioning between workflow phases.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Updates an existing PR body by modifying MUTABLE blocks and appending to APPEND-ONLY blocks. Use when transitioning between workflow phases.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | update-pull-request |
| description | Updates an existing PR body by modifying MUTABLE blocks and appending to APPEND-ONLY blocks. Use when transitioning between workflow phases. |
| argument-hint | PR number, target phase, actor, summary, and optional block content |
Renders the current workflow state to the PR body at phase transitions. Reads the updated state file and writes the corresponding PR blocks using boundary markers (PR_BLOCK:*:BEGIN/END) for safe, idempotent edits.
The state file is the source of truth. This skill is always called after manage-state has been updated — never the other way around.
Schema reference: Block definitions, mutability rules, and idempotency rules are defined in
pr-schema.instructions.md. The PR body template is inpr-template.instructions.md.
Implementing, add Branch linkReviewing, populate Review SummaryReady, undraft, sanitize sections| Phase | Caller |
|---|---|
| Branching through Review | orchestrator (direct skill invocation) |
| Finalization (Submit) | pr-author agent |
python3 --version)git installedGITHUB_TOKEN or BITBUCKET_TOKEN setPR_BLOCK:*:BEGIN/END boundary markersThe caller must provide:
| Input | Required | Description |
|---|---|---|
| PR number | Always | The PR number returned by create-pull-request |
| Target phase | Always | One of: Planning, Implementing, Reviewing, Submitting, Ready |
| Actor | Always | Agent name performing the update (e.g., orchestrator, pr-author) |
| Summary | Always | One-line description for the Phase Log entry |
| Branch name | If entering Implementing | Branch name to populate Links block |
| Review Summary content | If entering Submitting | Risk level, findings, resolutions from reviewer |
| Decisions Log entry | If scope changed | Full decision entry (date, title, decision, rationale, alternatives, impact, trigger) |
| Title | Optional | Updated PR title (typically only at finalization) |
| Undraft | If entering Ready | Flag to mark PR as ready for review |
python3 ./.github/skills/create-pull-request/scripts/pr_helper.py fetch-body \
--pr-number <PR_NUMBER> > /tmp/pr_current_body.md
Scan /tmp/pr_current_body.md and confirm all PR_BLOCK:*:BEGIN/END pairs from the template exist. If any marker pair is missing or malformed: STOP and report the error. Do not guess where to write.
Replace the entire content between BEGIN and END markers for each block being updated. Use the structure from the PR template in pr-template.instructions.md.
Implementing): Update Branch to actual branch name.Submitting): Populate with reviewer's findings and resolutions.Apply idempotency rules from pr-schema.instructions.md before appending.
| <ISO timestamp> | \` | | File writing rule: Write the updated body to
/tmp/pr_updated_body.mdusingpython3 -c '...'with single outer quotes. Never use heredocs (<<EOF) orpython3 -c "..."with double outer quotes — both corrupt output in agent shell sessions:python3 -c 'open("/tmp/pr_updated_body.md","w").write(FULL_BODY_STRING)'
# Update the PR via API
python3 ./.github/skills/create-pull-request/scripts/pr_helper.py update \
--pr-number <PR_NUMBER> \
--body-file /tmp/pr_updated_body.md
If entering Ready phase (finalization):
python3 ./.github/skills/create-pull-request/scripts/pr_helper.py update \
--pr-number <PR_NUMBER> \
--body-file /tmp/pr_updated_body.md \
--undraft
If updating the title at finalization:
python3 ./.github/skills/create-pull-request/scripts/pr_helper.py update \
--pr-number <PR_NUMBER> \
--body-file /tmp/pr_updated_body.md \
--title "<final title>" \
--undraft
Report the PR URL back to the caller. If the update failed, report the error and the HTTP status code so the caller can decide whether to retry or escalate.
| Target Phase | Status Update | Links Update | Phase Log Append | Review Summary | Undraft |
|---|---|---|---|---|---|
Implementing (branch) | Phase → Implementing | Branch → name | Yes | No | No |
Implementing (impl done) | No change | No | Yes | No | No |
Reviewing | Phase → Reviewing | No | Yes | No | No |
Submitting | Phase → Submitting | No | Yes | Yes (populate) | No |
Ready (finalize) | Phase → Ready, Draft → false | No | Yes | Sanitize | Yes |
fetch-body to get the latest PR body before editing — never edit from a stale copypr_helper.py script lives at .github/skills/create-pull-request/scripts/pr_helper.pyAgent Notes section if empty--dry-run on pr_helper.py update to preview changes before applyingCreates, reads, and updates the per-workflow agent state file at .github/state/<TICKET-KEY>.md — a fast-access local mirror of workflow context that reduces GitHub API round-trips and enables richer resumption. Use when creating a new workflow, at phase transitions, or when resuming.
Restores full workflow context from an existing draft PR and its state file, then returns the current phase and all parsed context (plan, branch, ticket key, task statuses) so the orchestrator can route to the correct resume point. Use when the input to a workflow is a PR URL or number.
Updates an existing PR body by modifying MUTABLE blocks and appending to APPEND-ONLY blocks. Use when transitioning between workflow phases.
Creates, reads, and updates the per-workflow agent state file at .github/state/<TICKET-KEY>.md — a fast-access local mirror of workflow context that reduces GitHub API round-trips and enables richer resumption. Use when creating a new workflow, at phase transitions, or when resuming.
Creates a draft Pull Request using the canonical PR body template. Populates all initial blocks and returns PR URL + PR number. Use after the branch has been created and pushed.
Performs git operations: creating branches from ticket keys, staging and committing changes with conventional commit messages, and pushing to origin. Use when branching, committing, or pushing code.