{"id":"d83aa084-bbed-4a58-884e-f234192a119d","shortId":"s938NF","kind":"skill","title":"dispatching-parallel-agents","tagline":"Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies. Triggers on: \"multiple failures\", \"parallel work\", \"independent problems\", any multi-domain issue. Dispatches one agent per independent problem domain for concurrent invest","description":"# Dispatching Parallel Agents\n\n## Overview\n\nWhen you have multiple unrelated failures (different test files, different subsystems, different bugs), investigating them sequentially wastes time. Each investigation is independent and can happen in parallel.\n\n**Core principle:** Dispatch one agent per independent problem domain. Let them work concurrently.\n\n## When to Use\n\n```dot\ndigraph when_to_use {\n    \"Multiple failures?\" [shape=diamond];\n    \"Are they independent?\" [shape=diamond];\n    \"Single agent investigates all\" [shape=box];\n    \"One agent per problem domain\" [shape=box];\n    \"Can they work in parallel?\" [shape=diamond];\n    \"Sequential agents\" [shape=box];\n    \"Parallel dispatch\" [shape=box];\n\n    \"Multiple failures?\" -> \"Are they independent?\" [label=\"yes\"];\n    \"Are they independent?\" -> \"Single agent investigates all\" [label=\"no - related\"];\n    \"Are they independent?\" -> \"Can they work in parallel?\" [label=\"yes\"];\n    \"Can they work in parallel?\" -> \"Parallel dispatch\" [label=\"yes\"];\n    \"Can they work in parallel?\" -> \"Sequential agents\" [label=\"no - shared state\"];\n}\n```\n\n**Use when:**\n- 3+ test files failing with different root causes\n- Multiple subsystems broken independently\n- Each problem can be understood without context from others\n- No shared state between investigations\n\n**Don't use when:**\n- Failures are related (fix one might fix others)\n- Need to understand full system state\n- Agents would interfere with each other\n\n## The Pattern\n\n### 1. Identify Independent Domains\n\nGroup failures by what's broken:\n- File A tests: Tool approval flow\n- File B tests: Batch completion behavior\n- File C tests: Abort functionality\n\nEach domain is independent - fixing tool approval doesn't affect abort tests.\n\n### 2. Create Focused Agent Tasks\n\nEach agent gets:\n- **Specific scope:** One test file or subsystem\n- **Clear goal:** Make these tests pass\n- **Constraints:** Don't change other code\n- **Expected output:** Summary of what you found and fixed\n\n### 3. Dispatch in Parallel\n\n```typescript\n// In Claude Code / AI environment\nTask(\"Fix agent-tool-abort.test.ts failures\")\nTask(\"Fix batch-completion-behavior.test.ts failures\")\nTask(\"Fix tool-approval-race-conditions.test.ts failures\")\n// All three run concurrently\n```\n\n### 4. Review and Integrate\n\nWhen agents return:\n- Read each summary\n- Verify fixes don't conflict\n- Run full test suite\n- Integrate all changes\n\n## Agent Prompt Structure\n\nGood agent prompts are:\n1. **Focused** - One clear problem domain\n2. **Self-contained** - All context needed to understand the problem\n3. **Specific about output** - What should the agent return?\n\n```markdown\nFix the 3 failing tests in src/agents/agent-tool-abort.test.ts:\n\n1. \"should abort tool with partial output capture\" - expects 'interrupted at' in message\n2. \"should handle mixed completed and aborted tools\" - fast tool aborted instead of completed\n3. \"should properly track pendingToolCount\" - expects 3 results but gets 0\n\nThese are timing/race condition issues. Your task:\n\n1. Read the test file and understand what each test verifies\n2. Identify root cause - timing issues or actual bugs?\n3. Fix by:\n   - Replacing arbitrary timeouts with event-based waiting\n   - Fixing bugs in abort implementation if found\n   - Adjusting test expectations if testing changed behavior\n\nDo NOT just increase timeouts - find the real issue.\n\nReturn: Summary of what you found and what you fixed.\n```\n\n## Common Mistakes\n\n**❌ Too broad:** \"Fix all the tests\" - agent gets lost\n**✅ Specific:** \"Fix agent-tool-abort.test.ts\" - focused scope\n\n**❌ No context:** \"Fix the race condition\" - agent doesn't know where\n**✅ Context:** Paste the error messages and test names\n\n**❌ No constraints:** Agent might refactor everything\n**✅ Constraints:** \"Do NOT change production code\" or \"Fix tests only\"\n\n**❌ Vague output:** \"Fix it\" - you don't know what changed\n**✅ Specific:** \"Return summary of root cause and changes\"\n\n## When NOT to Use\n\n**Related failures:** Fixing one might fix others - investigate together first\n**Need full context:** Understanding requires seeing entire system\n**Exploratory debugging:** You don't know what's broken yet\n**Shared state:** Agents would interfere (editing same files, using same resources)\n\n## Real Example from Session\n\n**Scenario:** 6 test failures across 3 files after major refactoring\n\n**Failures:**\n- agent-tool-abort.test.ts: 3 failures (timing issues)\n- batch-completion-behavior.test.ts: 2 failures (tools not executing)\n- tool-approval-race-conditions.test.ts: 1 failure (execution count = 0)\n\n**Decision:** Independent domains - abort logic separate from batch completion separate from race conditions\n\n**Dispatch:**\n```\nAgent 1 → Fix agent-tool-abort.test.ts\nAgent 2 → Fix batch-completion-behavior.test.ts\nAgent 3 → Fix tool-approval-race-conditions.test.ts\n```\n\n**Results:**\n- Agent 1: Replaced timeouts with event-based waiting\n- Agent 2: Fixed event structure bug (threadId in wrong place)\n- Agent 3: Added wait for async tool execution to complete\n\n**Integration:** All fixes independent, no conflicts, full suite green\n\n**Time saved:** 3 problems solved in parallel vs sequentially\n\n## Key Benefits\n\n1. **Parallelization** - Multiple investigations happen simultaneously\n2. **Focus** - Each agent has narrow scope, less context to track\n3. **Independence** - Agents don't interfere with each other\n4. **Speed** - 3 problems solved in time of 1\n\n## Verification\n\nAfter agents return:\n1. **Review each summary** - Understand what changed\n2. **Check for conflicts** - Did agents edit same code?\n3. **Run full suite** - Verify all fixes work together\n4. **Spot check** - Agents can make systematic errors\n\n## Real-World Impact\n\nFrom debugging session (2025-10-03):\n- 6 failures across 3 files\n- 3 agents dispatched in parallel\n- All investigations completed concurrently\n- All fixes integrated successfully\n- Zero conflicts between agent changes\n\n## Examples\n\n### Example 1: Multiple Test Failures\nFailures: 3 test files failing with different errors\nDomain 1: agent-tool-abort.test.ts (timing issues)\nDomain 2: batch-completion-behavior.test.ts (tools not executing)\nDomain 3: tool-approval-race-conditions.test.ts (execution count = 0)\nDispatch: 3 agents in parallel, each fixes one domain\nResult: All tests pass, no conflicts\n\n### Example 2: Multiple Subsystems Broken\nFailures: API down, database slow, frontend errors\nDomain 1: API health check and restart\nDomain 2: Database query optimization\nDomain 3: Frontend error boundary fix\nDispatch: 3 agents in parallel\nResult: All systems restored, no interference\n\n### Example 3: Related Failures (DON'T use parallel)\nFailures: Form validation fails, API validation fails, database constraint fails\nIssue: All related — fixing one might fix others\nAction: Investigate together first, don't dispatch in parallel\n\n## Troubleshooting\n\n### Issue: Failures seem independent but aren't\nSolution: Investigate together first. Don't dispatch in parallel if fixing one might fix others.\n\n### Issue: Agents are interfering with each other\nSolution: Scope was too broad. Narrow each agent's scope to one specific problem domain.\n\n### Issue: One agent finishes before others\nSolution: That's fine. Review their summary while others work. Integrate when all complete.","tags":["dispatching","parallel","agents","synapse","deve1993","agent-skills","ai-agents","ai-coding","ai-workspace","anti-poisoning","auto-learning-ai","automation"],"capabilities":["skill","source-deve1993","skill-dispatching-parallel-agents","topic-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workspace","topic-anti-poisoning","topic-auto-learning-ai","topic-automation","topic-claude-code","topic-code-quality","topic-cursor","topic-developer-tools","topic-devops"],"categories":["Synapse"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/deve1993/Synapse/dispatching-parallel-agents","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add deve1993/Synapse","source_repo":"https://github.com/deve1993/Synapse","install_from":"skills.sh"}},"qualityScore":"0.453","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 7 github stars · SKILL.md body (7,277 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:14:13.354Z","embedding":null,"createdAt":"2026-05-18T13:21:46.053Z","updatedAt":"2026-05-18T19:14:13.354Z","lastSeenAt":"2026-05-18T19:14:13.354Z","tsv":"'-03':809 '-10':808 '0':436,651,863 '1':235,365,399,444,647,667,680,728,762,767,835,848,892 '2':8,274,371,412,455,641,671,689,734,774,853,880,899 '2025':807 '3':183,310,382,394,426,432,464,629,636,675,699,719,745,756,783,813,815,840,859,865,904,910,921 '4':336,754,792 '6':625,810 'abort':260,272,401,418,422,478,655 'across':628,812 'action':946 'actual':462 'ad':700 'adjust':482 'affect':271 'agent':4,37,47,80,107,113,127,145,176,227,277,280,341,358,362,389,516,530,545,611,666,670,674,679,688,698,737,747,765,779,795,816,831,866,911,979,992,1002 'agent-tool-abort.test.ts':322,521,635,669,849 'ai':318 'api':885,893,932 'approv':249,268 'arbitrari':468 'aren':961 'async':703 'b':252 'base':473,686 'batch':254,659 'batch-completion-behavior.test.ts':326,640,673,854 'behavior':256,488 'benefit':727 'boundari':907 'box':111,118,129,133 'broad':511,989 'broken':193,244,607,883 'bug':61,463,476,693 'c':258 'captur':406 'caus':190,458,574 'chang':298,357,487,552,568,576,773,832 'check':775,794,895 'claud':316 'clear':289,368 'code':300,317,554,782 'common':508 'complet':255,416,425,660,707,822,1019 'concurr':43,88,335,823 'condit':440,529,664 'conflict':350,713,777,829,878 'constraint':295,544,549,936 'contain':374 'context':201,376,525,535,593,742 'core':76 'count':650,862 'creat':275 'databas':887,900,935 'debug':600,805 'decis':652 'depend':21 'diamond':100,105,125 'differ':55,58,60,188,845 'digraph':93 'dispatch':2,35,45,78,131,167,311,665,817,864,909,952,969 'dispatching-parallel-ag':1 'doesn':269,531 'domain':33,41,84,116,238,263,370,654,847,852,858,872,891,898,903,999 'dot':92 'edit':614,780 'entir':597 'environ':319 'error':538,799,846,890,906 'event':472,685,691 'event-bas':471,684 'everyth':548 'exampl':621,833,834,879,920 'execut':645,649,705,857,861 'expect':301,407,431,484 'exploratori':599 'face':7 'fail':186,395,843,931,934,937 'failur':25,54,98,135,213,240,323,327,331,582,627,634,637,642,648,811,838,839,884,923,928,957 'fast':420 'file':57,185,245,251,257,286,448,616,630,814,842 'find':494 'fine':1009 'finish':1003 'first':590,949,966 'fix':216,219,266,309,321,325,329,347,392,465,475,507,512,520,526,556,561,583,586,668,672,676,690,710,789,825,870,908,941,944,973,976 'flow':250 'focus':276,366,522,735 'form':929 'found':307,481,503 'frontend':889,905 'full':224,352,592,714,785 'function':261 'get':281,435,517 'goal':290 'good':361 'green':716 'group':239 'handl':414 'happen':73,732 'health':894 'identifi':236,456 'impact':803 'implement':479 'increas':492 'independ':9,28,39,70,82,103,138,143,153,194,237,265,653,711,746,959 'instead':423 'integr':339,355,708,826,1016 'interf':981 'interfer':229,613,750,919 'interrupt':408 'invest':44 'investig':62,68,108,146,208,588,731,821,947,964 'issu':34,441,460,497,639,851,938,956,978,1000 'key':726 'know':533,566,604 'label':139,148,159,168,177 'less':741 'let':85 'logic':656 'lost':518 'major':632 'make':291,797 'markdown':391 'messag':411,539 'might':218,546,585,943,975 'mistak':509 'mix':415 'multi':32 'multi-domain':31 'multipl':24,52,97,134,191,730,836,881 'name':542 'narrow':739,990 'need':221,377,591 'one':36,79,112,217,284,367,584,871,942,974,996,1001 'optim':902 'other':203,220,587,945,977,1005,1014 'output':302,385,405,560 'overview':48 'parallel':3,26,46,75,123,130,158,165,166,174,313,723,729,819,868,913,927,954,971 'partial':404 'pass':294,876 'past':536 'pattern':234 'pendingtoolcount':430 'per':38,81,114 'place':697 'principl':77 'problem':29,40,83,115,196,369,381,720,757,998 'product':553 'prompt':359,363 'proper':428 'queri':901 'race':528,663 'read':343,445 'real':496,620,801 'real-world':800 'refactor':547,633 'relat':150,215,581,922,940 'replac':467,681 'requir':595 'resourc':619 'restart':897 'restor':917 'result':433,678,873,914 'return':342,390,498,570,766 'review':337,768,1010 'root':189,457,573 'run':334,351,784 'save':718 'scenario':624 'scope':283,523,740,986,994 'see':596 'seem':958 'self':373 'self-contain':372 'separ':657,661 'sequenti':20,64,126,175,725 'session':623,806 'shape':99,104,110,117,124,128,132 'share':17,179,205,609 'simultan':733 'singl':106,144 'skill' 'skill-dispatching-parallel-agents' 'slow':888 'solut':963,985,1006 'solv':721,758 'source-deve1993' 'specif':282,383,519,569,997 'speed':755 'spot':793 'src/agents/agent-tool-abort.test.ts':398 'state':18,180,206,226,610 'structur':360,692 'subsystem':59,192,288,882 'success':827 'suit':354,715,786 'summari':303,345,499,571,770,1012 'system':225,598,916 'systemat':798 'task':10,278,320,324,328,443 'test':56,184,247,253,259,273,285,293,353,396,447,453,483,486,515,541,557,626,837,841,875 'threadid':694 'three':333 'time':66,459,638,717,760,850 'timeout':469,493,682 'timing/race':439 'togeth':589,791,948,965 'tool':248,267,402,419,421,643,704,855 'tool-approval-race-conditions.test.ts':330,646,677,860 'topic-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workspace' 'topic-anti-poisoning' 'topic-auto-learning-ai' 'topic-automation' 'topic-claude-code' 'topic-code-quality' 'topic-cursor' 'topic-developer-tools' 'topic-devops' 'track':429,744 'trigger':22 'troubleshoot':955 'typescript':314 'understand':223,379,450,594,771 'understood':199 'unrel':53 'use':5,91,96,181,211,580,617,926 'vagu':559 'valid':930,933 'verif':763 'verifi':346,454,787 'vs':724 'wait':474,687,701 'wast':65 'without':16,200 'work':14,27,87,121,156,163,172,790,1015 'world':802 'would':228,612 'wrong':696 'yes':140,160,169 'yet':608 'zero':828","prices":[{"id":"57e50f92-42c3-47e2-ad52-d4b93519ad37","listingId":"d83aa084-bbed-4a58-884e-f234192a119d","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"deve1993","category":"Synapse","install_from":"skills.sh"},"createdAt":"2026-05-18T13:21:46.053Z"}],"sources":[{"listingId":"d83aa084-bbed-4a58-884e-f234192a119d","source":"github","sourceId":"deve1993/Synapse/dispatching-parallel-agents","sourceUrl":"https://github.com/deve1993/Synapse/tree/main/skills/dispatching-parallel-agents","isPrimary":false,"firstSeenAt":"2026-05-18T13:21:46.053Z","lastSeenAt":"2026-05-18T19:14:13.354Z"}],"details":{"listingId":"d83aa084-bbed-4a58-884e-f234192a119d","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"deve1993","slug":"dispatching-parallel-agents","github":{"repo":"deve1993/Synapse","stars":7,"topics":["agent-skills","ai-agents","ai-coding","ai-workspace","anti-poisoning","auto-learning-ai","automation","claude-code","code-quality","cursor","developer-tools","devops","fullstack-development","multi-agent-systems","nextjs","opencode","persistent-memory","self-improving","telegram-bot"],"license":"other","html_url":"https://github.com/deve1993/Synapse","pushed_at":"2026-05-15T21:34:01Z","description":"Self-improving AI brain for Claude Code & Desktop — 28 MCP tools, 253 skills, collective memory, project tracking, work logs. One server, all your sessions share the same knowledge. Deploy on Coolify in 2 minutes.","skill_md_sha":"94d9f63cd3262f8c8ce2bcbee58763e52d4e69cb","skill_md_path":"skills/dispatching-parallel-agents/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/deve1993/Synapse/tree/main/skills/dispatching-parallel-agents"},"layout":"multi","source":"github","category":"Synapse","frontmatter":{"name":"dispatching-parallel-agents","description":"Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies. Triggers on: \"multiple failures\", \"parallel work\", \"independent problems\", any multi-domain issue. Dispatches one agent per independent problem domain for concurrent investigation."},"skills_sh_url":"https://skills.sh/deve1993/Synapse/dispatching-parallel-agents"},"updatedAt":"2026-05-18T19:14:13.354Z"}}