gh-stack
Skill1 starsChanged 16 days agoMITView on GitHub
Manages stacked PRs and splits multi-part work into reviewable branches with gh-stack. Use for stack creation, viewing, edits, push, submit, sync, rebase, merge, or checkout; when asked to split or isolate work for review; whenever a user mentions a stack, branch layers, dependent PRs, or gh stack; or when a stack is checked out.
43 other projects use a version of this.
Adopted by
Most recently taken up by
- githubnext/chopintheir own version, first seen Nov 8, 2026
- ErikaAX08/erikas-skillstheir own version, first seen Nov 8, 2026
- devantler-tech/ksailtheir own version, first seen Nov 7, 2026
- theexperiencecompany/gaiatheir own version, first seen Nov 3, 2026
- cloudposse/atmostheir own version, first seen Nov 1, 2026
- Egoushka/agent-skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use gh-create-pr, gh-commit and 8 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.
ant-designSkillgh-create-pr
使用 GitHub CLI (gh) 推送当前分支并创建或更新 PR。在用户说「提 PR」「新建 PR」「用 gh 建 PR」「submit PR」「create pull request」时使用。
Also in 4 projects that use this
kelvincushmanSkillgh-commit
Create well-formatted commits with conventional commit format.
Also in 3 projects that use this
kelvincushmanSkillprek
Use when setting up or running hooks with prek in any repository. prek is a Rust drop-in alternative to pre-commit for running Git hooks that check, format, lint, and validate code and repository files. Prefer it when speed, workspace mode, built-in hooks, shared toolchains, or native TOML configuration matter.
Also in 3 projects that use this
carapace-shSkillbun
Use when working with the bun CLI — Bun's all-in-one JavaScript runtime and toolkit. Covers the CLI command reference (install, add, remove, run, build, test, x, create, init, pm, upgrade, link, unlink), bunfig.toml configuration, environment variables, the package manager and lockfile, the test runner, the bundler, the Bun runtime API (Bun.serve, Bun.file, Bun.spawn, Bun.write, hashing, transpiler), the Bun shell ($ template literal), module resolution and loaders, and globals. Triggers on: "bun", "bunx", "bun install", "bun add", "bun remove", "bun run", "bun build", "bun test", "bun x", "bun create", "bun init", "bun pm", "bun upgrade", "bun link", "bun unlink", "bunfig.toml", "bun.lock", "Bun.serve", "Bun.file", "Bun.write", "Bun.spawn", "Bun.hash", "Bun.password", "bun:test", "Bun.build", "Bun.Transpiler", "bun shell", "$ template", "import.meta", "JavaScriptCore", "Bun.serve", "HTMLRewriter", "Bun.SQL", "Bun.RedisClient", "Bun.Glob", "Bun.plugin", "bun:ffi".
Also in 3 projects that use this
xfstudioSkilltypescript-expert
TypeScript and JavaScript expert with deep knowledge of type-level programming, performance optimization, monorepo management, migration strategies, and modern tooling. Use PROACTIVELY for any TypeScript/JavaScript issues including complex type gymnastics, build performance, debugging, and architectural decisions. If a specialized expert is a better fit, I will recommend switching and stop.
Also in 3 projects that use this
xfstudioSkilltypescript-advanced-types
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.
Also in 4 projects that use this
Other versions43 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 43
- vercel/next.js★ 143ksame name
- remotion-dev/remotion★ 72ksame name
- CherryHQ/cherry-studio★ 53ksame name
- Arize-ai/phoenix★ 12ksame name
- trycompai/crm★ 12ksame name
- CherryHQ/cherry-studio-app★ 4.1ksame name
- dotnet/macios★ 2.9ksame name
- dotnet/android★ 2.1ksame name
- github/gh-stack★ 1.8ksame name
- cloudposse/atmos★ 1.4ksame name
33 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 repository57 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-loginSkill
- animateSkill
- app-intentsSkill
- app-store-connectSkill
- architectSkill
- arenaSkill
- blast-radiusSkill
- codebase-designSkill
- code-qualitySkill
- correctSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- eli5Skill
- engineering-principlesSkill
- gauntlet-loopSkill
- goal-swarmSkill
- grillingSkill
- grill-with-docsSkill
- handoffSkill
- howSkill
- improve-codebase-architectureSkill
- ios-hapticsSkill
- koubouSkill
- mergeSkill
- orchestrationSkill
- prototypeSkill
- prSkill
- react-best-practicesSkill
- react-doctorSkill
- reframeSkill
- repo-cleanupSkill
- researchSkill
- retroSkill
- review-fix-loopSkill
- reviewSkill
- review-sweepSkill
- seoSkill
- setup-sreestackSkill
- show-dont-tellSkill
- showroomSkill
- snipsnap-do-choresSkill
- snip-snapSkill
- swift-testing-modernizationSkill
- swiftuiSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- ui-designSkill
- uikitSkill
- verifySkill
- wayfinderSkill
- web-component-inspirationSkill
- whySkill
- writing-for-agentsSkill
- xcode-security-auditSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 42 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Check gh stack --version and gh stack <command> --help before relying on newer capabilities.
- Very specific: line 29
Before a new stack's first init, check that setup for the rerere prompt.
- Distinctive: line 31
Before checkout or history-changing work, follow Preserve local files in every affected worktree.
- Distinctive: line 59
Use names from the task; branch names are used verbatim, including slashes.
“Common” is measured: kept by at least 6 in 10 of the 42 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
gh-stack
gh stack manages linear chains of branches and PRs. Stacks print trunk-first:
(main) <- auth <- api <- frontend. Left is bottom and merges first; right is
top. up moves away from trunk; down moves toward it. Put dependencies below
their callers and use separate stacks for independent work.
Before acting
- Plan new layers with stack design before writing
code. For an existing stack, inspect
gh stack view --jsonand edit the layer that owns the concern; usegit log --all -- <path>when ownership is unclear. - Check
gh stack --versionandgh stack <command> --helpbefore relying on newer capabilities.gh stack help <command>prints top-level help instead. For installation/configuration, use setup. Before a new stack's firstinit, check that setup for thererereprompt; explicit branch names alone do not suppress it. - Before checkout or history-changing work, follow Preserve local files in every affected worktree. Retain verified backups through conflicts and recovery.
- With multiple remotes,
push,submit,sync,rebase, andlinkneed--remote <name>unlessremote.pushDefaultselects it.checkoutandtrunkhave no--remoteflag and require that config. - Register every scoped PR taken over, created, or pushed through T3 thread registration; a CLI operation does not register its layers with the thread.
Worktree capabilities
Shared catalogs, foreign-owner navigation, and owner-aware recovery require a
supporting extension. Check the installed version and relevant help before
assuming those behaviors. If navigation help lacks --print-path, use Git's
worktree inventory to locate an existing owner and work there; do not invent
that flag, force another checkout, mix old/new writers, or upgrade outside scope.
With supported path mode, navigation or explicit-target checkout --print-path
returns an owner's path without taking its checkout. Unoccupied targets are
checked out here first. Use stdout only after exit 0, quote the path, and never
eval it. See navigation for the guarded
shell helper and worktree recovery
for migration and ownership limits.
Common calls
Give explicit arguments and flags even under a PTY: bare commands can open a TUI. Use names from the task; branch names are used verbatim, including slashes.
| Task | Non-interactive call |
| Inspect state | gh stack view --json |
| Create layers bottom to top | gh stack init <branch>... |
| Add the next layer from the top | gh stack add <branch> |
| Select a layer or stack | gh stack checkout <target> |
| Navigate | gh stack up, down, top, bottom, or trunk |
| Publish PR layers | gh stack submit --auto |
| Update branches without creating PRs | gh stack push |
| Replay upper layers after a lower-layer edit | gh stack rebase --upstack |
| Synchronize | gh stack sync |
| Merge a scoped set | gh stack merge <target> --yes |
Stage specific files and commit the owning layer before moving up. After an edit below the top, rebase upstack, return to the top, then push. Read the affected command behavior for preconditions and partial effects.
submit --auto creates drafts; --open marks new and existing PRs ready for
review. Titles/bodies are generated; use gh pr edit for custom text. sync
fetches, reconciles, rebases, pushes, and refreshes PR state; pruning needs
--prune when non-interactive. A diverged stack can return exit 0 with
Sync aborted: verify the resulting state instead of declaring synchronization.
A merge target scopes the operation: a PR includes every unmerged PR below it;
a stack number includes the whole unmerged stack. Bare numbers resolve as stack
numbers first; confirm the selected set when IDs overlap. The selected set is
all-or-nothing for direct merging. A base merge queue chooses the method despite
method flags and can land separate groups. Use gh stack merge, following the
caller's merge authorization. See merge behavior.
Other public commands: link, unstack (see command behavior); alias,
feedback (see installed help). switch and the modify editor are menu-only;
use explicit checkout/navigation, or the documented recovery flags for an
existing interrupted operation. For non-interactive restructuring, read
restructuring.
State and failures
Parse successful view --json stdout; status messages are on stderr.
view --short is human-readable. The state schema
and exit codes live with command behavior.
On exit 3, follow conflict recovery. A failed rebase pauses; sync attempts rollback. Inspect whether restoration completed before restarting anything. Resolve/stage only in the diagnostic's owner worktree; a later conflict may name another owner. Supported recovery flags use recorded owners. Keep retained files accounted for after success or recovery. Lock and interrupted-modify diagnostics also require their specific recovery procedure, rather than bypassing state.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

