add-agent

A guided command for adding support for another coding agent to an application. An agent adapter connects that coding tool's events and settings to the application.

In plain words
What is it for?
Use it to gather an agent's CLI and configuration details, create its Rust adapter, register its profile, map its events, and add routing tests.
Why use it?
It turns an open-ended integration into a fixed sequence of questions, reference checks, implementation, registration, and tests. This helps ensure the new adapter is wired into all required places.

Command for Claude Code

Install

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.

agentmods
npx agentmods add commands/shirenchuang/agentbro/add-agent
Clone the repo
git clone --depth 1 https://github.com/shirenchuang/agentbro

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 672 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00019 $0.00672
Opus 5 $0.00010 $0.00336
Sonnet 5 $0.00004 $0.00134
Haiku 4.5 $0.00002 $0.00067

Measured yesterday against content hash b35eac9f4403, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-agent 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 yesterday.

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.

.claude/commands/add-agent.md · 60 lines

What it actually says

要新增的 Agent: $ARGUMENTS

按下面的步骤执行,每一步做完简短汇报再做下一步。不要并行,不要跳步。

1. 摸清需求

先问用户(用 AskUserQuestion):

  • 该 Agent 的 CLI 命令名是什么(用于 which 检测)?
  • Hook 配置格式是 JSON / YAML / TOML / 自定义?
  • 配置文件相对路径(相对用户 home,比如 .foo/config.toml)?
  • 希望支持哪些事件(SessionStart / ToolUse / Notification …)?

2. 读参考实现

并行读这三个文件,建立模板印象:

  • src-tauri/src/agents/traits.rs —— trait 定义
  • src-tauri/src/agents/kimi.rs —— 最简 TOML 实现 + 测试模板
  • src-tauri/src/agents/profiles.rs —— 第 642 行起的 kimi_profile() 模板

3. 写适配器

src-tauri/src/agents/<agent-name>.rs 写新文件,模板基于 kimi.rs只有 parse_event 里的事件名映射is_installed 检测 是 Agent 特异的。

4. 注册

修改 src-tauri/src/agents/mod.rs:

  • 顶部加 pub mod <agent_name>;
  • all_adapters()(第 214 行附近) 加 Box::new(<agent_name>::<Name>Adapter::new())
  • impl_default_adapter! 宏(第 255 行附近)加 <agent_name>::<Name>Adapter

修改 src-tauri/src/agents/profiles.rs:

  • pub fn <name>_profile() -> AgentIntegrationProfile { ... }
  • profile_for_agent() 的 match 里加 "<name>" => Some(<name>_profile()),

5. 写测试

在新文件底部加 #[cfg(test)] mod tests,至少覆盖:

  • SessionStart 路由
  • PreToolUse / PostToolUse 路由
  • 一个失败/错误事件路由

6. 提示用户人工补的部分

输出一段清单告诉用户:

  • src/components/notch/AgentIcon.tsx(或对应映射处)补 icon
  • src/i18n/locales/{en,zh,ja,ko,tr}.json 五份文件都补展示名
  • README.mdREADME.en.md 的"支持的 Agent"表加一行

(这些涉及视觉素材和措辞,建议人工而非 AI 完成。)

7. 收尾

运行 /check。全绿后回报最终改动文件清单。

Changes

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.

  1. yesterday First seen · 60 lines · 19 tokens per session scan A b35eac9f4403

Subscribe to this mod's changes

add-agent is a command published in the GitHub repository shirenchuang/agentbro (212 stars, last pushed 28d ago), licensed Apache-2.0. It adds 19 tokens to every session and 672 once invoked, about $0.0001 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.