dot_claude/skills/multi-agent-orchestration/SKILL.md
Use when work can be decomposed into independent, parallelizable tasks - Planner/Worker/Judge pattern for spawning subagents with bounded scope, clear acceptance criteria, and quality gates before merging results | 作業を独立した並列化可能なタスクに分解できる場合に使用 - 境界付きスコープ、明確な受け入れ基準、マージ前の品質ゲートを持つサブエージェント生成のためのPlanner/Worker/Judgeパターン
npx skillsauth add lv416e/dotfiles multi-agent-orchestrationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Sequential execution of parallelizable work is wasted time. But naive parallelization creates merge conflicts, duplicated effort, and incoherent results.
Core principle: Decompose into independent bounded tasks, execute in parallel with isolated contexts, verify before merging. The orchestrator thinks; the workers execute; the judge validates.
Violating task boundaries is violating the entire pattern.
EACH AGENT GETS ONE BOUNDED TASK WITH CLEAR ACCEPTANCE CRITERIA
If you cannot write a two-sentence task description with a concrete "done when" condition, the task is not ready for delegation.
Use when work decomposes into independent units:
Use this ESPECIALLY when:
Do NOT use when:
The Planner never writes code. The Planner decomposes, delegates, and coordinates.
Responsibilities:
Each Worker receives ONE bounded task and works in isolation.
Characteristics:
The Judge reviews Worker output against acceptance criteria.
Characteristics:
BEFORE spawning any agents:
Map the Work
Find Independence
Write Task Specifications
Each task spec MUST include:
TASK: [One-sentence description]
SCOPE: [Exact files/modules/functions this task may touch]
INPUT: [What the agent needs to know — context, requirements, examples]
ACCEPTANCE CRITERIA: [Concrete "done when" conditions]
CONSTRAINTS: [What the agent must NOT do — files to avoid, patterns to follow]
Verify Decomposition
Each Worker needs an isolated context. Two strategies:
REQUIRED SUB-SKILL: Use using-git-worktrees to create one worktree per Worker.
# Orchestrator creates worktrees before spawning Workers
git worktree add .worktrees/task-auth -b orchestrate/task-auth
git worktree add .worktrees/task-api -b orchestrate/task-api
git worktree add .worktrees/task-tests -b orchestrate/task-tests
Why worktrees: Each Worker gets a full working copy. No merge conflicts during execution. Workers can build and test independently.
When Workers produce output that doesn't modify the repository:
Spawn Workers using the Task tool with precise prompts.
Each Task tool invocation MUST include:
Task prompt template:
You are a Worker agent. Complete this task and NOTHING ELSE.
TASK: Write unit tests for the authentication module.
SCOPE: Only modify files in src/auth/__tests__/
INPUT: The auth module exposes login(), logout(), refreshToken().
Each function returns a Promise. See src/auth/index.ts for signatures.
ACCEPTANCE CRITERIA:
- Tests cover all three exported functions
- Tests cover success and error paths
- All tests pass when run with `npm test -- --testPathPattern=auth`
- No modifications outside src/auth/__tests__/
CONSTRAINTS:
- Do NOT modify source code, only test files
- Use existing test utilities from test/helpers.ts
- Follow test naming patterns from src/users/__tests__/ as reference
Working directory: /project/.worktrees/task-auth-tests
When complete, report: PASS (all criteria met) or FAIL (which criteria unmet and why).
Parallel execution:
After all Workers complete:
Collect Results
Merge Strategy (for code changes)
# Start from main development branch
git checkout main
# Merge each Worker's branch
git merge orchestrate/task-auth --no-edit
git merge orchestrate/task-api --no-edit
git merge orchestrate/task-tests --no-edit
If merge conflict:
Merge Strategy (for non-code output)
BEFORE declaring done, spawn a Judge agent.
You are a Judge agent. Review the following work against its acceptance criteria.
ORIGINAL TASK: [paste full specification]
WORKER OUTPUT: [paste result or point to changed files]
Evaluate EACH acceptance criterion:
- MET / NOT MET with specific evidence
Final verdict: PASS (all criteria met) or FAIL (list unmet criteria).
Do NOT fix anything. Only evaluate.
If Judge returns FAIL:
| Situation | Action | |-----------|--------| | Worker reports FAIL | Re-read its output. Is the task spec wrong? Fix spec and re-dispatch. Is the code genuinely broken? Fix in a new focused Worker. | | Worker modifies files outside its SCOPE | Discard that Worker's output entirely. The boundary violation means results are untrustworthy. Re-dispatch with stricter constraints. | | Merge conflict between Worker branches | Resolve manually. This means your decomposition had overlapping scopes. Document and prevent next time. | | Worker hangs or produces no output | Kill and re-dispatch. Likely the task spec was ambiguous or the scope was too large. Break it down further. | | Judge returns FAIL on specific criteria | Spawn a NEW Worker to fix only the failing criteria. Do not re-run the entire task. | | Multiple Workers fail on the same issue | STOP orchestration. Shared problem indicates missing context in Phase 1. Re-analyze before re-dispatching. |
DECOMPOSITION:
Task 1: Write unit tests for src/auth/ → worktree: task-auth-tests
Task 2: Write unit tests for src/billing/ → worktree: task-billing-tests
Task 3: Write unit tests for src/notifications/ → worktree: task-notif-tests
WHY PARALLELIZABLE: Each test suite touches only its own __tests__/ directory.
No shared files. No shared state.
MERGE: Fast-forward merges (no conflicts possible if scopes are respected).
JUDGE: Run full test suite. All tests pass. No regressions.
DECOMPOSITION:
Task 1: Add REST endpoint for /api/export (src/api/export.ts, src/api/export.test.ts)
Task 2: Add CSV formatter (src/formatters/csv.ts, src/formatters/csv.test.ts)
Task 3: Add email delivery integration (src/delivery/email.ts, src/delivery/email.test.ts)
WHY PARALLELIZABLE: Each feature is in a separate module with a defined interface.
Workers implement to the interface spec, not to each other's code.
MERGE: Sequential merges. Integration test after all merges.
JUDGE: Each module works in isolation. Integration test passes.
DECOMPOSITION:
Task 1: Review PR #42 for correctness and edge cases
Task 2: Review PR #43 for security implications
Task 3: Review PR #44 for performance impact
WHY PARALLELIZABLE: Each review is independent read-only analysis.
No file modifications. No worktrees needed.
MERGE: Collect all review comments. Deduplicate if PRs overlap.
JUDGE: Not needed (reviews are already evaluative).
If you catch yourself thinking:
ALL of these mean: Your decomposition is wrong. Return to Phase 1.
| Excuse | Reality | |--------|---------| | "Tasks are mostly independent, a little overlap is fine" | A little overlap guarantees merge conflicts. Eliminate overlap or sequence the dependent parts. | | "I'll coordinate between Workers as they go" | Workers are isolated. Mid-task coordination means the task wasn't properly specified. | | "One big task is easier than decomposing" | One big task is sequential. Decomposition is the entire point. If it can't decompose, don't use this pattern. | | "The Judge step is overhead, I'll skip it" | Skipping quality gates means shipping unverified work. The Judge catches what each Worker misses about the whole. | | "I'll parallelize everything for maximum speed" | Over-parallelization creates merge hell. Parallelize ONLY what is truly independent. | | "Workers can figure out the details" | Vague specs produce vague results. Every minute spent on task specs saves ten minutes of rework. | | "Just spawn more agents for more speed" | Diminishing returns. Communication overhead grows. 3-5 parallel Workers is usually the sweet spot. | | "I'll fix the boundaries after seeing what conflicts" | Fix boundaries BEFORE execution. Post-hoc conflict resolution is the expensive path. |
| Phase | Key Activities | Success Criteria | |-------|---------------|------------------| | 1. Decompose | Map work, find independence, write task specs | Each task has bounded scope, clear criteria, zero overlap | | 2. Isolate | Create worktrees or scope boundaries | Each Worker has isolated workspace | | 3. Execute | Spawn Workers in parallel via Task tool | All Workers complete with PASS status | | 4. Merge | Combine results, resolve any conflicts | Clean merges, integrated output | | 5. Judge | Quality gate review against criteria | All acceptance criteria verified MET |
This skill requires using:
Complementary skills:
Called by:
Can tasks run without knowing each other's output?
YES → Parallel (use this skill)
NO → Do they form a strict chain (A→B→C)?
YES → Sequential (don't use this skill)
NO → Partial: group independent tasks, sequence dependent groups
The overhead rule: If you have fewer than 3 independent tasks, or each task takes under 2 minutes, the orchestration overhead exceeds the parallelization benefit. Just do them sequentially.
development
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization | 新しいスキルの作成、既存スキルの編集、またはデプロイ前にスキルが機能するか検証する際に使用 - プロセスドキュメントにTDDを適用し、記述前にサブエージェントでテストし、合理化に対して堅牢になるまで反復
development
Use when design is complete and you need detailed implementation tasks for engineers with zero codebase context - creates comprehensive implementation plans with exact file paths, complete code examples, and verification steps assuming engineer has minimal domain knowledge | 設計が完了し、コードベースの知識がゼロのエンジニア向けに詳細な実装タスクが必要な場合に使用 - 正確なファイルパス、完全なコード例、検証ステップを含む包括的な実装計画を作成。エンジニアの領域知識が最小限であることを前提
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.