
pr-stack
Manage stacked PRs using whichever stacking tool is installed: Graphite (gt), git-town (git town), or GitHub's native gh stack extension. Detects which is available in the current repo, then drives the matching one via its per-tool reference (references/gt.md, references/git-town.md, or references/gh-stack.md). Use when the user asks to "create a stack", "stack a branch", "restack", "submit a stacked PR", "rebase the stack", "sync the stack", "track this branch", "the bottom PR merged, what now", "clean up after a stack merge", or invokes /pr-stack. If none is available, stop and tell the user — never fall back to ad-hoc git push chains. Do NOT use for staging or committing — hand off to /commit. Do NOT use for PR review traffic, comments, or CI checks — hand off to /gh.
- Installs
- 41
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/paulnsorensen/skillz-that-grillz --skill pr-stack- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads pr-stack automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
pr-stack
Stacked branches: a chain of small branches each opening one PR, kept in order across rebases and pushed as a group.
Three tools implement this workflow today. They share the same mental model but live in different ecosystems:
- Graphite (
gt) — third-party CLI, mature, requires a Graphite account (gt auth). Stack metadata lives in.git/.graphite_repo_config. - git-town (
git town) — third-party CLI, mature, no account and forge-agnostic (GitHub / GitLab / Gitea / Bitbucket / Forgejo / Azure DevOps). Branch lineage lives in local git config (git-town-branch.<name>.parent), so there's nothing to sign up for. - GitHub
gh stack— first-partyghextension (github/gh-stack), private preview as of 2026-05; repos must be allow-listed via gh.io/stacksbeta. Stack metadata lives in.git/gh-stack. Uses standardgh auth login— no third-party account.
This skill picks whichever one the user has and drives it. It does not
emulate stacking with plain git.
Detection — run before anything else
# gt available?
command -v gt >/dev/null 2>&1 && gt --version >/dev/null 2>&1
# gt initialized in this repo?
test -f "$(git rev-parse --git-dir)/.graphite_repo_config"
# gh stack extension installed?
# (gh extension list output is TAB-separated: <short-name>\t<owner/repo>\t<version>)
# Guard with `command -v gh` so the probe stays quiet when gh itself is missing
# — `2>/dev/null` on the pipeline doesn't catch the shell's own "command not
# found" message.
command -v gh >/dev/null 2>&1 \
&& gh extension list 2>/dev/null | awk -F '\t' '$2 == "github/gh-stack"' | grep -q .
# git-town available?
command -v git-town >/dev/null 2>&1 && git town --version >/dev/null 2>&1
# git-town configured for this repo? (non-empty trunk = set up)
git config --local --get git-town.main-branch >/dev/null 2>&1
Pick the tool the repo is already set up for. A tool counts as usable here when it's installed and configured for this repo:
| Tool | Installed probe | Configured-for-repo probe |
|---|---|---|
gt | command -v gt | .git/.graphite_repo_config exists |
git town | command -v git-town | git config --local --get git-town.main-branch non-empty |
gh stack | gh extension list has github/gh-stack | no preflight — detected lazily when a remote op exits 4 |
Then:
- Exactly one usable → use it; read that tool's reference.
- More than one usable → prefer
gt(GA, mature, and the repo may already track a stack), thengit town(GA, no account, forge-agnostic), thengh stack(first-party but private preview). Tell the user which others are present and offer to switch. - Installed but not configured → offer the one-time setup (
gt init, orgit config --local git-town.main-branch <trunk>— your trunk name, e.g.main/master;gh stackneeds no repo init) and proceed. - None usable → stop. Don't reach for
git pushchains. See "None installed" below.
Run the probes every invocation — the user's environment can change between sessions.
None installed
If detection finds none of gt, git town, or the gh stack extension,
surface this verbatim and stop:
Stacked-PR tooling isn't available on this machine / for this repo. Install one of:
- Graphite CLI —
brew install withgraphite/tap/graphite(ornpm install -g @withgraphite/graphite-cli@stable), thengt auth --token <token from https://app.graphite.com/activate>andgt initinside this repo.- git-town —
brew install git-town(orchoco/scoopon Windows), thengit config --local git-town.main-branch <trunk>(your trunk name, e.g.main/master; or thegit town config setupwizard) inside this repo, plus eithergit config --local git-town.github-connector gh(reuse yourghauth) or agit-town.github-tokenPAT. Works on GitHub, GitLab, Gitea, and more.- GitHub native
gh stack—gh extension install github/gh-stack, then make sure the repo is allow-listed at gh.io/stacksbeta (private preview as of 2026-05).Once one of those is installed, re-invoke
/pr-stackand I'll drive it.
Do not improvise with plain git push chains, parent-target wiring, or
manual PR linking — the value of this skill is the stack-aware machinery,
and faking it produces a worse outcome than telling the user the tool is
missing.
Third failure mode — gh stack installed but the repo isn't allow-listed.
The CLI installs anywhere, but remote ops (submit, sync, link) fail
with exit code 4 when the repo isn't on the private-preview allow-list.
If you see exit 4, surface this and point the user at
gh.io/stacksbeta. If gt is also installed
locally, offer to fall back to it for this repo.
Mental model (shared)
- Trunk is
main(or whatever the repo calls it). - Stack is a chain of branches, each parented on the previous one. The bottom of every stack is trunk.
- One PR per branch, each PR targeting its parent branch. The chain reviews bottom-up.
- Submit pushes the whole chain and opens / updates one PR per branch.
- Sync pulls trunk, restacks every surviving branch onto the new trunk tip, and prunes branches whose PRs have merged.
All three tools implement this model. Command names diverge — see the per-tool reference.
After a PR in the stack merges
When the bottom (or any merged) PR lands, the rest of the stack needs to follow trunk forward and the merged branch needs to drop out. This is a distinct moment — don't wait for it to come up in normal "sync" cadence.
Run the tool's sync command:
| Tool | Command | What it does |
|---|---|---|
gt | gt sync then gt submit --stack | Fetches trunk, restacks survivors onto the new trunk tip locally, prompts to delete merged / closed branches. Then submit pushes the rebased survivors. |
gh stack | gh stack sync (gh stack submit only if you have unpushed local commits) | GitHub already cascaded the rebase server-side at merge time; sync mostly pulls that state down and updates local refs. |
git town | git town sync --stack | Fetches trunk, drops the merged branch, rebases the survivors onto the new trunk tip locally, and force-pushes them so the forge re-targets their PRs. |
Key divergence: with gh stack the survivors were already rebased by the
GitHub server when the bottom PR merged — your job is to pull that state
down, not to recompute it. With gt the rebase is local, so gt sync
does the actual work on your machine.
If sync hits a conflict (trunk and a survivor touched the same lines), drop
into the tool's conflict-recovery flow — gt continue / gt abort,
git town continue / git town skip, or
gh stack rebase --continue / --abort. Never reach for bare
git rebase --continue; the tool's metadata won't advance.
After sync succeeds, run gt log short / git town branch / gh stack view to confirm the
chain looks right before the next submit.
Tool-equivalence cheat sheet
| Action | gt | git town | gh stack |
|---|---|---|---|
| Initialize stack metadata | gt init (repo-level) | git town config setup (repo-level) | gh stack init (per-stack) |
| Start a stack off trunk | gt create on trunk | git town hack <name> | gh stack init + gh stack add |
| Create branch on top | gt create -am "msg" | git town append <name> (then commit) | gh stack add -Am "msg" |
| Amend tip + restack children | gt modify -a | edit, then git town sync --stack | (edit, then gh stack push) |
| New commit + restack children | gt modify -cam "msg" | commit, then git town sync --stack | (commit, then gh stack push) |
| Inspect stack | gt log short (gt ls) | git town branch | gh stack view (-s short) |
| Pull trunk + restack | gt sync | git town sync --stack | gh stack sync |
| Cascade restack only | gt restack | git town sync --stack --no-push | gh stack rebase |
| Submit / update PRs | gt submit --stack (gt ss) | git town propose --stack | gh stack submit |
| Adopt a plain-git branch | gt track (any time) | git town set-parent (any time) | gh stack init --adopt (init-time only) |
| Move up / down in stack | gt up / gt down | git town switch (picker) | gh stack up / gh stack down |
| Continue after conflict | gt continue | git town continue | gh stack rebase --continue |
| Abort / skip halted op | gt abort | git town skip / git town undo | gh stack rebase --abort |
| Open existing PRs as stack | n/a | n/a (set parents, then propose --stack) | gh stack link <PRs...> |
When in doubt about flags, always defer to the per-tool reference, not to memory — all three CLIs drift between versions.
Rules (apply to all three tools)
- Don't reach into
git rebasemid-stack. Use the tool's sync / restack / modify commands so children stay parented correctly. - Don't
git pusha single branch in a stack. Use the tool's submit / push command — bare push skips the parent-target wiring and leaves the rest of the stack stale. - Stage explicitly. All three tools follow the staged set the way
git commitdoes. Stage by name; avoidgit add -A. - One concern per branch. That's the whole point of stacking — keep each PR reviewable in isolation.
- After a rebase conflict, use the tool's
continue/abort, never baregit rebase --continue/--abort— the tool's metadata won't update otherwise.
Handoffs
- Staging and crafting commit messages →
/commit - PR review, CI checks, merge, comments →
/gh - Pre-commit hooks complaining →
/prek
When to read references
references/gt.md— fullgtcommand surface (create / modify / sync / submit / track / log), install + auth, restack recipes, conflict recovery, monorepo / multi-trunk caveats. Read when detection picksgt.references/git-town.md— fullgit towncommand surface (hack / append / sync / propose / set-parent / ship), install + forge auth, conflict recovery, config keys, squash-merge gotcha. Read when detection picksgit town.references/gh-stack.md— fullgh stackcommand surface, install + waitlist, exit codes, conflict recovery, divergence fromgt. Read when detection picksgh stack.
FAQ
What does the pr-stack skill do?
Manage stacked PRs using whichever stacking tool is installed: Graphite (gt), git-town (git town), or GitHub's native gh stack extension. Detects which is available in the current repo, then drives the matching one via its per-tool reference (references/gt.md, references/git-town.md, or references/gh-stack.md). Use when the user asks to "create a stack", "stack a branch", "restack", "submit a stacked PR", "rebase the stack", "sync the stack", "track this branch", "the bottom PR merged, what now", "clean up after a stack merge", or invokes /pr-stack. If none is available, stop and tell the user — never fall back to ad-hoc git push chains. Do NOT use for staging or committing — hand off to /commit. Do NOT use for PR review traffic, comments, or CI checks — hand off to /gh.
How do I install pr-stack?
Run npx skills add https://github.com/paulnsorensen/skillz-that-grillz --skill pr-stack in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/pr-stack/ (personal) or .claude/skills/pr-stack/ (project).
Which AI agents can use pr-stack?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is pr-stack safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains pr-stack?
It is published by paulnsorensen in paulnsorensen/skillz-that-grillz. It has 41 recorded installs.
More from paulnsorensen/skillz-that-grillz
skillz
paulnsorensen/skillz-that-grillz
Add, improve, audit, wedge, or autoimprove a skill. Improve and audit also accept a sub-agent definition. The result runs predictably on Claude Code, Codex, OMP, and other Agent Skills hosts. Use for /skillz , "improve this skill", "autoimprove this skill", "optimize this skill", "tighten this skill", "audit this agent", "new skill for X", "skill not triggering", "fix trigger rate", "wedge this", "turn this repeated work into a CLI", or "what in this skill should be a CLI". Do NOT use for CLAUDE.md or system-prompt edits, or for code changes that a cheese pipeline skill owns.
gh
paulnsorensen/skillz-that-grillz
Complete GitHub tasks using the gh CLI — pull request inspection, review, and merge, issues, CI checks, releases, workflow runs, code search, repo and label management. Use when the user says "merge PR", "check CI", "list issues", "review PR", "PR status", "close issue", "trigger workflow", "view release", "search repos", or invokes /gh. Use git (log, diff, status) for read-only local context only. Do NOT use for committing, staging, pushing, or PR creation — use /plate for those. Do NOT use for code-quality review — use a dedicated review skill.
chezmoi
paulnsorensen/skillz-that-grillz
Manage dotfiles with chezmoi — the source-state dotfile manager that uses filename attributes (dot, private, encrypted, runonce), Go templates, and password-manager integration to keep one set of dotfiles working across many machines. Use when the user says "set up dotfiles", "manage my dotfiles", "bootstrap a new machine", "chezmoi", "encrypt my SSH key in dotfiles", "template dotfiles per OS", "add secrets to dotfiles", "what should be in my .chezmoi.toml.tmpl", or asks how to share configs across macOS / Linux / servers. Also trigger when the user is staring at a fresh machine and wants the one-liner that gets them home, or when they're about to commit something sensitive into a dotfiles repo. Do NOT use for stow / yadm / rcm or other dotfile managers, generic git repo setup, or password-manager setup unrelated to dotfiles.
prek
paulnsorensen/skillz-that-grillz
Onboard prek (Rust-powered pre-commit) into any project and suggest hooks tailored to the language/framework. Use when the user says "add prek", "set up pre-commit hooks", "configure prek", "what hooks should I use", or when you notice a project without a prek.toml that would benefit from pre-commit checks. Also trigger when the user wants to add new hooks to an existing prek.toml, audit their hook config, or migrate from pre-commit to prek. Covers Rust, Python, TypeScript/JavaScript, Go, Ruby, and Shell projects. Do NOT use for husky, lint-staged, or CI pipeline hook configuration — this skill is specifically for prek.
copilot
paulnsorensen/skillz-that-grillz
Use when the user says "copilot review", "review with copilot", "delegate to copilot", "have copilot fix this", "copilot agent task", "set up copilot", "generate copilot instructions", "bootstrap copilot for this repo", or invokes /copilot. Three modes: review (run a code review on a PR and route fixes to Copilot via inline @copilot fix this comments), delegate (create a gh agent-task, poll until the coding agent opens a PR, optionally hand off to review), and setup (one-time bootstrap that writes .github/copilot-instructions.md and the per-role .github/instructions/.instructions.md files). review and delegate are routine; setup is a one-time repo bootstrap loaded on demand from references/setup.md only when the user explicitly asks. Do NOT use for plain GitHub PR work — that is /gh's job.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.