openclaw-create-agent

Create and wire a new OpenClaw agent with a fixed workflow. Use when the user asks to create/add a new OpenClaw agent or says “我要创建一个新的 Agent”, automate multi-agent setup for Feishu, modify ~/.openclaw/openclaw.json channel accounts, bindings, and session.dmScope, or run follow-up commands such as gateway restart and binding verification.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "openclaw-create-agent" with this command: npx skills add xiaowen-0725/openclaw-create-feishu-agent-skills

OpenClaw Create Agent

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.

Required Inputs

First align the user's target scenario, then collect fields. Ask only for missing required fields.

Scenario alignment question (must ask first):

  • Option A: create a new bot/app and map it to a new agent (routing_mode=account)
  • Option B: map an existing/new group to a new agent under one bot (routing_mode=peer)
FieldRequiredNotes
agent_idyeslowercase letters, digits, - only
workspaceyesuse absolute path for project workspace
modelnooptional model override for this agent
routing_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)
  • if this is a new group, collect peer_id only after guided gates in Step 0.5

Workflow

  1. Align scenario (new bot per agent or multi-group per agent).
  2. For multi-group scenarios, run guided gates in Step 0.5.
  3. Read current config and backup.
  4. Create agent runtime with OpenClaw CLI.
  5. Upsert config for channel account, binding, and dmScope.
  6. Restart gateway and verify.
  7. Return a concise change summary.

Step 0: Align Requirement

Ask this first:

你是要哪一种?
1) 新建一个机器人,对应一个新 Agent(account 路由)
2) 已有一个机器人,在新群里绑定一个新 Agent(peer 路由)

Map answer:

  • option 1 -> routing_mode=account
  • option 2 -> routing_mode=peer

If answer is ambiguous, stop and clarify before editing config.

Step 0.5: Multi-Group Guided Gates

Apply this step when the user is doing multi-group multi-agent routing.

  1. Guide the user to create a new group and add the bot into that group.
  2. Pause and wait for explicit confirmation: 已创建群.
  3. Only after receiving 已创建群, guide the user to send one message in that group to generate logs.
  4. Pause and wait for explicit confirmation: 已发送.
  5. Only after receiving 已发送, check OpenClaw logs and extract chat_id (format oc_xxxxx).

Suggested command:

openclaw logs --follow

Expected signal in logs:

Received message from peer: { kind: "group", id: "oc_xxxxxxxxxxxxxxxx" }

Step 1: Precheck and Backup

Run:

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.

Step 2: Create Agent Runtime

Run OpenClaw CLI first (required):

openclaw agents add <agent_id> --workspace <workspace> --non-interactive

If model is provided:

openclaw agents add <agent_id> --workspace <workspace> --model <model> --non-interactive

Step 3: Upsert openclaw.json

Use the bundled script:

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:

  • upsert channels.<channel>.accounts.<account_id> when account mode is used
  • upsert one binding for this agent
  • always enforce session.dmScope = per-account-channel-peer for multi-agent Feishu setup

Read references/routing-modes.md when routing choice is unclear.

Step 4: Restart and Verify

Run:

openclaw gateway restart
openclaw agents list --bindings

Validate:

  • target agent appears in list
  • binding points to expected channel/account or channel/peer

Step 5: Report Output

Return:

  • created/updated binding match
  • whether account entry was added/updated
  • whether dmScope changed
  • verification command results

Constraints

  • Preserve existing unrelated agents/accounts/bindings.
  • Reject route conflicts (same channel/account/peer route already used by another agent).
  • Avoid interactive prompts unless user explicitly asks for interactive mode.
  • Assume channel=feishu only.
  • In multi-group scenarios, do not continue past Step 0.5 until receiving 已创建群 and then 已发送.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

技能编辑器

编辑、完善或审查 AgentSkills。当需要创建新技能、对现有 SKILL.md 进行修改、清理/审计/整理技能文件时激活此技能。触发词:编辑技能, skill 注意事项, metadata 检查, 完善技能, 清理技能, 审计技能, skill 规范, 编写 skill, 新建技能

Registry SourceRecently Updated
Automation

全闭环管道

全闭环自动化管道 — Hunter→Skill Factory→Orchestrator→Dashboard→Profit。将Phase 1-3所有组件串联为自动运行的超级管道。核心能力:(1) 一键全流程 (2) 定时自动运行 (3) 异常自愈 (4) 利润报告

Registry SourceRecently Updated
Automation

智美人AI实战课

《智美人AI Agent实战课》配套技能——从0到1搭建AI Agent的完整课程体系。第01节:AI Agent基础概念+工具链搭建。课程内容含数字人讲解视频、实战代码、课后练习。覆盖:OpenClaw配置、技能安装、MCP工具、多Agent协同、变现实战。

Registry SourceRecently Updated
Automation

利润优化引擎

利润优化引擎 — 订单管理/计价/结算模拟。核心能力:(1) 订单管理 (2) 计价模型 (3) 成本追踪 (4) 利润计算

Registry SourceRecently Updated