← ClaudeAtlas

pr-monitor-and-manage-stoplisted

Clean-cancel companion to /pr-monitor-and-manage. Stops the PR-fleet Monitor tasks, clears monitoring state in session-state.json, and prints a final summary. Triggers on "/pr-monitor-and-manage-stop", "/pmm-stop", "stop monitoring PRs".
auerbachb/claude-code-config · ★ 5 · Code & Development · score 73
Install: claude install-skill auerbachb/claude-code-config
Clean-cancel companion to `/pr-monitor-and-manage`. Use this to stop the PR-fleet manager without leaving a dangling main/auto-wake Monitor, stale monitoring state, or re-scan behind. A stale pause marker left by a killed session is safely reconciled: the next `/pr-monitor-and-manage` invocation reads it and resumes (or the user runs `/pmm-stop` here to fully tear down), then re-runs discovery from scratch. ## Resolve the state helper Same three-candidate lookup as `/babysit-pr-stop`: ```bash resolve_script() { local name="$1" candidate for candidate in \ "$HOME/.claude/skills-worktree/.claude/scripts/$name" \ "$HOME/.claude/scripts/$name" \ ".claude/scripts/$name"; do if [[ -x "$candidate" ]]; then echo "$candidate"; return 0; fi done return 1 } SESSION_STATE_SH=$(resolve_script session-state.sh) || { echo "ERROR: session-state.sh not found" >&2; exit 1; } ``` ## Step 1: Confirm there is something to stop ```bash ACTIVE=$("$SESSION_STATE_SH" --get '.pmm_active' 2>/dev/null || echo null) PAUSED_AT=$("$SESSION_STATE_SH" --get '.pmm.paused_at' 2>/dev/null || echo null) STOP_PENDING=$("$SESSION_STATE_SH" --get '.pmm.stop_requested' 2>/dev/null || echo false) MAIN_TASK_ID=$("$SESSION_STATE_SH" --get '.pmm_monitor_task_id' 2>/dev/null || echo null) MAIN_GENERATION=$("$SESSION_STATE_SH" --get '.pmm_monitor_generation' 2>/dev/null || echo null) AUTO_WAKE_TASK_ID=$("$SESSION_STATE_SH" --get '.pmm.auto_wake_monitor_task_id' 2>/dev/null || echo null) AUTO_