refactor: update execute commands to spawn gsd-executor subagent
- execute-plan.md: spawn gsd-executor instead of general-purpose with template - execute-phase.md: spawn gsd-executor for wave-based parallel execution - Remove template filling, subagent has all logic baked in Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -13,16 +13,15 @@ allowed-tools:
|
||||
---
|
||||
|
||||
<objective>
|
||||
Execute a single PLAN.md file by spawning a subagent.
|
||||
Execute a single PLAN.md file by spawning the `gsd-executor` subagent.
|
||||
|
||||
Orchestrator stays lean: validate plan, spawn subagent, handle checkpoints, report completion. Subagent loads full execute-plan workflow and handles all execution details.
|
||||
Orchestrator stays lean: validate plan, spawn subagent, handle checkpoints, report completion. The `gsd-executor` has all execution logic baked in.
|
||||
|
||||
Context budget: ~15% orchestrator, 100% fresh for subagent.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@~/.claude/get-shit-done/references/principles.md
|
||||
@~/.claude/get-shit-done/templates/subagent-task-prompt.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@@ -78,9 +77,26 @@ Plan path: $ARGUMENTS
|
||||
⚡ Executing {phase_number}-{plan_number}: {objective one-liner}
|
||||
```
|
||||
|
||||
5. **Fill and spawn subagent**
|
||||
- Fill subagent-task-prompt template with extracted values
|
||||
- Spawn: `Task(prompt=filled_template, subagent_type="general-purpose")`
|
||||
5. **Spawn gsd-executor subagent**
|
||||
|
||||
```
|
||||
Task(
|
||||
prompt="Execute plan at {plan_path}
|
||||
|
||||
Plan: @{plan_path}
|
||||
Project state: @.planning/STATE.md
|
||||
Config: @.planning/config.json (if exists)",
|
||||
subagent_type="gsd-executor",
|
||||
description="Execute {phase}-{plan}"
|
||||
)
|
||||
```
|
||||
|
||||
The `gsd-executor` subagent has all execution logic baked in:
|
||||
- Deviation rules (auto-fix bugs, critical gaps, blockers; ask for architectural)
|
||||
- Checkpoint protocols (human-verify, decision, human-action)
|
||||
- Commit formatting (per-task atomic commits)
|
||||
- Summary creation
|
||||
- State updates
|
||||
|
||||
6. **Handle subagent return**
|
||||
- If contains "## CHECKPOINT REACHED": Execute checkpoint_handling
|
||||
@@ -205,9 +221,11 @@ All {N} phases finished.
|
||||
</offer_next>
|
||||
|
||||
<checkpoint_handling>
|
||||
When subagent returns with checkpoint:
|
||||
When `gsd-executor` returns with checkpoint:
|
||||
|
||||
**1. Parse return:**
|
||||
|
||||
The subagent returns a structured checkpoint:
|
||||
```
|
||||
## CHECKPOINT REACHED
|
||||
|
||||
@@ -306,32 +324,38 @@ Wait for user input:
|
||||
|
||||
**4. Spawn fresh continuation agent:**
|
||||
|
||||
Fill continuation-prompt template with:
|
||||
- completed_tasks_table: From checkpoint return
|
||||
- resume_task_number: Current task number
|
||||
- resume_task_name: Current task name
|
||||
- resume_status: Derived from checkpoint type and user response
|
||||
- user_response: What user provided
|
||||
- resume_instructions: Type-specific guidance (see template)
|
||||
Spawn fresh `gsd-executor` with continuation context:
|
||||
|
||||
```
|
||||
Task(prompt=filled_continuation_template, subagent_type="general-purpose")
|
||||
Task(
|
||||
prompt="Continue executing plan at {plan_path}
|
||||
|
||||
<completed_tasks>
|
||||
{completed_tasks_table from checkpoint return}
|
||||
</completed_tasks>
|
||||
|
||||
<resume_point>
|
||||
Resume from: Task {N} - {task_name}
|
||||
User response: {user_response}
|
||||
{resume_instructions based on checkpoint type}
|
||||
</resume_point>
|
||||
|
||||
Plan: @{plan_path}
|
||||
Project state: @.planning/STATE.md",
|
||||
subagent_type="gsd-executor",
|
||||
description="Continue {phase}-{plan}"
|
||||
)
|
||||
```
|
||||
|
||||
The `gsd-executor` has continuation handling baked in — it will verify previous commits and resume correctly.
|
||||
|
||||
**Why fresh agent, not resume:**
|
||||
Task tool resume fails after multiple tool calls (presenting to user, waiting for response). Fresh agent with state handoff via continuation-prompt.md is the correct pattern.
|
||||
Task tool resume fails after multiple tool calls (presenting to user, waiting for response). Fresh agent with state handoff is the correct pattern.
|
||||
|
||||
**5. Repeat:**
|
||||
Continue handling returns until "## PLAN COMPLETE" or user stops.
|
||||
</checkpoint_handling>
|
||||
|
||||
<checkpoint_templates>
|
||||
Templates for checkpoint handling:
|
||||
|
||||
- `@~/.claude/get-shit-done/templates/checkpoint-return.md` - Subagent return format
|
||||
- `@~/.claude/get-shit-done/templates/continuation-prompt.md` - Fresh agent spawn template
|
||||
</checkpoint_templates>
|
||||
|
||||
<success_criteria>
|
||||
- [ ] Plan executed (SUMMARY.md created)
|
||||
- [ ] All checkpoints handled
|
||||
|
||||
Reference in New Issue
Block a user