Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

gh-stack

Skill by CherryHQ

Manages stacked pull requests with the gh-stack GitHub CLI extension. It creates, views, syncs, rebases, merges and checks out stacks of dependent branches so each PR shows one reviewable layer.

  • Score 92
  • 4.1k stars
  • AGPL-3.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install gh-stack

Built from the published package, never by AI.

git clone --depth 1 https://github.com/CherryHQ/cherry-studio-app /tmp/cherry-studio-app && mkdir -p ~/.claude/skills && cp -r /tmp/cherry-studio-app/.agents/skills/gh-stack ~/.claude/skills/gh-stack

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install gh-stack in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

gh-stack is an agent skill for the gh stack GitHub CLI extension. It manages stacked branches and pull requests, where each branch has one PR based on the branch below it, so a reviewer sees only that layer's diff. The skill covers creating and viewing stacks, adding layers, pushing, submitting, syncing, rebasing, merging and checking out stacks. It also guides splitting multi-part work into reviewable branches.

The skill tells the assistant how to run gh stack without prompts, using flags such as --auto, --yes and --remote, and how to read state with view --json. It documents exit codes and rebase conflict recovery. Stacks are strictly linear, with one parent and at most one child. The skill is aimed at developers and AI assistants working with stacked PRs on GitHub.

Written from the project's SKILL.md and checked against it.

What it can do

  • Create a stackInitialises a stack with gh stack init and adds dependent layers with gh stack add.
  • Submit PRsPushes every branch and opens draft PRs with gh stack submit --auto, or ready PRs with --open.
  • SyncFetches, reconciles with GitHub, rebases, pushes and refreshes PR state with gh stack sync.
  • Rebase upstackReplays every branch above an edited layer onto the change with gh stack rebase --upstack.
  • Merge a stackMerges a PR and every unmerged PR below it with gh stack merge, all-or-nothing.
  • Read stack stateReports branches, base SHAs, PR numbers and rebase status as JSON with gh stack view --json.

What you need

  • GitHub CLI (gh) with the gh-stack extension installed
  • Stacked PRs enabled on the GitHub repository
  • remote.pushDefault set when the repository has more than one remote

Try asking

  • Split this feature into a stack of reviewable PRs, bottom layer first.
  • Show the current stack as JSON and tell me which PRs need a rebase.
  • Merge PR #42 and every unmerged PR below it in the stack.

Good to know

  • Stacks are strictly linear, with one parent and at most one child.
  • No non-interactive reorder or removal of branches in a stack.
  • gh stack modify is TUI-only and has no non-interactive path.
  • gh pr merge cannot merge a stack, so gh stack merge must be used.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .agents/skills/gh-stack/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md8 KB
  • references/commands.md9 KB
  • references/stack-design.md4 KB
  • references/troubleshooting.md7 KB

Alternatives to gh-stack

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

gh-stack: common questions

What is a stacked PR?

A stack is an ordered chain of branches rooted on a trunk, where each branch has one PR based on the branch below it. A reviewer sees only that layer's diff.

Why does the skill use flags like --auto and --yes?

gh stack can open prompts or a full-screen TUI under a terminal, which blocks agent sessions. The skill asks the assistant to pass explicit flags instead of relying on terminal detection.

What happens if a stack merge fails partway?

The merge is all-or-nothing. If any PR in the set cannot merge, none of them do.

How do I install gh-stack?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is gh-stack free?

The code is published under the AGPL-3.0 licence. The service it connects to may have its own pricing.

Is gh-stack safe to use?

It scores 92 of 100. Grades: maintenance A, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to gh-stack?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

gh-stack Install

Add to stack

Loading.