用法:
# 基礎用法 - 建立常駐 Agent(繫結群聊)
~/.openclaw/workspace-recruiter/skills/agent-recruiter/scripts/recruit-agent.sh <agent_id> <agent_name> [群聊 ID]
# 示例:建立 Tim 維護專員,繫結到指定群
~/.openclaw/workspace-recruiter/skills/agent-recruiter/scripts/recruit-agent.sh tim "Tim 維護專員" <群聊 ID>
指令碼會自動完成:
~/.openclaw/agents/<id>/agent/ + ~/.openclaw/workspace-<id>/)每個 Agent 包含以下核心檔案:
~/.openclaw/
├── agents/
│ └── <agent_id>/
│ └── agent/
│ ├── agent.json # Agent 基本配置
│ ├── models.json # 模型配置
│ └── auth-profiles.json # 認證配置
│
├── workspace-<agent_id>/
│ ├── SOUL.md # ⭐ Agent 人格和身份(核心)
│ ├── AGENTS.md # 工作區規範
│ ├── IDENTITY.md # 名稱、Emoji、Vibe
│ ├── TOOLS.md # 本地工具配置
│ ├── USER.md # 使用者資訊
│ ├── HEARTBEAT.md # 定期任務清單
│ └── memory/
│ ├── YYYY-MM-DD.md # 每日日誌
│ └── MEMORY.md # 長期記憶
│
└── openclaw.json
├── agents.list[] # Agent 註冊列表
└── bindings[] # 訊息路由繫結
| 檔案 | 作用 | 必填 |
|---|---|---|
| SOUL.md | Agent 的人格、使命、工作流程、成功指標 | ⭐ 必填 |
| AGENTS.md | 工作區使用規範、記憶系統、工具指南 | ✅ 推薦 |
| IDENTITY.md | 名稱、Emoji、Vibe、專業領域 | ✅ 推薦 |
| agent.json | OpenClaw 註冊配置 | ⭐ 必填 |
# SOUL.md - Who You Are
## 🧠 Your Identity & Memory
- **Role**: [核心角色定位]
- **Personality**: [性格特點]
- **Memory**: [記住的成功模式]
- **Experience**: [經歷過的案例]
## 🎯 Your Core Mission
### [核心職責 1]
- [具體任務]
- [可量化目標]
### [核心職責 2]
- [具體任務]
- [交付標準]
## 🚨 Critical Rules You Must Follow
### [規則類別 1]
- [必須遵守的規則]
## 📋 Your Technical Deliverables
### [交付物示例]
```code
// 程式碼或模板示例
You're successful when:
mkdir -p ~/.openclaw/agents/<agent_id>/agent
mkdir -p ~/.openclaw/workspace-<agent_id>
{
"id": "<agent_id>",
"name": "<agent_name>",
"workspace": "/Users/junchen/.openclaw/workspace-<agent_id>",
"agentDir": "/Users/junchen/.openclaw/agents/<agent_id>/agent",
"model": "modelstudio/qwen3.5-plus"
}
cp ~/.openclaw/agents/mike/agent/models.json ~/.openclaw/agents/<agent_id>/agent/
cp ~/.openclaw/agents/mike/agent/auth-profiles.json ~/.openclaw/agents/<agent_id>/agent/
# 使用模板
cp ~/.openclaw/workspace-recruiter/skills/agent-recruiter/templates/SOUL.md.template ~/.openclaw/workspace-<agent_id>/SOUL.md
cp ~/.openclaw/workspace-recruiter/skills/agent-recruiter/templates/AGENTS.md.template ~/.openclaw/workspace-<agent_id>/AGENTS.md
cp ~/.openclaw/workspace-recruiter/skills/agent-recruiter/templates/IDENTITY.md.template ~/.openclaw/workspace-<agent_id>/IDENTITY.md
# 編輯內容
vim ~/.openclaw/workspace-<agent_id>/SOUL.md
vim ~/.openclaw/workspace-<agent_id>/IDENTITY.md
在 agents.list 新增:
{
"id": "<agent_id>",
"name": "<agent_name>",
"workspace": "/Users/junchen/.openclaw/workspace-<agent_id>",
"agentDir": "/Users/junchen/.openclaw/agents/<agent_id>/agent",
"model": "modelstudio/qwen3.5-plus"
}
在 bindings 新增(繫結群聊):
{
"type": "route",
"agentId": "<agent_id>",
"match": {
"channel": "feishu",
"peer": {
"kind": "group",
"id": "<群聊 ID>"
}
}
}
openclaw gateway restart
參考模板:templates/examples/tim/SOUL.md 和 templates/examples/tim/IDENTITY.md
職責:
配置:
# 建立 Tim
./scripts/recruit-agent.sh tim "Tim 維護專員" <群聊 ID>
# 自定義 SOUL.md
vim ~/.openclaw/workspace-tim/SOUL.md
ls ~/.openclaw/agents/<agent_id>/agent/agent.json 2>/dev/null && echo "✅ 存在" || echo "❌ 不存在"
cat ~/.openclaw/agents/<agent_id>/agent/agent.json
cat ~/.openclaw/workspace-<agent_id>/SOUL.md
cat ~/.openclaw/openclaw.json | grep -A8 '"agentId": "<agent_id>"'
openclaw gateway status
cat ~/.openclaw/openclaw.json | jq '.agents.list[].id'
agency-agents: https://github.com/msitarzewski/agency-agents
Agent 目錄: ~/.openclaw/agents/
Workspace 目錄: ~/.openclaw/workspace-<agent_id>/
配置檔案: ~/.openclaw/openclaw.json
Gateway 日誌: /tmp/openclaw/openclaw-*.log
OpenClaw 文件: /opt/homebrew/lib/node_modules/openclaw/docs
cat ~/.openclaw/workspace-<agent_id>/SOUL.md
cat ~/.openclaw/workspace-<agent_id>/IDENTITY.md
識別: 哪些是模板佔位符(如 [Agent 顯示名稱]),哪些已有內容
| 常見角色參考: | 角色型別 | agency-agents 參考 |
|---|---|---|
| 系統維護/DevOps | engineering-devops-automator.md | |
| 資訊分析師 | research-news-analyst.md | |
| 金融分析師 | sales-sales-pipeline-analyst.md | |
| 客服支援 | support-customer-success.md |
保持 agency-agents 結構:
7w4.net小蔥技能站,你的AI助手技能庫。
IDENTITY.md 精簡版:
背景: Agent 已建立,但 SOUL/IDENTITY 是模板
最佳化過程:
關鍵改進:
❌ 壞例子:"你是一個有用的助手" ✅ 好例子:"你是系統維護專員,每小時巡檢 cron/agent/skill 狀態,連續錯誤≥3 次必須告警"
❌ 壞例子:"系統執行良好" ✅ 好例子:"系統異常發現時間 <1 小時,cron 連續錯誤率 <5%"
❌ 壞例子:"檢查系統狀態" ✅ 好例子:"Step1: 執行 gateway status → Step2: 讀取 jobs.json → Step3: 生成報告"
❌ 壞例子:"友好、專業" ✅ 好例子:"細緻、主動、預防性思維、系統化"
❌ 壞例子:自己瞎寫結構 ✅ 好例子:參考 agency-agents 的專業模板,保持一致性
質量良好,主要優點是自動化程度高、文件詳盡、示例專業。適合快速建立 OpenClaw Agent,使用說明清晰易懂。主要缺點是部分模板檔案缺失,指令碼配置存在硬編碼限制,缺乏完整的錯誤恢復機制。整體是一個比較完善的 Skill,功能覆蓋完整但有小細節需要最佳化。