dispatching-parallel-agents
Use when 2+ independent tasks can run without shared mutable state, when context isolation is needed between tasks, when parallel subagent dispatch is requested, when batch review of multiple files is required, or when the user requests fan-out across independent investigations.
- License 许可
- MIT
- 最近更新
- 2026-10-28
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- dispatching-parallel-agents
- bucket
- engineering
- description
- Use when 2+ independent tasks can run without shared mutable state, when context isolation is needed between tasks, when parallel subagent dispatch is requested, when batch review of multiple files is required, or when the user requests fan-out across independent investigations.
02 资源文件 5
- 参考文档references/example.md1.1 KB
- 参考文档references/pressure-and-antipatterns.md977 B
- 参考文档references/procedure-details.md1.3 KB
- 参考文档references/prompt-template.md832 B
- 参考文档references/verification.md1.1 KB
03 SKILL.md 正文
Dispatching Parallel Agents
This skill is the fan-out playbook for the current agent. Independence, one-message dispatch, and a merged report are the contract. Worker subagents do the work (general-purpose, spec-reviewer-agent, standards-reviewer-agent, or other named verifiers).
A task is independent when it shares no mutable file / DB / config / lock with its peers and does not need another peer's output. Fake parallelism is sequential work wrapped in extra Agent calls.
When to use
- 2+ truly independent tasks (no shared files / DB / config / lock)
- Context explosion (e.g. six failing test files → one worker per file)
- Parallel review of disjoint files (axes or modules that do not overlap)
- Independent exploration of unfamiliar modules (one worker per module)
- Batch-fix N similar bugs in N independent files
code-review already fans out Standards + Spec; use that skill when the job is the dual-axis gate, not this general playbook.
When not to use
- Peers depend on each other (B reads A's output → sequence)
- One trivial task (setup cost exceeds the work)
- The user asked for order ("先 X 再 Y")
- Two workers would write the same file
Procedure
-
Identify independent tasks. Confirm no shared mutable state, no overlapping write paths, no peer-output dependency. Count follows shape: one worker per independent module / compile boundary; otherwise cost vs speed vs dependency. Completion: a named list of units, each with a disjoint write (or read) path, or a decision to run sequentially instead.
-
Write a 7-field prompt per worker. ROLE / SCOPE / PERMISSION / REFERENCE / CONSTRAINTS / DELIVERABLE / OUTPUT RULES. Skeleton:
references/prompt-template.md. Missing ROLE, SCOPE, or PERMISSION means the worker will drift. Completion: every unit has all seven fields. -
Fan out in one message. The current agent issues multiple Agent/Task calls in a single message, each targeting a worker. Sequential messages are sequence, not parallel. Completion: N workers launched together.
-
Collect structured results. Each worker returns verifiable output (paths, commands, exit codes, findings) — not "looks good". Completion: N results in hand, including crashed workers reported as FAIL.
-
Cross-check. Scope creep, overlapping writes, and peer-output leakage —
references/verification.md. Completion: conflicts named or confirmed absent. -
Synthesize. Merge into one report. Commit is not this step; a later implementing turn owns git. Completion:
dispatched N, passed M, failed Kplus the merged table.
Shape, shared-state table, and one-message vs sequential: references/procedure-details.md.
Prompt skeleton
ROLE: <worker identity>
SCOPE: 1 logical task; write paths do not overlap peers
PERMISSION: <tools + read/write scope>
REFERENCE: <paths the worker must read first>
CONSTRAINTS: <no scope creep, no drive-by refactors>
DELIVERABLE: <concrete artifact>
OUTPUT RULES: <format; deliverable is the output>
Full template: references/prompt-template.md.
Acceptance criteria
- [ ] 2+ tasks are independent (or the run correctly fell back to sequence)
- [ ] Each worker has explicit SCOPE (one logical task, disjoint write paths)
- [ ] Workers launched in one message by the current agent
- [ ] Each result is structured and verifiable
- [ ] Cross-check ran before the merge
- [ ] Report includes
dispatched N, passed M, failed K
References
- Worked example (three disjoint reviews, synthesize, no commit):
references/example.md - Procedure expansion:
references/procedure-details.md - Prompt template:
references/prompt-template.md - Cross-check:
references/verification.md - Pressure / anti-patterns:
references/pressure-and-antipatterns.md
04 同仓库更多 Skills
writing-plans
Use when turning a buildable spec into ordered tracer bullets after architecture-change-reviewer. Covers vertical slicing, dependency order, and headroom for the implementer. Triggers on 写计划, 拆任务, 任务分解, 制定方案, 跨文件改动, 计划.
wayfinder
Use when a chunk of work is more than one agent session can hold — plan it as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.
verification-before-completion
This skill should be used when claiming "完成" / "done" / "fixed" / "passing" / "ready to ship", before trusting a subagent success report, or when checking "对照计划" / "对照 spec" — whether this run's delivery matches its basis.
using-agent-skills
Use when starting a new session, switching tasks, or unsure which arthurpower skill applies. Routes incoming work to the matching skill via flowchart before invoking. Activates on phrases like "which skill should I use", "skill check", "pre-task skill check", "how to start", "router", "skill routing", or when multiple competing skills could apply. Does not auto-invoke user-invoked authoring skills (skill-authoring, self-evolving-rules).
test-driven-development
Use when implementing logic, fixing a bug, or changing behavior — write the failing test first (RED), then minimal code (GREEN), then refactor. Triggers on "write the failing test first", "Prove-It", or a bug that needs a reproduction test before the fix.
systematic-debugging
Use when debugging a test failure, build break, unexpected runtime error, flaky test, or hanging process. Triggers on phrases like "fix this bug", "getting an error", "failing test", "flaky", "hanging", "halfway through debugging", "this used to work", "intermittent failure", "stack trace shows X", or any case where behavior does not match expectations. Prevents shotgun debugging.