Community编程与开发github.com

pr

Prepare, update, and land pull requests, including branch hygiene and merge workflows. Use when the user wants help creating a PR, updating an existing PR, merging changes, splitting a PR into a stacked sequence, adding a new draft PR on top of a registered stack, preparing a stack to land (`/fix-pr-stack`), landing it (`/merge-pr-stack`), or following up on a branch.

pr 是什么?

pr is a Claude Code agent skill that prepare, update, and land pull requests, including branch hygiene and merge workflows. Use when the user wants help creating a PR, updating an existing PR, merging changes, splitting a PR into a stacked sequence, adding a new draft PR on top of a registered stack, preparing a stack to land (`/fix-pr-stack`), landing it (`/merge-pr-stack`), or following up on a branch.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mantasindrasius/skills/tree/HEAD/skills/pr

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

PR Workflow

Handle the branch and pull-request lifecycle cleanly.

Workflow

  1. Check branch and diff state. Understand what changed, what is staged, and whether the branch is appropriate for the requested action.

  2. Prepare the update. Run the expected validation commands (AGENTS.md § Toolchain), compose a clean summary, and make sure the branch reflects the intended scope.

  3. Create or update the PR. Use the repo's normal PR flow without bypass flags or hidden shortcuts. Pick the command by the state the PR should be left in:

CommandLeaves the PRWraps the docs
/prready for review — opened ready, or the branch's draft turned readyyes: on a planned branch it runs the Wrap row (/pr-wrap) first; readies nothing while a 1-WIP/ document of the branch remains
/draft-prdraft — fast, every check skippedno — the changeset stays in 1-WIP/

To push new commits to an existing PR, commit and git push on its branch: that never changes its draft or ready state.

  1. Land or reorganize the work. When asked, merge carefully, split a PR into a stacked sequence (/split-pr-to-stack), add a draft PR on top of a registered stack (/add-to-pr-stack), or branch a follow-up off an open PR.

Use These Source Prompts

  • .agents/commands/pr.md (a ready-for-review PR — wraps first on a planned branch)
  • .agents/commands/draft-pr.md (a draft PR, checks skipped, no wrap)
  • .agents/commands/merge.md (base-aware merge; not main-locked)
  • .agents/commands/repoint.md (repoint a stacked branch onto main after its predecessor lands)
  • .agents/commands/squash-pr.md (squash-land a PR to main, or fold it into its base PR — detects the stacked-base ambiguity and asks)
  • .agents/commands/follow-up-branch.md (start a new branch based on a referenced branch or PR; does not open a PR)
  • .agents/commands/add-to-pr-stack.md (new draft PR at the tail of a registered stack)
  • .agents/commands/fix-pr-stack.md (rebase, comment sweep, local-gated fixes — before landing)
  • .agents/commands/merge-pr-stack.md (land a whole registered stack bottom-up — async merge, GitHub restacks)
  • .agents/commands/split-pr-to-stack.md (split one PR into a stacked sequence; A→B→C → A→B1→B2→C)

Stacked PRs

For any stacked-PR work — planning a stack, splitting an existing PR into stacked slices, implementing one of its PRs, rebasing a single stack branch, keeping a branch current with its base, repointing after a predecessor lands, squash-landing, preparing a stack to land (/fix-pr-stack) then landing it (/merge-pr-stack), branching a follow-up off an open PR, or adding a new draft PR on top of a registered stack — use the pr-stack skill (.agents/skills/pr-stack/SKILL.md). It is the shared model behind /plan-pr-stack, /add-to-pr-stack, /split-pr-to-stack, /pr-stack-rebase, /fix-pr-stack, /merge-pr-stack, /green, /validate-changes, /merge, /repoint, /squash-pr, and /follow-up-branch.

Inside a stack, each PR is implemented in its own worktree, in the order its changeset's [wf] rows set. /pr-wrap runs the /validate-changes procedure itself, and both always run /pr-stack-rebase (this branch only — never gh stack sync from a per-PR worktree) before any code diff, not only when the base has visibly moved.

Merge gate

Before approving, merging, or reporting a PR as ready to land, read the state on the PR's current head SHA instead of re-checking by hand:

gh pr checks <N>                      # every check, required or not: pending, failed and skipped are named
gh pr view <N> --json state,isDraft,mergeable,mergeStateStatus,reviewDecision,headRefOid

A PR is mergeable only when it is open and not a draft, every check has passed (optional ones included), mergeable is not CONFLICTING, and no review thread is unresolved without an answer. A blocked verdict is the work queue, not a reason to merge anyway.

The ## Workflow rows this skill's commands own

/pr-wrap owns Wrap, the last row, under .agents/skills/pr-lifecycle/SKILL.md; opening the PR ready, or gh pr ready on the draft, is its closing act, through /pr's Open ready procedure. /pr owns no row: on a planned branch it runs the Wrap row, on an ad-hoc branch it opens the PR ready on its own. /fix-pr is a post-wrap procedure with no row and no TODO (§ Post-wrap); reacting to and replying on review threads is /fix-pr's own work.

Comments posted on the user's behalf

A comment or reply an agent posts goes out under the user's GitHub identity, so a reader cannot tell it from one the user typed. Every such comment — review-thread replies, PR-level comments, issue comments, review bodies — starts with this prefix line, then a blank line, then the message:

🤖 **<login>'s agent:**

<message>

<login> is the user's GitHub login (gh api user -q .login). Write the prefix into the scratch body file, never into shell source:

{ printf "🤖 **%s's agent:**\n\n" "$(gh api user -q .login)"; cat tmp/reply-text.md; } > tmp/reply.md

Reactions, PR titles and PR descriptions are not comments and take no prefix.

References

Read references/git-usage.md for the git rules this repo keeps.

Guardrails

  • Never use --no-verify.
  • Keep destructive branch actions explicit and intentional.

Individual skills in this repo

This repo contains 2 individual skills — each has its own dedicated page.

cursor-subagent

Offload a command's implementation work to the Cursor agent CLI (`agent -p`, stream-json, `--resume` to keep one conversation) on Composer (`#composer`) or `glm-5p3-flash` (`#glm`), with the smallest allowed subagent as its driver (Sonnet · low on Claude Code; GLM · low on Cursor — on Cursor only the GLM and Composer model families may be used, and `-flash` variants are preferred wherever a family offers them): it starts turns, follows and judges the agent's stream, and resumes until the stage is really done. Applies to the implementation commands — `/green`, `/pr-wrap`, `/fix-pr`, the rows `/yolo` runs, and `/yolo-pr-stack`'s `[G]`/`[W]`/`[F]` stages. Planning always stays with the session's own model. Runs on this machine. The main agent checks the Cursor agent is installed and logged in and guides the user through both when not. Use ONLY when the user asks for it — `#cursor-subagent` (or `#composer`), `#glm`, or words like "let Composer do it" / "offload to Cursor". Never choose ...

deferred-work

The file-per-item records this repo keeps for work it did NOT do and decisions nobody reviewed — changeset TODOs (`docs/todo/`), code issues (`docs/code-issues/`), and deferred answers, the questions a `#yolo` run decided instead of asking (`docs/deferred-answers/`). Defines when deferring is legitimate at all (the bar is high: the goal of a changeset is its full planned scope), the record formats, how planning cross-checks them as changeset prerequisites, and how records are closed. Use when planning a changeset or a PR stack, when something cannot be finished, when recording a verified code-quality finding, when a `#yolo` run would have asked a question, or when landing a stack.

相关技能