stacked-prs
Skill2 starsChanged 29 days agoMITView on GitHub
Use when landing a stack of dependent GitHub pull requests (A ← B ← C, each based on the one below) onto the default branch, merging a pull request whose base is another open pull request's branch, responding to review comments across such a stack, or whenever a request mentions "stacked PRs", "PR stack", "dependent PRs", or merging several related pull requests in sequence. Requires GitHub's official stacked-PR feature so GitHub owns stack-wide rules, CI, ordering, retargeting, and merge state.
14 other projects use a version of this.
Adopted by
Most recently taken up by
- Integralist/agent-skillstheir own version, first seen Nov 6, 2026
- dbosk/claude-skillstheir own version, first seen Nov 1, 2026
- Mathews-Tom/armorytheir own version, first seen Nov 1, 2026
- Beakpoint-Insights/roosttheir own version, first seen Nov 1, 2026
- gsimone/skillstheir own version, first seen Oct 25, 2026
- azents/azentstheir own version, first seen Oct 23, 2026
Used with
Projects with it also use show-me, blast-radius and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AnasX7Skillshow-me
Help the user understand the current topic visually with concise diagrams, code-shape sketches, and focused HTML artifacts.
Also in 3 projects that use this
MicrosoftSkillblast-radius
Assesses network dependency and shared-infrastructure exposure. Use when the user asks which services, customers, SLA policies, routes, or redundant links are affected by a network fault.
Also in 3 projects that use this
Harut8Skillarchitect
Also in 3 projects that use this
GoogleSkillimprove-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Also in 3 projects that use this
GoogleSkillgrilling
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
Also in 3 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
- +1 more from google
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- Mathews-Tom/armory★ 340same name
- dgalarza/agent-skills★ 72same name
- Beakpoint-Insights/roost★ 32same name
- Integralist/agent-skills★ 23same name
- azents/azents★ 16same name
- d-oit/rust-2026-template★ 15same name
- malinskibeniamin/skills★ 4same name
- anis-dr/skills★ 3same name
- magnusrodseth/dotfiles★ 3same name
- dbosk/claude-skills★ 1same name
4 more not listed
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.
In this repository17 other files it gives its agents.
- agent-experienceSkill
- agent-notesSkill
- code-reviewSkill
- docs-standardSkill
- error-handlingSkill
- find-simplificationsSkill
- lifecycle-reviewSkill
- perf-evidenceSkill
- pre-push-checksSkill
- prose-standardSkill
- record-browser-gifSkill
- responsive-uiSkill
- test-reliabilitySkill
- trim-cot-leakageSkill
- ui-ux-reviewSkill
- upgrade-guideSkill
- vibe-harness-bootstrapSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
7
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
- Distinctive: line 14
Use a clean dedicated worktree.
- Distinctive: line 54
When a dependent pull request is not yet in the official stack:
- Very specific: line 57
If all authors match, link the chain in bottom-to-top order: gh stack link --base <trunk> <bottom-pr> <next-pr> ...
- Distinctive: line 58
If authors differ or any author is unavailable, ask the user before changing GitHub state.
- Very specific: line 61
Never dissolve, reorder, or rebuild an existing stack automatically.
- Distinctive: line 65
Do not rewrite branches merely because a refresh mechanism exists.
- Distinctive: line 77
Verify every comment against the code before acting: a reviewer who flags the right symptom can still misdiagnose the cause.
- Distinctive: line 79
Keep each review fix a distinct commit.
- Distinctive: line 80
Treat a delegated fix's report as intent, not proof of what landed.
- Very specific: line 102
Delete branches only in a separate final pass after their pull requests report MERGED, and only when gh pr list --state open --base …
“Common” is measured: kept by at least 6 in 10 of the 13 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
Landing an official GitHub pull-request stack
Land dependent pull requests through GitHub's native stack object and gh stack merge. Do not reproduce stack semantics by merging and retargeting individual pull requests with gh pr merge and gh pr edit. The project's AGENTS.md owns which histories (merge-forward or rebase) are allowed.
Require native stack support
Run gh stack --version before changing GitHub state. Stop if the official extension or server-side stack feature is unavailable; do not fall back to merging and retargeting pull requests one at a time. Stacks require every head branch to live in the same repository, so stop on a cross-fork chain.
Use a clean dedicated worktree. Fetch current pull-request metadata and exact head commits rather than trusting branch names or an earlier report:
gh pr view <pr> --json number,author,baseRefName,baseRefOid,headRefName,headRefOid,isCrossRepository,state,isDraft,reviewDecision,mergeStateStatus,statusCheckRollupQuery PullRequest.stack and stackEntry.position for at least one pull request in each apparent chain; this official object, not base-branch inference alone, is the stack-membership authority. Paginate entries when size exceeds the returned page:
gh api graphql -F owner=<owner> -F name=<repo> -F number=<pr> -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
number
author { login }
baseRefName
headRefName
stackEntry { position }
stack {
number
baseRefName
size
entries(first: 100) {
nodes {
position
pullRequest { number author { login } baseRefName headRefName state isDraft }
}
}
}
}
}
}'Establish the expected bottom-to-top order from the live bases: the bottom targets the trunk, and each higher pull request targets the head branch immediately below it.
Link missing stack members
Compare existing stack entries with the expected chain. One existing stack may contain an order-preserving subset of the chain; multiple stack numbers, an unexpected entry, or a conflicting order requires user direction before any change.
When a dependent pull request is not yet in the official stack:
- Compare every
author.loginexactly. - If all authors match, link the chain in bottom-to-top order:
gh stack link --base <trunk> <bottom-pr> <next-pr> ... <top-pr>. - If authors differ or any author is unavailable, ask the user before changing GitHub state.
- Re-query and require one stack number, the expected trunk, the complete pull-request set, and the expected positions and base chain.
Never dissolve, reorder, or rebuild an existing stack automatically; gh stack link is additive, and merged or queued entries cannot be unstacked.
Refresh only when needed
Do not rewrite branches merely because a refresh mechanism exists. When the live merge state or repository rules require an updated trunk, choose an allowed history:
- Native cascading rebase: check out the stack with
gh stack checkout <pr-or-stack>when it is not tracked locally, then rungh stack sync. It may rebase and lease-protected force-push every active layer before local validation, so immediately inspect the rewritten scope, run the relevant checks for every affected layer (see pre-push-checks), and do not merge or claim readiness until they pass. On a rebase conflict, usegh stack rebase, resolve and validate, then publish withgh stack push. If local and remote stack compositions diverge, stop and ask; never delete or recreate the remote stack automatically. - Incremental merge-forward: merge the trunk into the bottom affected branch, then propagate each updated parent into its child in bottom-to-top order and push normally. If the base advances during an in-progress merge, preserve that checkpoint before merging the newer tip.
A history rewrite invalidates commit-hash assumptions: re-fetch exact heads and re-audit unresolved review threads, approvals, mergeability, and checks after the push. Never use raw --force or overwrite a remote head that advanced concurrently.
Respond to review across the stack
Review comments may target several layers. Keep the chain linked through the official stack while fixing them.
- Work on each pull request's branch in its own worktree; parallel fixes never share a checkout.
- Verify every comment against the code before acting: a reviewer who flags the right symptom can still misdiagnose the cause.
- Fix each accepted finding on the pull request that introduced it, then propagate it upward through every affected child, with either refresh history above. A fix that originates in a higher layer leaves the lower one shipping the defect and hides the fix from its reviewer.
- Keep each review fix a distinct commit. A later rebase may change its commit hash, but do not amend a reviewed fix away; amend only your own work that is neither pushed nor reviewed.
- Treat a delegated fix's report as intent, not proof of what landed. Rerun the checks yourself on the actual tree, and prove a regression test fails on the unfixed code (introduce the regression, watch it fail, revert).
- Reply in the comment's review thread, not as a top-level comment, naming the fix and the current commit that carries it.
Before landing, verify that every fixed pull request's current diff carries its correction at the layer that introduced the issue, each child's diff against its parent shows only that child's changes, and the relevant checks pass on every affected layer, not only the top.
Preflight the merge range
Re-query the stack immediately before merging. Require every selected pull request to be open, non-draft, in the expected order, and compliant with the repository's review and check requirements, each judged independently. "Land the stack" selects the whole stack; a partial landing requires an explicit boundary pull request and includes every layer from the bottom through that boundary.
Merge through the stack API
gh stack merge <stack-number> --yes --merge # whole stack
gh stack merge <boundary-pr> --yes --merge # explicitly requested partial landingDo not pass --delete-branch, retarget dependents manually, or issue per-pull-request merge commands. GitHub merges the selected range bottom-up and retargets or rebases any remaining layers. A direct stack merge is all-or-nothing; when the trunk uses a merge queue, GitHub queues the selected range together but may land it in separate groups. If the merge reports a blocker, resolve it through the owning pull request or stop and report it; never bypass requirements or fall back to gh pr merge.
Verify the landed state
Wait until every selected pull request reports MERGED; a queued request is not a completed landing (gh pr view <pr> --json number,state,mergedAt,mergeCommit). For a partial landing, re-query the stack and verify that every remaining pull request is still linked in order and targets the trunk or the layer below it. GitHub may have rebased those layers, so re-check their heads, reviews, and CI.
Delete branches only in a separate final pass after their pull requests report MERGED, and only when gh pr list --state open --base <branch> --json number --jq length returns 0.
Does 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.

