docs: fix brownfield flow, remove deprecated resume-task
- Fix brownfield example to use execute-phase instead of execute-plan - Remove /gsd:resume-task command (relies on broken Task resume) - Checkpoint continuation now uses fresh agents, not resume Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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 |
|
||||
|
||||
@@ -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
|
||||
---
|
||||
|
||||
<objective>
|
||||
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.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/workflows/resume-task.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
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
|
||||
</context>
|
||||
|
||||
<process>
|
||||
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
|
||||
</process>
|
||||
|
||||
<usage>
|
||||
**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".
|
||||
</usage>
|
||||
|
||||
<error_handling>
|
||||
**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
|
||||
</error_handling>
|
||||
|
||||
<success_criteria>
|
||||
- [ ] Agent resumed via Task tool resume parameter
|
||||
- [ ] Agent-history.json updated with completion
|
||||
- [ ] current-agent-id.txt cleared
|
||||
- [ ] User informed of result
|
||||
</success_criteria>
|
||||
@@ -1,259 +0,0 @@
|
||||
<trigger>
|
||||
Use this workflow when:
|
||||
- User runs /gsd:resume-task
|
||||
- Need to continue interrupted subagent execution
|
||||
- Resuming work after session ended mid-plan
|
||||
</trigger>
|
||||
|
||||
<purpose>
|
||||
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.
|
||||
</purpose>
|
||||
|
||||
<process>
|
||||
|
||||
<step name="parse_arguments">
|
||||
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.
|
||||
</step>
|
||||
|
||||
<step name="validate_agent">
|
||||
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.
|
||||
</step>
|
||||
|
||||
<step name="check_conflicts">
|
||||
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.
|
||||
</step>
|
||||
|
||||
<step name="update_status">
|
||||
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.
|
||||
</step>
|
||||
|
||||
<step name="resume_agent">
|
||||
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
|
||||
</step>
|
||||
|
||||
<step name="completion_update">
|
||||
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.
|
||||
```
|
||||
</step>
|
||||
|
||||
<step name="handle_errors">
|
||||
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.
|
||||
</step>
|
||||
|
||||
</process>
|
||||
|
||||
<success_criteria>
|
||||
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
|
||||
</success_criteria>
|
||||
Reference in New Issue
Block a user