Use this skill to create one new OpenClaw agent and finish routing/config updates in one pass.
This skill is Feishu-only. Do not use it for Telegram, Slack, Discord, or other channels.
First align the user's target scenario, then collect fields. Ask only for missing required fields.
Scenario alignment question (must ask first):
routing_mode=account)routing_mode=peer)FieldRequiredNotesagent_idyeslowercase letters, digits, - onlyworkspaceyesuse absolute path for project workspacemodelnooptional model override for this agentrouting_modeyesaccount or peer``channelnofixed to feishu
For routing_mode=account (one bot per agent), collect:
account_id (required)app_id, app_secret, bot_name (optional but recommended)For routing_mode=peer (single bot, multi-group), collect:
peer_kind ( group or direct, required)peer_id (required)account_id (optional, narrows matching if provided)peer_id only after guided gates in Step 0.5dmScope.Ask this first:
text
你是要哪一种?
1) 新建一个机器人,对应一个新 Agent(account 路由)
2) 已有一个机器人,在新群里绑定一个新 Agent(peer 路由)
Map answer:
routing_mode=accountrouting_mode=peerIf answer is ambiguous, stop and clarify before editing config.
Apply this step when the user is doing multi-group multi-agent routing.
已创建群.已创建群, guide the user to send one message in that group to generate logs.已发送.已发送, check OpenClaw logs and extract chat_id (format oc_xxxxx).Suggested command:
bash
openclaw logs --follow
Expected signal in logs:
text
Received message from peer: { kind: "group", id: "oc_xxxxxxxxxxxxxxxx" }
Run:
bash
test -f ~/.openclaw/openclaw.json
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak.$(date +%Y%m%d%H%M%S)
If config file is missing, stop and ask user to initialize OpenClaw first.
Run OpenClaw CLI first (required):
bash
openclaw agents add <agent_id> --workspace <workspace> --non-interactive
If model is provided:
bash
openclaw agents add <agent_id> --workspace <workspace> --model <model> --non-interactive
openclaw.json#Use the bundled script:
bash
python3 scripts/upsert_openclaw_agent.py \
--config ~/.openclaw/openclaw.json \
--agent-id <agent_id> \
--routing-mode <account|peer> \
[--account-id <account_id>] \
[--app-id <app_id>] \
[--app-secret <app_secret>] \
[--bot-name <bot_name>] \
[--peer-kind <group|direct>] \
[--peer-id <peer_id>]
Run from this skill folder, or replace scripts/upsert_openclaw_agent.py with its absolute path.
Script behavior:
channels.<channel>.accounts.<account_id> when account mode is usedsession.dmScope = per-account-channel-peer for multi-agent Feishu setupRead references/routing-modes.md when routing choice is unclear.
Run:
bash
openclaw gateway restart
openclaw agents list --bindings
Validate:
Return:
dmScope changedchannel=feishu only.已创建群 and then 已发送.