← ClaudeAtlas

opening-a-stacked-pr-sequencelisted

Open a stack of dependent PRs in the right order (each PR's base = the branch below it, not main), merge bottom-up, and fix the child PR after the lower one merges so already-reviewed code stops reappearing. Triggers on: stacked PRs, what base should stacked PRs target, PR shows code already reviewed, squash merge broke my stacked PR, restack after merge, rebase --onto after squash, open PR on top of another PR, PR sequencing.
sblattj/agent-chandlery · ★ 0 · AI & Automation · score 72
Install: claude install-skill sblattj/agent-chandlery
## More triggers stack my PRs, chain of PRs, split this into stacked PRs, PR #2 shows PR #1's changes, diff shows already merged commits, retarget the next PR, which PR do I merge first, merged the top PR first by mistake, update branch fails on a stacked PR, update-branch 403, bring the stack up to date with develop, PR says BEHIND. # Opening a stacked PR sequence Sets up a PR stack so every PR shows only its own changes, and tells you the exact fix for the next PR after a lower one merges. ## Do this ```bash S=${CLAUDE_SKILL_DIR:-${SKILL_DIR:-~/.claude/skills/opening-a-stacked-pr-sequence}}/stack.sh $S plan add-login add-logout add-settings # prints push + gh pr create lines, each based on the one below $S restack add-logout 123 # after PR #123 merged: detects merge type, prints the fix $S restack add-logout b9097d2 # same, with the lower PR's old tip SHA ``` Read-only: it prints commands, never pushes or rebases. Run it inside the clone (repo = the cwd's `origin`). Env: `BASE` (default: origin's default branch), `REMOTE` (default `origin`). The repo's real trunk wins (`develop`, `master`, ...); the user's agent instructions file (AGENTS.md / CLAUDE.md), if it names defaults, may list known bases. Rules the commands encode: 1. **Base each PR on the branch below it.** PR #1 targets main, PR #2 targets PR #1's branch. Based on main, PR #2's diff carries PR #1's work from day one. 2. **Turn on auto-delete once** (`gh repo edit --d