stacked-prslisted
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