pattern-stack/claudecode-patterns/stack-management
Claude Code and agent skill by pattern-stack/claudecode-patterns
- community
Checking that the SKILL.md file is still in the repository.
Auto-load PR stack context for current branch. Reads stack state and reports position. Use when working on any branch that is part of a PR stack.
Install
npx vskill@latest install pattern-stack/claudecode-patterns/stack-managementSKILL.md
The same SKILL.md was published earlier as pattern-stack/claudecode-patterns/stack-management.
Stack Context Auto-Loader
Provides stack awareness to Claude and subagents automatically. Read-only — never modifies state. Backed by gh stack (GitHub's official extension); /sdlc:stack is the full skill.
Steps
- Check the extension is installed:
``bash gh extension list 2>/dev/null | grep -q 'github/gh-stack' ``
- If installed, read stack state. Always `--json` — bare
viewopens a TUI under a PTY and
blocks forever: ``bash gh stack view --json 2>/dev/null ``
- Exit code 2 means the current branch is not in a stack — stay silent, this is the
common case. Exit 6 means the branch belongs to several stacks; report that and stop.
- On success, report concisely —
branches[]is ordered bottom (trunk-side) to top:
`` Stack: <n of total> | <currentBranch> | trunk: <trunk> PRs: <open>/<total> open ` Derive the position from the index of the entry whose isCurrent is true. PR state per branch is branches[].pr.state (OPEN | MERGED | QUEUED); pr` is absent when no PR exists.
- If any branch has
needsRebase: true, warn:
`` ⚠ Stack needs a rebase — run gh stack rebase (or --upstack after editing a lower layer) ``
- If a rebase is already in flight (
gh stack rebasewould exit 7), warn:
`` ⚠ Rebase in progress — resolve conflicts, git add, then gh stack rebase --continue ``
- If the extension is not installed, suggest:
`` gh stack not installed. Install with: gh extension install github/gh-stack ``
view --json schema
JSON goes to stdout; status messages go to stderr — never parse stderr.
base is the saved SHA of the parent this branch was last known to contain — it can be older than the parent's current tip, which is what needsRebase reflects.
Principles
- Lean: one command, concise output
- Read-only: never modify state or branches (note
viewdoes refresh PR state from GitHub as a
best-effort side effect, and does not fail when the API is unreachable)
- Silent when irrelevant: no output when not on a stack branch (exit 2)
- Actionable warnings: surface needs-rebase and rebase-in-progress states
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugin/skills/stack-management/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/pattern-stack/claudecode-patterns/stack-management)