/murnana-github:stack-create [what to stack, or existing branch names bottom-to-top]from murnana-github
Create a stack of pull requests (GitHub Stacked PRs) with gh stack
Ships in murnana-github. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Turn a change into a GitHub stack — an ordered chain of small PRs where each PR targets the branch below it and the bottom PR targets the trunk — using the gh stack CLI extension.
Run these first, each line as its own Bash call, exactly as written. Send the first four together in one message, then run the last one on its own (it exits 2 when the current branch is not in a stack, which is expected here):
gh auth status 2>&1 || true
gh extension list 2>&1 || true
git status --short --branch
git remote -v
gh stack view --json
Treat $ARGUMENTS (if any) as a hint about what to stack, or as existing branch names listed bottom to top. It doesn't skip any step below.
gh stack opens a TUI or prompt when arguments are missing, and that blocks this session. Always pass explicit arguments:
| Use | Never use | Why |
|---|---|---|
gh stack init <branch>... | bare gh stack init | prompts for a branch name |
gh stack add <branch> | bare gh stack add | prompts, fails even when piped |
gh stack submit --auto | bare gh stack submit | opens the PR editor TUI |
gh stack view --json | gh stack view | full-screen TUI; --short is for humans, not parsing |
gh stack up / down / top / bottom | gh stack switch, gh stack modify | menu/TUI only — no non-interactive path |
Help is gh stack <command> --help (gh stack help <command> doesn't work). Flags and exit codes: references/command-reference.md.
Copy this checklist into your response and tick it off:
- [ ] 1 gh / gh-stack usable
- [ ] 2 Project rules
- [ ] 3 Pick the input pattern
- [ ] 4 Design layers → approval
- [ ] 5 Build the stack locally
- [ ] 6 Pre-PR checks
- [ ] 7 Submit
- [ ] 8 Verify and hand off
AskUserQuestion tool, never as a plain-text question at the end of a reply. This includes every "wait for approval" and every "ask how to proceed": show the plan or the failure in the reply, then call AskUserQuestion with options such as 「この内容で進める」 and 「修正する」. The dialog can hide the reply, so say in the question itself, in one line, what is being approved.$ARGUMENTS, the conversation, the files or command output already answer. Where a step gives a default, use it and state it in the plan instead of asking.AskUserQuestion is unavailable (a non-interactive run), don't guess: stop before changing anything and list the questions in the reply.gh and gh-stack are usablegh auth status failed → stop and ask, following ${CLAUDE_PLUGIN_ROOT}/skills/pr-create/references/gh-fallback-mcp.md. Note that the MCP fallback cannot create stacks; it only helps for plain PRs.stack line in gh extension list → ask (AskUserQuestion) before running gh extension install github/gh-stack. Never install silently. Requires Git 2.36+.git remote -v and git config --get remote.pushDefault empty → pass --remote <name> to every init/submit/link call (ask which remote if unclear).Read ${CLAUDE_PLUGIN_ROOT}/skills/pr-create/references/project-rules.md and apply it: project conventions decide the trunk (--base), branch naming, commit message format and required checks. Glob for a candidate file before reading it.
| Situation | Path |
|---|---|
| A. Uncommitted (or not-yet-started) work to split into layers | Steps 4 → 5A |
| B. Branches that already exist and are already chained | gh stack init <b1> <b2> ... adopts them (bottom to top), then Step 6 |
| C. Branches managed by jj / Sapling / git-town, user doesn't want local tracking | gh stack link [--base <trunk>] <b1> <b2> ... (bottom to top) — pushes and creates PRs itself; skip Step 7 |
| Already-committed work on one branch that must be split | Out of scope: it needs a history rewrite. Stop, explain, and ask how to proceed |
Current branch is already in a stack (gh stack view --json succeeded) | Extend it: gh stack top, then gh stack add <branch> per new layer |
Follow references/layer-design.md. Present the plan table it describes — trunk, then one row per layer bottom to top with branch name, files, and commit message — and wait for approval before touching git. Reordering layers after branches exist is expensive (and gh stack modify is unavailable to you), so settle the order now.
For the bottom layer:
gh stack init [--base <trunk>] <branch-1>
git add <paths for layer 1>
git commit -m "<message>"
For each next layer, on the current top branch:
gh stack add <branch-n>
git add <paths for layer n>
git commit -m "<message>"
git add -A, which would sweep later layers' files into this one.git status --short must be empty of planned files. Anything left over means a layer is missing a file: stop and ask.gh stack add -Am is not used: it auto-generates the branch name and stages everything.Same rules as pr-create Step 3: discover the project's lint/test/build, run the relevant ones (each is an ordinary permission-prompted Bash call), and if one fails stop before pushing. Every layer is checked by CI against the stack base, so a broken lower layer blocks every layer above it from merging. Run checks on the top branch at minimum; when a lower layer could plausibly break on its own, check it out (gh stack down/bottom) and run them there too.
gh stack submit --auto [--remote <name>]
--auto creates draft PRs with auto-generated titles. Add --open only if the user asked for ready-for-review PRs.submit pushes every branch, creates one PR per branch with chained bases, and links them as a stack on GitHub.gh stack view --json and confirm every branch has pr.number and the bases chain trunk → bottom → … → top./murnana-github:stack-pr-message writes proper per-layer messages.gh stack init turns on git rerere automatically; don't fight it.git push the branches yourself; submit/link push with the right lease and base wiring.gh pr edit afterwards is the supported path (that is what stack-pr-message does).init / add / submit / link / view --json flags, JSON fields, exit codes:
references/command-reference.mdgh fallback (shared with pr-create):
${CLAUDE_PLUGIN_ROOT}/skills/pr-create/references/What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/large-file-guardInstall a hook that blocks git commit when a non-LFS file is too large for GitHub to accept on push./pr-createPush the current branch and create a pull request (or stacked PRs) after approval./stack-pr-messageWrite titles and bodies for every PR in a GitHub stack and apply them with gh pr edit/stack-rebaseCascade-rebase a GitHub stack with gh stack rebase / sync, resolve conflicts, and pushnpx claudepluginhub murnana/murnana-claude-code-plugin --plugin murnana-githubOther plugins' skills for the same job