Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/mateaix/mateclaw/multi_agent_collaborationnpx skills add mateaix/mateclaw --skill multi_agent_collaborationgit clone --depth 1 https://github.com/mateaix/mateclawWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00037 | $0.00884 |
| Opus 5 | $0.00018 | $0.00442 |
| Sonnet 5 | $0.00007 | $0.00177 |
| Haiku 4.5 | $0.00004 | $0.00088 |
Grade A, and why
multi_agent_collaboration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
92% identical to chat_with_agent — 113 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
What it actually says
多 Agent 协作
何时使用
当任务明显需要多个专业 Agent 共同完成,或用户明确要求多 Agent 协作时使用。
应该使用
- 任务可拆分为多个专业子域,每个子域有对应 Agent
- 多个独立子任务可以并行执行(节省时间)
- 需要来自不同 Agent 的结果进行综合分析
- 用户明确要求"让 A 和 B 一起做"
不应使用
- 一个 Agent 可以完成,无需分工
- 只是简单咨询,用
chat_with_agent即可 - 刚收到某 Agent 的消息,不要立刻回调它(防死循环)
两种协作模式
模式一:串行(有依赖关系)
B 的任务需要 A 的结果时使用:
# 第一阶段:A 完成
result_a = delegateToAgent(
agentName="research-agent",
task="[来自 Agent coordinator 的请求] 收集最新 AI 大模型基准测试数据,返回原始数据表格。"
)
# 第二阶段:B 基于 A 的结果处理
result_b = delegateToAgent(
agentName="data-analyst",
task="[来自 Agent coordinator 的请求] 基于以下数据生成分析报告和可视化建议:\n\n" + result_a
)
模式二:并行(互相独立)
多个子任务之间没有依赖时使用,最多同时 3 个:
results = delegateParallel(
tasksJson="[
{\"agentName\": \"research-agent\", \"task\": \"[来自 Agent coordinator 的请求] 搜索竞品 A 的最新功能更新\"},
{\"agentName\": \"data-analyst\", \"task\": \"[来自 Agent coordinator 的请求] 分析我们产品上月用户留存数据\"},
{\"agentName\": \"writer-agent\", \"task\": \"[来自 Agent coordinator 的请求] 起草本次竞品分析报告的大纲\"}
]"
)
所有任务完成后一次性返回全部结果,再由当前 Agent 整合。
完整工作流程
第一步:查询可用 Agent
listAvailableAgents()
根据各 Agent 的描述分配任务。
第二步:判断串行 or 并行
| 判断条件 | 模式 |
|---|---|
| 子任务 B 依赖子任务 A 的结果 | 串行 |
| 子任务互相独立,可同时进行 | 并行 |
| 混合(部分有依赖) | 先并行无依赖任务,再串行有依赖任务 |
第三步:分配并执行
使用对应模式(见上)。
第四步:整合结果
由当前 Agent(编排者)负责整合所有 Agent 的返回结果,形成最终回复。不要把整合工作再委托给某个子 Agent。
关键规则
- 任务说明中加
[来自 Agent <名称> 的请求]帮助目标 Agent 识别来源 - 并行任务数量不超过 3 个;超过时按优先级分批
- 不让两个 Agent 互相调用对方(会形成死循环)
- 整合由编排者负责,不再向下委托
- 如需上下文连贯,在
task中附带前一阶段的关键结论
与 chat_with_agent 的区别
| 技能 | 场景 |
|---|---|
chat_with_agent |
一对一,咨询或单任务委托 |
multi_agent_collaboration |
一对多,多 Agent 分工、并行或串行编排 |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 105 lines · 37 tokens per session scan A 6a70783ddc2b
multi_agent_collaboration is a skill published in the GitHub repository mateaix/mateclaw (1,061 stars, last pushed 2d ago), licensed Apache-2.0. It adds 37 tokens to every session and 884 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to chat_with_agent, differing in 113 lines, and is treated as a copy.
Other skills, from other repositories
make-skill
Use this skill when sedimenting a session into a reusable workspace skill. Triggers when the user wants to turn the current conversation, workflow, or troubleshooting path into a SKILL.md. Phrases like 'turn this into a skill', 'remember how I did X', 'save this workflow', 'make a skill from this', and any /make-skill…
make-skill
用于把当前会话沉淀为可复用的 workspace skill。当用户希望把当前对话、工作流或排错路径写成 SKILL.md 时触发。触发表达包括「把这个变成 skill」「记住我是怎么做 X 的」「保存这个工作流」「make a skill from this」以及任何 /make-skill 调用。.
terraform-skill
Use when working with Terraform or OpenTofu - creating modules, writing tests (native test framework, Terratest), setting up CI/CD pipelines, reviewing configurations, choosing between testing approaches, debugging state issues, implementing security scanning (trivy, checkov), or making infrastructure-as-code…
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of "Word doc", "word document", ".docx", or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when…
docx
当用户需要创建、读取、编辑或处理 Word 文档(.docx)时,使用此技能。触发场景包括提到“Word 文档”、“.docx”,或要求生成带目录、标题、页码、信头等格式的专业文档;也包括提取或重组 .docx 内容、插入或替换图片、在 Word 文件中查找替换、处理修订或批注,以及将内容整理为正式 Word 文档。如果用户要求生成“报告”“备忘录”“信函”“模板”等 Word / .docx 交付物,也应使用此技能。不要用于 PDF、电子表格、Google Docs,或与文档生成无关的一般编程任务。.
multi_agent_collaboration
Use this skill when another agent's expertise or context is needed, or when the user explicitly asks to involve another agent. First list agents, then use qwenpaw agents chat for two-way communication with replies.