skills/parallel-agents/SKILL.md
Use when facing 3+ independent test failures, bugs in unrelated subsystems, or investigation questions where each problem is isolable and does not share root cause, files, or shared state with the others. User phrases like "these failures look unrelated", "fan this out", "investigate in parallel".
npx skillsauth add joshsymonds/gambit parallel-agentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When facing 3+ independent failures, dispatch one agent per problem domain concurrently. Verify independence first, dispatch all in single message, wait for all agents, check conflicts, verify integration.
Core principle: Independence verification BEFORE dispatch. Single message dispatch for true parallelism.
Iron Law: NO dispatch without verifying independence first. ALL agents dispatched in a SINGLE message or they run sequentially. No exceptions.
Announce at start: "I'm using gambit:parallel-agents to investigate these independent failures concurrently."
MEDIUM FREEDOM — Follow the 6-step process strictly. Independence verification mandatory. Parallel dispatch in single message required. Adapt agent prompt content to problem domain.
| Step | Action | STOP If | |------|--------|---------| | 1 | Identify domains | < 3 independent domains | | 2 | Create agent prompts | Prompts incomplete | | 3 | Dispatch in SINGLE message | - | | 4 | Wait for all agents | Agent stuck > 5 min | | 5 | Review results | Conflicts found | | 6 | Verify integration | Tests fail |
Why 3+? With only 2 failures, coordination overhead often exceeds sequential time.
Critical: Dispatch all agents in a single message with multiple Task() calls, or they run sequentially.
Use when:
Don't use when:
Test for independence with 3 questions:
"If I fix failure A, does it affect failure B?"
"Do failures touch same code/files?"
"Do failures share error patterns?"
If < 3 independent domains: STOP. Investigate sequentially instead.
Create coordination Task:
TaskCreate
subject: "Parallel Investigation: [N] independent failures"
description: |
## Independent Domains
1. [Domain 1]: [files/tests]
2. [Domain 2]: [files/tests]
3. [Domain 3]: [files/tests]
## Independence Verification
- Domain 1 vs 2: [why independent]
- Domain 2 vs 3: [why independent]
- Domain 1 vs 3: [why independent]
## Agent Status
- [ ] Agent 1 ([Domain 1]): dispatched / returned / result
- [ ] Agent 2 ([Domain 2]): dispatched / returned / result
- [ ] Agent 3 ([Domain 3]): dispatched / returned / result
## Progress
- [ ] All agents dispatched (single message)
- [ ] All agents returned
- [ ] No conflicts found
- [ ] Integration verified (full test suite)
activeForm: "Coordinating parallel investigation"
Then: TaskUpdate taskId: "[id]" status: "in_progress"
Each agent prompt must have:
Good prompt structure:
Fix the 3 failing tests in src/agents/tool_abort_test.go:
1. "TestAbortWithPartialOutput" - expects 'interrupted at' in message
2. "TestMixedCompletedAndAborted" - fast tool aborted instead of completed
3. "TestPendingToolCount" - 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
Constraints:
- Do NOT just increase timeouts - find the real issue
- Do NOT modify files outside src/agents/
- Do NOT change behavior, only fix tests or bugs
Return: Summary of root cause and what you fixed.
Bad prompts: Too broad ("Fix all the tests"), no context ("Fix the race condition"), no constraints (agent might refactor everything).
CRITICAL: All agents in ONE message with multiple Task() calls.
// CORRECT - Single message, parallel execution
Task
subagent_type: "general-purpose"
description: "Fix tool_abort_test.go failures"
prompt: "[prompt 1]"
Task
subagent_type: "general-purpose"
description: "Fix batch_completion_test.go failures"
prompt: "[prompt 2]"
Task
subagent_type: "general-purpose"
description: "Fix tool_approval_test.go failures"
prompt: "[prompt 3]"
// WRONG - Sequential messages
Task prompt1
[Wait for response]
Task prompt2 // Sequential, not parallel!
TaskOutput task_id: "[id]" block: falseWhen all agents return:
Run full test suite (not just the fixed tests):
Task
subagent_type: "general-purpose"
description: "Run full test suite"
prompt: "Run: [test command]. Report pass/fail counts and any failures."
Decision tree:
Update coordination Task:
TaskUpdate
taskId: "[coordination-task-id]"
description: |
## Results
- Agent 1: Fixed [X] in [files]
- Agent 2: Fixed [Y] in [files]
- Agent 3: Fixed [Z] in [files]
## Conflicts
[None / Description and resolution]
## Integration
All tests pass. Changes integrated successfully.
status: "completed"
All mean: STOP. Follow the process.
| Excuse | Reality | |--------|---------| | "Just 2 failures, can still parallelize" | Overhead exceeds benefit, do sequentially | | "Probably independent, will dispatch and see" | Verify independence FIRST | | "Can dispatch sequentially to save syntax" | Must dispatch in single message | | "Agent failed, but others succeeded" | All agents must succeed or re-investigate | | "Conflicts are minor, can ignore" | Resolve all conflicts explicitly | | "Can skip verification, agents ran tests" | Agents can make mistakes, YOU verify |
See REFERENCE.md for detailed good/bad examples including:
Before completing parallel agent work:
Can't check all boxes? Return to process.
This skill calls:
gambit:debugging (how to investigate individual failures)gambit:verification (verify integration)subagent_type: "general-purpose") for parallel investigation and test runningCalled by:
Workflow:
Multiple failures detected
↓
Step 1: Verify independence (3+ domains)
↓
Step 2: Create agent prompts
↓
Step 3: Dispatch in SINGLE message
↓
Step 4: Wait for all agents
↓
Step 5: Review results, check conflicts
↓
Step 6: Verify integration
↓
All failures resolved
testing
Use when creating a new skill, modifying an existing skill, writing or rewriting a SKILL.md file, auditing a skill's description for discoverability, or when user mentions "create a skill", "write a skill", "new skill", "modify skill", "improve skill", "edit the skill".
development
Use before any completion claim, success statement, or marking a task done. Triggers when about to say "Great!", "Perfect!", "Done", "All set", "Ready to commit", before creating a PR, before moving to the next task, or when code has changed since the last test run.
data-ai
Use when starting an isolated feature branch, when working on multiple features simultaneously, when experimenting without affecting the main workspace, or when a clean workspace is needed before beginning implementation. User phrases like "start a new branch", "set up a worktree", "isolated workspace", "work on feature X separately".
development
Use at the start of every session before any response or action. Also invoke whenever uncertain which gambit skill applies, when about to implement / debug / refactor / test / plan / brainstorm, or when a user request could match any gambit skill even at 1% probability.