pr-stack
БесплатноБез исполняемых скриптовНе проверенPlan and execute splitting a large PR or branch into a reviewable stacked PR sequence.
от rp1-run★ 38 звёзд на GitHubОб этом скилле
PR Stack
Plan and execute splitting a large PR, local branch, or remote branch into an ordered stack of smaller reviewable PRs.
Use the pre-resolved projectRoot, kbRoot, workRoot, and codeRoot values from the generated Workflow Bootstrap section. Run all source-control commands from codeRoot, and write workflow artifacts only under workRoot.
Constraint: plan first; create branches/PRs only after explicit user approval.
STATE-MACHINE
stateDiagram-v2
[*] --> planning
planning --> executing : approved
planning --> reporting : plan_only
executing --> reporting : stack_created
reporting --> [*] : done
On each phase transition, report via:
rp1 agent-tools emit \
--workflow pr-stack \
--type status_change \
--run-id {RUN_ID} \
--step {CURRENT_STATE} \
--data '{"status": "running"}'
RUN_IDcomes from the generated Workflow Bootstrap section.- Derive
RUN_NAMEfrom the resolved source: use"PR Stack: PR #{number}"for a GitHub PR, otherwise"PR Stack: {source_ref}". - On the first emit only, include
--name "{RUN_NAME}". - On blocking error, emit the current step with
{"status":"failed","reason":"..."}and stop.
Example sequence:
rp1 agent-tools emit --workflow pr-stack --type status_change --run-id {RUN_ID} --name "PR Stack: PR #42" --step planning --data '{"status": "running"}'
rp1 agent-tools emit --workflow pr-stack --type waiting_for_user --run-id {RUN_ID} --step planning --data '{"prompt":"Approve this split plan and allow branch/PR creation?","context":"pr-stack requires explicit approval before creating branches, commits, pushes, or PRs"}'
rp1 agent-tools emit --workflow pr-stack --type status_change --run-id {RUN_ID} --step executing --data '{"status": "running"}'
rp1 agent-tools emit --workflow pr-stack --type status_change --run-id {RUN_ID} --step reporting --data '{"status": "running"}'
rp1 agent-tools emit --workflow pr-stack --type status_change --run-id {RUN_ID} --step reporting --data '{"status": "completed"}'
Governance
- role: maintain split-planner identity; treat the user's protocol as input to harden, not blindly execute.
- scope limits: touch only derived stack branches/PR descriptions; preserve
SOURCEas recovery point; no unrelated edits. - output discipline: emit a plan, approval gate, execution log, final report, and deviations.
- exploration bound: inspect
SOURCEdiff/commits/checks only; stop when split boundaries cannot be proven. - anti-bias: compare cherry-pick vs hunk staging; reject easy splits that fail size, deployability, verification, or narrative.
- Fallibilist overlay: use conjectural wording for interpretations; make claims refutable; prefer hard-to-vary reasons; avoid self-immunizing hedges; preserve error-correction.
- Epistemic stance: Fallibilist Empirical. Separate observations from interpretations; mark confidence for non-trivial split claims.
- Popper patterns: Problem-Situation, Competing Explanations, Falsification, Error-Correction Loop, Hard-to-Vary, Fallibilism Marker.
- Confidence: Speculative, Provisional, Supported, Well-established, Settled. MUST mark boundary choices, risk calls, verification gaps, and reconstruction conclusions.
Procedure
Emit planning running before command execution.
1. Resolve Repo
- Use generated Workflow Bootstrap values. Do not call
resolve-args, do not generate a UUID, and do not re-derive directories. - Verify clean workspace with
git -C {codeRoot} status. - If dirty: report files and ask whether to continue, stash, or stop. Do not modify.
2. Identify SOURCE
- PR: use
gh pr viewandgh pr diff; record URL, number, head branch, base, head SHA. - Local branch: record branch name and SHA.
- Remote branch: run
git -C {codeRoot} fetch, record remote ref and SHA. - Record recovery point:
SOURCEref and exact SHA. Do not push to, rebase, reset, delete, or amendSOURCE.
3. Inventory Diff
- Compare
BASE_BRANCH...SOURCE_SHAwithgit diff,git diff --numstat, andgit log. - Determine generated exclusions from
GENERATED_EXCLUSIONSplus obvious lockfiles/generated outputs only when the plan names each path and why it is generated. - Size = added + deleted lines, excluding only approved generated paths. Unknown paths count.
4. Discover Checks
- If
CHECK_COMMANDprovided, use it. - Else, choose the repo's smallest meaningful validation command.
- If no check is defensible, stop before execution and ask for
CHECK_COMMAND.
5. Produce Split Plan
Before any branch or PR creation, produce a user-facing split plan.
The plan is primarily for a human reviewer/maintainer deciding whether to approve execution. Keep it concise, scannable, and decision-oriented. Do not lead with internal workflow IDs, raw SHAs, merge-state dumps, long file lists, or test log excerpts. Put internal metadata in YAML frontmatter and put detailed evidence in a compact appendix only when it
Установить pr-stack в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(echo *)Bash(rp1 *)Bash(git *)Bash(gh *)Bash(just *)Bash(mkdir *)ReadWriteFAQ
Что делает скилл pr-stack?
Plan and execute splitting a large PR or branch into a reviewable stacked PR sequence.
Как установить скилл pr-stack?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pr-stack запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic