agentleFS
kostya-epifanovkostya-epifanov/claude-gantry/skills/ship/SKILL.md

ship

Skill1 starsChanged 3 months agoMITView on GitHub

Advances the current branch one clean step closer to a merged PR, doing only what isn't done yet — commits outstanding changes, pushes to the upstream, opens a pull request, and once the PR exists and is up to date, reports its status and waits. Idempotent — it detects the stage and picks up from there, so it's safe to run repeatedly. Pass --no-pr to stop after the push without opening a PR, --draft to open the PR as a draft, or --review / --review-fix to run gantry:review before the push. Use when the user types "/gantry:ship", or asks to ship, to commit and push, to open a PR for this branch, or to "get this out for review". Refuses to run on the repo's default branch.

  • Commits and pushes

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-deploy, debug-fix and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ayudaySkill

    setup-deploy

    Configure deployment settings for /land-and-deploy. Detects your deploy platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom), production URL, health check endpoints, and deploy status commands. Writes the configuration to CLAUDE.md so all future deploys are automatic. Use when: "setup deploy", "configure deployment", "set up land-and-deploy", "how do I deploy with gstack", "add deploy config".

    Also in 23 projects that use this

  • zebbernSkill

    debug-fix

    Find and fix a bug or issue — from any source (GitHub issue, error message, user report, or observed behavior)

    Also in 4 projects that use this

  • seek888Skill

    open-gstack-browser

    Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in. Opens a visible browser window where you can watch every action in real time. The sidebar shows a live activity feed and chat. Anti-bot stealth built in. Use when asked to "open gstack browser", "launch browser", "connect chrome", "open chrome", "real browser", "launch chrome", "side panel", or "control my browser". Voice triggers (speech-to-text aliases): "show me the browser".

    Also in 12 projects that use this

  • ayudaySkill

    unfreeze

    Clear the freeze boundary set by /freeze, allowing edits to all directories again. Use when you want to widen edit scope without ending the session. Use when asked to "unfreeze", "unlock edits", "remove freeze", or "allow all edits".

    Also in 26 projects that use this

  • ShreyRaviSkill

    landing-report

    Read-only queue dashboard for workspace-aware ship. Shows which VERSION slots are currently claimed by open PRs, which sibling Conductor workspaces have WIP work likely to ship soon, and what slot /ship would pick next. No mutations — just a snapshot. Use when asked to "landing report", "what's in the queue", "show me open PRs", or "which version do I claim next". (gstack)

    Also in 11 projects that use this

  • ramybarsoumSkill

    document-release

    Post-ship documentation update. Reads all project docs, cross-references the diff, updates README/ARCHITECTURE/CONTRIBUTING/CLAUDE.md to match what shipped, polishes CHANGELOG voice, cleans up TODOS, and optionally bumps VERSION. Use when asked to "update the docs", "sync documentation", or "post-ship docs". Proactively suggest after a PR is merged or code is shipped.

    Also in 25 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

