stacked-pr
Skill2 starsChanged 15 days agoMITView on GitHub
Manage GitHub stacked pull requests and dependent PR chains. Use for designing or operating a stack, splitting work into reviewable layers, recovering divergent stacks, or changing CI workflows, bots, or webhook integrations whose behavior depends on stack state.
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
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 43
When a request, project rule or task record sets a review-size cap, carry it through the selected route.
- Very specific: line 45
Check cap mode for each layer, passing its actual immediate PR base, selected head and cap.
- Distinctive: line 50
Read-only inspection may use the same check and report its verdict without publishing.
- Very specific: line 52
Before pushing or creating new layers' PRs, invoke pr in Review gate mode for each new layer, bottom-up, against its immediate PR base.
- Distinctive: line 65
Stack-aware CI and integrations: when the fix changes a workflow, bot, GraphQL client, or webhook because of stack state.
- Distinctive: line 68
API: when REST owns the state: a bot, integration, stateless job, or explicit REST request performs a native-stack operation.
- Distinctive: line 71
Manual: when the user explicitly asks for ordinary dependent PRs instead of a native stack.
- Distinctive: line 96
Keep one mutation owner throughout an operation.
- Distinctive: line 110
Run a Drive pass for every new layer before waiting.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Stacked pull requests
A stack is a linear chain of pull requests in one repository. The bottom targets the trunk; every layer above targets the branch below it, so each PR shows only its own concern.
main <- data-model <- api-routes <- ui
bottom topDependencies point toward the trunk, changes to a lower layer cascade upward, and merges proceed bottom-up.
A stack map is a line in a PR body that lists the chain's PRs bottom-to-top and marks the current one. GitHub shows a native stack's order and navigation on every member PR, so a PR in a native stack carries no map; remove any map that a PR brings into one. Every other open PR in a dependent chain carries the map, because GitHub shows no chain for it.
Scope and safety
Bound the work to the requested operation. Explanations, reviews, and status checks are read-only.
Creation and maintenance may change only the local branches and linked PRs needed for that
operation. A later lifecycle stage must be explicitly included in the request, except
follow-up: new layers continue into pr-followup Drive unless the user asked for no
follow-up, using Follow up layers below. This skill keeps topology, rebases and landing.
Merging requires the user's explicit approval for the exact PR set and merge method immediately
before the merge command, except the user's own PRs in a repository that pr-followup's
personal-repository merge policy covers: those land bottom-up under that standing authorization
once each layer passes its gates. Preserve unrelated dirty-tree work. Before rewriting ancestry, record the
current branch and relevant tips so every original commit remains reachable until verification.
Under that standing authorization, enter the selected route's merge branch for the current bottom PR only. After its verified merge, repair the remaining chain through that route's maintenance branch and rebuild the next bottom's gate evidence before landing it. Outside that policy, retain the exact PR set and method the user approved.
When a request, project rule or task record sets a review-size cap, carry it through
the selected route. Before pushing or creating PRs, invoke pr in
Check cap mode for each layer, passing its actual immediate PR base, selected
head and cap. An upper layer is never checked cumulatively against trunk. Require
a current within-cap result; if pr is unavailable, report the missing check
and keep capped publication pending. The selected stack route retains mutation
and remediation ownership under the shared contract defined by pr.
Read-only inspection may use the same check and report its verdict without publishing.
Before pushing or creating new layers' PRs, invoke pr in Review gate mode for
each new layer, bottom-up, against its immediate PR base. The stack route applies
the fixes and restacks the layers above before reviewing them.
Route the request
Choose one primary route, load its file, select the requested operation there, and stop when that operation's completion criterion is satisfied; after creating or extending layers, continue as Scope and safety directs. For a request that explicitly includes several operations, complete them in dependency order and satisfy each criterion before loading the next.
Decide the route in this order:
- Stack-aware CI and integrations when the fix changes a workflow, bot, GraphQL client, or webhook because of stack state. Product-code and test failures use another route. Load references/automation.md.
- API when REST owns the state: a bot, integration, stateless job, or explicit REST request performs a native-stack operation. Load references/api-workflow.md.
- Otherwise run
gh extension listand record the result.- Manual when the user explicitly asks for ordinary dependent PRs instead of a native stack. Load references/manual-chain.md.
- CLI otherwise:
github/gh-stackis installed, or it is absent and the route installs it before its first command. Only the user or a project rule can prohibit installation. Load references/cli-workflow.md.
Any other request for stacked or dependent PRs asks for a native stack. When installing the absent
extension is prohibited or fails, report a blocker with that observation and offer ordinary
dependent PRs or, with the user's authorization, the API route. When GitHub reports native stacks
unavailable for the repository, report a blocker and offer ordinary dependent PRs. The manual route
then follows only the user's choice, and a chain
that gh-stack already tracks moves to it through the migration section of troubleshooting.md.
GitHub reports native stacks unavailable when a failed native-stack read, link, or submit is confirmed by the stack-list check in cli-create.md; routing does not probe for it. During a read-only request, report it and keep inspecting through Git and PR reads without changing tracking or ownership.
Existing branches and PRs that no tool tracks yet do not decide the route. On the CLI route, a
mutation adopts them first as part of the requested operation, through the adopt step in
cli-create.md and the adoption section of troubleshooting.md, keeping every existing tip. Branches
that another tool manages follow the interoperability section there instead. Linked Git worktrees,
including WorkTrunk's, are not another branch manager: gh-stack tracks their branches. Read-only requests
inspect untracked branches without writing tracking.
Keep one mutation owner throughout an operation. Reading through another interface is safe, but
switching writers during a mutation can desynchronize local tracking and GitHub state. Once the
stack view shows that gh-stack tracks a chain, a plain git rebase or push on its branches
switches the writer. When the user explicitly moves such a chain to manual, migrate ownership
through troubleshooting.md first.
Routing is complete when the requested operation, the route, and the observation that decided it are recorded, such as the extension listing, a failed install, GitHub's report, the user's explicit choice, or the REST or automation context. For repository-bound work, also identify the repository, trunk, push remote, and authenticated principal. Before a mutation, record the current branch, dirty paths, relevant branch tips, and intended remote objects.
Follow up layers
Run a Drive pass for every new layer before waiting. Keep one stack mutation owner;
each pass returns its head/base, result and pending watch action to that owner instead
of arming a watch or ending the turn. Complete authorized repairs and bottom-up landing
first, then refresh affected layers. In T3 Code, arm all remaining layer watches in one
batched host invocation and yield, as pr-followup's T3 Code adapter directs. Reuse
existing watches. Report any layer whose watch failed; a first layer's wait never
postpones the other layers' initial passes.
Conditional references
The primary route points to these only when their branch is reached:
- references/stack-design.md — plan layers before creating branches or splitting existing work.
- references/troubleshooting.md — recover from a failure, divergence, adoption, restructuring, worktrees, or another branch manager.
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- OutThisLife/brooklyn-skills★ 207same name
- nir-mo/gh-stack-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.
In this repository48 other files it gives its agents.
- accessibilitySkill
- agent-instructionsSkill
- analyze-change-effectsSkill
- article-processingSkill
- ci-cd-automationSkill
- comment-styleSkill
- commitSkill
- communicate-clearlySkill
- compare-solutionsSkill
- create-project-instructionsSkill
- daily-meeting-updateSkill
- debugSkill
- deprecate-and-removeSkill
- design-code-structureSkill
- domain-searchSkill
- error-handlingSkill
- explain-codeSkill
- explain-decisionsSkill
- github-actionsSkill
- handoffSkill
- humanizeSkill
- issue-workflowSkill
- observabilitySkill
- people-memorySkill
- performance-optimizationSkill
- planningSkill
- pr-followupSkill
- prototypeSkill
- pr-review-followupSkill
- pr-reviewSkill
- prSkill
- report-work-activitySkill
- retroSkill
- review-code-changesSkill
- simplify-codeSkill
- skill-maintenanceSkill
- task-breakdownSkill
- tddSkill
- teachSkill
- typescript-best-practicesSkill
- verification-authoringSkill
- verifySkill
- wayfinderSkill
- workflow-to-skillSkill
- work-modeSkill
- worktrunkSkill
- write-documentationSkill
- youtube-processingSkill
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.

