fix: add explicit wait-for-subagent instructions in orchestration workflows (#2755)

Adds ORCHESTRATOR RULE blockquotes immediately after every Task() spawn
in 26 GSD workflow files, instructing the parent orchestrator to stop
working on the task while the subagent is active. This prevents the
parallel-work anti-pattern on Codex runtime where the parent continues
reading files and producing duplicate/conflicting output after spawning.

Rules are placed inline at each spawn point (not as generic headers)
so they are adjacent to and unambiguously associated with each Task()
call. Background Task() spawns get a variant noting not to return to
the spawning context until the subagent reports back.

Closes #2729

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-26 13:33:35 -04:00
committed by GitHub
parent 7255539ff9
commit 8f2ec0e8f7
26 changed files with 106 additions and 0 deletions

View File

@@ -916,6 +916,8 @@ Use template: ~/.claude/get-shit-done/templates/research-project/PITFALLS.md
", subagent_type="gsd-project-researcher", model="{researcher_model}", description="Pitfalls research")
```
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling all 4 researcher Task() calls above, do NOT read research files or synthesize content independently while the subagents are active. Wait for all 4 researchers to complete before spawning the synthesizer. This prevents duplicate work and wasted context.
After all 4 agents complete, spawn synthesizer to create SUMMARY.md:
```
@@ -941,6 +943,8 @@ Commit after writing.
", subagent_type="gsd-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
```
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available.
Display research complete banner and key findings:
```
@@ -1156,6 +1160,8 @@ Write files first, then return. This ensures artifacts persist even if context i
", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Create roadmap")
```
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available.
**Handle roadmapper return:**
**If `## ROADMAP BLOCKED`:**
@@ -1242,6 +1248,8 @@ Use AskUserQuestion:
", subagent_type="gsd-roadmapper", model="{roadmapper_model}", description="Revise roadmap")
```
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Task() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available.
- Present revised roadmap
- Loop until user approves