agentleFS
REPOZYREPOZY/superpowers-optimized/skills/dispatching-parallel-agents/SKILL.md

dispatching-parallel-agents

Skill146 starsChanged 7 months agoMITView on GitHub

Use when 2+ tasks are independent and can run concurrently without file or state conflicts or sequential dependencies. Triggers on: "run these in parallel", "do these at the same time", plans with independent tasks, when subagent-driven-development identifies parallelizable work.

189 other projects use a version of this, 149 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Leodorareluctant259Skill

    chinese-code-review

    中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈

    Also in 8 projects that use this

  • Leodorareluctant259Skill

    chinese-commit-conventions

    中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化

    Also in 8 projects that use this

  • obraSkill

    diagnosing-superpowers

    Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

    Also in 19 projects that use this

  • kntismSkill

    condition-based-waiting

    Use when tests have race conditions, timing dependencies, or inconsistent pass/fail behavior - replaces arbitrary timeouts with condition polling to wait for actual state changes, eliminating flaky tests from timing guesses

    Also in 3 projects that use this

  • xfstudioSkill

    context-driven-development

    Use this skill when working with Conductor's context-driven

    Also in 3 projects that use this

  • EvezArtSkill

    analytics-dashboard

    User behavior tracking and analytics dashboards

    Also in 3 projects that use this

  • +3 more from Leodorareluctant259

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 179 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use parallel subagents only for truly independent work.

    line 13
  2. Distinctive:

    Use parallel dispatch when all are true:

    line 17
  3. Distinctive:

    If any condition fails, run sequentially.

    line 22
  4. Distinctive:

    Write one focused prompt per domain.

    line 34
  5. Distinctive:

    Run integration verification: execute the full project test suite plus any cross-domain checks.

    line 38
  6. Distinctive:

    Never forward parent session context or history to subagents.

    line 42
  7. Distinctive:

    When risk is high, fall back to sequential execution.

    line 98

“Common” is measured: kept by at least 6 in 10 of the 179 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dispatching Parallel Agents

Use parallel subagents only for truly independent work.

Decision Check

Use parallel dispatch when all are true:

  • Problems have separate root causes.
  • Tasks do not edit the same files.
  • Tasks do not require shared intermediate state.

If any condition fails, run sequentially.

Do not use when:

  • Failures are related — fixing one might fix others.
  • The task is exploratory — you don't know what's broken yet.
  • Agents would edit the same files or shared resources.
  • Understanding the problem requires seeing the full system state.
  • The task is content relay — fetching raw content (file contents, web pages, API responses) to bring back to the parent session. Agent results are compressed; raw content will be lost. Fetch it directly instead with Read (local files) or curl (URLs).

Procedure

  1. Split work into independent domains.
  2. Write one focused prompt per domain.
  3. Dispatch all agents in a single message with multiple parallel Agent tool calls. Do not dispatch sequentially across multiple messages — staggered dispatch delays start times, burns cache TTL, and undermines the parallelism.
  4. Collect summaries and changed files.
  5. Resolve conflicts between summaries and changed files.
  6. Run integration verification: execute the full project test suite plus any cross-domain checks. Do not mark the wave complete until integration passes.

Context Isolation

Never forward parent session context or history to subagents. Construct each subagent's prompt from scratch using only the items listed below. Subagents must not receive conversation history, prior reasoning chains, or context from other subagent runs.

Why this is also the cache-optimal approach: All subagents share the same system prompt prefix, which is cached by the API. By keeping each subagent's input as [cached system prompt] + [small unique task prompt], every agent gets a cache hit on the heavy shared prefix and only pays full price for its small task-specific tail. Forwarding parent conversation history would make each subagent's prefix unique and large, breaking cache sharing and multiplying input token costs.

Prompt Requirements

Each agent prompt must include:

  • Exact scope
  • Acceptance criteria
  • Constraints (what not to touch)
  • Required output format
  • Subagent containment: "You are a focused subagent. Do NOT invoke any skills from the superpowers-optimized plugin. Do NOT use the Skill tool. Do NOT dispatch, spawn, or delegate to any subagent of your own. Do all of this work yourself. Your only job is the task described below."

Example prompt

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

Your task:
1. Read the test file and understand what each test verifies.
2. Identify root cause — timing issues or actual bugs?
3. Fix the root cause. Do NOT just increase timeouts.
4. Do NOT change any files outside src/agents/agent-tool-abort.test.ts and its direct implementation file.

You are a focused subagent. Do NOT invoke any skills from the superpowers-optimized plugin.
Do NOT use the Skill tool. Do NOT dispatch, spawn, or delegate to any subagent of your own. Do all of this work yourself.
Your only job is the task described above.

Return: Summary of root cause and what you changed.

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 ✅ With context: Paste the error messages and test names

❌ No constraints: Agent might refactor everything ✅ Constrained: "Do NOT change files outside X"

❌ Vague output: "Fix it" — you don't know what changed ✅ Specific output: "Return summary of root cause and what you changed"

Risks

  • False independence assumptions
  • Merge conflicts across shared files
  • Inconsistent behavior across parallel fixes
  • Cache TTL expiry for long-running tasks: the default prompt cache TTL is 5 minutes. If individual agent tasks are expected to run longer than that, the cache benefit diminishes. For very long tasks this is not a reason to avoid parallelism — it just means the input token saving is smaller.

When risk is high, fall back to sequential execution.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.