/agent-traffic-control:stacked-pr-review-per-base-diff-and-attachfrom agent-traffic-control
Reviewing a stack of dependent pull requests: diff each one against ITS OWN base rather than against main, and attach the reports to the bottom branch.
Ships in agent-traffic-control. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Reviewing a stack of N dependent PRs (where #B is based on #A, #C is based on #B, etc., rather than each PR being based on main) hits two distinct issues:
Diff capture for reviewer agents. If you naively run gh pr diff <N>
against every PR in the stack, gh defaults to comparing against the PR's
declared base — which is correct. But if you pre-filter via git diff main..pr-branch, you'll include all upstream PRs' changes in the
"downstream PR's diff," and reviewers will flag findings against code
that actually shipped 2 PRs ago. The reviewer attributes the finding to
the wrong PR, and the author of the downstream PR is left confused.
Where to commit the review reports. Once 3 reviewer agents have
produced reviewer_correctness.md, reviewer_architecture.md,
reviewer_security.md, they need to live somewhere reachable by every
PR in the stack — but committing them to the top-of-stack PR pollutes
that PR's diff (the reports become "changes" the topmost PR is making).
The base-of-stack PR is the natural home.
roundtable:agent-review-panel) to cover the whole stackFor each PR in the stack, capture its diff against ITS OWN base, not against main:
mkdir -p /tmp/stack-review
for pr in 57 58 59; do
# gh pr diff defaults to PR's declared base (the right thing)
gh pr diff $pr -R <org>/agentic-ai-workshop \
> /tmp/stack-review/pr${pr}-vs-its-base.diff
# Also save the body so reviewers have author intent
gh pr view $pr -R <org>/agentic-ai-workshop --json body -q .body \
> /tmp/stack-review/pr${pr}-body.md
done
wc -l /tmp/stack-review/*.diff
Each reviewer agent then receives the per-PR diffs + bodies via the prompt:
PR #57 vs main: /tmp/stack-review/pr57-vs-its-base.diff (~600 lines)
PR #58 vs #57 branch: /tmp/stack-review/pr58-vs-its-base.diff (~230 lines)
PR #59 vs #58 branch: /tmp/stack-review/pr59-vs-its-base.diff (~330 lines)
State explicitly in the prompt: "PR #58 vs s13-gemini-retry-friendly-error
(#57's branch)" so the reviewer doesn't misread the base.
Once reports exist, commit them to the BOTTOM PR's branch (the stack's
shared base), not the topmost. In a 3-PR stack #A ← #B ← #C, commit
docs/reviews/<topic>/ to #A's branch. Every PR in the stack then sees
those reports because:
The mechanism: gh pr diff uses merge-base, not the literal base ref at PR
creation time. When the base branch advances, the merge-base advances too,
and the PR's "diff" shifts accordingly.
# Example: 3-PR stack #57 → #58 → #59 (each based on prior).
# Bottom of stack is #57's branch, but for "the foundation under all 3", use #59's
# branch only if all 3 will inherit reports — actually #57 is the truer base.
# Pick the branch where the report applies AND where the PR descriptions
# already reference it. For the s13 review session, #59's branch was the
# correct home because the reviews evaluated all 3 PRs and #57/#58 reviewers
# had already begun without seeing them.
git worktree add /tmp/stack-base-worktree s13-firestore-jobstore
cp docs/reviews/<topic>/*.md /tmp/stack-base-worktree/docs/reviews/<topic>/
cd /tmp/stack-base-worktree
git add docs/reviews/
git commit -m "docs: review panel reports for the s13 stack (#issue)"
git push
After the push, refresh the PRs to see the diff update:
gh pr diff 57 | wc -l # should NOT include the new review .md files
gh pr diff 58 | wc -l # same
gh pr diff 59 | wc -l # WILL include the new review .md files (it's PR #59's diff vs main now)
(The bottom PR's diff grows by the size of the reports; the upper PRs are unaffected. This is the intended behavior — reviewers of the bottom PR see the reports as part of "this PR introduces a foundation including review docs.")
After committing reports to the base branch:
gh pr view <top_pr> --json files -q '.files[].path' — confirm the report files do NOT appear in the top PR's file listgh pr view <base_pr> --json files -q '.files[].path' — confirm they DO appear in the base PR's file listls docs/reviews/<topic>/ — confirm files exist locally (you inherit them because base advanced)If the reports DO appear in every PR's diff, the PR base refs aren't set up as a stack — they may all be based on main. Check with:
gh pr list --state open --json number,headRefName,baseRefName
The 2026-05-28 GA/GTM audit s13-stack review:
main
└── #57 s13-gemini-retry-friendly-error (base: main)
└── #58 s13-firestore-foundation (base: s13-gemini-retry-friendly-error)
└── #59 s13-firestore-jobstore (base: s13-firestore-foundation)
├── #62 s13-tool-cache (base: s13-firestore-jobstore)
└── #63 s13-fixup-surgical (base: s13-firestore-jobstore)
└── #64 s13-fixup-structural (base: s13-fixup-surgical)
Reviewer agents got per-base diffs (pr57-vs-main.diff,
pr58-vs-s13-gemini-retry.diff, pr59-vs-s13-firestore-foundation.diff).
Reports were committed to s13-firestore-jobstore (#59's branch). Net
effect:
main. If the bottom PR was already merged when reports are written, commit them to main via a separate small docs PR instead.roundtable:agent-review-panel skill writes reports to docs/reviews/<date>-<topic>/. Combine that directory naming with the base-branch attachment pattern for clean cross-PR visibility.gh pr diff documentation: defaults to PR's declared base (the right thing for stacked PRs by construction)roundtable:agent-review-panel — Phase 1 "Codebase State Check" already enumerates the worktree+branch state; this skill adds the stacked-PR attachment dimensionThese carry disable-model-invocation: true. They never appear in the skill
listing and the Skill tool refuses them, so the only way in is to open the file
with Read when one of these matches what you are looking at.
stacked-pr-base-branch-deletion-auto-closes-dependent — deleting a base PR's branch auto-closed the dependent stacked PR, which cannot be reopenedcode-review-subagent-fabricates-specifics-to-inflate-severity — a reviewer agent's HIGH/BLOCKING finding cites specifics that do not exist in the diffsubagent-pre-existing-misattribution — a reviewer put test failures on the wrong side of the pre-existing / PR-introduced lineprove-test-failures-pre-existing-via-clean-worktree — proving failures predate your change by replaying the suite in a clean worktreeWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wan-huiyan/agent-traffic-control --plugin agent-traffic-control118 skills in this plugin
/agent-refusal-with-evidence-beats-literal-complianceA dispatched agent that does exactly what you asked can ship a defect you would
have stopped yourself, because it can see something at the worksite that you
could not see when you wrote the brief. Use when: (1) you are writing a brief
that prescribes a specific fix, threshold, wording or value rather than the
outcome you want; (2) an agent reports that it did not do what you asked and
you are deciding whether that is insubordination or judgement; (3) an agent
asserts "this is fine" or "not needed" with no measurement behind it; (4) you
are reviewing overnight output and want to know which decisions were checked
and which were assumed. Two halves, and both are needed: give the agent
explicit permission to satisfy the INTENT of an instruction while refusing its
letter, and REQUIRE the evidence with the refusal — what it built or measured,
what that showed, what it did instead. Evidence is the whole difference between
a refusal you can bank and one you have to re-litigate. Four agents correctly
declined an instruction in a single run; one built the suggested fix, measured
that it turned a silent safe refusal into a permanently red pipeline, and
reverted it unpushed.
/auto-merge-rearms-while-agent-live-kill-then-disarm-verify