Skip to content

Commit 6e7a1a0

Browse files
cahaselerclaude
andauthored
fix: enforce mandatory specialized subagent types in orchestration (#188)
Add explicit requirement at the top of orchestration instructions in both commands/tasks.md and templates/tasks-template.md that every Task tool call MUST use the correct subagent_type (stub-writer, test-generation, implementer, validator). Claude was falling back to general-purpose agents which lack the tailored system prompts and tool constraints. Co-authored-by: Craig Haseler <cahaseler@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0b467fa commit 6e7a1a0

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

commands/tasks.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,14 @@ Phase 4 ──┘
191191
192192
## Orchestration Instructions
193193
194+
**MANDATORY: Use specialized subagent types.** Every Task tool call during orchestration MUST use the correct `subagent_type` parameter:
195+
- **Stub** steps → `subagent_type: stub-writer`
196+
- **Tests** steps → `subagent_type: test-generation`
197+
- **Implement** steps → `subagent_type: implementer`
198+
- **Validate** steps → `subagent_type: validator`
199+
200+
Do NOT use `subagent_type: general-purpose` or omit `subagent_type`. The specialized agents have tailored system prompts, tool access, and behavioral constraints that general-purpose agents lack.
201+
194202
When the user approves this task breakdown and says to begin implementation:
195203
196204
### Real-Time Task Coordination (Native Task System)

templates/tasks-template.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ Document which phases can run in parallel and which have dependencies.
124124

125125
## Orchestration Instructions
126126

127+
**MANDATORY: Use specialized subagent types.** Every Task tool call during orchestration MUST use the correct `subagent_type` parameter:
128+
- **Stub** steps → `subagent_type=stub-writer`
129+
- **Tests** steps → `subagent_type=test-generation`
130+
- **Implement** steps → `subagent_type=implementer`
131+
- **Validate** steps → `subagent_type=validator`
132+
133+
Do NOT use `subagent_type=general-purpose` or omit `subagent_type`. The specialized agents have tailored system prompts, tool access, and behavioral constraints that general-purpose agents lack.
134+
127135
### Setup: Create Native Tasks
128136

129137
Before starting implementation, create native tasks for all steps with dependencies:
@@ -176,7 +184,7 @@ When multiple phases are marked [P], use **pipeline flow** with native task coor
176184

177185
1. **Create all native tasks upfront** with `blockedBy` dependencies (see Setup above)
178186
2. **Use `TaskList`** to see all unblocked tasks ready to dispatch
179-
3. **Dispatch** all unblocked stub writers in a single message
187+
3. **Dispatch** all unblocked tasks in a single message using the correct `subagent_type` for each (see table above)
180188
4. **Post status** to user: "Dispatched stub writers for Phases X, Y, Z. Waiting for task completion."
181189
5. **STOP and wait** - Do NOT call TaskOutput or poll agents. When a subagent completes, the system will wake you automatically with its results. At that point:
182190
- `TaskUpdate` the completed step's status to completed

0 commit comments

Comments
 (0)