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

dispatching-parallel-agents

Skill17 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.

190 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-code-review, chinese-commit-conventions and 8 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

  • AWSSkill

    condition-based-waiting

    Replace arbitrary sleeps in tests with polling for the ACTUAL condition — a waitFor(() => predicate, description, timeoutMs) helper that polls every 10 ms, calls the getter inside the loop (no stale cache), and throws a clear error on timeout. Use when a test uses setTimeout / sleep / time.sleep, is flaky (passes on fast machines, fails under load or in CI), times out when run in parallel, or waits for an async operation, event, state, count, or file to appear. Do NOT use when the test genuinely exercises timing behavior (debounce / throttle) — then wait for the triggering condition FIRST and comment WHY the timed wait is justified. Trigger on "flaky test", "race condition in tests", "why does this pass locally and fail in CI", or any `await new Promise(r => setTimeout(r, N))` in a test.

    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

  • +1 more from Leodorareluctant259

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 181 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 181 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.