Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

pr-stack

БесплатноБез исполняемых скриптовНе проверен

Plan and execute splitting a large PR or branch into a reviewable stacked PR sequence.

rp1-runот 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_ID comes from the generated Workflow Bootstrap section.
  • Derive RUN_NAME from 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 SOURCE as recovery point; no unrelated edits.
  • output discipline: emit a plan, approval gate, execution log, final report, and deviations.
  • exploration bound: inspect SOURCE diff/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

  1. Use generated Workflow Bootstrap values. Do not call resolve-args, do not generate a UUID, and do not re-derive directories.
  2. Verify clean workspace with git -C {codeRoot} status.
  3. If dirty: report files and ask whether to continue, stash, or stop. Do not modify.

2. Identify SOURCE

  • PR: use gh pr view and gh 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: SOURCE ref and exact SHA. Do not push to, rebase, reset, delete, or amend SOURCE.

3. Inventory Diff

  • Compare BASE_BRANCH...SOURCE_SHA with git diff, git diff --numstat, and git log.
  • Determine generated exclusions from GENERATED_EXCLUSIONS plus 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_COMMAND provided, 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

Полный SKILL.md на GitHub

Установить pr-stack в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash(echo *)
Bash(rp1 *)
Bash(git *)
Bash(gh *)
Bash(just *)
Bash(mkdir *)
Read
Write

FAQ

Что делает скилл 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), без исполняемых скриптов.

Похожие скиллы

Сравнить pr-stack с