agentleFS
MorningStar0709MorningStar0709/trae-agent-enhancements/skills/dispatching-parallel-agents/SKILL.md

dispatching-parallel-agents

Skill18 starsChanged 7 months agoMITView on GitHub

Use when there are 2 or more independent tasks that can be delegated to available Task subagents in parallel, including Chinese requests such as “并行搜索”“并行审查”“并行浏览器验证”“并行跑子代理”. Do not use when tasks share file edits, depend on shared state, require sequential reasoning, or are faster with direct tools.

136 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use diagnosing-superpowers, chinese-code-review and 7 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.
  • 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 6 projects that use this

  • shibit-netSkill

    chinese-code-review

    中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。

    Also in 3 projects that use this

  • shibit-netSkill

    chinese-commit-conventions

    中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。

    Also in 3 projects that use this

  • MicrosoftSkill

    testing-anti-patterns

    Use when writing or changing tests, adding mocks, or tempted to add test-only methods to production code - prevents testing mock behavior, production pollution with test-only methods, and mocking without understanding dependencies

    Also in 4 projects that use this

  • kntismSkill

    defense-in-depth

    Use when invalid data causes failures deep in execution, requiring validation at multiple system layers - validates at every layer data passes through to make bugs structurally impossible

    Also in 3 projects that use this

  • MicrosoftSkill

    root-cause-tracing

    Use when errors occur deep in execution and you need to trace back to find the original trigger - systematically traces bugs backward through call stack, adding instrumentation when needed, to identify source of invalid data or incorrect behavior

    Also in 4 projects that use this

  • +1 more from shibit-net
  • +1 more from microsoft

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 129 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If tasks are not clearly separated, split them first before evaluating parallel feasibility.

    line 33
  2. Distinctive:

    Evaluate Task Boundaries: Run each task through all five conflict checks below.

    line 40
  3. Very specific:

    Verify Environment: Check if the current environment has capable subagents for the task types found in step 1.

    line 49
  4. Distinctive:

    Aggregate: After subagents return, the main session must aggregate and cross-check the results.

    line 55
  5. Distinctive:

    Shared State Detected: If tasks share state, immediately fallback to sequential execution.

    line 77
  6. Very specific:

    Subagent Unavailable: If the required subagent type is missing, fallback to sequential tool usage or executing-plans.

    line 78
  7. Distinctive:

    Subagent Failure: If a parallel subagent fails, report the specific failure and either retry that specific task or complete it sequentially.

    line 79

“Common” is measured: kept by at least 6 in 10 of the 129 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 This Skill

  • There are 2 or more mutually independent search, review, or browser validation tasks.
  • The main session is deep in context and an isolated sub-task can be offloaded to a subagent.
  • Each task can be clearly described on its own.
  • Tasks do not share file editing state, runtime state, or intermediate results.

Do Not Use

  • Multiple tasks will edit the same file or depend on the same intermediate state.
  • The current environment lacks the required implementation/review subagent capabilities.
  • The tasks are essentially different facets of the same problem and require holistic understanding.
  • The work is small enough that doing it directly is clearly faster — if in doubt, dispatch is safer than over-optimizing for speed.
  • The user is asking for a YAML-based multi-role simulation; use workflow-runner instead.
  • The tasks involve writing or modifying code; use subagent-driven-development instead. This skill is strictly for read-only, analysis, or independent review tasks.

Input Contract

Required inputs:

  • A clear list of tasks to be evaluated for parallel execution.

Optional inputs:

  • The specific subagent types available in the current environment — discover dynamically via discovering-subagent-capabilities.

Missing input handling:

  • If tasks are not clearly separated, split them first before evaluating parallel feasibility.

Execution Protocol

Execute in the following order:

  1. Pre-flight: Discover Available Subagents: Use discovering-subagent-capabilities to read the Task tool's subagent_type enum from the system prompt. Read each subagent's description and match against the task types. The enum is dynamic — do not assume a fixed set of agent names. If no matching subagent exists for a task type, fallback to inline execution.
  2. Evaluate Task Boundaries: Run each task through all five conflict checks below. If ANY check fails, abort parallelization — do not proceed.

    #Conflict checkFail condition
    1Same fileAny two tasks modify the same file path
    2Same module/stateTwo tasks share the same module, configuration, or runtime state
    3Sequential dependencyOne task's output is another task's input (must run in order)
    4Resource contentionTwo tasks require the same port, file lock, environment variable, or API rate-limited endpoint
    5Transactional boundaryTwo tasks must either both succeed or both roll back to maintain consistency
  3. Verify Environment: Check if the current environment has capable subagents for the task types found in step 1. If code implementation is needed and no reliable implementation subagent exists, fallback to executing-plans or sequential execution.
  4. Check Parallel Constraints:
    • Each sub-problem must be writable as a self-contained prompt (≤30 words per subagent query).
    • Parallel dispatch must not exceed 4 concurrent tasks.
  5. Prepare Prompts: Write a self-contained prompt for each subagent, including goal, scope, necessary context, expected return content, and constraints. Keep each prompt focused and narrow — if a parallel task is expected to be large (5+ files or broad scope), pre-split it into multiple finer-grained sub-tasks before dispatch. Use the subagent types identified in step 1 to route each task to the best-matching agent.
  6. Dispatch: Launch multiple Task calls simultaneously in a single tool message, using the subagent_type values discovered in step 1. Do not exceed 4 parallel tasks.
  7. Aggregate: After subagents return, the main session must aggregate and cross-check the results. Do not treat subagent reports as final facts without verification.

Aggregation Protocol:

1. Extract key findings from each subagent report.
2. Compare findings side by side: which points agree, which conflict.
3. For conflicting claims, rate credibility per subagent using the table below:

   | Credibility | Criteria |
   |:------------|:---------|
   | **High** | Claim is backed by code, error log, test output, or config evidence from the subagent's context |
   | **Medium** | Claim is reasoned based on project structure or conventions but lacks direct evidence |
   | **Low** | Claim is opinion-based ("this feels wrong", "I think it might be...") |
   | **Reject** | Claim directly contradicts known facts from other verified sources |

   When credibility is equal on both sides, flag the conflict for the user.
4. State the final conclusion per conflict point, with reasoning.
5. If conflicts cannot be resolved without additional input, flag them for the user.

Failure Handling

  • Shared State Detected: If tasks share state, immediately fallback to sequential execution.
  • Subagent Unavailable: If the required subagent type is missing, fallback to sequential tool usage or executing-plans.
  • Subagent Failure: If a parallel subagent fails, report the specific failure and either retry that specific task or complete it sequentially.

Output Contract

The final output must include:

  • The list of tasks dispatched in parallel.
  • The aggregated results from all subagents.
  • Any cross-check or verification performed on the results.
  • Any failures or fallback actions taken.

Integration

  • workflow-runner: Adjacent — workflow-runner handles YAML-based multi-role orchestration with DAG dependencies; dispatching-parallel-agents handles ad-hoc parallel subagent tasks without a pre-defined workflow.
  • subagent-driven-development: Adjacent — subagent-driven-development dispatches implementation subagents sequentially with two-stage reviews; dispatching-parallel-agents is for read-only parallel analysis/review tasks only.
  • executing-plans: Fallback — when tasks are not truly independent, fall back to sequential execution in the main session.
  • discovering-subagent-capabilities: Upstream — before dispatching, use this skill if you need to verify which subagent types are available in the current environment.

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.