diff --git a/get-shit-done/templates/subagent-task-prompt.md b/get-shit-done/templates/subagent-task-prompt.md index 9b0c2aafc..c09baf796 100644 --- a/get-shit-done/templates/subagent-task-prompt.md +++ b/get-shit-done/templates/subagent-task-prompt.md @@ -1,6 +1,6 @@ # Subagent Task Prompt Template -Template for spawning plan execution subagents from execute-phase orchestrator. +Template for spawning plan execution agents from execute-phase orchestrator. --- @@ -11,6 +11,8 @@ Template for spawning plan execution subagents from execute-phase orchestrator. Execute plan {plan_number} of phase {phase_number}-{phase_name}. Commit each task atomically. Create SUMMARY.md. Update STATE.md. + +**Checkpoint handling:** If you hit a checkpoint task, STOP and return a checkpoint message (see checkpoint_behavior below). The orchestrator will present it to the user and resume you with their response. @@ -26,8 +28,40 @@ Project state: @.planning/STATE.md Config: @.planning/config.json (if exists) + +When you encounter a checkpoint task (type="checkpoint:*"), STOP execution and return this format: + +## CHECKPOINT REACHED + +**Type:** [human-verify | decision | human-action] +**Plan:** {phase}-{plan} +**Progress:** {completed}/{total} tasks complete + +[Checkpoint content from checkpoint_protocol in execute-plan.md] + +**Awaiting:** [Resume signal from the task] + +The orchestrator will present this to the user and resume you with their response. +When resumed, you'll receive: "User response: {their_input}" +Parse and continue appropriately. + + + +When plan completes successfully, return: + +## PLAN COMPLETE + +**Plan:** {phase}-{plan} +**Tasks:** {completed}/{total} +**SUMMARY:** {path to SUMMARY.md} + +**Commits:** +- {hash}: {message} +... + + -- [ ] All tasks executed +- [ ] All tasks executed (or paused at checkpoint) - [ ] Each task committed individually - [ ] SUMMARY.md created in plan directory - [ ] STATE.md updated with position and decisions @@ -58,4 +92,8 @@ Task( ) ``` -Subagent reads @-references, loads full workflow context, executes plan. +Agent reads @-references, loads full workflow context, executes plan. + +When agent returns: +- If contains "## CHECKPOINT REACHED": Parse and present to user, then resume +- If contains "## PLAN COMPLETE": Finalize execution diff --git a/get-shit-done/workflows/execute-plan.md b/get-shit-done/workflows/execute-plan.md index 5bb35305a..5af23cfd7 100644 --- a/get-shit-done/workflows/execute-plan.md +++ b/get-shit-done/workflows/execute-plan.md @@ -1152,6 +1152,49 @@ I'll verify after: [verification] See ~/.claude/get-shit-done/references/checkpoints.md for complete checkpoint guidance. + +**When spawned by an orchestrator (execute-phase or execute-plan command):** + +If you were spawned via Task tool and hit a checkpoint, you cannot directly interact with the user. Instead, RETURN to the orchestrator with checkpoint details so it can present to the user and resume you. + +**Return format for checkpoints:** + +``` +## CHECKPOINT REACHED + +**Type:** [human-verify | decision | human-action] +**Plan:** {phase}-{plan} +**Progress:** {completed}/{total} tasks complete + +[Checkpoint content - same as checkpoint_protocol display above] + +**Awaiting:** [Resume signal from the task] +``` + +The orchestrator will: +1. Parse your return +2. Present the checkpoint to the user +3. Collect user's response +4. Resume you with: `Task(resume=your_agent_id, prompt="User response: {their_input}")` + +**When resumed after checkpoint:** + +You will receive a prompt like: `"User response: approved"` or `"User response: option-a"` + +- Parse the user's response +- If approved/done: continue to next task +- If issues described: address them, then continue or re-present checkpoint +- If option selected: proceed with that choice + +**How to know if you were spawned:** + +If you're reading this workflow because an orchestrator spawned you (vs running directly from /gsd:execute-plan), the orchestrator's prompt will include checkpoint return instructions. Follow those instructions when you hit a checkpoint. + +**If running in main context (not spawned):** + +Use the standard checkpoint_protocol - display checkpoint and wait for direct user response. + + If any task verification fails: