gh-stack
Skill11 starsChanged 27 days agoMITView on GitHub
使用 gh-stack GitHub CLI 扩展管理堆叠分支和拉取请求。适用于创建、推送、变基、同步、切换、查看、重组或合并相互依赖的 PR 链及堆叠差异。
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 7 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 repository20 other files it gives its agents.
- absorb-skillSkill
- agent-healthSkill
- architecture-decision-recordSkill
- benchmark-checklistSkill
- brainstormingSkill
- codecov-coverageSkill
- frontend-design-reviewSkill
- linux-performance-analysisSkill
- loop-on-ciSkill
- pull-requestSkill
- requesting-code-reviewSkill
- runtime-verificationSkill
- shared-memorySkill
- show-meSkill
- simplifySkill
- systematic-debuggingSkill
- technical-writingSkill
- test-scenariosSkill
- writing-plansSkill
- x-tweet-fetcherSkill
The file
Files
管理堆叠拉取请求
使用 gh stack 管理线性分支链,每个分支对应一个聚焦的 PR,并以下一层分支为基准。
main -> data-models -> api -> frontend基础改动放在栈的下层,依赖它的使用方放在上层。无关工作使用独立的栈。
前置检查
git rev-parse --git-dir
git status --short
gh --version
gh auth status
gh extension list | rg 'github/gh-stack'获得明确授权后安装:
gh extension install github/gh-stack存在多个远端时,配置目标默认远端,或在支持的命令中传入 --remote:
git config remote.pushDefault origin非交互规则
- 调用
init、add和基于分支的checkout时始终传入分支名;省略参数可能触发交互提示。 - 始终使用
gh stack submit --auto;只有已准备好评审的 PR 才添加--open。 - 始终使用
gh stack view --json;默认查看模式是交互式的。 - 使用常规
git add和git commit,明确控制每一层的改动。 - 修改较低层前先切换过去并在该层提交,然后运行
gh stack rebase --upstack。 - 分支由多个栈共享时,需要先检出一个无歧义的分支。
- 执行
checkout <pr-number>前,必要时用gh stack unstack --local移除冲突的本地跟踪信息。 - 使用
gh stack merge --yes合并;不要用gh pr merge替代堆叠 PR 的合并操作。
常用流程
创建并提交一个栈:
gh stack init data-models
# 编辑,然后执行 git add 和 git commit
gh stack add api
# 编辑,然后执行 git add 和 git commit
gh stack add frontend
# 编辑,然后执行 git add 和 git commit
gh stack submit --auto
gh stack view --json修改较低层并更新依赖层:
gh stack checkout api
# 编辑,然后执行 git add 和 git commit
gh stack rebase --upstack
gh stack push
gh stack view --json日常同步:
gh stack sync
gh stack view --json执行相关操作前,阅读 完整命令参考,确认准确参数、栈链接、结构调整、冲突恢复、合并队列、退出码和各命令的具体行为。
恢复边界
- 变基冲突:解决报告的文件并暂存,然后执行
gh stack rebase --continue;无法安全解决时用gh stack rebase --abort中止。 - 多栈歧义:检出一个明确且不共享的分支,不要猜测。
- GitHub API 失败:重试前检查认证和标准错误输出。
- 栈状态被锁定:重试前确认没有正在运行的
gh stack进程。 - 仓库不支持堆叠 PR:报告限制,不要用无关命令模拟。
验证
每次执行会修改状态的流程后,运行 gh stack view --json,验证分支顺序、基准分支、PR 状态和变基状态。报告实际命令及输出覆盖的范围,不要仅凭推送成功就宣称整个栈状态正常。
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.

