Get the FREE Ultimate OpenClaw Setup Guide →

dispatching-parallel-agents

npx machina-cli add skill CodingCossack/agent-skills-library/dispatching-parallel-agents --openclaw
Files (1)
SKILL.md
3.4 KB

Dispatching Parallel Agents

Dispatch one agent per independent problem. Let them work concurrently.

Dispatch Workflow

Copy and track:

- [ ] 1. Identify independent domains
- [ ] 2. Create focused agent tasks
- [ ] 3. Dispatch in parallel
- [ ] 4. Review and integrate

1. Identify Independent Domains

Group failures by what's broken:

  • File A tests: Tool approval flow
  • File B tests: Batch completion
  • File C tests: Abort functionality

Each domain is independent—fixing tool approval doesn't affect abort tests.

Critical check: If fixing one might fix others → investigate together first (don't parallelize).

2. Create Focused Agent Tasks

Each agent needs:

  • Scope: One test file or subsystem
  • Goal: Make these tests pass
  • Constraints: Don't change unrelated code
  • Output: Summary of findings and fixes

3. Dispatch in Parallel

Example (Claude Code):

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")

4. Review and Integrate

  1. Read each agent's summary
  2. Check for conflicts (same files edited?)
    • If two agents touched the same file → stop and re-scope (one owner per file)
  3. Run full test suite
  4. If failures:
    • Check for merge conflicts → resolve manually
    • If no conflicts → investigate as new failures
  5. Repeat until green

Agent Prompt Template

Fix the [N] failing tests in [file path]:

1. "[test name]" - [error summary]
2. "[test name]" - [error summary]

Context: [relevant background, e.g., "These are timing/race condition issues"]

Your task:
1. Read the test file, understand what each test verifies
2. Identify root cause—timing issues or actual bugs?
3. Fix by [preferred approach, e.g., "replacing arbitrary timeouts with event-based waiting"]

Do NOT: [anti-patterns, e.g., "just increase timeouts—find the real issue"]

Return: Summary of root cause and changes made.

Common Mistakes

❌ Bad✅ Good
"Fix all the tests""Fix agent-tool-abort.test.ts"
"Fix the race condition"Paste error messages + test names
No constraints"Do NOT change production code"
"Fix it""Return summary of root cause and changes"

Example

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

Integration: All fixes independent, no conflicts, full suite green.

Source

git clone https://github.com/CodingCossack/agent-skills-library/blob/main/skills/dispatching-parallel-agents/SKILL.mdView on GitHub

Overview

This skill splits failures into independent domains and runs a dedicated subagent for each. It speeds remediation when multiple, unrelated failures occur with no shared state or ordering dependencies.

How This Skill Works

First identify independent domains and assign each a focused agent task with a clear scope, goal, and constraints. Then dispatch those agents to work concurrently and collect their summaries and fixes. Finally review for conflicts, run the full test suite, and integrate changes.

When to Use It

  • Two or more unrelated failures across different files or subsystems with no shared state or ordering dependencies.
  • Failures clearly map to separate domains (e.g., test file A, test file B, and a separate subsystem).
  • You want faster diagnosis by solving issues in parallel rather than sequentially.
  • No risk that a fix in one domain will create side effects in another due to shared code paths.
  • You’ve validated that independent fixes can proceed without coordination.

Quick Start

  1. Step 1: Identify independent domains and scope each domain to a dedicated agent.
  2. Step 2: Create focused agent tasks (scope, goal, constraints) and dispatch in parallel.
  3. Step 3: Review summaries, resolve conflicts, and integrate with the full test suite.

Best Practices

  • Identify independent domains before dispatch to avoid cross-domain interference.
  • Scope each agent to a single test file or subsystem with a defined goal and constraints.
  • Avoid overlapping edits; require one owner per file to prevent conflicts.
  • Review each agent’s summary and consolidate findings before running the full suite.
  • If a fix could affect others, pause parallelization and re-scope rather than forcing a parallel run.

Example Use Cases

  • Example: 6 test failures across 3 files after refactor; agents fix timeouts with event-based waiting, correct a mislocated field, and add async tool wait; full suite green.
  • Example: Independent domains—tool-approval, batch-completion, and abort logic—fixed in parallel with no file conflicts.
  • Example: Overlapping edits detected; re-scoped to one owner per file to avoid conflicts.
  • Example: A race-condition across two domains addressed by synchronized waits in each domain’s agent.
  • Example: CI run shows full green after parallelized fixes across distinct subsystems.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers