بنقرة واحدة
dispatching-parallel-agents
Runs independent subtasks concurrently via sub-agents.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Runs independent subtasks concurrently via sub-agents.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Flags risky shell commands and unsafe tree ops.
Detects high-confidence security risks in code.
Surfaces the dojo's non-negotiable prime directives.
Activates the dojo framework at the start of a session.
Plans multi-step work before writing code.
Captures lessons and promotes recurring patterns.
| name | dispatching-parallel-agents |
| description | Runs independent subtasks concurrently via sub-agents. |
| tier | practical |
| category | delegation |
| created_by | human |
| platforms | ["windows","macos","linux"] |
| tags | ["delegation","parallel","sub-agents"] |
| author | Andreas Wasita (@andreaswasita) |
Runs multiple sub-agents concurrently when a plan contains independent subtasks with non-overlapping file boundaries. Each sub-agent receives a self-contained spec. Does NOT parallelize work with dependencies or shared mutable state — that path silently corrupts results.
tasks/todo.md with task IDs and explicit dependencies.task Copilot tool available (or equivalent sub-agent mechanism).view, edit, grep, and powershell Copilot tools.1. From `tasks/todo.md`, pick tasks with no dependency edges between them.
2. Confirm each has a non-overlapping file scope.
3. Write a self-contained spec per agent (goal, files, DO NOT touch, verification).
4. Dispatch all sub-agents in one tool-call batch.
5. Collect each result; integrate.
6. Run an integration verification on the merged result.
7. Log failures and reasons in `tasks/lessons.md`.
| Parallel-safe | Sequential-only |
|---|---|
| Independent API modules in different folders | Task B reads Task A's output |
| Separate research questions | Shared config edits |
| Per-package builds in a monorepo | Same-file mutations |
| Per-file lint or type-check passes | Migration scripts that order-depend |
| Spec field | Required |
|---|---|
| Goal | One sentence |
| Files owned | Directory or explicit list |
| Files forbidden | "DO NOT touch" list |
| Verification | Tests this agent must pass before returning |
| Return format | What the agent reports back |
Use view on tasks/todo.md. List tasks with empty or already-satisfied dependency sets. Cross-check file scopes: any overlap → sequential, not parallel.
## Parallelizable
- [ ] Task A: User API endpoints (`src/api/users/`)
- [ ] Task B: Product API endpoints (`src/api/products/`)
- [ ] Task C: Migration scripts (`src/db/migrations/`)
## Sequential (depends on A+B+C)
- [ ] Task D: Integration tests for all endpoints
Each spec is self-contained — no agent should need to ask "what do I do?":
### Agent 1 Spec: User API Endpoints
Goal: Implement CRUD endpoints for users.
Files owned: src/api/users/ (create new); src/routes/index.ts (add one route line).
DO NOT touch: src/api/products/, src/db/.
Verification: All new tests in src/api/users/__tests__/ pass; existing tests unaffected.
Return: list of files created + test result summary.
Issue the sub-agent calls in a single tool-calling batch so they execute in parallel, not sequentially. Use the task tool with mode: background for any agent expected to take more than a few seconds.
For each returned agent:
view and git diff --stat.After all agents complete, run the full test suite and bash scripts/verify.sh --check on the combined result. Per-agent green does not imply combined green.
If one agent fails:
Do not block the others — let successes complete.
Diagnose: was the spec ambiguous? Hidden dependency missed?
Re-dispatch the failed task with a revised spec, or finish it sequentially.
Append to tasks/lessons.md:
- date: 2026-05-19
error_type: parallel-dispatch-failure
trigger: "Agent 2 needed Agent 1's output; was dispatched in parallel"
root_cause: "Implicit dependency not surfaced in tasks/todo.md"
fix: "Re-ran Agent 2 after Agent 1 completed"
rule: "Every parallel-eligible task must declare its dependencies explicitly"
tasks/todo.md — only zero-dep tasks dispatched in parallel.scripts/verify.sh --check passed on the combined result.tasks/lessons.md was updated with the root cause.