gh-stack
Copilot instructions1.6k starsChanged 59 days agoMITView on GitHub
A Go CLI extension (gh stack) for managing stacked branches and pull requests. Uses Cobra for commands, bubbletea/lipgloss for TUI, and stretchr/testify for tests. Repository operations require Git 2.36+. No Makefile, no code generation, no external linter config. Standard Go toolchain only. For full architecture details, see AGENTS.md in the repository root.
Trending
Less talk lately.about the whole repository
Who's talking about github/gh-stack
- ggml-org/llama.cpp“RPC: add `-sm tensor`”GitHub · Aug 5, 2026 · 11 reactions
- isledecomp/isle“ReproBit: certified byte-identical reproduction”GitHub · Aug 31, 2026 · 4 reactions
- voidzero-dev/vite-plus“feat: ship a Renovate preset and dependency-bot docs for lockstep updates”GitHub · Aug 16, 2026 · 4 reactions
- FrancisDeea/pocketool“chore: refresh favicon and app icon branding”GitHub · Aug 13, 2026 · 4 reactions
- anchildress1/supascribe-notes-mcp“docs(agents): rewrite all AGENTS.md files for AI-only consumption”GitHub · Aug 13, 2026 · 4 reactions
The biggest 5 of 46 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 46
Talked about on GitHub, Bluesky and Hacker News (46 times).
On GitHub · 41
- Aug 5, 2026RPC: add `-sm tensor` — ggml-org/llama.cpp11 reactions · 38 comments
- Aug 31, 2026ReproBit: certified byte-identical reproduction — isledecomp/isle4 reactions · 1 comment
- Aug 16, 2026feat: ship a Renovate preset and dependency-bot docs for lockstep updates — voidzero-dev/vite-plus4 reactions · 3 comments
- Aug 13, 2026chore: refresh favicon and app icon branding — FrancisDeea/pocketool4 reactions · 2 comments
- Aug 13, 2026docs(agents): rewrite all AGENTS.md files for AI-only consumption — anchildress1/supascribe-notes-mcp4 reactions · 1 comment
36 more on GitHub
- Sep 21, 2026agent/parakeet perf resident — joshuaswarren/ane-linux-experiments3 reactions · 2 comments
- Aug 30, 2026test(shm): prove bounded peer reclamation — ahrav/magic-context3 reactions · 4 comments
- Aug 30, 2026feat(e2e): wire metamorphic evaluation CI — ahrav/magic-context3 reactions · 3 comments
- Aug 30, 2026feat(e2e): add metamorphic invariant transforms — ahrav/magic-context3 reactions · 3 comments
- Aug 29, 2026ci: add Dreamer eval lane and harden evidence — ahrav/magic-context3 reactions · 3 comments
- Aug 27, 2026feat(memory): warn before repeating rejected approaches — ahrav/magic-context3 reactions · 3 comments
- Aug 27, 2026feat(memory): capture rejected approaches — ahrav/magic-context3 reactions · 7 comments
- Aug 27, 2026fix(memory): exclude rejected approaches from native memory — ahrav/magic-context3 reactions · 3 comments
- Aug 26, 2026feat(module): stage and mirror canonical claim operations — ahrav/magic-context3 reactions · 6 comments
- Aug 26, 2026feat(claims): establish the direct claim contract — ahrav/magic-context3 reactions · 5 comments
- Aug 19, 2026fix(ssr): rewrite computed key of destructing parameter — vitejs/vite3 reactions
- Aug 6, 2026[LoopVectorize] Support vectorization of compressing patterns — llvm/llvm-project3 reactions · 39 comments
- Jul 20, 2026docs: finish demo stack README (layer 3) — e2b-dev/runtime3 reactions
- Jul 20, 2026docs: extend demo stack README (layer 2) — e2b-dev/runtime3 reactions
- Jul 20, 2026docs: add demo stack README (layer 1) — e2b-dev/runtime3 reactions
- Oct 4, 2026fix(policy): refuse project-scope policy check and apply from home — kenryu42/cc-safety-net2 reactions · 4 comments
- Oct 3, 2026Improve LocalExecutor bookkeeping: correctly add tasks to the `running` list — apache/airflow2 reactions · 1 comment
- Oct 3, 2026ci: start packed-runtime with the source checks and audit dependencies last — kenryu42/cc-safety-net2 reactions · 4 comments
- Oct 3, 2026fix(gate): unwrap caffeinate as a built-in exec wrapper — kenryu42/cc-safety-net2 reactions · 4 comments
- Oct 2, 2026更新资源包到 3.1.41 — YUCLing/open-orpheus2 reactions · 2 comments
- Sep 29, 2026docs 483/filter chatlogs/dr and options — aglabo/chatlog-exporter2 reactions
- Sep 29, 2026fix: fail OpenCode v2 install on a failed plugin, protect v1 config.json, settle the OpenClaw enable race — kenryu42/cc-safety-net2 reactions · 4 comments
- Sep 29, 2026fix(detect): follow relocated config homes and report Codex trust, Copilot repo overrides, and OpenCode v2 failures — kenryu42/cc-safety-net2 reactions · 4 comments
- Sep 29, 2026fix(openclaw): re-enable the plugin a reinstall after uninstall leaves disabled, and honor OPENCLAW_HOME — kenryu42/cc-safety-net2 reactions · 6 comments
- Sep 29, 2026fix(hermes): analyze file tools in Hermes' directory and install into the active profile — kenryu42/cc-safety-net2 reactions · 4 comments
- Sep 29, 2026fix(hosts): analyze commands from the Monitor, monitor and powershell shell tools — kenryu42/cc-safety-net2 reactions · 4 comments
- Sep 20, 2026fix(test): prevent orphaned fixture process trees — prvious/pv2 reactions · 3 comments
- Sep 20, 2026fix(test): prevent daemon fixture failures from hanging CI — prvious/pv2 reactions · 3 comments
- Sep 17, 2026chore(dev): ignore extra env files in worktrees — saldanaj97/atlaris2 reactions · 5 comments
- Sep 17, 2026feat(ui): refine maintenance page to match design — saldanaj97/atlaris2 reactions · 6 comments
- Sep 10, 2026Publish the Lister program pattern rename — asimov-specs/asimov-specs.github.io2 reactions
- Sep 10, 2026Publish the Matcher program pattern — asimov-specs/asimov-specs.github.io2 reactions
- Sep 5, 2026feat(cli): show reconciliation queue and phase progress — prvious/pv2 reactions · 7 comments
- Sep 4, 2026perf(daemon): isolate blocking reconciliation operations — prvious/pv2 reactions · 6 comments
- Sep 4, 2026perf(resources): share manifest snapshot and bound artifact downloads — prvious/pv2 reactions · 3 comments
- Aug 29, 2026fix: show account import verification errors — near/near-cli-rs2 reactions · 2 comments
On Bluesky · 4
- Aug 20, 2026gh-stack : une extension GitHub CLI pour gérer les stacked PRs, découper un gros changement en une chaîne de petites PRs liées, avec rebase… — @camilleroux.com2 likes and reposts · 3 replies
- Aug 15, 2026Native stacked PR support plus a CLI workflow removes a lot of day-to-day branch friction. https://github.com/github/gh-stack — @u11g.com2 likes and reposts
- Aug 15, 2026gh-stack : extension GitHub CLI pour gérer les stacked PRs — @news.humancoders.com2 likes and reposts
- Aug 6, 2026מעניין שגיטאהב נכנסו חזק לעניין הזה של Stacked PR, עכשיו גם CLI+Skill, זה בטח קשור לAI איכשהו. אבל ממה שניסיתי, הם מתייחסים לכל הStack כאל… — @baruchiro.com1 likes and repost
On Hacker News · 1
- Aug 3, 2026GitHub/gh-stack: GitHub Stacked PRs1 point
The file
We split this copilot-instructions.md into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
No Makefile, no code generation, no external linter config.
- Very specific: line 31
Check errors with var exitErr *ExitError.
- Very specific: line 33
Use config.NewTestConfig() for test configs with captured I/O.
- Very specific: line 38
Use stackStateDir(cfg) for application state and beginStackMutation before mutation snapshots.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
gh-stack: Copilot Instructions
A Go CLI extension (gh stack) for managing stacked branches and pull requests. Uses Cobra for commands, bubbletea/lipgloss for TUI, and stretchr/testify for tests.
Repository operations require Git 2.36+.
Build and validate
go mod download # install deps
go build -o gh-stack . # build
go vet ./... # static analysis. Always run before tests.
go test -race -count=1 ./... # tests with race detectionNo Makefile, no code generation, no external linter config. Standard Go toolchain only.
Project layout
cmd/: One Cobra command per file. Each exports<Name>Cmd(cfg *config.Config)with logic inrun<Name>().internal/git/:Opsinterface wrapping git CLI.MockOpsfor tests. UseForWorktree(path)for scoped execution,CommonDir()for shared storage, andGitDir()for native per-worktree state. Never use productionos.ChdirorSetOpsto switch context.internal/github/:ClientOpsinterface (18 methods) for GitHub API.MockClientfor tests. Stack operations use the public Stacks REST API (/repos/{owner}/{repo}/stacks); merges use the async merge API (/repos/{owner}/{repo}/pulls/{n}/merge-async) with an explicitmerge_action(direct_mergeormerge_queue) chosen from the base branch's merge-queue detection.merge_actionis optional — omitting it (or sendingdefault) lets the server auto-route (merge queue if one is configured, else direct merge) — but the CLI sends it explicitly so a wrong detection fails loudly instead of silently merging directly.internal/config/:Configstruct passed to all commands. Holds I/O, colors, and test hooks (SelectFn,ConfirmFn,InputFn,GitHubClientOverride).internal/stack/: Shared catalog (<common-dir>/gh-stack, JSON), conservative legacy migration, atomic saves, and short catalog locks.internal/worktree/: Origin/owner identities, cleanliness preflight, scoped operations, and touched-ref recovery.internal/tui/: bubbletea views (stackview,modifyview).
Coding conventions
- Return typed
ExitErrorsentinels (codes 1-10 incmd/utils.go) fromRunE. Never callos.Exit()directly. - Check errors with
var exitErr *ExitError; errors.As(err, &exitErr). - Table-driven tests with
t.Run()subtests. - Use
config.NewTestConfig()for test configs with captured I/O. - Mock git:
restore := git.SetOps(&git.MockOps{...}); defer restore(). Always defer restore. - Mock GitHub:
cfg.GitHubClientOverride = &github.MockClient{...}. - Mock prompts: set
cfg.SelectFn,cfg.ConfirmFn, orcfg.InputFn. - Load stack files with
stack.Load(dir)after writing to get correct checksums. - Use
stackStateDir(cfg)for application state andbeginStackMutationbefore mutation snapshots; defer cleanup. The clone-wide operation lock is separate from short catalog saves. - Recovery must match stack identity, execute in the recorded worktree, and retain journals on partial failures. Native Git markers stay per-worktree.
- Finish paused operations before switching preview stages or versions. Reject origin-only and unknown rebase execution modes before routing recovery; use the matching layer3 build in the recorded origin for origin-only journals.
- Mutation locks coordinate gh-stack only, not Git commands/editors. Keep affected worktrees quiescent during rewrites. Pass the snapshot SHA (or prior
Context.TouchedSHA) toContext.Startbefore ref mutations; never claim an external commit as this operation's work during continuation. - Distributed modify preflights action/cascade targets and executes in recorded owners; only the origin may switch for unoccupied branches. Preserve dropped/folded source worktrees and refs. Before native continuation, preflight other worktrees, not remaining branches in the intentionally busy pending worktree.
For full architecture details, see AGENTS.md in the repository root.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

