pattern-stack/claudecode-patterns/stack-management

Claude Code and agent skill by pattern-stack/claudecode-patterns

Trust tier 2
  • community
LLM review pending
Source check pending

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-management

SKILL.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

  1. Check the extension is installed:

``bash gh extension list 2>/dev/null | grep -q 'github/gh-stack' ``

  1. If installed, read stack state. Always `--json` — bare view opens a TUI under a PTY and

blocks forever: ``bash gh stack view --json 2>/dev/null ``

  1. 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.

  1. 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.

  1. If any branch has needsRebase: true, warn:

`` ⚠ Stack needs a rebase — run gh stack rebase (or --upstack after editing a lower layer) ``

  1. If a rebase is already in flight (gh stack rebase would exit 7), warn:

`` ⚠ Rebase in progress — resolve conflicts, git add, then gh stack rebase --continue ``

  1. 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.

trunk string
currentBranch string
branches[] name, head, base, isCurrent, isMerged, isQueued, needsRebase
branches[].pr number, url, state ("OPEN" | "MERGED" | "QUEUED"); absent when no PR exists

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 view does 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/pattern-stack/claudecode-patterns/stack-management/badge)](https://verified-skill.com/skills/pattern-stack/claudecode-patterns/stack-management)

Something wrong with this skill or its page? Tell us.