30 rules. 0 are common, 10 are distinctive, and 20 are very specific to this project.

  • 0

    Common

    Most of the 185 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 20

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    --no-pr: if $ARGUMENTS contains --no-pr, run commit → push only.

    line 22
  2. Very specific:

    --base <branch>: if $ARGUMENTS names a base branch, pass it straight through to the detector (below) so it overrides base detection, and …

    line 37
  3. Distinctive:

    Look before writing the message: git status and git diff (or git diff --staged).

    line 88
  4. Distinctive:

    Respect intentional staging: If anything is already staged, commit exactly what's staged.

    line 90
  5. Distinctive:

    One coherent change: If the outstanding work is clearly several unrelated changes, don't bury them in one "ship" commit — pause and ask how …

    line 92
  6. Very specific:

    If the review changed files, commit them on their own — separately from stage 2's commit, so the review's edits stay legible as review …

    line 195
  7. Very specific:

    A review you asked for can stop the ship: If gantry:review reports the change unsafe to ship — it sets status: blocked for exactly this — …

    line 225
  8. Distinctive:

    If the push is rejected because the remote moved, stop and report it — let the user integrate (git pull --rebase) rather than force-pushing.

    line 248
  9. Very specific:

    The tracker id goes first: When the detector says TASK:present — never on inherited, whose task.md is a previous task's — run bash …

    line 282
  10. Very specific:

    Read what exists at ROOT — the detector already reported which do:

    line 316
  11. Very specific:

    Every body carries a ## Risk section, and a ## Guarded changes section when the change is

    line 382
  12. Very specific:

    not: read from review.md or decided by you — ship computes it again, at ship time, against the same base the review used:

    line 386
  13. Very specific:

    every FLOOR: the script printed.

    line 430
  14. Distinctive:

    Never write "judged by the base's version" for this one: there was no base version to judge it.

    line 503
  15. Very specific:

    When the change is guarded, the PR also gets the GitHub label guarded — under *Open it* below, after the PR exists, so a missing label …

    line 505
  16. Distinctive:

    All of them are disclosures.

    line 510
  17. Very specific:

    2b. A review whose coverage was reduced: When review.md is current (FRESH:yes) and carries a Guard blocks: header line whose text — after …

    line 531
  18. Distinctive:

    When all three hold, name the version that actually executed, and be exact about what was and was not exercised — one sentence is wrong for …

    line 575
  19. Very specific:

    Check the composed title, the composed body, and the commit subject against task.md and the diff.

    line 628
  20. Distinctive:

    Keep the file out of git, so git add -A on a later run can never sweep it into a commit:

    line 657
  21. Very specific:

    Write the final, re-read body with the Write tool to <ROOT>/.claude/artifacts/pr-body.md.

    line 663
  22. Very specific:

    Run the create only when the list did not print guarded.

    line 693
  23. Very specific:

    If gh pr create failed, leave the file where it is: it is excluded from git, so it cannot reach a commit, and the next run composes the …

    line 704
  24. Very specific:

    What it may rewrite: Only the ## Deliberately not done, ## Exercised by this run, ## Risk and ## Guarded changes sections, each only when …

    line 723
  25. Very specific:

    Run from ROOT, with relative paths, under the same rule as *Open it* above.

    line 728
  26. Very specific:

    Ask whether each section needs refreshing — three questions.

    line 760
  27. Very specific:

    No guarded file was written (the change is not guarded and the body has no ## Guarded changes) → there is no second splice, so the Risk …

    line 848
  28. Very specific:

    ## Not proven by this run is not refreshed: When QA has moved to exercised and the task declared scenarios, that section may still list …

    line 866
  29. Distinctive:

    Check it, send it, clean up — three blocks, because each gates the next.

    line 870
  30. Distinctive:

    If a guard stopped it (on the default branch, diverged, nothing to ship, gh unavailable), say which and what the user should do next.

    line 953

“Common” is measured: kept by at least 6 in 10 of the 185 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

gantry:ship

Move the current branch to the next stage on the path commit → push → open PR → wait, doing only the stages that aren't done yet. Run it once and it advances as far as it can in one go; run it again later and it picks up wherever the branch now sits.

Typing /gantry:ship is the go-ahead to commit, push, and open the PR — don't ask for confirmation stage by stage. Do still stop on the guards below (default branch, diverged branch, nothing to ship). This skill runs in any repo, so follow that repo's conventions, not gantry's.

Ship does not review. There is no review stage on the path above, and a bare /gantry:ship never invokes /code-review or gantry:review. A review is slow, expensive and worth choosing, so it is something you ask for by flag — see Review, only when you asked for it below.

--no-pr: if $ARGUMENTS contains --no-pr, run commit → push only. Skip stage 4 entirely and treat the push as the finish line — after pushing, go straight to the report and note the PR was intentionally not opened. This is the mode /gantry:auto --no-pr passes through. One thing survives the skip: stage 4's disclosure checks. The push still happens, so a --no-pr run that changed the plugin's own files, or shipped a task with unproven acceptance criteria, still has to say so — in the report, since there is no body to say it in.

--review / --review-fix: run gantry:review before the push, in a fresh headless child session. --review reviews and reports without touching the code; --review-fix also runs a second child that applies the findings triage kept. Both take an optional tier — --review=<tier>, --review-fix=<tier> — and the bare forms mean high. --review-model <alias> and --review-effort <level> reach the child as --model and --effort; with neither, it inherits the user's defaults. See the section below, which is where the whole behaviour lives.

--base <branch>: if $ARGUMENTS names a base branch, pass it straight through to the detector (below) so it overrides base detection, and open the PR against it. Use it when the repo integrates somewhere other than what detection would pick. An override that names a branch which doesn't exist is ignored (the detector warns and auto-detects); a malformed --base with no value is a usage error (the detector exits non-zero). /gantry:auto --base <branch> passes through.

--draft: open the pull request as a draft (gh pr create --draft). Use it when nobody has reviewed the change live — which is why /gantry:auto-unattended always passes it. A draft doesn't request reviewers, so it says "this is finished but unwatched" rather than "please look now". It only affects stage 4; with --no-pr it does nothing.

Steps

1. Detect the stage

$GANTRY is this skill's plugin root — resolve it from this file's own location, the same way the other gantry skills do, rather than hardcoding a path.

bash "$GANTRY/skills/ship/scripts/detect_state.sh"                 # normal
bash "$GANTRY/skills/ship/scripts/detect_state.sh" --base <branch> # when --base was given

One read-only pass. It prints BRANCH, BASE (the PR base = repo default branch), UPSTREAM, AHEAD/BEHIND vs upstream, AHEAD_OF_BASE (commits not yet in base), DIRTY, ON_DEFAULT, GH (ok/missing/unauth), PR (none, or number + url + state + mergeable + reviewDecision), and a final STAGE: — the entry point. Route on STAGE:

  • not-a-repo / detached → nothing to ship; say so and stop.
  • on-default → the branch is the base; you can't open a PR against itself. Stop and suggest starting a branch first (e.g. /gantry:worktree <name>). Don't commit onto the default branch.
  • behind → the branch has diverged from its upstream (ahead and behind). Stop; tell the user to integrate first (git pull --rebase) and re-run. Never force-push to resolve this.
  • no-diff → clean and pushed but no commits over BASE — there's nothing to open a PR for. Report and stop.
  • commit → go to stage 2, then flow on through push and PR.
  • push → skip to stage 3 — through the review section below, if a review flag was given.
  • pr → skip to stage 4. The branch is already pushed; the PR has not been opened. A review flag still runs first — see Review, only when you asked for it, which says what pr does.
  • done → skip to stage 5. The PR already exists.

A review flag is the one thing these skips must not jump over: the section that describes it sits between stages 2 and 3, and it carries its own entry-point table for exactly this reason.

Completing one stage lands you at the top of the next, so once you enter at the routed stage, continue straight down without re-detecting — with one exception: --review-fix can create a commit, and if it does, you must re-run the script before continuing. That exception belongs to the review section below, which says when it applies.

2. Commit

Look before writing the message: git status and git diff (or git diff --staged).

  • Respect intentional staging. If anything is already staged, commit exactly what's staged. Otherwise stage everything with git add -A and commit that.
  • One coherent change. If the outstanding work is clearly several unrelated changes, don't bury them in one "ship" commit — pause and ask how to split it. A quick, coherent diff needs no such pause. If task.md's frontmatter names a lead:, put this question to the lead instead, as a fork, following $GANTRY/skills/auto/references/lead.md.
  • Message: a concise imperative subject, plus a short body if the change warrants it. Match the repo's recent git log style, including whether it uses commit trailers — some repos do, some (like gantry) deliberately don't. Follow the ambient convention.
  • Re-read the subject before committing it, under the same rule stage 4 applies to the PR body: a claim about how something works either cites the file that establishes it, or it does not go in the subject. This is the only point at which the subject is free to fix. After stage 3 it is on the remote, and stage 3 does not rewrite history to correct prose.
git commit -m "<subject>"        # add -m for a body paragraph if warranted

Then assert the tree is clean — after every commit this skill makes, before anything is pushed. A commit takes what was staged when it ran: a file edited since, or left out by partial staging, is not in it, and the push below would carry the branch without it, silently.

bash "$GANTRY/skills/ship/scripts/assert_clean_tree.sh"

Exit 0 (CLEAN) → continue exactly as before. Any non-zero exit → no push, no PR, stop. Exit 1 prints DIRTY:<n> and a PATH: line for every outstanding path: name them all in the report, including files you left out on purpose, and let the user decide each one — commit it, exclude it, or discard it. Never commit or exclude one yourself to turn the check green. Say what a re-run does: with nothing staged, ship falls back to git add -A and commits every leftover. Exit 2 means the check could not run (not a work tree, or git status failed); that is a stop too, never a pass.

Review, only when you asked for it

Not a stage. It has no number because it is not on the path: with neither flag given, nothing in this section runs and nothing invokes a reviewer. That is the default, and it is deliberate.

  • --review → launch gantry:review in a fresh headless child. It reviews, verifies its findings, triages them against task.md, records what is in scope to fix in review.md, and reports. It does not touch the code under review.
  • --review-fix → the same, and then — when the detector says REVIEW:pending — a second headless child runs gantry:review --fix, which applies what review.md lists and re-runs the gate over its own edits.

Headless, through the launcher, never in this session. Since 0.7.0 there is one place a review runs when an entry point asks for it, and it is lib/run_phase_headless.sh — the same launcher the drivers use — so the reviewer is a child that has read nothing but the skill, the artifacts and the diff, rather than the context that just wrote the commit. Do not invoke /gantry:review yourself. Run each launch with the Bash tool's run_in_background and wait for the completion notification; do not poll:

bash "$GANTRY/lib/run_phase_headless.sh" --phase review --root <ROOT> --tier <tier>
bash "$GANTRY/lib/run_phase_headless.sh" --phase review-fix --root <ROOT>      # --review-fix, on REVIEW:pending

Pass --model every time: a child with no --model takes the user default from settings.json, not this session's model. Use --review-model's alias when it was given, otherwise the model this session is running on. Add --effort <level> only when --review-effort was given, and --plugin-dir "$GANTRY" when $GANTRY is not under ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/plugins/ (a checkout, not an install). Then read the launcher's lines: exit 1 or 3 → the review did not happen; stop with its REASON: line, no push, no PR. Exit 2 → a broken environment (no jq, no claude); stop and say so. On exit 0, run bash "$GANTRY/lib/detect_stage.sh": STATUS:blocked → the review found the change unsafe; stop. Under --review-fix, REVIEW:pending → launch the fix child and read its GATE_EXIT:; REVIEW:clean or REVIEW:partial → nothing to apply, say so (on partial, say a guard block reduced review coverage). Carry every DENIED: line and both SESSION: ids into the report.

The tier rides on the flag. --review=<tier> and --review-fix=<tier> are forwarded to the launcher as --tier <tier>; the bare forms mean high. Do not validate the tier here. gantry:review owns the valid-value list and rejects anything outside it — duplicating that list is how two skills come to disagree about it. If the child rejects the value it stops without dispatching anything, the launcher exits non-zero with its reason, and by then stage 2 has already committed: nothing has been pushed, the commit stands, and the run is resumed by fixing the flag and running ship again. Say exactly that in the report rather than leaving the state to be guessed at.

Where it runs, at each entry point. "Before the push" only describes one of them, and an explicitly requested review must never silently not happen:

  • commit → after stage 2's commit, before stage 3's push.
  • push → nothing to commit; run it before stage 3's push.
  • pr → the branch is already pushed. Run the review anyway; if it commits anything, push that before opening the PR, so the PR is never opened over a tip older than the review that informed it. This is the entry point where doing nothing would be a silent failure.
  • done → the PR is already open. Say the flag had no effect and why; do not review a change that has already been published as though it could still change the outcome here.
  • no-diff / the other guards → the run stops before this section is reached.

The gate belongs to the review, and a red one stops the ship. The fix child re-runs lib/run_gates.sh over its own fixes and records the result in review.md's applied: line, which the launcher reads back as GATE_EXIT: — ship runs no gate of its own, so take the exit code from that line and treat a non-zero one as terminal: no push, no PR. A fix made after the gate went green is unproven code, and --review-fix is the only path on which ship could carry unproven code to a remote. Report the exit code and what failed.

And note what a 0 does not prove. Under --review-fix the review runs run_gates.sh without --strict on the supervised path, so a repo where no checks are detected exits 0 — the NO-GATES notice — rather than the 3 that --strict would give. In that repo the review's edits are pushed unproven: nothing ran over them. Say so in the report instead of reporting a green gate. "The gate passed" and "there was no gate" are not the same result, and this is still the one path that can push code no check has seen.

If the review changed files, commit them on their own — separately from stage 2's commit, so the review's edits stay legible as review edits rather than folded into the change being reviewed. That is --review-fix, and only it:

git add -A && git commit -m "Apply review findings"            # --review-fix

Then, if that commit was made (a fix child that changed nothing makes none), run the same assertion, with the same rule — any non-zero exit stops the ship before the push:

bash "$GANTRY/skills/ship/scripts/assert_clean_tree.sh"

A bare --review has nothing to commit. The only files a read-only review writes are review.md, handover.md and task.md's status, and all three are excluded (docs/ARCHITECTURE.md § The artifact contract) — so git add -A would stage nothing and the commit would fail on an empty index. Do not run one. What it deferred still reaches the reviewer, through stage 4's body rather than through the diff.

Then re-detect — after --review-fix, and after the commit it caused rather than before it. Everything downstream branches on AHEAD and DIRTY, so a read taken before the fixes, or before the commit they caused, would push the wrong thing, or nothing at all. After a bare --review the tree is where stage 2 left it and the original read still holds.

bash "$GANTRY/skills/ship/scripts/detect_state.sh"     # again, after --review-fix and its commit

A review you asked for can stop the ship. If gantry:review reports the change unsafe to ship — it sets status: blocked for exactly this — stop: no push, no PR. This is a deliberate difference from a missing reviewer, which never blocks anything: you asked for this review, so its verdict counts. Report what it found.

Why this skill's allowed-tools is as wide as it is. Frontmatter restricts what is permitted while the skill is active, so an invoked sub-skill cannot use a tool this one has not allowed. The review no longer runs inside this session — its tools are the child's, set by the launcher — so none of this list is what lets a review edit. Write is still needed for the pull-request body file in stage 4 and for the lead reply file under references/lead.md; AskUserQuestion for stage 2's split question and SendMessage for its lead form; Edit, Agent, Grep and Glob stay so that a sub-skill ship invokes is not silently narrowed. Do not trim it.

3. Push

git push -u origin HEAD     # when UPSTREAM was NONE (first push of this branch)
git push                    # when an upstream already exists and AHEAD > 0

Take UPSTREAM and AHEAD from the most recent detector read — a review flag may have committed since the first one.

If the push is rejected because the remote moved, stop and report it — let the user integrate (git pull --rebase) rather than force-pushing.

4. Open the PR

First, branch on PR from the detector read. A PR that already exists cannot be opened again, and this stage's only fenced commands are gh pr create, which fails outright against one:

  • PR:none → compose and create, as the rest of this stage describes.
  • anything else (a PR already exists) → skip straight to Refresh the handover, QA and Risk sections below, then continue to stage 5. Nothing here is composed or created.

That second route is not hypothetical. detect_state.sh routes a dirty tree to commit and an ahead branch to push whether or not a PR exists, and stage 1 says to continue straight down without re-detecting — so "write the handover, make one more commit, run /gantry:ship" arrives here with the PR already open. It is also exactly the path on which a handover most needs to reach the body.

Skip this stage entirely if --no-pr was given — the push was the finish line. Go straight to the Report (not stage 5, which reads a PR that doesn't exist) and note the PR was intentionally not opened. Run the contract step, the Risk step and both disclosure checks below anyway and put their answers in the report — the risk level, every guarded file and every open risk; the push already happened, so skipping them would mean shipping the plugin's own change, or a task with unproven acceptance criteria, or a branch whose contract now lives only in an uncommitted file, with nothing anywhere saying so.

Otherwise, only when BASE differs from BRANCH and there are commits over BASE (the detector's no-diff guard already caught the empty case). If GH was missing or unauth, the commit and push still happened — report that, print the manual gh pr create command, and stop. That path composes no body file, so the printed command uses --fill, never --body-file: a path to a file this run never wrote either fails or, worse, sends a body some earlier run left behind.

Compose from the branch's commits rather than a bare --fill. Title = the change in one line; body = a short what/why, bulleting the commits when there are several.

The tracker id goes first. When the detector says TASK:present — never on inherited, whose task.md is a previous task's — run bash "$GANTRY/lib/task_id.sh" --task-file task.md. If its ID: line is not -, the title is <ID>: <the change in one line> (BASE-71: integrate updates the docs), and the first line under ## What this change is for is Tracker: <ID>, followed by a blank line. That is what lets Linear's GitHub integration, and its equivalents, link the PR to the issue. Nothing else in the body changes, and on ID:- — a date-slug id, or no id line — neither does the title. Exit 2 here means the file could not be read — run it from the worktree root, where the detector found task.md — and is not a reason to invent a prefix.

Do not hard-wrap the body. GitHub renders a pull request body in comment mode, where a single newline inside a paragraph becomes a <br> — so a body wrapped at a column, the way this and most repositories wrap their markdown files, arrives as a ragged column broken mid-sentence. Write each paragraph, each list item and each table row on one line however long it runs, and let the browser wrap it. Blank lines still separate blocks, and fenced code is still line-for-line.

This is the opposite of the rule for the commit message in stage 2, and deliberately so: a commit message is read in a terminal that does not wrap it for you, so it stays wrapped. Two renderers, two rules, and the body is the one the reviewer reads.

scripts/check_pr_body.sh decides this rather than judgement — it runs over the finished body file under Open it below, the last thing before gh pr create, and you fix what it names.

For an unattended run the body is the entire interface to the reviewer — nobody watched the run and nobody will re-derive it — so the checks below run before the body is composed, and the re-read runs after it.

The contract, which the diff does not carry

task.md, plan.md, handover.md and qa.md are not committed (docs/ARCHITECTURE.md § The artifact contract), so unlike in 0.4.x they are not in the diff and a reviewer cannot open them from the pull request. The body is now the only channel they have, which makes this step load-bearing rather than a nicety: skip it and the reviewer gets a diff with no statement of what it was meant to do.

Read what exists at ROOT — the detector already reported which do:

bash "$GANTRY/lib/detect_stage.sh"      # TASK: / PLAN: / HANDOVER: / QA: lines
  • TASK:present → the body carries a ## What this change is for heading, and under it the Tracker: <ID> line when stage 4 found a tracker id, then task.md's Goal and Acceptance criteria — quoted, not re-summarised. A summary written here is a second source of truth that can drift from the contract the work was actually done against, which is the entire failure this heading exists to prevent. On TASK:inherited the file is the previous task's contract: do not quote it, and say the branch shipped without one.
  • task.md's ## Decisions section holds entries → a ## Decisions made heading, carrying each one: the question, what was chosen, and why. This is /gantry:grill's record of the conversation that settled the approach, and it is the only place that reasoning reaches a reviewer — the critique's own log lives in plan.md, which this body does not quote. Carry through anything grill marked decided by recommendation, unconfirmed: a decision the owner did not actually confirm is exactly what a reviewer should see flagged.

    Entries, not the heading. The task template ships this section with instructional prose in it, so a task.md freshly copied from the template has the heading and no decisions. Read it the way lib/detect_stage.sh reads Open questions: list items count, prose and fenced examples do not. Keying on the heading would quote the template's own guidance into the body as if it were this change's reasoning. A run with no entries — every gantry:auto-unattended run, since grill never ran — gets the heading and one line saying no grill conversation ran, per the absent rule below. And on TASK:inherited quote nothing here, for the same reason as the contract above: the decisions on disk belong to the previous, merged task.

  • HANDOVER:present → a ## Deliberately not done heading carrying handover.md's items, one line each with its reason. This is what /gantry:review deferred; a reviewer who cannot see it re-reports every finding the run already triaged. Put the marker line under the heading, so a later run can tell whether the body is still current:

    bash "$GANTRY/lib/handover_body_state.sh" --marker handover.md

    It prints one HTML comment carrying a digest of handover.md — invisible in GitHub's rendering, and the whole basis of the refresh below. A body born without it is rewritten once on the next run; one born with it is left alone until handover.md changes.

  • QA:, whatever its value → a heading of exactly ## Exercised by this run, fixed for the same reason Not proven by this run below is: a reader who knows it exists can tell "the scenarios were run" from "nobody ran them". On QA:exercised, quote qa.md's ## Scenarios lines verbatim — each scenario, whether it was declared or derived, its verdict and the observation — and its tools: line, so the reader knows what observed them; if the file ends with an applied: line, say that a fix landed after the review. On any other value, one line and no scenarios: absent → /gantry:qa did not run on this tree; no-agent → the repo has no .claude/agents/qa.md; unrunnable and no-scenarios → qa.md's reason: line verbatim; unknown → qa.md exists but its outcome: could not be read. Every value but exercised also feeds the Not proven heading below, when the task declared scenarios. When qa.md exists, put its marker line under the heading, as for the handover, so a later /gantry:qa run is noticed by the refresh below:

    bash "$GANTRY/lib/handover_body_state.sh" --section qa --marker qa.md
  • PLAN:present → not quoted. plan.md is how the work got done, not what it promised, and it is usually long. Name it as available in the worktree and leave it there.
  • Any of them absent → say so in one line under the relevant heading rather than omitting the heading. A branch shipped with no contract is a fact about the run, and a missing heading is indistinguishable from nobody writing one.

The --no-pr path has no body to put this in. Say the same thing in the report instead, under the rule that already governs that path's disclosures.

Risk, and the guarded changes

Every body carries a ## Risk section, and a ## Guarded changes section when the change is guarded — a review lens fired, or the diff changes a lens file (a LENS_IN_DIFF: line). The exact headings below are an interface: a CI check in the target repo and /gantry:integrate both parse them, and integrate skips a PR whose body has no ## Risk. Which files are guarded is not read from review.md or decided by you — ship computes it again, at ship time, against the same base the review used:

bash "$GANTRY/lib/risk_floor.sh" origin/<BASE>

origin/<BASE> when that ref exists, else <BASE> — the same rule /gantry:review resolves its base by, so the two read the same lens files and the same file set. It prints one block per lens that fired (LENS:, FLOOR:, optional DEFER:never, one FILE:<path> <level> per matched file, END), LENS_IN_DIFF: lines, or nothing at all. A LENS_IN_DIFF:<path> <level> line is a lens file this diff adds, edits or deletes, and it is guarded on its own, whether or not any lens fired: <level> is the strictest level any base lens assigns that path, and LENS_IN_DIFF:<path> critical no-base-lens means no lens at the base covers it — including a base with no lens at all — so nothing could judge it. Exit 2 is not "nothing fired": a lens is malformed or the script could not run. Then the ## Risk section says Lenses: could not be evaluated — <the stderr line>, the same sentence goes under ## Not proven by this run, and no guarded label is claimed either way. The level is then unassessed, whatever the review or the floors say — the same fail-closed policy as no review, because a lens that never ran is a guard that never ran. A fresh review.md's blast-radius bullets are still quoted. Lenses are read from the base ref, so the remedy is to fix the lens on the base branch (or clear the stderr cause) and run ship again; until then /gantry:integrate skips the PR.

First, is the review current? A review of an older diff is a missing one, not a lower one:

bash "$GANTRY/lib/review_fresh.sh"

FRESH:yes (exit 0) → read review.md as below. FRESH:stale (exit 1: the tree's content changed after the review — a new commit alone does not — or it is for another branch), FRESH:error (exit 2: the check could not run or the file is malformed — fail closed) and FRESH:absent (exit 3) all mean no review assessed the risk, in the next paragraph's sense. On stale and error, do not quote anything from review.md — not the level, not the blast radius, not Open risk: lines or lens notes: they describe another diff. The bullets then read not assessed — the review describes an older diff (stale) or not assessed — the review could not be checked against this diff (error), and the report names the REASON: line and says to run /gantry:review again. This is the same comparison /gantry:review --fix makes (lib/review_fresh.sh), so the two cannot disagree.

Then read review.md's ## Risk and ## Lens: <name> sections, if the file exists, is current and has them.

The level. Risk level: is the highest of:

  • the Risk level: in review.md's ## Risk — the review run's judgement, never yours;
  • every FLOOR: the script printed;
  • the level on every LENS_IN_DIFF: line;

raised one step (low → medium → high → critical, capped at critical) when there is any open risk. An open risk is a - Open risk: line under a ## Lens: section of review.md, or a [lens <name>] finding in its ## Address now that was never applied — the detector reports REVIEW:pending (a read-only ship --review, or a review whose fix step never ran). A lens with defer: never promised each finding would be fixed or shown; an unapplied one is shown.

No review assessed the risk — there is no review.md, or it has no ## Risk section (a review from before 0.8.0, or a bare /gantry:ship) — or risk_floor.sh exited 2 and the lenses could not be evaluated (above) — then the level is unassessed, whatever the floors say. The level is the review's judgement, and a floor written in its place would pass a CI check with a level nobody assessed. unassessed is never combined into a max. A PR shipped that way is skipped by /gantry:integrate until the cause is cleared and the next /gantry:ship refreshes the section, and the report says so with the remedy for its cause: with no current review, run /gantry:review; with lenses that could not be evaluated, fix the lens on the base branch (or clear the stderr cause) — re-running review does not help there (see above).

The section, with these exact headings and labels:

## Risk
<the marker line>
Risk level: <level>
Floor: <highest FLOOR> (lens <name>: <file>, <file>; lens <name>: <file>)
Blast radius:
- Breaks if wrong: <from review.md>
- Live after merge: <from review.md>
- Rollback: <from review.md>
  • Floor: appears only when the change is guarded, and names every lens and every matched file, then each lens file in the diff as lens-file: <path> — hyphenated, so it never reads as a lens named file — e.g. Floor: critical (lens security: bin/x; lens-file: .claude/review-lenses/new.md). Its level is the highest of the FLOOR: lines and the LENS_IN_DIFF: levels.
  • The three Blast radius: bullets are quoted from review.md. When there is no current review (no review.md, no ## Risk section, or review_fresh.sh stale/error), each says not assessed — no review ran on this diff (or the stale/error wording above). Lenses that could not be evaluated are the exception: the level is unassessed, but a fresh review's bullets are still quoted.
  • The marker line is how a later run can tell whether this section is current (see Refresh below). Compose the section without it first, together with the ## Guarded changes section when there is one, and write that text with the Write tool to <ROOT>/.claude/artifacts/risk-source.md; then print the marker from it:

    bash "$GANTRY/lib/handover_body_state.sh" --section risk --marker .claude/artifacts/risk-source.md

    and put the line it prints directly under ## Risk in the body. It is an HTML comment, invisible on GitHub.

## Guarded changes, only when the change is guarded, right after ## Risk:

## Guarded changes
- `<path>`: <what to look at>
- Open risk: <the finding, verbatim from review.md>

One bullet per FILE: line the script printed — every one of them, in its order. The note after each path is the bullet for that file under review.md's ### What to look at. A matched file with no note there is listed anyway, with not seen by the lens — changed after the review, or no review ran; that is also how a review.md that describes an older diff shows up. Then one - Open risk: bullet per open risk, as defined above. Each LENS_IN_DIFF: line adds one bullet in the same - `<path>`: … shape — integrate collects the backticked paths — and its text depends on the line:

  • LENS_IN_DIFF:<path> <level> → - `<path>`: lens file changed by this diff; judged by the base's lenses at <level>, not by its own new text.
  • LENS_IN_DIFF:<path> critical no-base-lens → - `<path>`: lens file changed by this diff; no lens at the base covers it, so it is floored at critical and nothing judged it — read it by hand. Never write "judged by the base's version" for this one: there was no base version to judge it.

When the change is guarded, the PR also gets the GitHub label guarded — under Open it below, after the PR exists, so a missing label permission can never stop the PR from opening.

What this run did not prove

All of them are disclosures. None withholds the PR, fails the gate, or blocks the push.

1. Acceptance criteria no gate could check. Ship's own detect_state.sh reads git state and never opens task.md, so the answer comes from the other detector:

bash "$GANTRY/lib/detect_stage.sh"      # read the HUMAN_ONLY: and E2E: lines

On HUMAN_ONLY:present the body carries a heading of exactly ## Not proven by this run, and under it the entries from task.md's human_only block verbatim.

2. Declared e2e scenarios nobody ran. On E2E:present with QA: anything but exercised, the same heading carries the entries of task.md's e2e.scenarios block verbatim — name, goal, steps — with one line in front saying why they were not run: the reason: line from qa.md when there is one, else that /gantry:qa did not run. The contract promised these checks and the run did not keep them; a reviewer who pulls the branch to tap through the feature is doing what this line tells them is still undone. On QA:exercised the scenarios are under Exercised by this run above, verdicts included, and nothing about them goes here — a scenario that ran and failed is a failure the body reports under that heading, not an unproven claim.

2b. A review whose coverage was reduced. When review.md is current (FRESH:yes) and carries a Guard blocks: header line whose text — after stripping bold/italic wrappers and one trailing period — is non-empty and not none (the detector's rule; it reports REVIEW:partial when ## Address now is clean), the same heading carries that line verbatim, with one sentence in front: review coverage was reduced, because a guard blocked a command the reviewer tried to run, so the clean Address now checked less than usual. On FRESH:stale or FRESH:error quote nothing from review.md, this line included — it describes another diff. Read the line from the file; the detector only says it exists. This is a heading trigger in its own right: with HUMAN_ONLY:absent and no unrun e2e scenarios, a 2b line still opens ## Not proven by this run. REVIEW:partial is one way to learn the line exists, not the only one — a guard line beside pending findings that were then applied still counts.

One source of truth for each half: the detector (with review_fresh.sh for 2b) decides whether the heading appears; task.md supplies the text for 1 and 2, review.md for 2b. The entries are multi-line and one labeled line per value is the detector's whole output contract, so it cannot carry them. If the detector says present and you cannot find quotable entries, emit the heading anyway and say the block could not be read — failing toward the disclosure is the point.

The heading is fixed so that its absence is itself information: a reader who knows it exists can tell "there was nothing to disclose" from "nobody wrote it down". A disclosure that appears only when someone remembers to write it is not a disclosure.

One heading, not one per signal. Anything else a phase reports as shipped-but-unproven belongs under it too — a gate that went green over code no check actually covered is the next such signal, and it arrives from /gantry:implement's report rather than from anything ship computes. Add what the phases reported; do not invent a signal no phase gave you, and do not open a second heading for it. A reviewer scans for one heading or none. (Exercised by this run is not a second copy of this one: it holds what was checked, and a reader needs the two kept apart.)

When --draft was passed, the body also says plainly what draft status does not mean: draft means unwatched, not unverified. Include it whether or not the heading above appeared — --draft is the condition, not HUMAN_ONLY: or E2E:. Left unsaid, a reviewer reads "draft" as unfinished work and takes the gaps as expected rather than as unchecked.

3. Whether the plugin's own change was exercised. Three conditions, all commands:

  1. The repo carries .claude-plugin/plugin.json at its root. If not, the whole check is inert — an ordinary target repo that happens to have a lib/ directory must not produce a disclosure about plugin versions.
  2. git diff --name-only <BASE>... shows a path under skills/, lib/, hooks/ or agents/.
  3. $GANTRY and the repo root are not the same tree (compare resolved real paths). When they are — the --plugin-dir shape CONTRIBUTING.md documents for testing a change locally — the edited skills did execute, and the disclosure is suppressed rather than stated. Saying "untested" there would be precisely the false mechanism claim the next step exists to strike.

When all three hold, name the version that actually executed, and be exact about what was and was not exercised — one sentence is wrong for half of these paths:

  • skills/ and agents/ are loaded by the harness from the installed plugin. Edits to them did not execute this session at all. This is the measured case: a run edited skills/ship, then invoked ship, which ran the old copy — the change's headline feature was never exercised by the run that shipped it, and the run reported success.
  • lib/ and hooks/ are executed from the worktree by any repo whose suite points at its own copies, which gantry's tests/lib.sh does. The tests exercised them; what did not happen is that the running plugin's copies were the edited ones. Calling those "untested" is false.

Resolve the version from a command, never a guess. $GANTRY is the running plugin root; the installed-plugins registry maps an install path to a version and a commit:

REG="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/plugins/installed_plugins.json"
jq -r --arg root "$GANTRY" '.plugins | to_entries[] as $e | $e.value[]
  | select(.installPath == $root) | "\($e.key) \(.version) \(.gitCommitSha)"' "$REG"

Use $GANTRY as given for this lookup — the registry stores the install path as a literal string, so a physically-resolved path fails to match whenever any component of it is a symlink (a symlinked $HOME or CLAUDE_CONFIG_DIR), and ship would report "no recorded install" for a plugin that is registered. Real-path resolution belongs to condition 3 above, which is comparing two trees for identity; it does not belong here, which is comparing a string to a recorded one. If the literal lookup misses, retry it once against the resolved path before concluding anything.

Three outcomes, and the skill owes the reader whichever one happened:

  • it matches a registry entry → name that plugin, version and commit;
  • $GANTRY resolves but matches no entry → say which root executed and that it corresponds to no recorded install;
  • nothing resolves → say "could not determine the executing plugin version". That is a legitimate and useful disclosure. It is never omitted, and never replaced by a guess.

Re-read what you just wrote

The last thing before gh pr create, and the only scrutiny this prose will get. /gantry:plan-critique read task.md and plan.md; /gantry:review read the diff, if it was asked to. None of them read this title, this body, or the commit subject — all three are written last, by the context most invested in the result.

One rule, narrow on purpose:

A claim about how something works either cites the file that establishes it, or it does not go in the body.

Not "be accurate", which is advice nobody can fail. Mechanism claims are what go wrong. Two were published in a gantry PR body — that a readiness hook was inert because the repo registered no Stop hook, and that detect_stage.sh computed one of its lines from repo settings. Both were false, both were caught by a human peer rather than by any phase, and the correction cost three commits and two rewrites of the body.

Check the composed title, the composed body, and the commit subject against task.md and the diff. Anything you cannot point at a file for is struck, not softened — "appears to" is still an assertion nobody verified.

The subject was already checked in stage 2, where amending was free. A problem found with it here is on the remote already, and stage 3 does not rewrite history to correct prose: say so in the body instead.

Why this lives here and not in /gantry:review. That phase runs against the diff, before ship has composed a title, a body or a message — so extending its scope means either running it a second time after composition or moving it after composition, and both cost more than the check is worth. It is a checklist you apply in your own context, not a sub-agent to dispatch. Do not "fix" this by moving it into review.

Open it

The body goes to gh as a file inside the worktree, never inline and never from outside the checkout. Inline, a real body — backticks, quotes, headings, many lines — does not survive shell quoting. From /tmp, a scratchpad or $HOME, --body-file is an upload of a file by path from outside the repository, which a privileged-command gate is right to put in front of a human — and it then asks once per pull request. A relative path into the git-excluded .claude/artifacts/ of the checkout the command runs in is the shape such a gate can tell is the repo's own prose.

ROOT is the worktree root lib/detect_stage.sh printed in the contract step above. Every command below uses a relative path, so run them from ROOT. If the shell is somewhere else, run cd "<ROOT>" as a Bash call of its own first. Never chain it — cd "<ROOT>" && gh pr create … names a body file relative to a directory the command itself moved to, which a gate that judges paths cannot verify, and it asks.

Keep the file out of git, so git add -A on a later run can never sweep it into a commit:

bash "$GANTRY/lib/ensure_excluded.sh" /task.md /plan.md /handover.md /review.md /qa.md .claude/artifacts/

Write the final, re-read body with the Write tool to <ROOT>/.claude/artifacts/pr-body.md. Overwrite whatever is there: a file left by an earlier attempt is not this run's body.

bash "$GANTRY/scripts/check_pr_body.sh" .claude/artifacts/pr-body.md

Fix what it names in the file and run it again until it passes. Then open the PR:

gh pr create --base "<BASE>" --head "<BRANCH>" --title "<title>" --body-file .claude/artifacts/pr-body.md
gh pr create --base "<BASE>" --head "<BRANCH>" --title "<title>" --body-file .claude/artifacts/pr-body.md --draft   # --draft

Report the PR URL it prints. When the change is guarded (a lens fired or a LENS_IN_DIFF: line was printed), label it guarded — creating the label first if the repository does not have it:

gh label list --search guarded --json name -q '.[].name'
gh label create guarded --color B60205 --description "Touches a path a review lens guards"
gh pr edit --add-label guarded

Run the create only when the list did not print guarded. A failure here is reported, never fatal: the PR is open, and a token without label permission is a reason to say "the guarded label could not be applied" in the report, not to undo anything. Not guarded → no label step.

Once the PR exists, remove the file — the body now lives on the pull request, and a stale copy is one a later run could mistake for its own:

rm -f .claude/artifacts/pr-body.md .claude/artifacts/risk-source.md

If gh pr create failed, leave the file where it is: it is excluded from git, so it cannot reach a commit, and the next run composes the body afresh and overwrites it — it is never reused as it stands, because the branch it described may have moved.

Refresh the handover, QA and Risk sections of an existing body

Entered from two places: stage 4's branch above, when a PR already exists, and stage 5 before its status read. Not a step inside either — a refresh that lived only on the fully-shipped path would never run after "write the handover, commit once more, ship", which is the common order.

Why it exists. The body is composed once, at gh pr create. handover.md is usually written after that, because /gantry:review is what produces one — and the body then still says no handover exists while the file holds verified findings. The worktree holding the only copy is one merge away from being pruned. qa.md goes stale the same way: /gantry:qa re-run after the PR opened — a repo that opted in late, a --fix pass — leaves a body reporting the old outcome, typically "no qa agent" over scenarios that have since passed. And ## Risk: a PR opened before review lenses existed has none — so /gantry:integrate skips it — and a review re-run after the PR opened changes the level, the open risks, or the guarded files.

What it may rewrite. Only the ## Deliberately not done, ## Exercised by this run, ## Risk and ## Guarded changes sections, each only when it is out of date. Every other byte of the body is left alone: a wholesale recompose would overwrite hand-edits made on GitHub after the PR opened. Skip the whole sub-stage when --no-pr was given — there is no PR to refresh — and when GH was missing or unauth.

Run from ROOT, with relative paths, under the same rule as Open it above.

  1. Make the directory and keep the files out of git. Open it does this on the create path; a run that entered at stage 5 never reaches it, and an unexcluded body file is one git add -A commits on the next run — which then reads the worktree as dirty. mkdir -p is not redundant: ensure_excluded.sh creates the directory holding the exclude file, not this one, and everywhere else in this repo the first write into .claude/artifacts/ is a Write tool call, which creates parents. Here it is a shell redirect, and stage 5 is reachable in a worktree where no phase ever wrote a gate log.

    mkdir -p .claude/artifacts
    bash "$GANTRY/lib/ensure_excluded.sh" journal.jsonl .claude/artifacts/
  2. Fetch the live body. -q .body is not optional — without it the file receives the JSON envelope rather than the body.

    rm -f .claude/artifacts/pr-body-live.md
    gh pr view --json body -q .body > .claude/artifacts/pr-body-live.tmp \
      && mv .claude/artifacts/pr-body-live.tmp .claude/artifacts/pr-body-live.md
    rm -f .claude/artifacts/pr-body-live.tmp

    The .tmp and the mv are the guard, not tidiness. A plain redirect truncates its target before gh runs, so a fetch that fails for any reason — auth, network, rate limit — leaves an empty pr-body-live.md behind. An empty body reads as MISSING at step 3, and step 4 would then "refresh" the pull request by replacing its entire body with the handover section alone, destroying the contract, the scope and the human-only checks. Writing to .tmp and promoting it only on success makes a failed fetch an absent file, which step 3 rejects instead.

  3. Ask whether each section needs refreshing — three questions. For the third, first compose the Risk text exactly as Risk, and the guarded changes describes — including its review_fresh.sh check, so a body refreshed after a later commit goes unassessed — for the tree as it is now, and write it with the Write tool to <ROOT>/.claude/artifacts/risk-source.md:

    bash "$GANTRY/lib/handover_body_state.sh" .claude/artifacts/pr-body-live.md handover.md
    bash "$GANTRY/lib/handover_body_state.sh" --section qa .claude/artifacts/pr-body-live.md qa.md
    bash "$GANTRY/lib/handover_body_state.sh" --section risk .claude/artifacts/pr-body-live.md .claude/artifacts/risk-source.md

    Each answers for its own section:

    • CURRENT → the body already carries this file. Leave that section alone.
    • NO-HANDOVER / NO-QA → there is no such file. Nothing to refresh in that section. (NO-RISK means risk-source.md was not written — compose it; every PR has a Risk section.)
    • STALE or MISSING → that section is refreshed in step 4. MISSING means the body has no such section at all — for the handover, the PR-opened-before-the-review case; for Risk, a PR opened before review lenses existed.
    • Exit 2 (no one-word answer) → the state could not be read: step 2's fetch failed and left no file, or there is no SHA-256 tool on PATH. Edit nothing, in either section. Report that the body could not be checked and leave the pull request as it is.

    Neither STALE nor MISSING → make no edit. Report that the body is current and skip to the end of the sub-stage.

  4. Compose each stale section and write it with the Write tool:

    • handover → the ## Deliberately not done heading, the marker line from handover_body_state.sh --marker handover.md, and handover.md's items one line each with its reason, exactly as the contract step describes — to <ROOT>/.claude/artifacts/handover-section.md.
    • QA → the ## Exercised by this run heading, the marker line from handover_body_state.sh --section qa --marker qa.md, and the content the contract step's QA: rule gives for qa.md as it now stands — to <ROOT>/.claude/artifacts/qa-section.md.
    • Risk → two files, because the splice replaces one ## section at a time: the ## Risk section with the marker line from handover_body_state.sh --section risk --marker .claude/artifacts/risk-source.md under its heading, to <ROOT>/.claude/artifacts/risk-section.md; and the ## Guarded changes section to <ROOT>/.claude/artifacts/guarded-section.md — when the change is no longer guarded (no lens fires and no LENS_IN_DIFF: line) but the live body has a ## Guarded changes section, that file holds the heading and None — no lens fires on the current diff.; when the change is not guarded and the body has none, write no guarded file and skip its splice — the Risk splice is then the last one and writes pr-body.md itself (below). A live ## Guarded changes section carrying the marker <!-- homebase-launcher-guarded --> belongs to the launcher, not to ship: never delete or rewrite it. Splice as usual — splice_pr_section.sh keeps that section whole, leaves the body unchanged (apart from the CR / trailing-newline normalisation every splice applies) when the change is not guarded, and appends your lens bullets (without duplicating the launcher's) when it is. Do not write the None — no lens fires text over it by hand.

    Then splice. One stale section goes straight from the fetched body to pr-body.md:

    bash "$GANTRY/lib/splice_pr_section.sh" .claude/artifacts/pr-body-live.md .claude/artifacts/handover-section.md "Deliberately not done" > .claude/artifacts/pr-body.md
    bash "$GANTRY/lib/splice_pr_section.sh" .claude/artifacts/pr-body-live.md .claude/artifacts/qa-section.md "Exercised by this run" > .claude/artifacts/pr-body.md

    Both stale → chain them, so the fetched original stays untouched:

    bash "$GANTRY/lib/splice_pr_section.sh" .claude/artifacts/pr-body-live.md .claude/artifacts/handover-section.md "Deliberately not done" > .claude/artifacts/pr-body-handover.md
    bash "$GANTRY/lib/splice_pr_section.sh" .claude/artifacts/pr-body-handover.md .claude/artifacts/qa-section.md "Exercised by this run" > .claude/artifacts/pr-body.md

    A stale Risk section is spliced the same way, after any of the above, each splice reading the previous one's output — Risk first, then Guarded changes — and the last one writing pr-body.md:

    bash "$GANTRY/lib/splice_pr_section.sh" .claude/artifacts/pr-body-live.md .claude/artifacts/risk-section.md "Risk" > .claude/artifacts/pr-body-risk.md
    bash "$GANTRY/lib/splice_pr_section.sh" .claude/artifacts/pr-body-risk.md .claude/artifacts/guarded-section.md "Guarded changes" > .claude/artifacts/pr-body.md

    No guarded file was written (the change is not guarded and the body has no ## Guarded changes) → there is no second splice, so the Risk splice writes pr-body.md directly. Skipping it while still writing pr-body-risk.md leaves step 5 with no ## Risk in what it sends:

    bash "$GANTRY/lib/splice_pr_section.sh" .claude/artifacts/pr-body-live.md .claude/artifacts/risk-section.md "Risk" > .claude/artifacts/pr-body.md

    (Start the Risk splice from pr-body-handover.md or the QA splice's output instead of pr-body-live.md when those ran first; the fetched original is never overwritten.) After a Risk refresh in which the change is guarded, apply the guarded label exactly as Open it does, non-fatally.

    Each splice replaces its one section, or inserts it before ## Not proven by this run when the body has no such section yet. A non-zero exit means the heading is ambiguous — it appears more than once — and nothing was written. Do not hand-edit around it: report that the body needs a human, and leave the pull request as it is.

    ## Not proven by this run is not refreshed. When QA has moved to exercised and the task declared scenarios, that section may still list them as not run. Say so in the report, naming the line, so a human deletes it; rewriting a third section on a guess is how hand-edits get lost.

  5. Check it, send it, clean up — three blocks, because each gates the next. The body goes as a file inside the checkout, for the reasons Open it gives:

    bash "$GANTRY/scripts/check_pr_body.sh" .claude/artifacts/pr-body.md

    Fix what the check names in the file and run it again until it passes. Only the refreshed sections are this run's prose; if the check flags lines elsewhere in the body, they came back from GitHub that way — fix them too rather than reverting, since gh pr edit sends the whole file. Then send it:

    gh pr edit --body-file .claude/artifacts/pr-body.md
    rm -f .claude/artifacts/pr-body.md .claude/artifacts/pr-body-live.md .claude/artifacts/pr-body-handover.md .claude/artifacts/pr-body-risk.md .claude/artifacts/handover-section.md .claude/artifacts/qa-section.md .claude/artifacts/risk-section.md .claude/artifacts/guarded-section.md .claude/artifacts/risk-source.md

    Clean up only after the edit succeeded — the same rule the create path states for pr-body.md. If gh pr edit failed, leave the files where they are: they are excluded from git so they cannot reach a commit, the fetched original is the only copy of what the body said before, and gh pr edit --body-file .claude/artifacts/pr-body.md is what a human reruns by hand. Report the path rather than deleting the work.

  6. Report which sections were refreshed and what each now says, or that the body was already current and nothing was edited.

5. Done — report and wait

The branch is fully shipped: PR open, nothing left to push.

First, run Refresh the handover, QA and Risk sections above — unless stage 4 already routed you through it on the way here, in which case it has just run and a second pass would only spend another gh pr view and repeat its report. Then come back here. A handover written after the PR opened reaches nobody otherwise, and this is the stage a run lands on once there is nothing left to commit or push — which is exactly when a review has just produced one.

Then pull the current status so "wait" is informed, not blind:

gh pr view --json url,state,mergeable,reviewDecision,statusCheckRollup
gh pr checks    # CI state, if there are checks

Report the PR URL, review decision, mergeability, and check status, and that there's nothing to do but wait for review/CI. If checks are failing or the PR is blocked, say so plainly — that's the one thing worth flagging here.

Report

State what actually happened this run — which stages ran (committed / pushed / opened PR), the commit subject, the PR URL, whether the PR is a draft or ready for review, and the terminal status.

Whether a review ran, and it only ran if you asked. Say which flag was given, at which tier, and whether it was --review or --review-fix; the child session ids, the MODEL: and EFFORT: lines, and every DENIED: line, verbatim from the launcher; how many files the fixes touched, if any; and the GATE_EXIT: the fix child recorded over those fixes. If no flag was given, say the run was not reviewed — plainly, as a fact about this run rather than an omission. If gantry:review rejected the tier, say that the commit stands and nothing was pushed. If it blocked the ship, lead with that.

All stage 4 disclosures, always — including under --no-pr, where the report is the only place they can land. Say whether the Not proven heading was emitted and why (or why not) — the human_only entries, the e2e scenarios nobody ran, the review's Guard blocks: line (reduced review coverage), or any combination — what Exercised by this run carried (the QA: value, and the verdicts on exercised), and what the executing-plugin check concluded: the version that ran, that the check was inert because the repo is not a plugin, that it was suppressed because the plugin root and the repo are the same tree, or that the version could not be determined. The driver journals this from what you report, so an omission here becomes an omission in an append-only log.

The risk: the Risk level: the body carries and what set it (the review's level, which lens floor, a one-step raise for open risks — or unassessed, and that integrate will skip the PR until a review runs or, when the lenses could not be evaluated, until the lens is fixed on the base and ship runs again); every lens that fired and its matched-file count; whether risk_floor.sh could not evaluate the lenses; whether the guarded label was applied, or why not; and on a refresh, whether the Risk section was refreshed.

The clean-tree check, every time a commit was made: CLEAN, or the PATH: lines that stopped the push, with nothing pushed.

If a guard stopped it (on the default branch, diverged, nothing to ship, gh unavailable), say which and what the user should do next. When a run stops after a review but before the PR — the gh missing/unauth case is the common one — a bare re-run is safe: ship reviews only when asked, so re-running without a review flag will not review the branch a second time.

Be honest about anything skipped or unverified.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.