gh-stack
Manage Cherry Studio stacked branches and pull requests with the GitHub gh-stack extension. Use for planning, creating, inspecting, rebasing, syncing, linking, or recovering a stack of dependent PRs.
Install / Use
npx skills add CherryHQ/cherry-studio --skill gh-stackInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of gh-stack
gh-stack scores 94/100 on our quality scale, 403rd of 4,596 Development & Engineering skills we index (top 9%).
Its SKILL.md is 5.3 KB long, split into 7 sections with 4 code examples: a solid amount of guidance for an agent.
With 52,735 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated today, so gh-stack is actively maintained.
- It is released under AGPL-3.0, a copyleft license: you can use it, but modified versions you distribute must carry the same license.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-19. Automated pattern scan on 2026-10-19. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
gh-stack compared with similar skills
All 4 of these similar skills score higher than gh-stack; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| gh-stack (this skill)by CherryHQ | 94 | 52.7k | today | SKILL.md |
| Agent-Reachby Panniantong | 100 | 99.4k | 4d ago | CLAUDE.md |
| taste-skillby Leonxlnx | 100 | 99.1k | today | CLAUDE.md |
| ai-job-searchby MadsLorentzen | 100 | 55.5k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 42.0k | today | CLAUDE.md |
Frequently asked questions
- How do I install gh-stack?
- Run
npx skills add CherryHQ/cherry-studio --skill gh-stack. The install tabs above show the steps for each supported agent. - Which AI agents does gh-stack work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is gh-stack safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is AGPL-3.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is gh-stack still maintained?
- The repository was last updated today, so gh-stack is actively maintained.
Skill content
View source on GitHubname: gh-stack description: Manage Cherry Studio stacked branches and pull requests with the GitHub gh-stack extension. Use for planning, creating, inspecting, rebasing, syncing, linking, or recovering a stack of dependent PRs. metadata: author: github upstream-version: "0.0.8"
GitHub Stack
Use gh stack for branch topology and synchronization. Use the repository's gh-create-pr skill for Cherry-specific PR bodies, Spec approval, AC coverage, verification, and Agent Note lifecycle.
Availability and prerequisites
This public skill is tracked in .agents/skills/ and discovered from the repository. Developers do not install a separate agent skill. pnpm skills:sync maintains the .claude/skills/ compatibility symlink.
Run this preflight before the first gh stack command in a task:
command -v gh >/dev/null 2>&1 || {
echo "GitHub CLI is required: https://cli.github.com/" >&2
exit 1
}
gh auth status
if ! gh stack --help >/dev/null 2>&1; then
gh extension install github/gh-stack
fi
gh stack --help >/dev/null
If GitHub CLI authentication, extension installation, or the final verification fails, stop and report the failing command. Do not guess stack topology with ad hoc branch comparisons.
Before initializing a stack, avoid extension prompts:
git config rerere.enabled true
When multiple remotes exist, resolve the intended remote and pass --remote <name> to commands that accept it. Do not silently change remote.pushDefault for the developer.
Stack model
A stack is a linear dependency chain. The bottom branch is closest to the trunk; each higher branch contains only work that depends on the layer below it.
main
-> spec
-> implementation-core
-> implementation-ui
Plan the complete dependency order before creating branches. Put a newly discovered lower-layer change on its owning branch, then rebase the upstack branches; do not hide it in the current layer.
Agent-safe commands
All commands must be non-interactive:
- Always run
gh stack view --json; plainviewopens a TUI. - Always supply branch names to
init,add, andcheckout. - Always use
--autowithsubmitif that command is explicitly allowed. - Pass
--remote <name>topush,submit,sync, orlinkwhen more than one remote exists. - Use ordinary
git addandgit commit -S --signoffso each layer is staged deliberately.
Common operations:
gh stack init --base main <bottom-branch> [<higher-branch>...]
gh stack add <new-top-branch>
gh stack view --json
gh stack push --remote <remote>
gh stack rebase --upstack --remote <remote>
gh stack sync --remote <remote>
gh stack checkout <branch-or-pr>
gh stack link --remote <remote> <bottom-pr> <higher-pr> [...]
Exit code 2 from gh stack view --json means only that the current checkout has no matching local stack metadata. It does not prove that an existing PR is standalone on GitHub. In a clean disposable worktree, run gh stack checkout <pr-number-or-url> to discover and hydrate remote topology, then rerun gh stack view --json. Classify an existing PR as standalone only after remote discovery confirms that it is not attached to a GitHub stack.
Exit code 3 means a conflict, but recovery depends on the command. gh stack rebase leaves active recovery state, so resolve the conflict and run gh stack rebase --continue, or gh stack rebase --abort. gh stack sync rolls the attempted rebase back before returning; start a new gh stack rebase to resolve that conflict, and do not use --continue or --abort unless a rebase is active. Exit code 9 means GitHub stacked PRs are unavailable for the repository; stop instead of silently publishing a different PR shape.
Cherry PR creation
Do not use gh stack submit --auto to create human-authored Cherry PRs. It creates PRs before the required body preview and auto-generates bodies that do not satisfy the repository template.
Create a compliant stack bottom-up:
- Push the branches with
gh stack push --remote <remote>. - Invoke
gh-create-prfor each layer, using the parent branch as that layer's base. - After every PR has its approved title and body, link the existing PRs with
gh stack link --remote <remote> <bottom-pr> <higher-pr> [...]. - Verify the resulting topology with
gh stack view --json.
gh stack submit --auto is allowed only for an explicitly authorized automation workflow that is exempt from the human PR template. It is not a shortcut around Cherry's preview requirement.
Changes to an existing stack
When changing a lower layer:
- Check out that branch explicitly.
- Make and verify the focused change there.
- Run
gh stack rebase --upstack --remote <remote>. - Push or sync the stack.
- For every rewritten live PR, rerun
pnpm change:scope --base <verified-parent-ref>and only the checks invalidated by that rewritten scope.
After gh stack sync, inspect its output and run gh stack view --json; a successful command alone is not proof that each PR still has the intended base, scope, or verification.
Lifecycle boundary
Follow .agents/skills/agent-notes/SKILL.md for Spec approval and lifecycle transitions. Intermediate implementation layers keep the note proposed. Only the final layer whose cumulative, actually-run evidence covers every approved AC may move the bilingual note triplet to implemented/.
Related Skills
Agent-Reach
99.4kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
taste-skill
99.1kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
ai-job-search
55.5kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
42.0kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
