← 返回 Skills 市场
mengwuzhi

Create Agent

作者 mengwuzhi · GitHub ↗ · v1.0.1
cross-platform ⚠ suspicious
438
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install create-openclaw-agent
功能描述
一键创建完整配置的 OpenClaw agent,包括身份定义、团队集成、模型与通信渠道设置,支持交互和命令行模式。
使用说明 (SKILL.md)

create-agent

version: 1.0.0
author: 大总管
description: 一键创建新的 OpenClaw agent,包含完整的身份定义、团队集成和配置


功能

  • ✅ 创建 agent 目录结构
  • ✅ 生成身份文件模板(IDENTITY.md/SOUL.md/AGENTS.md/USER.md)
  • ✅ 自动更新 openclaw.json(agents.list + bindings)
  • ✅ 自动更新 TEAM.md(团队架构)
  • ✅ 支持多种预设角色(开发/测试/运维/写作/产品等)
  • ✅ 支持自定义模型和 Channel 配置

安装

clawhub install create-agent

或手动安装:

git clone \x3Crepo> ~/.openclaw/workspace/skills/create-agent

使用方法

交互式模式(推荐)

python3 ~/.openclaw/workspace/skills/create-agent/scripts/create_agent.py
# 或
python3 ~/.openclaw/workspace/skills/create-agent/scripts/create_agent.py --interactive

