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

Reviews stacked pull requests by diffing each against its own base and attaching reports to the base branch.

3|Updated May 8, 2026
One-click install
npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill stacked-pr-review-per-base-diff-and-attach-wan-huiyan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stacked-pr-review-per-base-diff-and-attach
Source: https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/stacked-pr-review-per-base-diff-and-attach
Command: npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill stacked-pr-review-per-base-diff-and-attach-wan-huiyan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When reviewing a stack of dependent pull requests (where PR #B is based on PR #A rather than main), naive diff capture against main inflates each downstream PR's diff with upstream changes, causing reviewers to attribute findings to the wrong PR. It also leaves orchestrators unsure where to commit multi-agent review reports so every PR in the stack can see them without polluting top-of-stack diffs. ## Core Features & Use Cases - Per-base diff capture: Uses gh pr diff against each PR's declared base (not git diff main..branch) so every reviewer sees only that PR's actual changes, plus saved PR bodies for author intent. - Base-branch report attachment: Commits review reports (e.g., docs/reviews/<topic>/) to the bottom PR's branch, leveraging merge-base semantics so upper PRs inherit the reports without diff bloat. - Verification workflow: Confirms via gh pr view --json files that reports appear only in the base PR's file list, and detects misconfigured stacks where all PRs are actually based on main. - Use Case: A 3-reviewer panel audits a 6-PR stack (#57 through #64); each reviewer receives per-base diffs, and the reports are committed to the foundation branch so all dependent PRs inherit them automatically. ## Quick Start Review this stack of dependent pull requests by diffing each PR against its own base branch and commit the review reports to the bottom PR's branch.

Frequently Asked Questions about stacked-pr-review-per-base-diff-and-attach

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review stacked pull requests on GitHub?▼

Run `gh pr diff <N>` for each PR in the stack, which defaults to diffing against the PR's declared base branch rather than main. Save each diff and PR body separately, then hand reviewers the per-base diffs with the base branch named explicitly in the prompt.

Why does my stacked PR diff show changes from other PRs?▼

This happens when you diff with `git diff main..branch` instead of the PR's declared base, pulling all upstream PRs' changes into the downstream diff. Use `gh pr diff`, which respects the declared base, so reviewers only see that PR's actual changes.

Where should I commit review reports for a stack of PRs?▼

Commit review reports to the bottom PR's branch of the stack, not the topmost. Because `gh pr diff` uses merge-base semantics, upper PRs inherit the reports via base-branch advancement without the files appearing in their diffs.

Does gh pr diff work with PRs based on other PRs?▼

Yes, `gh pr diff` defaults to comparing against the PR's declared base, which is exactly right for stacked PRs. When the base branch advances, the merge-base advances too, so the diff automatically reflects only the PR's own changes.

When should I not commit review reports to a stacked PR branch?▼

Avoid it when the bottom PR is already merged, when the stack is only 2 PRs deep, or when all PRs are actually based on main rather than each other. In those cases, open a separate small docs PR against main instead.