Skip to content
Agentmart
Submit a tool
This entry duplicates gh-stack, which is the one we list in search.

gh-stack

Manages stacked PRs and splits multi-part work into reviewable branches with gh-stack.

Skill by github

IndexedMIT★ 1
Write a review

Chalk Labs

Need help deploying gh-stack?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/sreejithraman-gh-stack

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
gh-stack
Description
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.
License
MIT
Metadata
author: github · version: 0.2.0
Instructions
195 lines in SKILL.md · view on GitHub

Files (4)

  • SKILL.md
  • commands.md · references/
  • stack-design.md · references/
  • troubleshooting.md · references/

SKILL.md (first lines)

# 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](references/stack-design.md) before writing
  code. For an existing stack, inspect `gh stack view --json` and edit the layer
  that owns the concern; use `git log --all -- <path>` when ownership is unclear.
- Check `gh stack --version` and `gh stack <command> --help` before relying on
  newer capabilities. `gh stack help <command>` prints top-level help instead.
  For installation/configuration, use [setup](references/commands.md#setup).
  Before a new stack's first `init`, check that setup for the `rerere` prompt;
  explicit branch names alone do not suppress it.
- Before checkout or history-changing work, follow
  [Preserve local files](../pr/references/preserve-local-files.md) in every
  affected worktree. Retain verified backups through conflicts and recovery.
- With multiple remotes, `push`, `submit`, `sync`, `rebase`, and `link` need
  `--remote <name>` unless `remote.pushDefault` selects it. `checkout` and `trunk`
  have no `--remote` flag and require that config.
- Register every scoped PR taken over, created, or pushed through
  [T3 thread registration](../pr/SKILL.md#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](references/commands.md#navigation) for the guarded
shell helper and [worktree recovery](references/troubleshooting.md#driving-stacks-from-another-tool-or-worktree)
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](references/commands.md) 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](references/commands.md#merge).

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](references/troubleshooting.md#restructuring-a-stack).

## State and failures

Parse successful `view --json` stdout; status messages are on stderr.
`view --short` is human-readable. The [state schema](references/commands.md#view)
and [exit codes](references/commands.md#exit-codes) live with command behavior.

On exit 3, follow [conflict recovery](references/troubleshooting.md#rebase-conflicts-exit-3).
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](references/troubleshooting.md), rather than bypassing state.

From sreejithraman/SreeStack, MIT.

More from sreejithraman/SreeStack

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Oct 13, 2026 (19 days ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
0.2.0
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from github

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get gh-stack running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying gh-stack?

CallGet help
Cite this page

gh-stack skill. Agent Mart. https://agentmart.dev/skills/sreejithraman-gh-stack (last updated 2026-10-24)