fix(checkpoints): restore rich documentation and fix continuation pattern

- execute-plan.md: Replace broken Task(resume=...) with fresh continuation agent
- execute-phase.md: Expand checkpoint handling with full continuation flow
- checkpoints.md: Restore ~500 lines of detailed examples and anti-patterns

Checkpoint presentation formats now documented for all three types.
Templates referenced: checkpoint-return.md, continuation-prompt.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-01-14 16:26:08 -06:00
parent ac31b89526
commit e98bebfeeb
3 changed files with 712 additions and 98 deletions

View File

@@ -160,9 +160,23 @@ All three run in parallel. Task tool blocks until all complete.
<checkpoint_handling>
Plans with `autonomous: false` in frontmatter have checkpoints:
- Run in their assigned wave (can be parallel with other plans)
- Pause at checkpoint, return to orchestrator
- Orchestrator presents checkpoint to user
- User responds, orchestrator resumes agent
- Pause at checkpoint, return structured state to orchestrator
- Orchestrator presents checkpoint to user (see execute-plan.md for presentation formats)
- User responds, orchestrator spawns fresh continuation agent
**Checkpoint flow:**
1. Subagent returns `## CHECKPOINT REACHED` with Completed Tasks table
2. Orchestrator parses return and presents rich formatted checkpoint
3. User responds (approved/done/option selection)
4. Orchestrator fills continuation-prompt.md template with state
5. Spawns fresh agent: `Task(prompt=filled_continuation_template, subagent_type="general-purpose")`
**Why fresh agent, not resume:**
Task tool resume fails after multiple tool calls. Fresh agent with state handoff is the correct pattern.
**Templates:**
- `@~/.claude/get-shit-done/templates/checkpoint-return.md` - Subagent return format
- `@~/.claude/get-shit-done/templates/continuation-prompt.md` - Fresh agent spawn template
</checkpoint_handling>
<deviation_rules>

View File

@@ -201,13 +201,88 @@ When subagent returns with checkpoint:
**Plan:** {phase}-{plan}
**Progress:** {completed}/{total} tasks complete
[Checkpoint content]
### Completed Tasks
| Task | Name | Commit | Files |
|------|------|--------|-------|
| 1 | [task name] | [hash] | [files] |
**Awaiting:** [Resume signal]
### Current Task
**Task {N}:** [name]
**Status:** [blocked | awaiting verification | awaiting decision]
**Blocked by:** [specific blocker]
### Checkpoint Details
[Type-specific content for user]
### Awaiting
[What user needs to provide]
```
**2. Present to user:**
Display the checkpoint content exactly as returned by subagent.
**2. Present checkpoint to user:**
Display rich formatted checkpoint based on type:
**For human-verify:**
```
════════════════════════════════════════
CHECKPOINT: Verification Required
════════════════════════════════════════
Task {X} of {Y}: {task name}
I built: {what-built from checkpoint details}
How to verify:
{numbered verification steps}
Type "approved" to continue, or describe issues.
════════════════════════════════════════
```
**For human-action (auth gate):**
```
════════════════════════════════════════
CHECKPOINT: Authentication Required
════════════════════════════════════════
Task {X} of {Y}: {task name}
I tried: {automation attempted}
Error: {error encountered}
What you need to do:
{numbered instructions}
I'll verify after: {verification}
Type "done" when complete.
════════════════════════════════════════
```
**For decision:**
```
════════════════════════════════════════
CHECKPOINT: Decision Required
════════════════════════════════════════
Task {X} of {Y}: {task name}
Decision: {what's being decided}
Context: {why this matters}
Options:
1. {option-a}: {name}
Pros: {benefits}
Cons: {tradeoffs}
2. {option-b}: {name}
Pros: {benefits}
Cons: {tradeoffs}
Select: {option-a | option-b | ...}
════════════════════════════════════════
```
**3. Collect response:**
Wait for user input:
@@ -215,15 +290,34 @@ Wait for user input:
- decision: option selection
- human-action: "done" when complete
**4. Resume subagent:**
**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)
```
Task(resume="{agent_id}", prompt="User response: {user_input}")
Task(prompt=filled_continuation_template, subagent_type="general-purpose")
```
**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.
**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