← ClaudeAtlas

stacked-pr-review-per-base-diff-and-attachlisted

Two paired patterns for reviewing a stack of dependent PRs (#A → #B → #C where each is based on the prior, not on main). (1) Reviewer agents need each PR's diff against ITS OWN base, not all-vs-main — otherwise upstream PR's changes show as part of downstream PR's diff and reviewers misattribute findings. Use `gh pr diff <N> -R owner/repo > prN-vs-its-base.diff` per PR. (2) Review reports for the whole stack should be committed to the BASE branch of the stack (the bottom PR's branch), not to the most recent one — every PR up the stack inherits them via base-branch advance, and PR diffs still show only the actual feature changes because merge-base advances too. Use when: dispatching a multi-agent review panel against 2+ stacked PRs; deciding where to commit reviewer report .md files; auditing whether a stacked-PR review panel saw the right per-PR scope.
wan-huiyan/agent-traffic-control · ★ 2 · Code & Development · score 79
Install: claude install-skill wan-huiyan/agent-traffic-control
# Stacked PR review: per-base diffs + base-branch attachment ## Problem 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: 1. **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. 2. **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. ## Context / Trigger Conditions - A stack of 2+ open PRs exists where the head PR's base is another open PR (not main) - You're dispatching a multi-agent review panel (e.g., `roundtable:agent-review-panel`) to cover the whole stack - One of these symptoms: - Reviewer flags a "missing feature" in PR #C that was actually added in PR #A - Review