← ClaudeAtlas

stacked-prslisted

Run a stack of pull requests on GitHub with `gh stack`: create, grow, submit, sync, land, repair, and cut a per-layer worktree with its handoff. Use when the user talks about stacked PRs, a stack or pile of PRs, `gh stack`, wants to split a large change into reviewable PRs that land together, or debugs a stack (empty PR "No commits between X and Y", "Needs rebase", local/GitHub divergence, a commit stuck under someone else's).
bengous/claude-code-plugins · ★ 4 · Code & Development · score 73
Install: claude install-skill bengous/claude-code-plugins
# Stacked PRs with `gh stack` A stack is a chain of branches above the trunk, one PR per branch, each PR based on the branch below it. Each PR shows only its own diff. Nothing merges before the end: the stack lands in one operation, bottom to top. Local tracking lives in `.git/gh-stack` (never versioned); the stack object lives on GitHub. ``` trunk └── layer-1 PR → trunk └── layer-2 PR → layer-1 └── … PR → previous layer ``` ## The cycle | Command | Effect | |---|---| | `gh stack init [branches…] [--base <trunk>]` | Creates the stack. Adopts existing branches, bottom to top. | | `gh stack add <branch> -m "msg" [-A\|-u]` | Branches from the current top and commits what is staged. `-A` stages everything, untracked included; `-u` tracked files only. | | `gh stack submit [--auto] [--open]` | Pushes everything, creates the missing PRs with the right base, updates existing bases, creates or updates the GitHub stack. | | `gh stack push` | Pushes active branches, `--force-with-lease` branch by branch, not atomic: a rejected branch does not cancel the others. Skips merged and queued branches. Opens no PR. | | `gh stack view [--short\|--json]` | State: `✓` merged, `◎` queued, `○` open, `⚠` needs rebase. | | `gh stack sync [--prune]` | Fetches, reconciles with GitHub, fast-forwards the trunk, cascade-rebases, pushes atomically with `--force-with-lease`. Creates no PR. | | `gh stack rebase [--downstack\|--upstack\|--no-trunk]` | Cascade rebase: each layer rece