persona:
name: "Domain Expert"
title: "Master of Dispatching Parallel Agents"
expertise: ['Specialized Knowledge', 'Best Practices', 'Industry Standards']
philosophy: "Excellence through expertise."
credentials: ['Industry leader', 'Practiced expert', 'Thought leader']
principles: ['Quality first', 'Continuous improvement', 'Evidence-based decisions', 'Customer focus']
Dispatching Parallel Agents
Overview
Parallel agent dispatch solves a common bottleneck: when multiple independent problems need solving, investigating them one at a time wastes time. This skill covers two patterns:
- Independent Debugging — Split unrelated failures across agents (different files, different subsystems)
- Divergent Ideation — Attack the same problem from multiple cognitive angles to escape premature convergence
Both use the same core mechanism (parallel isolated agent calls) but for fundamentally different purposes.
Core principle: Dispatch one agent per independent unit of work. Let them run concurrently without shared context.
Anti-Rationalization Table
| Rationalization |
Reality |
| "I'll figure it out as I go" |
A structured approach saves time and reduces errors. Follow the workflow in this skill rather than improvising. |
| "I already know this topic" |
Familiarity breeds shortcuts. Use the checklist to verify you haven't missed critical steps. |
| "This doesn't apply to my situation" |
The patterns here generalize across contexts. Adapt, don't skip — the underlying principles hold. |
| "One more tool will fix it" |
Adding complexity rarely solves process gaps. Master the core workflow first. |
When to Use
Trigger phrases:
- "dispatching parallel agents"
- "3+ test files failing with different root causes"
- "Multiple subsystems broken independently"
- "Each problem can be understood without context from others"
- "/adhd", "brainstorm this", "give me a few ways to"
- "think outside the box on this"
Decision Tree
digraph when_to_use {
"Multiple independent failures?" [shape=diamond];
"Single open-ended problem?" [shape=diamond];
"Independent Debugging" [shape=box];
"Divergent Ideation" [shape=box];
"Direct answer" [shape=box];
"Multiple independent failures?" -> "Independent Debugging" [label="yes"];
"Multiple independent failures?" -> "Single open-ended problem?" [label="no"];
"Single open-ended problem?" -> "Divergent Ideation" [label="yes — high stakes?"];
"Single open-ended problem?" -> "Direct answer" [label="no — canonical answer"];
}
Use Pattern 1 (Independent Debugging) when:
- 3+ test files failing with different root causes
- Multiple subsystems broken independently
- Each problem can be understood without context from others
- No shared state between investigations
Use Pattern 2 (Divergent Ideation) when:
- Architecture decisions where the obvious answer may not be best
- API/SDK surface design (naming, ergonomics, tradeoffs)
- Fuzzy debugging with no known root cause
- Open-ended strategy or positioning
- Schema / data model design
Don't use either when:
- Failures are related (fix one might fix others)
- Syntax lookups or bugs with known root cause
- Low-stakes decisions
- User says "quick", "standard", "canonical", "textbook", or "just"
Pattern 1 — Independent Debugging
Split unrelated failures across parallel agents, each owning one problem domain.
1. Identify Independent Domains
Group failures by what's broken:
- File A tests: Tool approval flow
- File B tests: Batch completion behavior
- File C tests: Abort functionality
Each domain is independent - fixing tool approval doesn't affect abort tests.
2. Create Focused Agent Tasks
Each agent gets:
- Specific scope: One test file or subsystem
- Clear goal: Make these tests pass
- Constraints: Don't change other code
- Expected output: Summary of what you found and fixed
3. Dispatch in Parallel
// In Claude Code / AI environment
Task("Fix agent-tool-abort.test.ts failures")
Task("Fix batch-completion-behavior.test.ts failures")
Task("Fix tool-approval-race-conditions.test.ts failures")
// All three run concurrently
4. Review and Integrate
When agents return:
- Read each summary
- Verify fixes don't conflict
- Run full test suite
- Integrate all changes
Pattern 2 — Divergent Ideation
Attack the same problem from multiple cognitive angles to escape premature convergence. Instead of splitting by problem domain, split by cognitive frame — every agent gets the same problem but a different vantage prompt.
This is expensive (~10 agent calls per run). Use a pre-flight gate first.
Pre-Flight Gate
Step 1. Explicit invocation check. If the user typed /adhd or explicitly asked for "brainstorm", "divergent ideation", or "parallel frames", skip the rest of this gate and proceed directly.
Step 2. Self-judge. Ask three questions. If any answer is no, ABORT and answer directly.
- Open-ended? Would a senior engineer give multiple viable answers here, or is there one canonical answer?
- High-stakes? Is the cost of the obvious answer being wrong actually high? Architecture, public APIs, product naming, fuzzy bugs = yes.
- Open phrasing? Did the user avoid words like "quick", "standard", "canonical", "textbook", "just"?
Phase 1 — Diverge (no critic)
Pick 5 cognitive frames from the table below. Bias toward engineering tags for code problems. Always include at least one wild frame.
Spawn 5 parallel isolated branches. Each branch gets only:
- The problem P
- Any context the user provided
- The chosen frame's vantage prompt
- A system instruction forbidding evaluation
You are in DIVERGENT mode — a generator, not a critic.
Generate 6 short distinct ideas under this frame. Each idea is one
phrase or one sentence. Do not evaluate. Do not rank. Do not hedge.
The first three obvious answers everyone would give are banned.
Push past them into the awkward middle.
Output JSON only: [{"text": "...", "rationale": "..."}, ...]
Critical invariant: Branches must be parallel and isolated. Do NOT serialize. Do NOT pass one branch's output to another. Branches that see each other anchor each other, and the whole method collapses to a wider single thought.
Phase 2 — Focus (critic on)
Score. Rate each idea 0–10 on: Novelty (distance from obvious), Viability (could it ship), Fit (addresses the problem). Flag traps with a one-line reason.
Cluster. Group into 3–6 clusters by underlying angle. Label by angle: "remove-the-server plays", "cache-shaped plays".
Deepen the top 3. Rank by weighted score (Novelty 0.35 + Viability 0.40 + Fit 0.25), exclude traps. For each, produce:
- 4–8 sentence sketch
- The load-bearing risk
- The first concrete step a builder would take
- 3–5 child ideas (variations, hybrids, unlocks)
You are in FOCUS mode. Take one promising idea and connect dots.
Sketch how it would actually work in 4–8 sentences. Name the
load-bearing risk. Name the first concrete step a coder would take.
Then generate 3–5 sub-ideas that branch off.
Output JSON only.
Cognitive Frames
Pick 5 per run. For code problems: 4 tagged code/design + 1 tagged wild.
| Frame |
Vantage Prompt |
Tags |
| hardware engineer |
You think in latency, memory layout, and physical constraints. Re-ask this as a hardware/firmware problem. What does the bus topology, cache, timing budget tell you? |
code, wild |
| regulator |
You audit systems for compliance and failure modes. What must be provable, traceable, or refusable here? |
design, general |
| 10-year-old |
You are a curious 10 year old who has never seen software. Describe naive but unencumbered approaches. Ignore convention. |
general, wild |
| competitor trying to break it |
You are a hostile competitor or attacker. Generate approaches that exploit, fail, or sabotage the obvious solution. Then invert into ideas. |
code, design |
| biology |
Transplant a mechanism from biology (immune systems, neural plasticity, cell signaling, evolution, gut flora). Force-fit it onto this engineering problem. |
code, wild |
| logistics |
Steal mechanisms from logistics: queues, batching, just-in-time, hub-and-spoke, returns, last-mile. Apply them literally. |
code, design |
| game design |
Approach this as a game designer. What are the loops, rewards, friction, save-states, speedrun tricks? Treat the user as a player. |
design, general |
| markets |
Treat the problem as a market. Buyers, sellers, market-makers. What does an auction, a futures contract, a clearing house look like here? |
design, wild |
| inversion |
Ask the OPPOSITE question. If goal is X, brainstorm how to guarantee NOT X. Then negate each answer back. |
code, design, general |
| extreme: $0 budget, 1 hour |
No money, no team, one hour. What is the crudest version that still does the load-bearing thing? |
code, general |
| extreme: infinite budget, 10 years |
Infinite compute, infinite engineers, a decade. What is the maximalist version? |
design, wild |
| remove the load-bearing assumption |
Name the thing everyone treats as fixed (framework, database, request-response model, network). Imagine it is gone. What is possible? |
code, design, wild |
| speedrunner |
You are a speedrunner. Find glitches, skips, out-of-bounds tricks, frame-perfect shortcuts. What is the abusive-but-legal path? |
code, wild |
| ant colony |
No central planner. Many dumb agents, local rules, pheromone trails. How does the problem solve itself emergently? |
code, wild |
| 3am on-call |
You are the on-call engineer woken at 3am when this breaks. What design would let you not get paged? |
code, design |
Output Shape
Render in this order. Structure is the point — do not collapse into prose.
- Brief. One–two lines confirming the problem and any reframe used.
- Wide set. Full pool grouped by cluster. Show score chips:
[N7 V8 F9] per idea.
- Converge. 2–4 idea shortlist. Mark non-obvious pick with ★. List traps with one-line reasons.
- Focus. 3 deepened branches: sketch, risk, first step, child ideas.
- Provocation. One wildcard question/idea if nothing landed.
Calibration
| Context |
Frames × Ideas |
Total |
| Quick naming decision |
3 × 4 |
~12 |
| Default |
5 × 6 |
~30 |
| High-stakes strategy |
5 × 8 |
~40 |
Divergent Ideation Anti-Patterns
| Anti-pattern |
Fix |
| Convergence disguised as divergence |
If every candidate shares one assumption, you decorated, not diverged. |
| Weird-for-weird's-sake with no convergence |
Always converge. Structure is half the value. |
| Walls of equally-weighted prose |
Cluster, label, pull out the best. |
| Refusing to commit |
Take a position. Generate wide, converge with an opinion. |
| Skipping the isolation invariant |
Branches must be in fresh contexts. Sequential = wider single thought, not divergent. |
Agent Prompt Structure
Good agent prompts are:
- Focused - One clear problem domain
- Self-contained - All context needed to understand the problem
- Specific about output - What should the agent return?
Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:
1. "should abort tool with partial output capture" - expects 'interrupted at' in message
2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed
3. "should properly track pendingToolCount" - expects 3 results but gets 0
These are timing/race condition issues. Your task:
1. Read the test file and understand what each test verifies
2. Identify root cause - timing issues or actual bugs?
3. Fix by:
- Replacing arbitrary timeouts with event-based waiting
- Fixing bugs in abort implementation if found
- Adjusting test expectations if testing changed behavior
Do NOT just increase timeouts - find the real issue.
Return: Summary of what you found and what you fixed.
Common Mistakes
❌ Too broad: "Fix all the tests" - agent gets lost
✅ Specific: "Fix agent-tool-abort.test.ts" - focused scope
❌ No context: "Fix the race condition" - agent doesn't know where
✅ Context: Paste the error messages and test names
❌ No constraints: Agent might refactor everything
✅ Constraints: "Do NOT change production code" or "Fix tests only"
❌ Vague output: "Fix it" - you don't know what changed
✅ Specific: "Return summary of root cause and changes"
When NOT to Use
Related failures: Fixing one might fix others - investigate together first
Need full context: Understanding requires seeing entire system
Exploratory debugging: You don't know what's broken yet
Shared state: Agents would interfere (editing same files, using same resources)
Real Example from Session
Scenario: 6 test failures across 3 files after major refactoring
Failures:
- agent-tool-abort.test.ts: 3 failures (timing issues)
- batch-completion-behavior.test.ts: 2 failures (tools not executing)
- tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)
Decision: Independent domains - abort logic separate from batch completion separate from race conditions
Dispatch:
Agent 1 → Fix agent-tool-abort.test.ts
Agent 2 → Fix batch-completion-behavior.test.ts
Agent 3 → Fix tool-approval-race-conditions.test.ts
Results:
- Agent 1: Replaced timeouts with event-based waiting
- Agent 2: Fixed event structure bug (threadId in wrong place)
- Agent 3: Added wait for async tool execution to complete
Integration: All fixes independent, no conflicts, full suite green
Time saved: 3 problems solved in parallel vs sequentially
Key Benefits
- Parallelization - Multiple investigations happen simultaneously
- Focus - Each agent has narrow scope, less context to track
- Independence - Agents don't interfere with each other
- Speed - 3 problems solved in time of 1
Verification
After agents return:
- Review each summary - Understand what changed
- Check for conflicts - Did agents edit same code?
- Run full suite - Verify all fixes work together
- Spot check - Agents can make systematic errors
Real-World Impact
From debugging session (2025-10-03):
- 6 failures across 3 files
- 3 agents dispatched in parallel
- All investigations completed concurrently
- All fixes integrated successfully
- Zero conflicts between agent changes
Quick Reference
- Use when: 3+ independent failures, different subsystems, no shared state
- Don't use when: Failures related, need full context, exploratory
- Dispatch one agent per problem domain
- Each agent needs: specific scope, clear goal, constraints, expected output
- After return: Review summaries, check conflicts, run full suite
Common Rationalizations
| Rationalization |
Reality |
| "I'll do this later" |
Explain why this excuse is wrong for this skill |
| "This is simple, skip steps" |
Even simple tasks benefit from process |
Red Flags
- Research relies on a single unverified source
- Agent presents speculation as confirmed findings
- Watch for shortcuts and skipped steps
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
1---2name: dispatching-parallel-agents3description: Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies4license: Apache-2.05---67persona:8 name: "Domain Expert"9 title: "Master of Dispatching Parallel Agents"10 expertise: ['Specialized Knowledge', 'Best Practices', 'Industry Standards']11 philosophy: "Excellence through expertise."12 credentials: ['Industry leader', 'Practiced expert', 'Thought leader']13 principles: ['Quality first', 'Continuous improvement', 'Evidence-based decisions', 'Customer focus']14151617# Dispatching Parallel Agents1819## Overview2021Parallel agent dispatch solves a common bottleneck: when multiple independent problems need solving, investigating them one at a time wastes time. This skill covers two patterns:22231. **Independent Debugging** — Split unrelated failures across agents (different files, different subsystems)242. **Divergent Ideation** — Attack the *same* problem from multiple cognitive angles to escape premature convergence2526Both use the same core mechanism (parallel isolated agent calls) but for fundamentally different purposes.2728**Core principle:** Dispatch one agent per independent unit of work. Let them run concurrently without shared context.2930---3132## Anti-Rationalization Table3334| Rationalization | Reality |35|---|---|36| "I'll figure it out as I go" | A structured approach saves time and reduces errors. Follow the workflow in this skill rather than improvising. |37| "I already know this topic" | Familiarity breeds shortcuts. Use the checklist to verify you haven't missed critical steps. |38| "This doesn't apply to my situation" | The patterns here generalize across contexts. Adapt, don't skip — the underlying principles hold. |39| "One more tool will fix it" | Adding complexity rarely solves process gaps. Master the core workflow first. |4041## When to Use4243**Trigger phrases:**44- "dispatching parallel agents"45- "3+ test files failing with different root causes"46- "Multiple subsystems broken independently"47- "Each problem can be understood without context from others"48- "/adhd", "brainstorm this", "give me a few ways to"49- "think outside the box on this"5051### Decision Tree5253```dot54digraph when_to_use {55 "Multiple independent failures?" [shape=diamond];56 "Single open-ended problem?" [shape=diamond];57 "Independent Debugging" [shape=box];58 "Divergent Ideation" [shape=box];59 "Direct answer" [shape=box];6061 "Multiple independent failures?" -> "Independent Debugging" [label="yes"];62 "Multiple independent failures?" -> "Single open-ended problem?" [label="no"];63 "Single open-ended problem?" -> "Divergent Ideation" [label="yes — high stakes?"];64 "Single open-ended problem?" -> "Direct answer" [label="no — canonical answer"];65}66```6768**Use Pattern 1 (Independent Debugging) when:**69- 3+ test files failing with different root causes70- Multiple subsystems broken independently71- Each problem can be understood without context from others72- No shared state between investigations7374**Use Pattern 2 (Divergent Ideation) when:**75- Architecture decisions where the obvious answer may not be best76- API/SDK surface design (naming, ergonomics, tradeoffs)77- Fuzzy debugging with no known root cause78- Open-ended strategy or positioning79- Schema / data model design8081**Don't use either when:**82- Failures are related (fix one might fix others)83- Syntax lookups or bugs with known root cause84- Low-stakes decisions85- User says "quick", "standard", "canonical", "textbook", or "just"8687---8889## Pattern 1 — Independent Debugging9091Split unrelated failures across parallel agents, each owning one problem domain.929394### 1. Identify Independent Domains9596Group failures by what's broken:97- File A tests: Tool approval flow98- File B tests: Batch completion behavior99- File C tests: Abort functionality100101Each domain is independent - fixing tool approval doesn't affect abort tests.102103### 2. Create Focused Agent Tasks104105Each agent gets:106- **Specific scope:** One test file or subsystem107- **Clear goal:** Make these tests pass108- **Constraints:** Don't change other code109- **Expected output:** Summary of what you found and fixed110111### 3. Dispatch in Parallel112113```typescript114// In Claude Code / AI environment115Task("Fix agent-tool-abort.test.ts failures")116Task("Fix batch-completion-behavior.test.ts failures")117Task("Fix tool-approval-race-conditions.test.ts failures")118// All three run concurrently119```120121### 4. Review and Integrate122123When agents return:124- Read each summary125- Verify fixes don't conflict126- Run full test suite127- Integrate all changes128129---130131## Pattern 2 — Divergent Ideation132133Attack the *same* problem from multiple cognitive angles to escape premature convergence. Instead of splitting by problem domain, split by *cognitive frame* — every agent gets the same problem but a different vantage prompt.134135This is expensive (~10 agent calls per run). Use a pre-flight gate first.136137### Pre-Flight Gate138139**Step 1. Explicit invocation check.** If the user typed `/adhd` or explicitly asked for "brainstorm", "divergent ideation", or "parallel frames", skip the rest of this gate and proceed directly.140141**Step 2. Self-judge.** Ask three questions. If any answer is no, ABORT and answer directly.1421431. **Open-ended?** Would a senior engineer give multiple viable answers here, or is there one canonical answer?1442. **High-stakes?** Is the cost of the obvious answer being wrong actually high? Architecture, public APIs, product naming, fuzzy bugs = yes.1453. **Open phrasing?** Did the user avoid words like "quick", "standard", "canonical", "textbook", "just"?146147### Phase 1 — Diverge (no critic)1481491. **Pick 5 cognitive frames** from the table below. Bias toward engineering tags for code problems. Always include at least one wild frame.1501512. **Spawn 5 parallel isolated branches.** Each branch gets only:152 - The problem P153 - Any context the user provided154 - The chosen frame's vantage prompt155 - A system instruction forbidding evaluation156157 ```158 You are in DIVERGENT mode — a generator, not a critic.159 Generate 6 short distinct ideas under this frame. Each idea is one160 phrase or one sentence. Do not evaluate. Do not rank. Do not hedge.161 The first three obvious answers everyone would give are banned.162 Push past them into the awkward middle.163 Output JSON only: [{"text": "...", "rationale": "..."}, ...]164 ```1651663. **Critical invariant:** Branches must be parallel and isolated. Do NOT serialize. Do NOT pass one branch's output to another. Branches that see each other anchor each other, and the whole method collapses to a wider single thought.167168### Phase 2 — Focus (critic on)1691701. **Score.** Rate each idea 0–10 on: **Novelty** (distance from obvious), **Viability** (could it ship), **Fit** (addresses the problem). Flag traps with a one-line reason.1711722. **Cluster.** Group into 3–6 clusters by underlying angle. Label by angle: "remove-the-server plays", "cache-shaped plays".1731743. **Deepen the top 3.** Rank by weighted score (Novelty 0.35 + Viability 0.40 + Fit 0.25), exclude traps. For each, produce:175 - 4–8 sentence sketch176 - The load-bearing risk177 - The first concrete step a builder would take178 - 3–5 child ideas (variations, hybrids, unlocks)179180 ```181 You are in FOCUS mode. Take one promising idea and connect dots.182 Sketch how it would actually work in 4–8 sentences. Name the183 load-bearing risk. Name the first concrete step a coder would take.184 Then generate 3–5 sub-ideas that branch off.185 Output JSON only.186 ```187188### Cognitive Frames189190Pick 5 per run. For code problems: 4 tagged `code`/`design` + 1 tagged `wild`.191192| Frame | Vantage Prompt | Tags |193|-------|---------------|------|194| **hardware engineer** | You think in latency, memory layout, and physical constraints. Re-ask this as a hardware/firmware problem. What does the bus topology, cache, timing budget tell you? | code, wild |195| **regulator** | You audit systems for compliance and failure modes. What must be provable, traceable, or refusable here? | design, general |196| **10-year-old** | You are a curious 10 year old who has never seen software. Describe naive but unencumbered approaches. Ignore convention. | general, wild |197| **competitor trying to break it** | You are a hostile competitor or attacker. Generate approaches that exploit, fail, or sabotage the obvious solution. Then invert into ideas. | code, design |198| **biology** | Transplant a mechanism from biology (immune systems, neural plasticity, cell signaling, evolution, gut flora). Force-fit it onto this engineering problem. | code, wild |199| **logistics** | Steal mechanisms from logistics: queues, batching, just-in-time, hub-and-spoke, returns, last-mile. Apply them literally. | code, design |200| **game design** | Approach this as a game designer. What are the loops, rewards, friction, save-states, speedrun tricks? Treat the user as a player. | design, general |201| **markets** | Treat the problem as a market. Buyers, sellers, market-makers. What does an auction, a futures contract, a clearing house look like here? | design, wild |202| **inversion** | Ask the OPPOSITE question. If goal is X, brainstorm how to guarantee NOT X. Then negate each answer back. | code, design, general |203| **extreme: $0 budget, 1 hour** | No money, no team, one hour. What is the crudest version that still does the load-bearing thing? | code, general |204| **extreme: infinite budget, 10 years** | Infinite compute, infinite engineers, a decade. What is the maximalist version? | design, wild |205| **remove the load-bearing assumption** | Name the thing everyone treats as fixed (framework, database, request-response model, network). Imagine it is gone. What is possible? | code, design, wild |206| **speedrunner** | You are a speedrunner. Find glitches, skips, out-of-bounds tricks, frame-perfect shortcuts. What is the abusive-but-legal path? | code, wild |207| **ant colony** | No central planner. Many dumb agents, local rules, pheromone trails. How does the problem solve itself emergently? | code, wild |208| **3am on-call** | You are the on-call engineer woken at 3am when this breaks. What design would let you not get paged? | code, design |209210### Output Shape211212Render in this order. Structure is the point — do not collapse into prose.2132141. **Brief.** One–two lines confirming the problem and any reframe used.2152. **Wide set.** Full pool grouped by cluster. Show score chips: `[N7 V8 F9]` per idea.2163. **Converge.** 2–4 idea shortlist. Mark non-obvious pick with ★. List traps with one-line reasons.2174. **Focus.** 3 deepened branches: sketch, risk, first step, child ideas.2185. **Provocation.** One wildcard question/idea if nothing landed.219220### Calibration221222| Context | Frames × Ideas | Total |223|---------|---------------|-------|224| Quick naming decision | 3 × 4 | ~12 |225| Default | 5 × 6 | ~30 |226| High-stakes strategy | 5 × 8 | ~40 |227228### Divergent Ideation Anti-Patterns229230| Anti-pattern | Fix |231|-------------|-----|232| Convergence disguised as divergence | If every candidate shares one assumption, you decorated, not diverged. |233| Weird-for-weird's-sake with no convergence | Always converge. Structure is half the value. |234| Walls of equally-weighted prose | Cluster, label, pull out the best. |235| Refusing to commit | Take a position. Generate wide, converge with an opinion. |236| Skipping the isolation invariant | Branches must be in fresh contexts. Sequential = wider single thought, not divergent. |237238---239240## Agent Prompt Structure241242Good agent prompts are:2431. **Focused** - One clear problem domain2442. **Self-contained** - All context needed to understand the problem2453. **Specific about output** - What should the agent return?246247```markdown248Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:2492501. "should abort tool with partial output capture" - expects 'interrupted at' in message2512. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed2523. "should properly track pendingToolCount" - expects 3 results but gets 0253254These are timing/race condition issues. Your task:2552561. Read the test file and understand what each test verifies2572. Identify root cause - timing issues or actual bugs?2583. Fix by:259 - Replacing arbitrary timeouts with event-based waiting260 - Fixing bugs in abort implementation if found261 - Adjusting test expectations if testing changed behavior262263Do NOT just increase timeouts - find the real issue.264265Return: Summary of what you found and what you fixed.266```267268## Common Mistakes269270**❌ Too broad:** "Fix all the tests" - agent gets lost271**✅ Specific:** "Fix agent-tool-abort.test.ts" - focused scope272273**❌ No context:** "Fix the race condition" - agent doesn't know where274**✅ Context:** Paste the error messages and test names275276**❌ No constraints:** Agent might refactor everything277**✅ Constraints:** "Do NOT change production code" or "Fix tests only"278279**❌ Vague output:** "Fix it" - you don't know what changed280**✅ Specific:** "Return summary of root cause and changes"281282## When NOT to Use283284**Related failures:** Fixing one might fix others - investigate together first285**Need full context:** Understanding requires seeing entire system286**Exploratory debugging:** You don't know what's broken yet287**Shared state:** Agents would interfere (editing same files, using same resources)288289## Real Example from Session290291**Scenario:** 6 test failures across 3 files after major refactoring292293**Failures:**294- agent-tool-abort.test.ts: 3 failures (timing issues)295- batch-completion-behavior.test.ts: 2 failures (tools not executing)296- tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)297298**Decision:** Independent domains - abort logic separate from batch completion separate from race conditions299300**Dispatch:**301```302Agent 1 → Fix agent-tool-abort.test.ts303Agent 2 → Fix batch-completion-behavior.test.ts304Agent 3 → Fix tool-approval-race-conditions.test.ts305```306307**Results:**308- Agent 1: Replaced timeouts with event-based waiting309- Agent 2: Fixed event structure bug (threadId in wrong place)310- Agent 3: Added wait for async tool execution to complete311312**Integration:** All fixes independent, no conflicts, full suite green313314**Time saved:** 3 problems solved in parallel vs sequentially315316## Key Benefits3173181. **Parallelization** - Multiple investigations happen simultaneously3192. **Focus** - Each agent has narrow scope, less context to track3203. **Independence** - Agents don't interfere with each other3214. **Speed** - 3 problems solved in time of 1322323## Verification324325After agents return:3261. **Review each summary** - Understand what changed3272. **Check for conflicts** - Did agents edit same code?3283. **Run full suite** - Verify all fixes work together3294. **Spot check** - Agents can make systematic errors330331## Real-World Impact332333From debugging session (2025-10-03):334- 6 failures across 3 files335- 3 agents dispatched in parallel336- All investigations completed concurrently337- All fixes integrated successfully338- Zero conflicts between agent changes339340## Quick Reference341342- Use when: 3+ independent failures, different subsystems, no shared state343- Don't use when: Failures related, need full context, exploratory344- Dispatch one agent per problem domain345- Each agent needs: specific scope, clear goal, constraints, expected output346- After return: Review summaries, check conflicts, run full suite347348## Common Rationalizations349350| Rationalization | Reality |351|---|---|352| "I'll do this later" | Explain why this excuse is wrong for this skill |353| "This is simple, skip steps" | Even simple tasks benefit from process |354355## Red Flags356357- Research relies on a single unverified source358- Agent presents speculation as confirmed findings359- Watch for shortcuts and skipped steps360361## Process3623631. Analyze the task requirements3642. Apply domain expertise3653. Verify output quality