بنقرة واحدة
add-agent
引导向 agent_roster 追加新 Agent,配置名称、触发 mention、Backend、Persona 和工作目录。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
引导向 agent_roster 追加新 Agent,配置名称、触发 mention、Backend、Persona 和工作目录。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Backend-agnostic team coordination workflow for lead agents.
Backend-agnostic team coordination workflow for specialist agents.
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
引导添加外部 ACP Agent Backend(如 claude-code、codex、qwen、goose 等),配置到 config.toml 的 [[backend]] 中。
引导配置钉钉(DingTalk)Channel,包括企业应用创建、机器人配置、Webhook 接入和连通性验证。
引导配置飞书(Lark/Feishu)Channel,包括 App 创建、Webhook 配置、config.toml 写入和连通性验证。
| name | add-agent |
| description | 引导向 agent_roster 追加新 Agent,配置名称、触发 mention、Backend、Persona 和工作目录。 |
向 ~/.clawbro/config.toml 的 [[agent_roster]] 追加一个新 Agent。
每个 Agent 可以:
[ -f ~/.clawbro/config.toml ] && echo "✓ config.toml 存在" || echo "⚠ 请先运行 /setup"
echo "--- 当前已有 Agents ---"
grep -A 6 '\[\[agent_roster\]\]' ~/.clawbro/config.toml 2>/dev/null || echo "(暂无 agent_roster)"
echo "--- 可用 Backends ---"
grep -A 1 '\[\[backend\]\]' ~/.clawbro/config.toml 2>/dev/null | grep '^id' | sed 's/id *= */ /' || echo "(无 backend 配置)"
询问:Agent 的名称是什么?
命名规则:
claude、codex、researcher、rex、coder询问:用户在群聊中用什么 @mention 触发这个 Agent?(可以有多个别名)
示例:
["@claude"]["@代码助手", "@coder"]["@rex", "@Rex"]注意:群聊的 @mention 触发受
require_mention_in_groups控制。
询问:这个 Agent 使用哪个 Backend?
显示可选列表:
echo "可用 Backends:"
grep 'id = ' ~/.clawbro/config.toml | grep -A0 'backend' | awk '{print " " $3}' || true
# 以及内置选项
echo " native-main (内置 clawbro-rust-agent,默认)"
echo " claude-code (如果已通过 /add-acp-backend 添加)"
echo " codex (如果已通过 /add-acp-backend 添加)"
如果用户想用的 Backend 不存在,提示:
Backend "<name>" 不存在,请先运行 /add-acp-backend 添加它,然后再回来配置这个 Agent。
询问:这个 Agent 的工作目录是什么?(Agent 运行时的"当前目录",影响文件操作的相对路径)
示例:
/Users/xxx/projects/my-app — 代码助手专注于某个项目
/Users/xxx/documents — 文档助手处理文档
(留空 = 使用 Gateway 全局 default_workspace)
询问:是否为这个 Agent 配置个性(Persona)?
Persona 目录下可以放:
- SOUL.md — 核心性格和行为准则
- IDENTITY.md — Agent 的身份定义(包含 MBTI、名字、emoji 等)
- soul-injection.md — 注入到系统提示词的额外内容
示例目录:~/.clawbro/personas/rex
如果不需要独立个性,留空(将使用全局 shared memory)。
如果用户想创建 Persona,询问目录路径,并提示:
mkdir -p <persona_dir>
# 然后可以手动创建 SOUL.md 和 IDENTITY.md
询问:是否设为某个 Channel 的默认 Agent(当没有被 @mention 时使用)?
如果是,询问:
channel:lark、channel:dingtalk、scope:group:xxx)根据收集的信息生成 [[agent_roster]] 段:
[[agent_roster]]
name = "<name>"
mentions = [<mention-list>]
backend_id = "<backend-id>"
<如有 workspace_dir>workspace_dir = "<路径>"
<如有 persona_dir>persona_dir = "<路径>"
如需默认 binding,额外生成:
[[binding]]
kind = "channel"
channel = "<channel>"
agent = "<name>"
# 备份
cp ~/.clawbro/config.toml ~/.clawbro/config.toml.bak.$(date +%Y%m%d%H%M%S)
# 追加 agent_roster 配置
cat >> ~/.clawbro/config.toml << 'TOMLEOF'
[[agent_roster]]
name = "<name>"
mentions = [<mentions>]
backend_id = "<backend-id>"
<如有>workspace_dir = "<路径>"
<如有>persona_dir = "<路径>"
TOMLEOF
<如有 binding>cat >> ~/.clawbro/config.toml << 'TOMLEOF'
[[binding]]
kind = "channel"
channel = "<channel>"
agent = "<name>"
TOMLEOF
echo "✓ Agent '<name>' 已添加到 roster"
echo "--- 更新后的 agent_roster ---"
grep -A 8 '\[\[agent_roster\]\]' ~/.clawbro/config.toml
echo ""
echo "--- 验证配置语法(重启 Gateway)---"
source ~/.clawbro/.env && clawbro-gateway &
GATEWAY_PID=$!
sleep 2
PORT=$(cat ~/.clawbro/gateway.port 2>/dev/null || echo "8080")
curl -s http://127.0.0.1:$PORT/health
kill $GATEWAY_PID
✓ Agent '<name>' 已成功添加!
触发方式:在群聊中 @<mention> + 消息
Backend:<backend-id>
工作目录:<workspace_dir | 全局默认>
Persona:<persona_dir | 无>
如需开启 Team 模式(Lead + Specialists),请运行:/add-team-mode
# 内置 Agent(代码助手)
[[agent_roster]]
name = "coder"
mentions = ["@coder", "@代码助手"]
backend_id = "native-main"
workspace_dir = "/Users/xxx/projects"
# Claude Code Agent(需要先 /add-acp-backend)
[[agent_roster]]
name = "claude"
mentions = ["@claude", "@Claude"]
backend_id = "claude-code"
workspace_dir = "/Users/xxx/projects"
# Rex — 带 Persona 的研究助手
[[agent_roster]]
name = "rex"
mentions = ["@rex", "@Rex"]
backend_id = "native-main"
persona_dir = "/Users/xxx/.clawbro/personas/rex"
# 绑定:默认用 coder(无 mention 时)
[[binding]]
kind = "channel"
channel = "lark"
agent = "coder"