add-phase
Add phase to end of current milestone in roadmap
Recover from interrupted or failed execution
How it fires
How this command gets triggered: by you, by Claude, or both.
/recoverContext preview
What this command does when you run it.
Recover from interrupted or failed execution
description: Recover from interrupted or failed execution allowed-tools: - Read - Bash - Write - AskUserQuestion - Task
<objective> Intelligent recovery from interrupted, failed, or stuck GSD executions.
Detects the problem state and offers appropriate recovery options:
</objective>
<process>
<step name="diagnose">
Run comprehensive state check:
# Check for incomplete plans (PLAN without SUMMARY)
find .planning/phases -name "*-PLAN.md" | while read plan; do
summary="${plan/-PLAN.md/-SUMMARY.md}"
[ ! -f "$summary" ] && echo "INCOMPLETE: $plan"
done# Check for interrupted agents cat .planning/current-agent-id.txt 2>/dev/null cat .planning/agent-history.json 2>/dev/null | grep '"status": "spawned"'
# Check for handoff files find .planning/phases -name ".continue-here.md"
# Check git state git status --porcelain git stash list
**Categorize the state:**
| Finding | State | Recovery Action | |---------|-------|-----------------| | PLAN exists, no SUMMARY, no agent | Plan not started | Offer to execute | | PLAN exists, agent spawned | Agent interrupted | Offer to resume agent | | .continue-here.md exists | Mid-task pause | Offer to resume from handoff | | Uncommitted changes + incomplete | Partial execution | Offer to commit/stash/discard | | SUMMARY exists but incomplete | Failed summary | Regenerate summary | | Everything looks complete | No problem detected | Show /gsd:progress | </step>
<step name="present_diagnosis">
๐ Recovery Diagnosis State: [Interrupted Agent / Incomplete Plan / Mid-Task Pause / etc.] Details: โข Phase: 03-authentication โข Plan: 03-02-PLAN.md โข Last known progress: Task 2 of 4 complete โข Interrupted agent: agent_01HXYZ123 โข Handoff file: .planning/phases/03-auth/.continue-here.md Recovery options available:
</step>
<step name="offer_recovery">
Based on diagnosis, use AskUserQuestion:
**For Interrupted Agent:**
**For Mid-Task Pause (.continue-here.md):**
**For Uncommitted Changes:**
**For Incomplete Plan (no agent, no handoff):**
</step>
<step name="execute_recovery">
**Resume Agent:**
1. Read agent ID from current-agent-id.txt or agent-history.json
2. Use Task tool with resume parameter:
- resume: {agent_id}
- prompt: "Continue execution from where you left off"
3. Monitor completion
4. Update agent-history.json
5. Continue normal flow**Resume from Handoff:**
1. Read .continue-here.md for context: - Current task number - Completed work - Remaining work - Mental context 2. Present summary to user 3. Continue execution from that task 4. Delete .continue-here.md after resumption
**Restart Plan:**
1. Delete any partial artifacts: - SUMMARY.md (if exists and incomplete) - .continue-here.md - Clear current-agent-id.txt 2. Reset git if needed: - If partial commits: offer rollback to pre-plan - If no commits: just restart 3. Execute /gsd:execute-plan fresh
**Rollback:**
1. Find pre-execution checkpoint:
- git tag | grep "gsd-checkpoint-{phase}-{plan}-pre"
2. Execute /gsd:rollback {phase}-{plan}
3. Return to clean state**Commit Partial Work:**
1. Stage all changes: git add -A
2. Create WIP commit:
```bash
git commit -m "wip({phase}-{plan}): partial execution - interrupted"3. Update STATE.md with partial progress note 4. Offer to continue or pause
</step> <step name="verify_recovery"> ## Verify Recovery Success After recovery action: ```bash # Verify clean state git status # Should be clean or have only expected changes
# Verify no lingering artifacts ls .planning/current-agent-id.txt 2>/dev/null # Should not exist find .planning/phases -name ".continue-here.md" # Should be empty
# Verify STATE.md is accurate cat .planning/STATE.md | grep "Current Position"
Report to user:
โ Recovery complete Current state: Phase: 03-authentication Plan: Ready to execute 03-02 Git: Clean Recovered from: [Interrupted agent / Mid-task pause / etc.] Action taken: [Resume / Restart / Rollback / etc.] Next: /gsd:execute-plan or /gsd:progress
</step>
</process>
<edge_cases>
**Multiple Problems Detected:** Address in priority order: 1. Uncommitted changes (git state) 2. Interrupted agents (might still be running) 3. Handoff files (user-initiated pause) 4. Incomplete plans (system state)
**Agent Can't Be Resumed:**
GSD Pro โ The most powerful AI coding workflow for Claude Code. Free alternative to Cursor Composer, Copilot Workspace, Devin & Bolt. Multi-model routing, rollback/recovery, adaptive context. Fork of 30Kโ original. npx get-shit-done-cc
Repo: itsjwill/gsd-pro
Add phase to end of current milestone in roadmap
Generate tests for a completed phase based on UAT criteria and implementation
Capture idea or task as todo from current conversation context
Audit milestone completion against original intent before archiving
Run all remaining phases autonomously โ discussโplanโexecute per phase
List pending todos and select one to work on