mcpField
O
openclaw-agent-builder

openclaw-agent-builder

github.com/irangareddyAgent 工作流093 次安装37 周前更新
代码仓库

关于 openclaw-agent-builder

openclaw-agent-builder 是用于创建专用 OpenClaw Agent 的技能,适合配置专业化或多 Agent 环境。它涵盖工作区文件、技能、记忆、注册和路由。

主要功能

  1. 01定义 Agent 工作区文件
  2. 02指导设置身份与运行规则
  3. 03配置可选技能和记忆
  4. 04涵盖注册与路由

适用场景

  1. 01创建特定领域的 Agent
  2. 02区分不同 Agent 的身份与职责
  3. 03将频道或用户路由至 Agent

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/irangareddy/openclaw-essentials --skill openclaw-agent-builder

安装后在 Claude Code 中输入/openclaw-agent-builder确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

README.md
templates/
AGENTS-template.md
IDENTITY-template.md
SOUL-template.md

详细介绍

OpenClaw Agent 构建器

创建专用的 openclaw Agent,包含完整的工作区结构、身份文件和技能。

适用场景

为特定用途构建新的 openclaw Agent 时:

  • 特定领域的 Agent(Android 开发、SEO、内容写作等)
  • 多 Agent 路由场景
  • 独立的 Agent 个性
  • 基于工作区的 AI 助手

核心概念

OpenClaw Agent 结构

每个 Agent 都是一个隔离的思维单元,包含:

  • 工作区:文件(AGENTS.md、SOUL.md、USER.md、IDENTITY.md、TOOLS.md 等)
  • 状态目录:~/.openclaw/agents/<agentId>/agent(身份验证、配置)
  • 会话:~/.openclaw/agents/<agentId>/sessions(聊天记录)
工作区文件

必需:

  • AGENTS.md - 操作说明、记忆管理、行为规则
  • SOUL.md - 人设、语气、沟通风格
  • USER.md - 用户背景,以及如何称呼用户
  • IDENTITY.md - Agent 名称、表情符号、角色、使命
  • TOOLS.md - 工具说明和约定

可选:

  • HEARTBEAT.md - 心跳检查清单(保持简短)
  • BOOT.md - 网关重启时的启动检查清单
  • memory/ - 每日记忆日志(YYYY-MM-DD.md)
  • MEMORY.md - 精选的长期记忆
  • skills/ - 工作区专属技能

Agent 构建工作流

1. 先提问

开始构建前,先明确以下内容:

  • Agent 用途:这个 Agent 要解决什么问题?
  • 领域专长:需要哪些专业知识?
  • 沟通风格:专业?随意?技术性强?
  • 工具/集成:API、数据库、外部系统?
  • 所需技能:自定义能力或工作流?
2. 创建工作区结构
# Create agent workspace
mkdir -p ~/.openclaw/workspace-<agent-name>
cd ~/.openclaw/workspace-<agent-name>

# Initialize git (recommended)
git init
3. 构建核心文件

IDENTITY.md - Agent 的身份:

# IDENTITY.md

## Name
[Agent Name]

## Emoji
[1-2 relevant emojis]

## Role
[Short role description - e.g., "Android spec writer", "SEO optimizer"]

## Mission
[Concise mission statement - what the agent does and why]

SOUL.md - 个性和语气:

# SOUL.md - [Agent Name]

## Who You Are

[Description of expertise, background, strengths]

## Your Expertise

### [Domain 1]
- [Specific skill or knowledge area]
- [Another capability]

### [Domain 2]
- [Capability]

## Your Approach

### [Trait 1 - e.g., Analytical, Pragmatic]
- [How this manifests]

### [Trait 2]
- [Behavior pattern]

## Your Tone

[Communication style - concise/verbose, formal/casual, technical level]

## Your Values

1. **[Value 1]** - [Why it matters]
2. **[Value 2]** - [Explanation]

AGENTS.md - 操作说明:

# AGENTS.md - [Agent Name]

[Brief agent description and primary role]

## Primary Responsibilities

1. **[Task 1]** - [Description]
2. **[Task 2]** - [Description]

## Workflow

### On User Request: "[Trigger Pattern]"

1. **[Step 1]** [Action description]
   [Details, commands, or sub-steps]

2. **[Step 2]** [Next action]

### On User Request: "[Another Pattern]"

[Workflow steps]

## [Domain-Specific Section - e.g., "iOS Codebase Structure"]

[Relevant context, file paths, patterns]

## [Another Section - e.g., "Translation Guidelines"]

[Reference tables, mappings, rules]

## Memory

- Log [what to track] in `memory/YYYY-MM-DD.md`
- [Memory strategy specific to agent purpose]

## Tools