按提示输入:

  1. Agent ID(如 dev-fe
  2. Agent 名称(如 前端工程师
  3. 选择预设角色(8 个模板可选)
  4. 选择模型(4 个常用模型)
  5. 选择 Channel(telegram/飞书)
  6. 选择 Emoji
  7. 确认工作区路径
  8. 预览或执行

命令行模式

openclaw skill create-agent \
  --id "dev-fe" \
  --name "前端工程师" \
  --role "frontend" \
  --model "openai-codex/gpt-5.3-codex" \
  --channel "feishu" \
  --emoji "💻"

创建写作 Agent(示例)

openclaw skill create-agent \
  --id "inkflow" \
  --name "写作与分享助手" \
  --role "writer" \
  --model "bailian/qwen3.5-plus" \
  --channel "telegram" \
  --emoji "🖋️" \
  --workspace "/root/.openclaw/workspace-writing"

参数说明

参数 必填 说明 默认值
--id Agent ID(字母 + 数字 + 连字符) -
--name Agent 显示名称 -
--role 预设角色模板 custom
--model 使用的模型 bailian/qwen3.5-plus
--channel 通信渠道 telegram
--emoji Agent emoji 🤖
--workspace 工作区路径 /root/.openclaw/workspace-\x3Cid>
--dry-run 预览不执行 false

预设角色模板

开发团队角色

Role 说明 默认模型
dev-tl 技术负责人 + 产品设计 openai-codex/gpt-5.3-codex
dev-fs 全栈工程师 openai-codex/gpt-5.3-codex
dev-qa 测试工程师 openai-codex/gpt-5.3-codex
dev-ops 运维工程师 openai-codex/gpt-5.3-codex
dev-fe 前端工程师 openai-codex/gpt-5.3-codex
dev-be 后端工程师 openai-codex/gpt-5.3-codex

其他角色

Role 说明 默认模型
writer 写作与分享助手 bailian/qwen3.5-plus
analyst 数据分析师 bailian/qwen3.5-plus
researcher 研究员 bailian/qwen3.5-plus
custom 自定义角色 bailian/qwen3.5-plus

生成的文件

Agent 目录结构

~/.openclaw/agents/\x3Cid>/agent/
├── IDENTITY.md    # 身份定义
├── SOUL.md        # 角色定位和工作原则
├── AGENTS.md      # 工作流程(引用 TEAM.md)
├── USER.md        # 用户偏好
├── auth.json      # 认证信息(自动生成)
└── models.json    # 模型配置(自动生成)

工作区目录

~/.openclaw/workspace-\x3Cid>/
├── AGENTS.md      # 引用 TEAM.md
├── SOUL.md        # 同步自 agent 目录
├── USER.md        # 同步自 agent 目录
├── IDENTITY.md    # 同步自 agent 目录
├── memory/        # 记忆文件
└── .openclaw/     # 会话存储

自动配置

1. 更新 openclaw.json

自动添加:

{
  "agents": {
    "list": [
      {
        "id": "\x3Cid>",
        "name": "\x3Cname>",
        "workspace": "\x3Cworkspace>",
        "agentDir": "~/.openclaw/agents/\x3Cid>/agent",
        "model": "\x3Cmodel>",
        "identity": {
          "name": "\x3Cname>",
          "theme": "\x3Crole>",
          "emoji": "\x3Cemoji>"
        }
      }
    ]
  },
  "bindings": [
    {
      "agentId": "\x3Cid>",
      "match": {
        "channel": "\x3Cchannel>",
        "accountId": "\x3Cid>"
      }
    }
  ]
}

2. 更新 TEAM.md

自动添加新 agent 信息到团队架构文档。

3. 创建 Channel 账号

如需要,自动在 channels.\x3Cchannel>.accounts 中添加账号配置。


示例输出

$ openclaw skill create-agent --id "dev-fe" --name "前端工程师" --role "dev-fe"

🔧 正在创建 agent: dev-fe

[1/6] 创建目录结构...
  ✓ ~/.openclaw/agents/dev-fe/agent/
  ✓ ~/.openclaw/workspace-dev-fe/

[2/6] 生成身份文件...
  ✓ IDENTITY.md
  ✓ SOUL.md
  ✓ AGENTS.md
  ✓ USER.md

[3/6] 更新 openclaw.json...
  ✓ 添加 agent 到 agents.list
  ✓ 添加 binding 规则
  ✓ 添加 telegram 账号配置

[4/6] 更新 TEAM.md...
  ✓ 添加 dev-fe 到团队架构

[5/6] 设置文件权限...
  ✓ 认证文件权限:600

[6/6] 验证配置...
  ✓ 配置语法检查通过

✅ Agent "dev-fe" 创建完成!

下一步:
1. 配置 Channel Token(如需要)
2. 重启 Gateway: openclaw gateway restart
3. 验证 agent: openclaw agents list --bindings

后续步骤

配置 Channel

根据选择的 Channel,配置相应的 Token:

Telegram:

# 在 BotFather 创建 bot,获取 token
# 编辑 openclaw.json:
channels.telegram.accounts.\x3Cid>.botToken = "\x3Ctoken>"

飞书:

# 在飞书开放平台创建应用
# 设置环境变量:
export DEV_FE_APP_ID="cli_xxx"
export DEV_FE_APP_SECRET="xxx"

重启 Gateway

openclaw gateway restart

验证

openclaw agents list --bindings
openclaw channels status

删除 Agent

openclaw skill delete-agent --id "dev-fe"

会:

  1. openclaw.json 移除配置
  2. TEAM.md 移除信息
  3. 删除 agent 目录(可选备份)
  4. 删除工作区目录(可选备份)

注意事项

安全

  • 认证文件权限自动设置为 600
  • Token 建议使用环境变量
  • 敏感信息不要提交到版本控制

命名规范

  • Agent ID:小写字母 + 数字 + 连字符(如 dev-fe
  • Agent 名称:中文或英文(如 前端工程师
  • 工作区:~/.openclaw/workspace-\x3Cid>

模型选择

场景 推荐模型
代码/配置操作 openai-codex/gpt-5.3-codex
复杂推理 anthropic/claude-sonnet-4-6
日常任务 bailian/qwen3.5-plus
长文本分析 bailian/kimi-k2.5

故障排查

问题:Gateway 启动失败

# 检查配置语法
openclaw doctor

# 查看详细日志
openclaw logs --follow

问题:Agent 不响应

# 检查路由配置
openclaw agents list --bindings

# 检查 Channel 状态
openclaw channels status

问题:TEAM.md 更新失败

手动编辑 /root/.openclaw/workspace/TEAM.md,添加新 agent 信息。


变更历史

版本 日期 变更
1.0.0 2026-02-28 初始版本

许可证

MIT License


来源: 基于 2026-02-28 创建 InkFlow agent 的实战经验总结

安全使用建议
Before running this skill, review the included script (scripts/create_agent.py) line-by-line and back up ~/.openclaw/openclaw.json and ~/.openclaw/workspace/TEAM.md. Run the script with --dry-run first to see changes. Be cautious about the hardcoded /root paths — run as your normal user and confirm Path.home() and referenced paths are correct. The skill's docs tell you how to extract tokens from a browser; never paste secrets into public places and avoid running token-capture steps on shared machines. If you plan to configure channel tokens, set them in environment variables yourself and confirm the variable names the script will insert. If anything looks unexpected (adding bindings for 'main', adding proxy entries, or creating auth.json files), stop and inspect the generated files before restarting gateways or services.
功能分析
Type: OpenClaw Skill Name: create-openclaw-agent Version: 1.0.1 The skill's primary function is to create and configure OpenClaw agents, which involves creating directories, generating identity files, and modifying critical configuration files like `~/.openclaw/openclaw.json` and `/root/.openclaw/workspace/TEAM.md`. While these are powerful actions, they are explicitly stated and aligned with the skill's purpose. The Python script `create_agent.py` performs these operations, including a hardcoded local proxy `http://127.0.0.1:7890` for Telegram channels and a conditional fix to add a binding for the 'main' agent, which are functional choices rather than malicious indicators. The markdown files (`SKILL.md`, `README.md`, etc.) contain legitimate instructions for the AI agent to read contextual files, showing no evidence of prompt injection attempts to subvert the agent's behavior. No data exfiltration, unauthorized remote execution, or persistence mechanisms beyond the intended configuration were found.
能力评估
Purpose & Capability
The name/description (create a fully configured OpenClaw agent) aligns with the code and SKILL.md: the script creates agent/workspace files and updates openclaw.json and TEAM.md. However, the package declares no required environment variables or credentials even though the code writes channel account entries that reference environment variables like ${<AGENT>_TOKEN} and the docs instruct how to extract and set tokens for ClawHub/Channels. Also some paths in the code are hardcoded to /root (e.g., agentDir and TEAM.md path) which is inconsistent with using Path.home(), suggesting possible path assumptions that may not match the user's environment.
Instruction Scope
SKILL.md explicitly tells users to run the included script; the script will read and write local configuration files: ~/.openclaw/openclaw.json, ~/.openclaw/agents/<id>/..., and /root/.openclaw/workspace/TEAM.md. That's inside the stated purpose, but it means the skill will modify global agent configuration and team docs and create auth.json files. The documentation (GET_TOKEN.md) also guides obtaining tokens from a browser and storing them on the server—instructions that relate to credentials but are not surfaced as required by the registry metadata.
Install Mechanism
No install spec; the skill is instruction-only with a Python script included. That reduces automatic install risk. The provided usage runs the script locally (python3 scripts/create_agent.py) — nothing is downloaded from third‑party URLs by the manifest itself.
Credentials
Registry metadata lists no required env vars, but the script populates openclaw.json channel accounts with placeholders referencing environment variables (e.g., "${AGENTID_TOKEN}") and SKILL.md/README instructs setting environment variables for channel secrets (DEV_FE_APP_ID/SECRET and similar). GET_TOKEN.md shows how to extract a ClawHub token from a browser and suggests using it on the server. Requiring credentials (bot tokens, app secrets, ClawHub token) is plausible for channel setup, but the skill does not declare them up front and the documentation includes steps to retrieve sensitive tokens—this mismatch is a red flag and could lead to accidental credential exposure.
Persistence & Privilege
The skill is not marked 'always' and does not request elevated platform privileges. However it modifies user-local configuration (openclaw.json, TEAM.md) and creates agent auth files. That is expected for its purpose but you should be aware it changes global OpenClaw configuration and may add routing bindings and channel account entries (including adding a proxy setting for telegram: http://127.0.0.1:7890).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install create-openclaw-agent
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /create-openclaw-agent 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Fix: Auto-add binding for default account to prevent routing confusion
v1.0.0
初始版本,基于 InkFlow 创建实战经验
元数据
Slug create-openclaw-agent
版本 1.0.1
许可证
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Create Agent 是什么?

一键创建完整配置的 OpenClaw agent,包括身份定义、团队集成、模型与通信渠道设置,支持交互和命令行模式。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 438 次。

如何安装 Create Agent?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install create-openclaw-agent」即可一键安装,无需额外配置。

Create Agent 是免费的吗?

是的,Create Agent 完全免费(开源免费),可自由下载、安装和使用。

Create Agent 支持哪些平台?

Create Agent 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Create Agent?

由 mengwuzhi(@mengwuzhi)开发并维护,当前版本 v1.0.1。

💬 留言讨论