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/rockyflux/yq-workflow/multi-agentnpx skills add rockyflux/yq-workflow --skill multi-agentgit clone --depth 1 https://github.com/rockyflux/yq-workflowWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/rockyflux/yq-workflow/multi-agent)<a href="https://agentmods.dev/skills/rockyflux/yq-workflow/multi-agent"><img src="https://agentmods.dev/badge/skills/rockyflux/yq-workflow/multi-agent.svg" alt="Measured on agentmods" height="20"></a>What 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.1 | $0.00049 | $0.04946 |
| Opus 5 | $0.00024 | $0.02473 |
| Sonnet 5 | $0.00010 | $0.00989 |
| Haiku 4.5 | $0.00005 | $0.00495 |
Grade A, and why
multi-agent scanned grade A with 1 finding 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 5d 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
| 走卒 (Drone) | 无人蚁 Drone | 天罗走卒 | 简单 bash 命令,零 LLM 成本 | Bash(仅此一个) | 无(execSync) | This is a copy
88% identical to multi-agent — 8 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.
How it starts
The opening of the file, as written. The whole thing — 534 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🕸 天罗秘典 · 多 Agent 协同(蚁群仿生版)
参考蚁群仿生架构:侦察→工作→审查→修复→完成,信息素间接通信,自适应并发。
蚁群生命周期
所有多 Agent 协同任务遵循统一生命周期:
目标 → 侦察(Scout) → 任务池 → 工蚁(Worker)并行执行 → 兵蚁(Soldier)审查 → 修复(如需) → 完成
│ │
│ 信息素衰减(过时信息自动失效) │ 子任务自动产生
└───────────────────────────┘
阶段定义
| 阶段 | 角色 | 动作 | 产出 |
|---|---|---|---|
| 🔍 侦察 | Scout | 探索代码库,标记关键文件和依赖 | 任务池 + 依赖图 |
| ⚒️ 工作 | Worker | 并行执行任务,可产生子任务 | 代码变更 + 进度信息素 |
| 🛡️ 审查 | Soldier | 审查所有变更,发现问题 | 修复任务 / 通过 |
| 🔧 修复 | Worker | 执行审查产生的修复任务 | 修复后的代码 |
| ✅ 完成 | Lead | 汇总报告,统一 commit | 最终交付 |
Codex 原生协同协议(强化)
在 Codex CLI 中,TeamCreate/Task 抽象统一映射到以下原生动作:
| 协同意图 | Codex 动作 | 约束 |
|---|---|---|
| 创建团队/子任务 | spawn_agent |
明确角色、文件所有权、完成定义 |
| 下发任务/追问 | send_input |
单条消息只包含一个目标动作 |
| 等待完成 | wait |
优先长等待,避免忙轮询 |
| 长耗时命令 | awaiter agent |
测试/构建/监控必须用 awaiter |
| 代码探索 | explorer agent |
探索结果视为权威,不重复检索 |
| 执行改动 | worker agent |
明确“只改分配文件” |
| 收尾回收 | close_agent |
任务结束必须关闭子 Agent |
执行顺序(不可跳步)
1. 拆解任务 + 文件锁定矩阵
2. spawn explorer/worker/awaiter
3. 并行执行 + wait 收敛
4. reviewer 审查 + 必要修复
5. 汇总结果 + close_agent 全量回收
何时启用多 Agent
TeamCreate vs Task(subagent) 决策树
收到任务 → 评估规模
│
├─ 涉及 ≥3 个独立文件/模块? → TeamCreate
├─ 需要 ≥2 个并行工作流? → TeamCreate
├─ 总步骤 >10 步? → TeamCreate
├─ 用户明确要求并行/团队? → TeamCreate
│
├─ 单一探索/搜索任务? → explorer agent
├─ 单文件独立操作? → worker agent
└─ 简单查询/单步操作? → 直接执行
铁律:当犹豫时,优先 TeamCreate。多 Agent 并行效率远高于串行 subagent。
满足任意 1 条即启用 TeamCreate:
| 条件 | 说明 | 示例 |
|---|---|---|
| 多文件独立变更 | ≥3 个无交叉依赖的文件 | 6 个新秘典各自独立 |
| 可并行子任务 | ≥2 个无数据依赖的工作流 | 前端+后端+文档 |
| 复杂度高 | 单 Agent 需 >10 步 | 全栈重构 |
| 时间紧迫 | 劫钟催命,需加速 | 紧急修复多服务 |
角色体系(蚁群映射)
| 角色 | 蚁群映射 | 道语 | 职责 | 工具权限 | 模型建议 |
|---|---|---|---|---|---|
| 主修 (Lead) | 蚁后 Queen | 天罗主修 | 任务分解、调度、汇总 | spawn_agent/send_input/wait/close_agent |
当前模型 |
| 斥候 (Scout) | 侦察蚁 Scout | 天罗斥候 | 只读探索,标记关键文件 | explorer + Read/Grep/Glob(只读) |
haiku(快速低成本) |
| 道侣 (Worker) | 工蚁 Worker | 天罗道侣 | 执行任务,可产生子任务 | worker + Read/Write/Edit/Bash |
sonnet/当前模型 |
| 护法 (Soldier) | 兵蚁 Soldier | 天罗护法 | 审查质量,发现问题 | worker(审查模式) + Read/Grep/Glob(只读) |
sonnet |
| 走卒 (Drone) | 无人蚁 Drone | 天罗走卒 | 简单 bash 命令,零 LLM 成本 | Bash(仅此一个) | 无(execSync) |
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.
- 5d ago First seen · 534 lines · 49 tokens per session scan A 781e7f163bd5
multi-agent is a skill published in the GitHub repository rockyflux/yq-workflow (2 stars, last pushed 3mo ago), licensed MIT. It adds 49 tokens to every session and 4,946 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). It is 88% identical to multi-agent, differing in 8 lines, and is treated as a copy.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…
chronicle
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…