stacked-pr
Skill1 starsChanged 3 months agoMITView on GitHub
Use when the user asks to "stack a PR", "stacked PR", "branch on top of this PR", "next layer", "restack", "rebase the stack", "split this into a stack", or wants to start follow-up work while the previous PR is still in review.
- Commits and pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- hammoda711/stacked-pr-skilltheir own version, first seen Nov 8, 2026
- LuisUrrutia/skillstheir own version, first seen Oct 18, 2026
- OutThisLife/brooklyn-skillstheir own version, first seen Jul 23, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- OutThisLife/brooklyn-skills★ 207same name
- LuisUrrutia/skills★ 2same name
- hammoda711/stacked-pr-skill★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use GitHub's gh stack extension.
- Distinctive: line 20
Before running any command here, check whether the changes actually depend on each other — later layers building on earlier layers' code, …
- Very specific: line 34
If the repo's trunk is not the default branch, every init must say so, or the bottom PR targets the wrong branch:
- Distinctive: line 68
Run any mandatory post-PR step once for the whole stack, not once per layer.
- Very specific: line 69
Verify the bottom PR targets the intended trunk: gh stack view.
- Distinctive: line 70
If your repo enforces a title format (ticket prefixes and the like), put it in the commit message — that is what becomes the PR title.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stacked PRs
Use GitHub's gh stack extension. It already does parent tracking, cascading rebase, PR base
retargeting, and bottom-up merging. Do not hand-roll this with git rebase --update-refs,
git config branch.*.parent, or manual gh pr create --base — that reimplements the extension
badly and drifts from what GitHub's UI shows.
Public preview — flags may change. gh stack <cmd> --help is authoritative over this file.
First: does this actually need to be a stack?
Stacking couples the PRs. They merge bottom-up only, so a review stall or a revert on a lower layer blocks everything above it.
Before running any command here, check whether the changes actually depend on each other — later layers building on earlier layers' code, or a split of one logical change too big to review at once. If they're independent (unrelated files, either could merge first, no shared new symbols), stop and ask the user whether they really want a stack, and say why you're asking: independent PRs opened straight against the trunk merge in any order and don't block each other. Only proceed once they confirm.
Setup (once)
gh extension install github/gh-stack
gh stack alias # optional: shorter commandIf the repo's trunk is not the default branch, every init must say so, or the bottom PR targets
the wrong branch:
gh stack init --base develop <bottom-branch>Create a stack
gh stack init feat-auth # add --base <trunk> if trunk isn't the default branch
gh stack add -Am "api routes" # -A stages all, -m commits, then branches
gh stack add -Am "ui"
gh stack submit # push + create/update PRs, interactive editorgh stack submit opens an editor for titles/bodies; --auto skips it and generates titles from
commits, --open marks PRs ready for review (without it, --auto creates drafts). Commit
messages become the PR titles, so write them the way you want the PR titled.
Already have branches? Adopt them bottom-to-top instead of recreating:
gh stack init feat/auth feat/api feat/uiAlready have open PRs you don't want tracked locally? gh stack link --base <trunk>.
Adapt to your repo
gh stack submit creates the PRs, which means any repo-specific PR skill or convention you
normally rely on is bypassed. Retrofit those rules after submit rather than before:
- Apply required labels per PR:
gh pr edit <n> --add-label <label>. - Run any mandatory post-PR step once for the whole stack, not once per layer.
- Verify the bottom PR targets the intended trunk:
gh stack view. - If your repo enforces a title format (ticket prefixes and the like), put it in the commit message — that is what becomes the PR title.
Day to day
gh stack view # -s for short, --json for scripting
gh stack sync # fetch, rebase, push, sync PR state — the one you want most days
gh stack rebase # cascading rebase only; --downstack / --upstack to limit scope
gh stack push # push branches without touching PRs
gh stack modify # interactively reorder/restructure; --continue / --abort
gh stack up | down | top | bottom | trunk | switch | checkoutReach for gh stack sync before assuming a stack is broken — most "my diff looks wrong" reports
are just a stale local stack after trunk moved.
Merge
gh stack merge --squash # bottom-up; can merge several layers at onceGitHub retargets the remaining PRs onto the trunk automatically as lower layers merge. Never merge a middle PR first, and never merge a stacked PR from the web UI's plain merge button unless you've confirmed everything below it is already in.
Bail out
gh stack unstack --local # drop local tracking, leave the PRs alone
gh stack unstack # also unstack them on GitHubDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

