From agent-workflows
Cancels or pauses active PRD build runs by managing git worktrees, branches, and .claude/ state files. Options: pause, clean cancel, or cancel keeping branches.
npx claudepluginhub sjarmak/agent-workflows[--keep-branches]This skill is limited to using the following tools:
Check for an active run:
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Check for an active run:
if [ -f .claude/prd-build.state.json ]; then
cat .claude/prd-build.state.json
else
echo "NO_STATE_FILE"
fi
If NO_STATE_FILE: tell the user there's no active run to cancel.
Otherwise, present the current status and ask the user which action they want:
Pause — Update .claude/prd-build.state.json status to "paused". State is preserved. Resume later with /prd-build-resume.
Also append a timestamped line to .claude/prd-build.log.md: "Run paused by user".
Cancel (clean) — Remove all worktrees, branches, and state files:
# Remove worktrees
git worktree list --porcelain | grep -oP 'worktree \K.*prd-build.*' | while read wt; do git worktree remove --force "$wt"; done
# Remove branches
git branch --list 'prd-build/*' | xargs -r git branch -D
# Remove state files
rm -rf .claude/prd-build.state.json .claude/prd-build.log.md .claude/prd-build-artifacts/
Cancel (keep branches) — Remove worktrees and state but keep git branches for manual inspection:
# Remove worktrees only
git worktree list --porcelain | grep -oP 'worktree \K.*prd-build.*' | while read wt; do git worktree remove --force "$wt"; done
# Remove state files
rm -rf .claude/prd-build.state.json .claude/prd-build.log.md .claude/prd-build-artifacts/
WAIT for the user to choose before taking any action.