Agent Builder Plus (OpenClaw)
Design and generate a complete OpenClaw agent workspace with strong defaults and advanced-user-oriented clarifying questions.
Quick Start
CODEBLOCK0
Canonical references
- - Workspace layout + heartbeat rules: Read INLINECODE0
- File templates/snippets: Read INLINECODE1
- Optional background (generic agent architecture): INLINECODE2
Workflow: build an agent from scratch
Phase 1 - Interview (ask clarifying questions)
Ask only what you need; keep it tight. Prefer multiple short rounds over one giant questionnaire.
Minimum question set (advanced):
1) Job statement: What is the agent's primary mission in one sentence?
2) Surfaces: Which channels (Telegram/WhatsApp/Discord/iMessage/Feishu)? DM only vs groups?
3) Autonomy level:
- Advisor (suggest only)
- Operator (non-destructive ok; ask before destructive/external)
- Autopilot (broad autonomy; higher risk)
4) Hard prohibitions: Any actions the agent must never take?
5) Memory: Should it keep curated MEMORY.md? What categories matter?
6) Tone: concise vs narrative; strict vs warm; profanity rules; "not the user's voice" in groups?
7) Tool posture: tool-first vs answer-first; verification requirements.
Error recovery:
- - If user provides incomplete answers: Ask follow-up questions for missing information
- If user is unsure about autonomy level: Explain trade-offs and suggest starting with "Operator"
- If user wants to skip questions: Explain why each question matters for agent behavior
Phase 2 - Generate workspace files
Generate these files (minimum viable OpenClaw agent):
- - INLINECODE4
- INLINECODE5
- INLINECODE6
- INLINECODE7
- INLINECODE8 (often empty by default)
- INLINECODE9 (for first-run guidance)
Optionals:
- -
MEMORY.md (private sessions only) - INLINECODE11 seed (today) with a short "agent created" entry
- INLINECODE12 starter (if the user wants per-environment notes)
File creation commands:
CODEBLOCK1
Note: If you encounter "Missing required parameter: path (path or file_path)" error,
ensure you're using file_path parameter in your write tool calls.
Error handling:
- - If directory creation fails: Check permissions and path validity
- If file write fails: Verify disk space and write permissions
- If template reference fails: Ensure references/templates.md exists
Error recovery:
- - If directory creation fails: Check parent directory permissions, try alternative path
- If file write fails: Check disk space, verify write permissions, retry with reduced content
- If template reference fails: Verify references/ directory exists, check file permissions
Use templates from references/templates.md but tailor content to the answers.
Phase 2.5 - Register agent with OpenClaw
⚠️ CRITICAL WARNING: Channel Conflict Prevention
NEVER bind a new agent to the same channel as the main agent!
This will cause the new agent to hijack the main agent's channel, making it impossible to communicate with the main agent.
Before registering, check existing agent bindings:
CODEBLOCK2
Channel binding rules:
- 1. Main agent (大鱼): Always uses the primary Feishu DM channel
- New agents: Must use DIFFERENT channels or sub-channels
- Testing: Use
/agentname command binding for testing - Production: Create separate Feishu apps or use different channels
Backup configuration first:
CODEBLOCK3
Register the agent:
CODEBLOCK4
Channel binding options:
Feishu:
- - Direct binding: Configure in Feishu app settings (recommended for production)
- ⚠️ WARNING: Do NOT bind to the same Feishu app as main agent
- Create a separate Feishu app for the new agent
- - Command binding: Use
/agentname in Feishu messages (for testing)
- This is SAFE - does not hijack channels
- - Multiple channels: The agent can be bound to multiple channels simultaneously
Telegram:
- - Create a separate bot token for each agent
- Do NOT share bot tokens between agents
- Use different bot usernames
WhatsApp:
- - Use different phone numbers for each agent
- Do NOT share WhatsApp Business API credentials
Discord:
- - Use different bot tokens for each agent
- Create separate Discord applications
- Do NOT share bot tokens
iMessage:
- - Each agent should use a different Apple ID
- Do NOT share iMessage credentials
Authentication configuration (if needed):
CODEBLOCK5
Model provider configuration (optional):
If the new agent needs to use custom model providers, you need to configure API keys:
Step 1: Check main agent's model configuration
CODEBLOCK6
Step 2: Choose configuration approach
Option A: Use same model as main agent (recommended)
- - New agent can directly use main agent's model configuration
- No additional configuration needed
- Models are shared across agents by default
Option B: Configure new model provider
- - Required only if agent needs different model provider
- Add provider to openclaw.json models.providers
- Configure auth-profiles.json for the agent
Step 3: Configure model provider (if needed)
CODEBLOCK7
Step 4: Configure agent-specific auth (if needed)
CODEBLOCK8
⚠️ IMPORTANT: Model providers vs Channel providers
- - Model providers: Configure AI model API keys (OpenAI, Anthropic, custom providers)
- Location: openclaw.json → models.providers
- Used for: AI model access
- Examples: openai, anthropic, custom-maas-api-*
- - Channel providers: Configure messaging platform credentials (Feishu, Telegram, Discord)
- Location: openclaw.json → channels.
- Used for: Message delivery
- Examples: feishu, telegram, discord, whatsapp
Do not confuse these two types of providers!
Common error:
CODEBLOCK9
Solution:
- 1. Check if provider name matches openclaw.json models.providers
- Verify API key is configured correctly
- Check auth-profiles.json for agent-specific configuration
- Restart OpenClaw Gateway after configuration changes
⚠️ IMPORTANT: Never reuse credentials from main agent!
Error recovery:
- - If
openclaw agents add fails: Restores from backup and checks syntax - If auth fails: Verify credentials in auth-profiles.json
- If binding fails: Check channel permissions and network connectivity
- If backup fails: Check write permissions on ~/.openclaw/ directory
- If main agent stops responding: Immediately restore from backup and restart OpenClaw
Common errors and solutions:
Error 1: "No API key found for provider 'provider-name'"
Causes:
- - Provider name doesn't match any configured provider in openclaw.json
- Typo in provider name
- Provider not added to models.providers
Solutions:
- 1. Check provider name in openclaw.json:
cat ~/.openclaw/openclaw.json | grep -A 10 "providers"
- 2. Verify provider name spelling (case-sensitive)
- Add provider to models.providers if needed
- Restart OpenClaw Gateway after configuration changes
Error 2: "Agent failed before reply"
Causes:
- - Agent configuration is invalid
- Workspace files are missing or corrupted
- Model configuration is incorrect
Solutions:
- 1. Verify workspace files exist:
ls -la /path/to/workspace/
- 2. Check agent configuration:
openclaw agents list
- 3. Test agent loading:
openclaw agents test <agent-name>
- 4. Check OpenClaw logs:
CODEBLOCK14
Error 3: "Missing required parameter: path (path or file_path)"
Causes:
- - Using wrong parameter name in write tool
- Parameter format error in tool call
Solutions:
- 1. Use correct parameter name:
file_path instead of INLINECODE19 - Verify tool call syntax:
write:
file_path: /path/to/file.md
content: "content here"
- 3. Check tool documentation for correct parameters
Error 4: "Could not find exact text in file"
Causes:
- - Using edit tool with incorrect oldText
- Whitespace differences (spaces vs tabs)
- File already modified by another process
Solutions:
- 1. Re-read file to get exact content:
read /path/to/file.md
- 2. Use unique markers for large sections:
<!-- SECTION_START -->
[content]
<!-- SECTION_END -->
- 3. Match whitespace exactly (copy from file read)
- Use smaller oldText for more precise matching
Phase 2.6 - Verify configuration
Verification steps:
CODEBLOCK18
Success criteria:
- - Agent appears in
openclaw agents list output - All required files exist (IDENTITY.md, SOUL.md, AGENTS.md, USER.md)
- No syntax errors in configuration files
- Agent can be loaded without errors
If verification fails:
- 1. Check file permissions
- Validate JSON/YAML syntax in configuration files
- Review error messages from INLINECODE21
- Restore from backup if necessary
Error recovery:
- - If agent not in list: Check openclaw.json syntax, re-run Phase 2.5
- If files missing: Re-run Phase 2 with corrected paths
- If load test fails: Check file syntax, verify template content matches OpenClaw specs
Phase 3 - Guardrails checklist
Ensure the generated agent includes:
- - Explicit ask-before-destructive rule.
- Explicit ask-before-outbound-messages rule.
- Stop-on-CLI-usage-error rule.
- Max-iteration / loop breaker guidance.
- Group chat etiquette.
- Sub-agent note: essential rules live in
AGENTS.md.
Error recovery:
- - If guardrails are missing: Add them to AGENTS.md or SOUL.md
- If guardrails are too restrictive: Ask user for clarification on desired autonomy level
Phase 4 - Acceptance tests (fast)
Provide 5-10 short scenario prompts to validate behavior, e.g.:
- - "Draft but do not send a message to X; ask me before sending."
- "Summarize current workspace status without revealing secrets."
- "You hit an unknown flag error; show how you recover using --help."
- "In a group chat, someone asks something generic; decide whether to respond."
Error recovery:
- - If agent fails acceptance tests: Review guardrails, adjust autonomy level, verify template content
- If tests are too strict: Adjust test scenarios to match intended behavior
Phase 8 - Automated testing (optional)
Automated test commands:
CODEBLOCK19
Test script example:
CODEBLOCK20
Error recovery:
- - If automated tests fail: Review error messages, check file syntax, verify configuration
- If test script fails: Check script permissions, verify paths are correct
Optional: systemd service configuration
For production deployments, the agent can run as a systemd service:
Service file example:
CODEBLOCK21
Enable and start service:
CODEBLOCK22
Error recovery:
- - If service fails to start: Check journalctl logs, verify file paths, check user permissions
- If service crashes: Check OpenClaw logs, verify agent configuration, restart service
- If service wont enable: Check systemd configuration syntax, verify systemd is running
Workflow: iterate on an existing agent
When improving an existing agent, ask:
1) What are the top 3 failure modes you have seen? (loops, overreach, verbosity, etc.)
2) What autonomy changes do you want?
3) Any new safety boundaries?
4) Any changes to heartbeat behavior?
Then propose targeted diffs to:
- -
SOUL.md (persona/tone/boundaries) - INLINECODE24 (operating rules + memory + delegation)
- INLINECODE25 (small checklist)
Keep changes minimal and surgical.
Error recovery:
- - If diff application fails: Check file permissions, verify file exists, retry with backup
- If changes break agent behavior: Restore from git or backup, review changes
- If user rejects changes: Ask for clarification, propose alternative modifications
Agent Builder Plus (OpenClaw)
设计和生成一个完整的 OpenClaw 智能体工作区,具备强大的默认配置和面向高级用户的澄清性问题。
快速开始
bash
1. 阅读技能文档
Read SKILL.md and references/openclaw-workspace.md
2. 回答面试问题
提供以下内容的答案:工作陈述、交互界面、自主级别、禁止事项、记忆、语气、工具姿态
3. 生成工作区文件
该技能将创建:IDENTITY.md, SOUL.md, AGENTS.md, USER.md, HEARTBEAT.md
4. 验证和测试
运行验收测试以验证行为
规范参考
- - 工作区布局 + 心跳规则:阅读 references/openclaw-workspace.md
- 文件模板/代码片段:阅读 references/templates.md
- 可选背景(通用智能体架构):references/architecture.md
工作流程:从头构建一个智能体
阶段 1 - 访谈(提出澄清性问题)
只询问你需要的内容;保持简洁。倾向于多轮简短提问,而非一次冗长的问卷。
最小问题集(高级):
1) 工作陈述:用一句话描述智能体的主要使命是什么?
2) 交互界面:哪些渠道(Telegram/WhatsApp/Discord/iMessage/飞书)?仅私聊还是群组?
3) 自主级别:
- 顾问(仅建议)
- 操作员(非破坏性操作可执行;破坏性/外部操作需询问)
- 自动驾驶(广泛自主权;风险较高)
4) 硬性禁止:智能体绝对不能采取哪些行动?
5) 记忆:是否应保留精心整理的 MEMORY.md?哪些类别重要?
6) 语气:简洁 vs 叙述性;严谨 vs 温暖;脏话规则;群组中不使用用户的语气?
7) 工具姿态:工具优先 vs 答案优先;验证要求。
错误恢复:
- - 如果用户提供不完整的答案:针对缺失信息提出后续问题
- 如果用户对自主级别不确定:解释权衡利弊,建议从操作员开始
- 如果用户想跳过问题:解释每个问题对智能体行为的重要性
阶段 2 - 生成工作区文件
生成以下文件(最小可行 OpenClaw 智能体):
- - IDENTITY.md
- SOUL.md
- AGENTS.md
- USER.md
- HEARTBEAT.md(通常默认为空)
- BOOTSTRAP.md(用于首次运行指导)
可选文件:
- - MEMORY.md(仅限私有会话)
- memory/YYYY-MM-DD.md 种子文件(今天)包含一条简短的智能体已创建记录
- TOOLS.md 入门文件(如果用户需要按环境记录)
文件创建命令:
bash
创建工作区目录
mkdir -p /path/to/workspace/memory
创建文件(使用带有正确参数的写入工具)
重要:使用 file_path 参数,而不是 path
示例:
write:
file_path: /path/to/workspace/IDENTITY.md
content: content here
对于大文件(>2000字节),考虑使用 file-writer 技能
或将内容拆分为较小的块
注意: 如果遇到缺少必需参数:path(path 或 file_path)错误,
请确保在写入工具调用中使用了 file_path 参数。
错误处理:
- - 如果目录创建失败:检查权限和路径有效性
- 如果文件写入失败:验证磁盘空间和写入权限
- 如果模板引用失败:确保 references/templates.md 存在
错误恢复:
- - 如果目录创建失败:检查父目录权限,尝试替代路径
- 如果文件写入失败:检查磁盘空间,验证写入权限,减少内容后重试
- 如果模板引用失败:验证 references/ 目录存在,检查文件权限
使用 references/templates.md 中的模板,但根据答案定制内容。
阶段 2.5 - 向 OpenClaw 注册智能体
⚠️ 关键警告:渠道冲突预防
切勿将新智能体绑定到与主智能体相同的渠道!
这将导致新智能体劫持主智能体的渠道,使主智能体无法通信。
注册前,检查现有智能体绑定:
bash
列出所有智能体及其绑定
openclaw agents list
检查哪些渠道已被使用
openclaw channels list
渠道绑定规则:
- 1. 主智能体(大鱼):始终使用主飞书私聊渠道
- 新智能体:必须使用不同的渠道或子渠道
- 测试:使用 /agentname 命令绑定进行测试
- 生产环境:创建单独的飞书应用或使用不同渠道
首先备份配置:
bash
修改前备份 openclaw.json
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.backup
注册智能体:
bash
将智能体添加到 OpenClaw 配置
openclaw agents add
--workspace /path/to/workspace
示例 1:使用独立工作区(推荐 - 每个智能体拥有自己的工作区)
openclaw agents add my-assistant --workspace ~/.openclaw/workspace-my-assistant
示例 2:使用默认工作区(仅适用于单智能体设置)
openclaw agents add my-assistant --workspace ~/.openclaw/workspace
渠道绑定选项:
飞书:
- - 直接绑定: 在飞书应用设置中配置(推荐用于生产环境)
- ⚠️ 警告:不要绑定到与主智能体相同的飞书应用
- 为新智能体创建一个单独的飞书应用
- - 命令绑定: 在飞书消息中使用 /agentname(用于测试)
- 这是安全的 - 不会劫持渠道
Telegram:
- - 为每个智能体创建一个单独的机器人令牌
- 不要在智能体之间共享机器人令牌
- 使用不同的机器人用户名
WhatsApp:
- - 为每个智能体使用不同的电话号码
- 不要共享 WhatsApp Business API 凭据
Discord:
- - 为每个智能体使用不同的机器人令牌
- 创建单独的 Discord 应用程序
- 不要共享机器人令牌
iMessage:
- - 每个智能体应使用不同的 Apple ID
- 不要共享 iMessage 凭据
认证配置(如果需要):
bash
编辑外部服务访问的 auth-profiles.json
位置:~/.openclaw/auth-profiles.json
示例结构:
{
feishu: {
appId: cli_xxxxx,
appSecret: xxxxx
},
telegram: {
botToken: your-bot-token
}
}
模型提供商配置(可选):
如果新智能体需要使用自定义模型提供商,需要配置 API 密钥:
步骤 1:检查主智能体的模型配置
bash
查看主智能体的模型配置
cat ~/.openclaw/agents/main/agent/models.json
查看全局模型提供商
cat ~/.openclaw/openclaw.json | grep -A 20 providers
步骤 2:选择配置方法
选项 A:使用与主智能体相同的模型(推荐)
- - 新智能体可以直接使用主智能体的模型配置
- 无需额外配置
- 默认情况下,模型在智能体之间共享
选项 B:配置新的模型提供商
- - 仅当智能体需要不同的模型提供商时才需要
- 将提供商添加到 openclaw.json 的 models.providers 中
- 为智能体配置 auth-profiles.json
步骤 3:配置模型提供商(如果需要)
bash
将提供商添加到 openclaw.json
位置:~/.openclaw/openclaw.json
示例结构:
{
models: {
providers: {
custom-provider: {
baseUrl: https://api.example.com/v1,
apiKey: key_id:secret,
api: openai-completions,
models: [...]
}
}
}
}
步骤 4:配置智能体特定的认证(如果需要)
bash
为智能体编辑 auth-profiles.json
位置:~/.openclaw/agents//agent/auth-profiles.json
示例结构:
{
custom-provider: {
apiKey: key_id:secret,
baseUrl: https://api.example.com/v1
}
}
⚠️ 重要:模型提供商 vs 渠道提供商