Coordinate multiple sub-agents to collaboratively complete long-horizon software engineering tasks using the CAID (Centralized Asynchronous Isolated Delegation) paradigm. Use when tasks require complex multi-file edits, interdependent subtasks, parallelizable work, or when a single agent would take too long. This skill implements branch-and-merge coordination with git worktree isolation, dependency-aware task delegation, and structured integration. CRITICAL: Never use CAID as a fallback after si
This skill implements the Centralized Asynchronous Isolated Delegation (CAID) paradigm for coordinating multiple agents working on shared artifacts.
⚠️ CRITICAL WARNINGS FROM PAPER:
- - Use CAID from the outset — Don't run single-agent first as fallback. Sequential strategy costs nearly 2x with minimal gain.
- Physical worktree isolation is mandatory — Soft isolation (instruction-only) degrades performance on complex tasks.
- Engineer limits are strict — 2 for PaperBench-style, 4 for Commit0-style, never exceed 8.
- Higher cost/runtime trade-off — CAID improves accuracy, not speed. Integration is sequential/test-gated.
Use CAID from the outset for:
Don't use as fallback: Running single-agent first then CAID is inefficient (cost/runtime nearly additive, minimal performance gain).
Use single-agent for:
Before ANY delegation, the manager must:
CODEBLOCK0
Manager's role: Before delegating, analyze the task structure:
Commit0-style tasks (clear file structure):
PaperBench-style tasks (inferred structure):
Dependency graph construction:
CODEBLOCK1
Create PHYSICALLY isolated worktrees (not soft isolation):
CODEBLOCK2
⚠️ WARNING: Soft isolation (same workspace, instruction-level constraints) degrades performance to below single-agent on PaperBench. Physical
git worktreeisolation is mandatory.
Key isolation principles:
__init__.py, config files, global constants — engineers must NOT commit changes to theseSTRICT Engineer Limits:
| Task Type | Max Engineers | Why |
|---|---|---|
| PaperBench-style | 2 | Inferred dependencies; more destabilizes |
| Commit0-style |
⚠️ Critical: Increasing engineers beyond optimal degrades performance due to integration overhead and conflict resolution costs.
Task prioritization heuristics:
Manager should prioritize tasks that:
Round definition:
One round = complete cycle of delegation → implementation → dependency update
Recommended iteration limits (from paper experiments):
| Role | Max Iterations |
|---|---|
| Manager | 50 |
| Each Engineer |
Delegation algorithm:
CODEBLOCK3
Task assignment JSON format (structured communication — NO free-form dialog):
CODEBLOCK4
Key: All communication uses structured JSON, not free-form dialog. This prevents inter-agent misalignment (primary failure mode in multi-agent systems).
Event loop pattern:
Engineer self-verification (MANDATORY before submission):
Merge workflow:
CODEBLOCK5
Main branch is single source of truth throughout execution.
To prevent context explosion, manager uses LLMSummarizingCondenser pattern:
CODEBLOCK6
Compressed execution history format:
CODEBLOCK7
State synchronization when main advances:
CODEBLOCK8
Worktree cleanup (after completion or limit reached):
CODEBLOCK9
Worktrees are deleted after all assigned tasks are completed or when the engineer reaches the predefined iteration limit.
Manager iteration limits (from paper):
After the asynchronous loop completes, the manager does a final review before submitting the final product.
Final review checklist:
CODEBLOCK10
For OpenClaw, the sessions_spawn tool enables parallel agent execution:
Spawn engineer agents:
CODEBLOCK11
Check progress:
CODEBLOCK12
When main advances, update worktrees:
CODEBLOCK13
This ensures engineers work from latest integrated state.
From paper analysis (Section 4.4):
| Strategy | Pass Rate | Runtime | When to Use |
|---|---|---|---|
| Round-Manager Review | 60.2% | 3689s | Maximum correctness required |
| Engineer Self-Verification |
Default: Engineer self-verification without repeated manager review.
| Pitfall | Solution |
|---|---|
| Using CAID as fallback after single-agent fails | Use from outset; sequential costs ~2x with minimal gain |
| Soft isolation (instruction-only) |
git worktree physical isolation |
| Too many engineers (>4-8) | Strict limits: 2 PaperBench, 4 Commit0, 8 absolute max |
| Skipping manager pre-setup | Always prepare runtime/stubs/entry points first |
| Skipping manager final review | Always do final verification before submission |
| Merge conflicts from concurrent edits | Group dependent files; engineer resolves own conflicts |
| Not cleaning up worktrees | Delete worktrees after completion/limit reached |
| Agents develop inconsistent views | Structured JSON only; no free-form dialog |
| Silent interference between agents | Explicit merge with test verification |
| Tasks not clearly defined | Build dependency graph before ANY delegation |
| Integration failures discovered late | Self-verification mandatory before commit |
| Context explosion | Use LLMSummarizingCondenser pattern |
| Missing restricted files | Mark __init__.py, configs as restricted |
CAID trade-offs (vs single-agent):
When worth it: Long-horizon shared-artifact tasks where correctness matters more than speed.
See references/examples.md for concrete implementation examples including:
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 caid-multi-agent-1775884048 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 caid-multi-agent-1775884048 技能
skillhub install caid-multi-agent-1775884048
文件大小: 12.52 KB | 发布时间: 2026-4-12 09:17