PR Workflow
Handle the branch and pull-request lifecycle cleanly.
Workflow
-
Check branch and diff state. Understand what changed, what is staged, and whether the branch is appropriate for the requested action.
-
Prepare the update. Run the expected validation commands (
AGENTS.md§ Toolchain), compose a clean summary, and make sure the branch reflects the intended scope. -
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:
| Command | Leaves the PR | Wraps the docs |
|---|---|---|
/pr | ready for review — opened ready, or the branch's draft turned ready | yes: on a planned branch it runs the Wrap row (/pr-wrap) first; readies nothing while a 1-WIP/ document of the branch remains |
/draft-pr | draft — fast, every check skipped | no — 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.
- 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.