Agentflow sdlc-stop
Gracefully shut down the AgentFlow pipeline. In plugin mode, also cleans up agent teams and uses SendMessage for faster shutdown signaling.
git clone https://github.com/UrRhb/agentflow
T=$(mktemp -d) && git clone --depth=1 https://github.com/UrRhb/agentflow "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugin/skills/sdlc-stop" ~/.claude/skills/urrhb-agentflow-sdlc-stop && rm -rf "$T"
plugin/skills/sdlc-stop/SKILL.md/sdlc-stop
Gracefully shut down the AgentFlow pipeline.
Plugin Mode Additions
In plugin mode, also:
- Call TeamDelete("sprint-team") to clean up the agent team
- Workers receive shutdown signal via SendMessage (faster than Asana read)
- No need to instruct user about crontab — plugin handles scheduling
Process
Step 1: Signal pausing
Find the pinned Status task across all
[SDLC] projects.
Post comment:
[SYSTEM:PAUSING] Graceful shutdown initiated. Active workers will finish their current stage. No new tasks will be dispatched.
Step 2: Drain active work
Check all tasks in Research/Build/Review/Test/Integrate stages:
For tasks with
and recent heartbeat (< 10 min):[BUILD:STARTED]
- Leave them alone — the worker is still active
- Report: "Waiting for <task_code> to finish <stage> (worker <slot>)"
For tasks in Research or Build WITHOUT
(not started yet):[BUILD:STARTED]
- Move back to "1 - Backlog"
- Clear slot:
→[SLOT:T<N>][SLOT:--] - Reset stage:
→[STAGE:X][STAGE:Backlog] - Clean up git worktree if it exists:
git worktree remove feat/<task-code>-<slug> --force
For tasks in Review/Test that are waiting (no worker actively processing):
- Move back to "1 - Backlog"
- Clear slot
- Reset stage
- Clean up git worktree if it exists:
git worktree remove feat/<task-code>-<slug> --force
Step 3: Wait for active workers
Report which tasks are still being worked on.
Tell the user: "Active workers are finishing. The system will be fully paused when all active work completes. You can check your Kanban board for current status."
Step 4: Post paused status
Update the Status task:
[SYSTEM:PAUSED] Graceful shutdown complete — <timestamp> Tasks returned to Backlog: <N> Tasks still completing: <N> (if any workers were mid-build) To resume: run /sdlc-orchestrate
Step 5: Disable crontab (instruct user)
Tell the user:
To fully stop the orchestrator, comment out or remove the crontab entry: crontab -e # Comment out: */15 * * * * /usr/local/bin/claude -p "Run /sdlc-orchestrate" ... To resume later, uncomment it and run /sdlc-orchestrate once to kick things off.
Notes
- This does NOT kill running Claude Code sessions — it only signals via the Kanban board
- Workers will see the
status on their next board read and should stop picking up new work[SYSTEM:PAUSING] - If a worker finishes mid-shutdown, its task will remain in the completed stage (Review-Complete, Test, etc.) and the orchestrator will process it on resume
is idempotent — running it twice is harmless/sdlc-stop