diff --git a/README.md b/README.md index 07776c329..f188db1ff 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ Same as greenfield, but the system knows your codebase. Questions focus on what ### 3. Continue as normal -From here, it's the same: `/gsd:create-roadmap` → `/gsd:plan-phase` → `/gsd:execute-plan` +From here, it's the same: `/gsd:create-roadmap` → `/gsd:plan-phase` → `/gsd:execute-phase` The codebase docs load automatically during planning. Claude knows your patterns, conventions, and where to put things. @@ -340,7 +340,6 @@ You're never locked in. The system adapts. | `/gsd:list-phase-assumptions [N]` | See what Claude thinks before you correct it | | `/gsd:pause-work` | Create handoff file when stopping mid-phase | | `/gsd:resume-work` | Restore from last session | -| `/gsd:resume-task [id]` | Resume interrupted subagent execution | | `/gsd:consider-issues` | Review deferred issues, close resolved, identify urgent | | `/gsd:add-todo [desc]` | Capture idea or task from conversation for later | | `/gsd:check-todos [area]` | List pending todos, select one to work on | diff --git a/commands/gsd/resume-task.md b/commands/gsd/resume-task.md deleted file mode 100644 index 93ae88bda..000000000 --- a/commands/gsd/resume-task.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -name: gsd:resume-task -description: Resume an interrupted subagent execution -argument-hint: "[agent-id]" -allowed-tools: - - Read - - Write - - Edit - - Bash - - Task - - AskUserQuestion ---- - - -Resume an interrupted subagent execution using the Task tool's resume parameter. - -When a session ends mid-execution, subagents may be left in an incomplete state. This command allows users to continue that work without starting over. - -Uses the agent ID tracking infrastructure from execute-plan to identify and resume agents. - - - -@~/.claude/get-shit-done/workflows/resume-task.md - - - -Agent ID: $ARGUMENTS (optional - defaults to most recent) - -**Load project state:** -@.planning/STATE.md - -**Load agent tracking:** -@.planning/current-agent-id.txt -@.planning/agent-history.json - - - -1. Check .planning/ directory exists (error if not) -2. Parse agent ID from arguments or current-agent-id.txt -3. Validate agent exists in history and is resumable -4. Check for file conflicts since spawn -5. Follow resume-task.md workflow: - - Update agent status to "interrupted" - - Resume via Task tool resume parameter - - Update history on completion - - Clear current-agent-id.txt - - - -**Resume most recent interrupted agent:** -``` -/gsd:resume-task -``` - -**Resume specific agent by ID:** -``` -/gsd:resume-task agent_01HXYZ123 -``` - -**Find available agents to resume:** -Check `.planning/agent-history.json` for entries with status "spawned" or "interrupted". - - - -**No agent to resume:** -- current-agent-id.txt empty or missing -- Solution: Run /gsd:progress to check project status - -**Agent already completed:** -- Agent finished successfully, nothing to resume -- Solution: Continue with next plan - -**Agent not found:** -- Provided ID not in history -- Solution: Check agent-history.json for valid IDs - -**Resume failed:** -- Agent context expired or invalidated -- Solution: Start fresh with /gsd:execute-plan - - - -- [ ] Agent resumed via Task tool resume parameter -- [ ] Agent-history.json updated with completion -- [ ] current-agent-id.txt cleared -- [ ] User informed of result - diff --git a/get-shit-done/workflows/resume-task.md b/get-shit-done/workflows/resume-task.md deleted file mode 100644 index 96279fd9f..000000000 --- a/get-shit-done/workflows/resume-task.md +++ /dev/null @@ -1,259 +0,0 @@ - -Use this workflow when: -- User runs /gsd:resume-task -- Need to continue interrupted subagent execution -- Resuming work after session ended mid-plan - - - -Resume an interrupted subagent execution using the Task tool's resume parameter. - -Enables seamless continuation of autonomous work that was interrupted by session timeout, user exit, or crash. - - - - - -Parse the optional agent_id argument: - -```bash -# Check if argument provided -if [ -n "$ARGUMENTS" ]; then - AGENT_ID="$ARGUMENTS" - echo "Using provided agent ID: $AGENT_ID" -else - # Read from current-agent-id.txt - if [ -f .planning/current-agent-id.txt ] && [ -s .planning/current-agent-id.txt ]; then - AGENT_ID=$(cat .planning/current-agent-id.txt | tr -d '\n') - echo "Using current agent ID: $AGENT_ID" - else - echo "ERROR: No agent to resume" - exit 1 - fi -fi -``` - -**If no agent ID found:** -Present error: -``` -No active agent to resume. - -There's no interrupted agent recorded. This could mean: -- No subagent was spawned in the current plan -- The last agent completed successfully -- .planning/current-agent-id.txt was cleared - -Use /gsd:progress to check project status. -``` - -**If agent ID found:** Continue to validate_agent step. - - - -Validate the agent exists and is resumable: - -```bash -# Check if agent-history.json exists -if [ ! -f .planning/agent-history.json ]; then - echo "ERROR: No agent history found" - exit 1 -fi - -# Read history and find the agent -cat .planning/agent-history.json -``` - -**Parse agent-history.json and find entry matching AGENT_ID:** - -Check the entry status: -- **If status = "completed":** Error - agent already completed -- **If status = "spawned" or "interrupted":** Valid for resume -- **If not found:** Error - agent ID not in history - -**If agent already completed:** -``` -Agent already completed. - -Agent ID: [id] -Completed: [completion_timestamp] -Task: [task_description] - -This agent finished successfully. No resume needed. -``` - -**If agent not found:** -``` -Agent ID not found in history. - -ID: [provided_id] - -Available agents: -- [list most recent 5 agents with status] - -Did you mean one of these? -``` - -**If valid for resume:** Continue to check_conflicts step. - - - -Check for file modifications since the agent was spawned. - -**Read the agent entry to get context:** -- phase, plan, segment information -- timestamp of spawn - -**Check for git changes since spawn:** - -```bash -# Get files modified since agent spawn -# Note: This is a best-effort check - relies on git status -git status --short -``` - -**If modifications detected:** - -Use AskUserQuestion to warn user: - -``` -Files modified since agent was interrupted: -- [list files] - -These changes may conflict with the agent's work. - -Options: -1. Continue anyway - Agent will resume with current files -2. Abort - Review changes first - -Select option: -``` - -Wait for user response. - -**If user selects "Abort":** -``` -Resume aborted. Review your changes and run /gsd:resume-task when ready. -``` -End workflow. - -**If user selects "Continue anyway" or no conflicts found:** -Continue to update_status step. - - - -Update the agent status to "interrupted" if it was "spawned" (marking the interruption point): - -```bash -# Read current history -HISTORY=$(cat .planning/agent-history.json) -``` - -Update the entry in agent-history.json: -- If status was "spawned", change to "interrupted" -- Add note about resume attempt - -This provides audit trail of the interruption before resume. - - - -Resume the agent using Task tool's resume parameter: - -``` -Resuming agent: [agent_id] -Task: [task_description from history] -Phase: [phase]-[plan] - -The agent will continue from where it left off... -``` - -**Use Task tool with resume parameter:** - -``` -Task( - description: "Resume interrupted agent", - prompt: "Continue your previous work. You were executing [task_description].", - subagent_type: "general-purpose", - resume: "[AGENT_ID]" -) -``` - -Wait for agent completion. - -**On agent completion:** -- Capture any results returned -- Continue to completion_update step - - - -Update tracking files on successful completion: - -**1. Update agent-history.json:** - -Add new entry marking the resume completion: -```json -{ - "agent_id": "[AGENT_ID]", - "task_description": "[original task] (resumed)", - "phase": "[phase]", - "plan": "[plan]", - "segment": [segment or null], - "timestamp": "[now]", - "status": "completed", - "completion_timestamp": "[now]" -} -``` - -**2. Clear current-agent-id.txt:** - -```bash -# Clear the current agent file -> .planning/current-agent-id.txt -``` - -**3. Present completion message:** - -``` -Agent resumed and completed successfully. - -Agent ID: [id] -Task: [task_description] -Original spawn: [original_timestamp] -Completed: [now] - -The agent's work has been incorporated. Check git status for changes. -``` - - - -Error handling for resume failures: - -**If Task tool returns error on resume:** -``` -Failed to resume agent. - -Agent ID: [id] -Error: [error message] - -Possible causes: -- Agent context may have expired -- Agent may have been invalidated - -Options: -1. Start fresh - Execute plan from beginning -2. Check status - Review what was completed - -Run /gsd:execute-plan to start fresh if needed. -``` - -Do NOT clear current-agent-id.txt on error - allow retry. - - - - - -Resume is complete when: -- [ ] Agent resumed successfully via Task tool resume parameter -- [ ] Agent-history.json updated with completion status -- [ ] Current-agent-id.txt cleared -- [ ] User informed of completion -