← 返回
数据分析 中文

OpenClaw Agent Creator

Create new OpenClaw agents for Arch's multi-agent system. Use this skill when asked to create, add, or set up a new OpenClaw agent, or when adding an agent to the system defined in ~/.openclaw/. Covers the full lifecycle: directory creation, workspace files (SOUL.md, IDENTITY.md, etc.), openclaw.json config, Telegram routing (bindings + groups + mention patterns), cron job creation with proper prompt engineering, and gateway restart. Includes hard-won lessons from building the Wire (News) agent
为 Arch 多智能体系统创建新的 OpenClaw 智能体。当请求创建、添加或设置新智能体,或操作 ~/.openclaw/ 下的系统时使用。涵盖完整生命周期:目录创建、工作区文件(SOUL.md、IDENTITY.md 等)、openclaw. 配置、Telegram 路由(绑定、群组及提及模式)、含提示词工程的定时任务创建及网关重启。亦适用于修改现有智能体配置、添加定时任务或调试路由问题。
arch1904
数据分析 clawhub v1.0.0 1 版本 99708.2 Key: 无需
★ 0
Stars
📥 1,367
下载
💾 29
安装
1
版本
#latest

概述

OpenClaw Agent Creator

Create and configure agents for Arch's OpenClaw multi-agent system at ~/.openclaw/.

System Context

  • Owner: Archit (Arch), Linux user archit, timezone America/Denver
  • Gateway: Single process on port 18789 managing all agents
  • Bot: One Telegram bot shared across all agents — routing determines which agent handles which chat
  • Existing agents: Check ~/.openclaw/openclaw.jsonagents.list[] for current roster
  • Implementation history: See ~/.openclaw/implementation-docs/ for the Wire agent reference implementation

Agent Creation Workflow

1. Gather Requirements

Before creating anything, clarify with Arch:

  • Agent name and ID (lowercase, no spaces for ID)
  • Role and responsibilities (specific, not vague)
  • Model tier: cheap (Kimi K2.5 only) or full cascade (include Claude Sonnet)
  • Whether it needs a Telegram group for Q&A
  • Whether it needs cron jobs (what schedule, what tasks)
  • Whether heartbeat should be enabled or disabled

2. Stop the Gateway

openclaw gateway stop

MANDATORY before editing openclaw.json or cron/jobs.json. The gateway actively writes to jobs.json (updating job state after each cron run). Editing while the gateway runs causes race conditions and data loss.

3. Backup Config

cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.backup.$(date +%Y%m%d%H%M%S)

4. Create Directories

mkdir -p ~/.openclaw/workspace-<agent_id>/memory
mkdir -p ~/.openclaw/agents/<agent_id>/agent

NEVER reuse agentDir across agents — causes auth/session collisions.

5. Write Workspace Files

Use templates from assets/templates/ as starting points. Every agent needs:

FilePurposeRequired
-------------------------
SOUL.mdPersonality, role, responsibilities, behavioral modesYes
IDENTITY.mdQuick-reference card (name, role, emoji)Yes
USER.mdAbout Arch (copy from any existing agent workspace)Yes
AGENTS.mdWorkspace rules (boot sequence, memory, safety)Yes
HEARTBEAT.mdPeriodic task checklist (or comment if disabled)Yes

SOUL.md is the most important file. Be specific about responsibilities. Include behavioral modes if the agent operates differently in different contexts (e.g., briefing mode vs chat mode).

6. Edit openclaw.json — Agent Entry

Add to agents.list[]. See references/config-schema.md for all valid fields.

Minimal entry:

{
  "id": "<agent_id>",
  "name": "<Display Name>",
  "workspace": "/home/archit/.openclaw/workspace-<agent_id>",
  "agentDir": "/home/archit/.openclaw/agents/<agent_id>/agent",
  "identity": { "name": "<Display Name>" }
}

Common additions:

  • "model" — Override the default model cascade. Exclude expensive models for worker agents.
  • "heartbeat": { "every": "0" } — Disable heartbeat for cron-only agents.
  • "groupChat": { "mentionPatterns": ["@", "@"] } — Enable @mentions in groups.

Only ONE agent should have "default": true (currently Fossil). The default agent receives all unrouted messages.

7. Edit openclaw.json — Telegram Routing (if needed)

THREE separate config changes are required. Missing any one causes silent failures. See references/telegram-routing.md for the full explanation.

  1. Group config in channels.telegram.groups:

```json

"-100XXXXXXXXXX": { "requireMention": false }

```

  1. Binding in bindings[]:

```json

{ "agentId": "", "match": { "channel": "telegram", "peer": { "kind": "group", "id": "-100XXXXXXXXXX" } } }

```

  1. Mention patterns on the agent entry (already done in step 6 if groupChat was added).

8. Create Cron Jobs (if needed)

Edit cron/jobs.json. Every cron job prompt MUST include:

  • Dynamic group ID resolution preamble (NEVER hardcode Telegram group IDs):

```

FIRST: Resolve your Telegram group ID by running:

jq -r '.bindings[] | select(.agentId == "") | .match.peer.id' ~/.openclaw/openclaw.json

Use the output as the target for all Telegram messages in this task.

```

  • Date injection: $(date '+%A, %B %d, %Y') after the preamble
  • Explicit constraints: source allowlists, recency rules, format templates
  • Delivery instructions: use target='' placeholder (resolved by the preamble)

This self-healing pattern ensures cron jobs survive Telegram group ID migrations. See references/prompt-patterns.md for full patterns and references/telegram-routing.md for why this matters.

Critical: If copying files or prompts from another agent's workspace, grep for hardcoded paths and update them.

9. Restart Gateway and Verify

openclaw gateway start

Verify in logs:

  • Agent registered: agent registered:
  • Messages route correctly: lane enqueue: lane=session:agent::...

If messages to a Telegram group show skip: no-mention, the channels.telegram.groups config is missing (see references/bugs-and-pitfalls.md).

Reference Files

FileWhen to Read
-------------------
references/config-schema.mdWhen writing agent config or cron jobs
references/telegram-routing.mdWhen setting up Telegram group routing
references/prompt-patterns.mdWhen writing cron job prompts
references/bugs-and-pitfalls.mdWhen debugging issues or before any config edit

Template Files

Starter templates for workspace files are in assets/templates/. Copy and customize per agent.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 01:03 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 269 📥 56,899
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 367 📥 140,032
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 64,893