pr-stacklisted
Install: claude install-skill rp1-run/rp1
# 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
```mermaid
stateDiagram-v2
[*] --> planning
planning --> executing : approved
planning --> reporting : plan_only
executing --> reporting : stack_created
reporting --> [*] : done
```
**On each phase transition**, report via:
```bash
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**:
```bash
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 plann