Skip to content

reactive-execute prompt

The reactive-execute prompt drives parallel task execution within a slice. When the task dependency graph shows multiple tasks with no mutual dependencies, this prompt dispatches them simultaneously as subagents instead of running them sequentially.

Reactive execution is triggered during auto-mode when the dispatch engine detects two or more tasks in a slice that are ready for execution at the same time (their input dependencies are already satisfied). You don’t invoke it directly.

  1. Analyses the task dependency graph to identify which tasks can run in parallel
  2. Dispatches all ready tasks simultaneously using the subagent tool in parallel mode — each subagent gets a full execute-task prompt
  3. Waits for all subagents to complete
  4. Verifies outputs — checks that expected files were created, verification commands pass, and each task wrote its own T##-SUMMARY.md
  5. Preserves successful work — if one task fails, successful sibling tasks are kept as-is

The prompt follows strict rules when a parallel task fails:

  • Successful tasks are never rolled back — good work from sibling tasks is preserved exactly as it landed
  • Failed tasks without summaries get a failure summary written by the parent agent via gsd_save_summary with blocker_discovered: true
  • Failed tasks are not marked complete — they remain uncompleted so replan/retry can pick them up
  • No batch commits — the surrounding unit lifecycle owns commits, not this prompt
VariableDescription
workingDirectoryAbsolute path to the working directory
milestoneId / milestoneTitleActive milestone context
sliceId / sliceTitleSlice being executed
graphContextTask dependency graph showing relationships
readyTaskCountNumber of tasks ready for parallel dispatch
readyTaskListFormatted list of ready tasks with descriptions
subagentPromptsFull execute-task prompts for each subagent
inlinedTemplatesAny additional template content needed by subagents
  • execute-task — the prompt each parallel subagent receives
  • plan-slice — produces the task graph that determines parallelism
  • replan-slice — triggered when a parallel task discovers a blocker