See `TOOLS.md` for [domain-specific tools or integrations]

## Skills

- **[skill-name]** - [Purpose]
- **[another-skill]** - [Purpose]

USER.md - 用户背景:

# USER.md

## Who You Are

[User description, preferences, context]

## Your Goals

[What user wants to achieve with this agent]

## Communication Preferences

[How user prefers to interact]

TOOLS.md - 工具约定:

# TOOLS.md

## [Domain] Tools

- **[Tool/API name]**: [Purpose and usage notes]
- **[Another tool]**: [Notes]

## Authentication

[If agent needs API keys, credentials, etc.]

## Conventions

[Domain-specific conventions or patterns]
4. 添加技能(可选)

创建工作区专属技能:

mkdir -p skills/<skill-name>

每项技能都需要 SKILL.md:

---
name: skill-name
description: What the skill does
---

# Skill Name

[Skill documentation following agentskills.io format]

## When to Use

[Trigger conditions]

## Steps

[Detailed workflow]

## Examples

[Usage examples]
5. 设置记忆系统
mkdir -p memory
touch memory/$(date +%Y-%m-%d).md

还可使用 MEMORY.md 保存精选知识:

# MEMORY.md

## [Category]

- [Key fact or pattern]
- [Lesson learned]

## [Another Category]

[Organized knowledge]
6. 注册 Agent
# Add agent to openclaw
openclaw agents add <agent-name>

# Set workspace path
# Edit ~/.openclaw/openclaw.json:
{
  "agents": {
    "list": [
      {
        "id": "<agent-name>",
        "workspace": "~/.openclaw/workspace-<agent-name>"
      }
    ]
  }
}
7. 添加绑定(多 Agent 路由)

将特定频道/用户路由到此 Agent:

{
  "bindings": [
    {
      "agentId": "<agent-name>",
      "match": {
        "channel": "whatsapp",
        "peer": { "kind": "direct", "id": "+1234567890" }
      }
    }
  ]
}

设计原则

Agent 身份
  • 目标明确:职责单一、聚焦
  • 个性鲜明:相较于其他 Agent,拥有独特的语气和方式
  • 专业深入:精通特定领域
沟通风格
  • 简洁:默认言简意赅,除非领域要求详细说明
  • 专业:符合行业标准
  • 可执行:聚焦于具体做法,而不只是描述
记忆策略
  • 每日日志:记录重要事件和决策
  • 精选知识:将规律提炼到 MEMORY.md
  • 保留上下文:在 /new 或 /reset 前保存状态
技能组织
  • 工作区技能:Agent 专属能力
  • 共享技能:~/.openclaw/skills/ 中的通用工具
  • 覆盖规则:工作区技能优先于共享技能/内置技能

Agent 示例

Android 规格生成器
Purpose: Analyze iOS features, generate Android requirement specs
Style: Concise, technical, requirement-focused
Skills: ios-analyzer, android-spec-generator, github-issue-creator
SEO 专家
Purpose: Content optimization, keyword research, SEO strategy
Style: Data-driven, analytical, actionable
Skills: keyword-research, content-analyzer, competitor-analysis
内容写作者
Purpose: Blog posts, documentation, technical writing
Style: Clear, engaging, audience-aware
Skills: content-planner, seo-writer, editor

反模式

❌ 不要:

  • 在一个 Agent 中混合多个互不相关的领域
  • 创建冗长、健谈的 Agent,除非用途有此要求
  • 在 AGENTS.md、SOUL.md、TOOLS.md 中重复内容
  • 在工作区中存储密钥(请使用 ~/.openclaw/credentials/)

✅ 应该:

  • 让每个 Agent 都保持目标单一、明确
  • 让沟通风格符合领域规范
  • 按职责组织内容(身份/个性/操作)
  • 使用 git 备份工作区(私有仓库)

测试 Agent

# Start gateway with agent
openclaw gateway --agent <agent-name>

# Or use binding to route to agent
openclaw gateway

# Send test message via WhatsApp/Telegram/Discord
# Verify agent responds with expected personality/capability

维护

更新 Agent
cd ~/.openclaw/workspace-<agent-name>
git add .
git commit -m "Update [what changed]"
git push
添加新技能
cd ~/.openclaw/workspace-<agent-name>/skills
mkdir new-skill
# Create SKILL.md
备份 Agent
# Workspace already in git
# Separately backup sessions if needed:
tar -czf sessions-backup.tar.gz ~/.openclaw/agents/<agent-name>/sessions/

资源

构建前有疑问?

请用户澄清:

  1. Agent 的用途和范围
  2. 沟通风格偏好
  3. 所需集成/API
  4. 路由策略(专用频道还是共享频道)
  5. 技能要求

评论

支持 Markdown