stacks
БесплатноБез исполняемых скриптовНе проверенStacked pull requests with the GitHub CLI `gh stack` extension. Trigger whenever the user wants to split a large branch or change into a chain of dependent…
от robbyt★ 42 звезды на GitHubОб этом скилле
Stacked Pull Requests via gh stack
A stack is a chain of small PRs where each targets the branch below it, and the whole
chain lands on a trunk (usually main). Instead of one giant diff, reviewers get
focused, independently reviewable layers. This is the antidote to the un-reviewable
"here's 4,000 lines of AI-generated code" PR.
Use this skill for any multi-PR dependent chain or any gh stack … command. For a single
standalone PR, use the pr skill instead.
Preview status & constraints (read before you start)
- Public preview, extension
github/gh-stackv0.1.0 (snapshot: 2026-08-02). Behavior may change — if a command or flag here doesn't match reality, rungh stack <command> --helpand trust that. - Trunk = the base branch of the bottom PR. Defaults to the repo's default branch;
set a different one with
--base. - Same-repository only — no cross-fork stacks. Not supported in GitHub Desktop.
- Stack-base evaluation rule (surprising, important): branch protection, required checks, CODEOWNERS, code scanning, and Actions are evaluated against the stack base (the trunk), not the branch directly below. Every mid-stack PR is held to the trunk's standard, and a PR merges only after every PR below it also passes.
- Linear history is mandatory before merging. Closing a mid-stack PR blocks every PR above it.
Assume the extension is installed
Just run gh stack …. Don't run a detect/install check on every invocation — it adds
latency and noise for the common case. Base requirements: gh ≥ 2.90, git ≥ 2.20, and
gh auth status authenticated.
Only if a gh stack command actually fails, diagnose before installing anything:
| Failure | Response |
|---|---|
unknown command "stack" / extension not found |
Offer gh extension install github/gh-stack — ask the user first (it downloads and runs third-party code). |
| A documented command/flag is missing | Preview drift — offer an approval-gated gh extension upgrade gh-stack (not a reinstall). |
gh < 2.90 or git < 2.20 |
Report the version prerequisite; installing the extension won't fix it. |
| Auth / repo / divergence / network error | Do not suggest installing anything — fix the actual error. |
gh skill install github/gh-stack is not a prerequisite — that installs GitHub's own
agent skill; this skill is your guidance.
Design the stack first
Order layers by dependency, foundation at the bottom, each layer a single coherent change small enough to review on its own. A reader should be able to go bottom-to-top and watch the feature come together. Example for "add user auth":
- data model + migration → 2. CRUD endpoints → 3. JWT middleware/guards → 4. tests
Build a stack
Lifecycle — don't skip the "commit each layer" step or you'll create empty/mislayered branches:
verify clean tree → choose trunk + bottom-to-top branch names → init (or adopt existing)
→ implement & commit layer → add next branch from the current top → gh stack view → submit
# Start a new stack (bottom branch based on the trunk)
gh stack init auth-model
# ...or create/adopt several layers bottom-to-top in one shot
gh stack init --base main auth-model auth-endpoints auth-middleware
# Add the next layer on top of the current top branch.
# -A stages ALL changes (incl. untracked) — prefer a deliberate `git add` of just this
# layer's files so unrelated work isn't swept in, then:
gh stack add -m "Add CRUD endpoints" auth-endpoints
# Inspect before submitting
gh stack view --short
# Create/update the PRs. In a terminal this opens an editor; pass --auto to skip it.
gh stack submit --auto # new PRs as drafts
gh stack submit --auto --open # new PRs marked ready for review
Use gh stack submit, not gh pr create, for stack branches — submit pushes
branches, creates/updates each PR, fixes PR base branches, and creates/updates the stack
object on GitHub. gh pr create does none of the stack wiring.
Change a lower layer
Fix the layer where the change belongs, not at the top — a fix on the wrong branch corrupts the diffs of every branch above it.
git status && gh stack view --short # know where you are first
gh stack checkout auth-model # or: gh stack down
# ...confirm you're on the intended branch, then edit + commit HERE...
git add <this-layer's-files> && git commit -m "Fix token expiry handling"
gh stack rebase --upstack # carry the fix up into the branches above
gh stack push
gh stack top # return to where you were working
Keep a linear history (rebase)
Merging requires a linear history; restore it with a cascading rebase, then push.
gh stack rebase # cascade bottom→top (also: --downstack, --upstack, --no-trunk)
gh stack push
On conflict: resolve the markers → git add . → gh stack rebase --continue. To bail
out: gh stack rebase --abort (restores all b
Установить stacks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл stacks?
Stacked pull requests with the GitHub CLI `gh stack` extension. Trigger whenever the user wants to split a large branch or change into a chain of dependent PRs ("stack this into smaller PRs", "split this into a stack", "create a stacked PR", "break this feature into reviewable layers"), or manage an existing stack ("add a layer on top", "rebase my stack", "sync the stack after the bottom PR merged", "merge the stack"). Use this instead of the `pr` skill whenever the work involves more than one dependent PR or any `gh stack` command; use `pr` for single, standalone pull requests.
Как установить скилл stacks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл stacks запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic