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:
Lex Christopherson
2026-01-15 09:34:32 -06:00
parent b2646c894c
commit e95186b2a7
3 changed files with 274 additions and 79 deletions

View File

@@ -26,6 +26,8 @@ Context budget: ~15% orchestrator, 100% fresh per subagent.
@~/.claude/get-shit-done/references/principles.md
@~/.claude/get-shit-done/workflows/execute-phase.md
@~/.claude/get-shit-done/templates/subagent-task-prompt.md
@~/.claude/get-shit-done/templates/subagent-verify-prompt.md
@~/.claude/get-shit-done/workflows/verify-phase.md
</execution_context>
<context>
@@ -62,9 +64,18 @@ Phase: $ARGUMENTS
5. **Aggregate results**
- Collect summaries from all plans
- Report phase completion status
6. **Verify phase goal**
- Spawn verification subagent (uses subagent-verify-prompt.md)
- Verify must_haves from plan frontmatter against actual codebase
- If gaps found: create fix plans, execute, re-verify (max 3 cycles)
- If human verification needed: present items to user
- Block until verification passes or user approves
7. **Update roadmap and state**
- Update ROADMAP.md, STATE.md
6. **Update requirements**
8. **Update requirements**
Mark phase requirements as Complete:
- Read ROADMAP.md, find this phase's `Requirements:` line (e.g., "AUTH-01, AUTH-02")
- Read REQUIREMENTS.md traceability table
@@ -72,14 +83,14 @@ Phase: $ARGUMENTS
- Write updated REQUIREMENTS.md
- Skip if: REQUIREMENTS.md doesn't exist, or phase has no Requirements line
7. **Commit phase completion**
9. **Commit phase completion**
Bundle all phase metadata updates in one commit:
- Stage: `git add .planning/ROADMAP.md .planning/STATE.md`
- Stage REQUIREMENTS.md if updated: `git add .planning/REQUIREMENTS.md`
- Commit: `docs({phase}): complete {phase-name} phase`
8. **Offer next steps**
- Route to next action (see `<offer_next>`)
10. **Offer next steps**
- Route to next action (see `<offer_next>`)
</process>
<offer_next>
@@ -226,6 +237,8 @@ After all plans in phase complete (step 7):
<success_criteria>
- [ ] All incomplete plans in phase executed
- [ ] Each plan has SUMMARY.md
- [ ] Phase goal verified (must_haves checked against codebase)
- [ ] VERIFICATION.md created in phase directory
- [ ] STATE.md reflects phase completion
- [ ] ROADMAP.md updated
- [ ] REQUIREMENTS.md updated (phase requirements marked Complete)

View File

@@ -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