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/cyijun/agent-smith/agent-smithnpx skills add cyijun/agent-smith --skill agent-smithgit clone --depth 1 https://github.com/cyijun/agent-smithWrote 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/cyijun/agent-smith/agent-smith)<a href="https://agentmods.dev/skills/cyijun/agent-smith/agent-smith"><img src="https://agentmods.dev/badge/skills/cyijun/agent-smith/agent-smith.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 | $0.00033 | $0.02784 |
| Opus 5 | $0.00016 | $0.01392 |
| Sonnet 5 | $0.00007 | $0.00557 |
| Haiku 4.5 | $0.00003 | $0.00278 |
Grade A, and why
agent-smith 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.
How it starts
The opening of the file, as written. The whole thing — 263 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Smith
实现递归自相似多智能体系统的 Skill。每个智能体(史密斯)拥有独立的工作空间,通过目录隔离协议达成无冲突的并行任务分解与执行。
Overview
Agent Smith 是一个递归自相似的多智能体协作框架。每个智能体(史密斯)遵循相同的协议,在自己的工作空间内独立运行,通过父子间的 inbox/outbox 通信完成复杂任务的分解与汇总。
When to Use
在以下场景触发本 Skill:
- 用户请求"创建多智能体系统"或"设置 Agent Smith"
- 任务需要分解为多个并行子任务
- 需要协调多个 Agent 同时工作
- 复杂任务需要递归分解处理
- 要求无冲突的并行执行环境
When NOT to Use
在以下场景请勿触发本 Skill:
- 单个 Agent 可在 15 分钟内独立完成的任务
- 子任务之间存在严格线性依赖(每一步必须等待上一步完成)
- 仅需单 Agent 即可完成,并行执行无收益
- 任务已充分细化,无需进一步分解
Hard Constraints (Quick Reference)
以下限制由史密斯协议强制执行。修改这些值需要同时更新 SKILL.md 和 smith.md。
| 限制 | 值 |
|---|---|
| 最大递归深度 | 3(Level 0 根节点 → 最大 Level 3) |
| 每层最大子代理数 | 5 |
| Level ≥ 3 行为 | 禁止分解,必须直接执行 |
核心概念
史密斯 (Smith) 是自相似的智能体单元,每个史密斯拥有唯一 ID 和层级,能够执行任务、分解任务、创建子史密斯并汇总结果。所有史密斯遵循相同的协议,形成递归结构。
所有史密斯均受上述 Hard Constraints 约束。
无冲突协议 通过严格的目录隔离实现并行安全:每个史密斯只能写入自己的 private/ 和 outbox/,只能读取自己 inbox/ 中父史密斯分配的任务。父史密斯拥有创建子目录和写入子史密斯 inbox 的专属权限。
目录结构
.agent-smith/
├── smiths/
│ ├── smith-root/ # 根史密斯
│ │ ├── smith.md # 史密斯定义(只读)
│ │ ├── inbox/ # 任务队列(外部/父写入,自己读取)
│ │ ├── private/ # 私有工作区
│ │ ├── outbox/ # 结果输出
│ │ │ └── result.md
│ │ └── children/ # 子史密斯目录
│ │ └── smith-001/
│ │ ├── smith.md
│ │ ├── inbox/ # 父写入,子读取
│ │ ├── private/
│ │ ├── outbox/
│ │ └── children/
└── results/
└── final.md # 最终结果
初始化矩阵
当用户请求初始化 Agent Smith 时,执行以下步骤:
1. 创建目录结构
创建根史密斯环境:
.agent-smith/smiths/smith-root/inbox/—— 任务队列.agent-smith/smiths/smith-root/private/—— 私有工作区.agent-smith/smiths/smith-root/outbox/—— 结果输出.agent-smith/smiths/smith-root/children/—— 子史密斯容器.agent-smith/results/—— 最终结果
2. 读取 smith.md 模板
从 smith.md 读取史密斯定义模板。
3. 替换占位符
替换模板中的变量:
{SMITH_ID}→smith-root{PARENT_ID}→none{LEVEL}→0
4. 写入根史密斯定义
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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 · 263 lines · 33 tokens per session scan A 5ad6784c3a3b
agent-smith is a skill published in the GitHub repository cyijun/agent-smith (25 stars, last pushed 4mo ago), licensed MIT. It adds 33 tokens to every session and 2,784 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
openspec-verify-change
Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.
openspec-new-change
Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.
writing
将共享历史中的已验证事实和计算结果整理成符合受众、格式与长度约束的成稿。.
extract
Run the full Semantica semantic extraction pipeline on a file or selected text — NER, relations, events, coreference resolution, triplets, and validation. Clears result cache before each run. Returns Markdown tables with entity/relation/event/triplet results and inline validator warnings.
gsd-audit-milestone
Audit milestone completion against original intent before archiving.
kayba-stage-7-fixer
Implement the approved fixes from the action plan and log all changes. Trigger when the user says "run stage 7", "implement fixes", "apply action plan", or when invoked by the kayba-pipeline orchestrator. Requires eval/actionplan.md to exist.