OpenClaw 自我进化框架一键部署。安装宪法(AGENTS.md)、可进化灵魂(SOUL.md)、心跳系统、PARA三层记忆架构、目标管理,并通过场景化对话引导用户定义 Agent 性格。自动配置 EvoClaw(审批制进化)和 Self-Improving Agent(自主学习)。触发场景:"setup o...
为 OpenClaw 安装完整的自我进化框架:宪法 + 可进化灵魂 + 结构化心跳协议 + PARA 三层记忆 + 目标管理 + 治理配置。
安装内容:
在执行任何操作之前,必须先完成此步骤。跳过此步骤是禁止的。
询问用户:
"准备部署 openclaw-soul 自我进化框架。请确认:
- 工作区路径是什么?(默认:
~/.openclaw/workspace/)- 如有自定义路径请告知。"
将用户确认的路径记为 $WORKSPACE。如果用户说"默认"或不指定,使用 ~/.openclaw/workspace/。
必须先通过环境检查,否则禁止继续后续步骤。
运行预检脚本:
python3 "$(dirname "$0")/../scripts/preflight_check.py"
如果脚本不可用,手动执行以下检查:
$WORKSPACE 路径必须存在且可写$WORKSPACE/../openclaw.json 是否存在且为有效 JSONwhich clawhub 或检查 ~/.openclaw/bin/clawhub$WORKSPACE:
输出格式:逐项报告 pass/warn/fail,标记需要备份的文件。
判断逻辑:
fail → 报告问题并停止,告知用户如何修复warn → 告知用户限制,确认是否继续pass → 继续下一步对每个即将部署的文件,如果已存在于 $WORKSPACE:
cp "$WORKSPACE/{filename}" "$WORKSPACE/{filename}.backup.$(date +%Y%m%d-%H%M%S)"
列出所有被备份的文件告知用户。如果没有需要备份的文件,跳过此步骤并告知用户。
保证非破坏性:原文件在备份完成后才会被覆盖。
从 references/ 目录读取模板,写入 $WORKSPACE:
| 模板文件 | 目标位置 |
|---|---|
references/agents-template.md | $WORKSPACE/AGENTS.md |
references/soul-template.md | $WORKSPACE/SOUL.md |
references/heartbeat-template.md | $WORKSPACE/HEARTBEAT.md |
references/bootstrap-guide.md | $WORKSPACE/BOOTSTRAP.md |
references/user-template.md | $WORKSPACE/USER.md |
references/identity-template.md | $WORKSPACE/IDENTITY.md |
references/goals-template.md | $WORKSPACE/GOALS.md |
references/working-memory-template.md | $WORKSPACE/working-memory.md |
references/long-term-memory-template.md | $WORKSPACE/long-term-memory.md |
部署步骤:
references/ 中的模板文件内容$WORKSPACE 目标路径$WORKSPACE/
├── memory/
│ ├── daily/ # Layer 2: daily notes
│ ├── entities/ # Layer 1: knowledge graph
│ ├── experiences/ # EvoClaw
│ ├── significant/ # EvoClaw
│ ├── reflections/ # EvoClaw
│ ├── proposals/ # EvoClaw
│ └── pipeline/ # EvoClaw
└── soul-revisions/ # SOUL.md version snapshots
如果任何文件写入失败,立即停止并报告错误。
检查 $WORKSPACE/skills/evoclaw/SKILL.md 是否存在:
clawhub install evoclaw --force
--force 是因为 VirusTotal 可能误报,该 skill 已经过安全审查。检查 $WORKSPACE/skills/self-improving/SKILL.md 是否存在:
clawhub install self-improving --force
安装完成后,验证两个 skill 的 SKILL.md 文件存在且非空。
如果 clawhub CLI 不可用:
"clawhub 未找到。请手动安装依赖 skill:
clawhub install evoclawclawhub install self-improving安装完成后再次运行此 skill 继续配置。"
写入 $WORKSPACE/memory/evoclaw-state.json:
{
"mode": "advisory",
"require_approval": ["Core Identity", "Capability Tree", "Value Function"],
"auto_sections": ["Working Style", "User Understanding", "Evolution Log"],
"revision_dir": "soul-revisions",
"initialized": true
}
确认 evoclaw-state.json 存在且可解析为有效 JSON。
确保以下目录存在:
~/self-improving/
├── projects/
├── domains/
└── archive/
如果以下文件不存在,创建初始版本:
~/self-improving/memory.md:
# Self-Improving Memory
> Execution patterns and learned rules. Updated after corrections and lessons.
(empty — will accumulate through use)
~/self-improving/corrections.md:
# Corrections Log
> Failed attempts and their fixes. Each entry prevents the same mistake twice.
(empty — will accumulate through use)
~/self-improving/index.md:
# Self-Improving Index
> Quick reference to all domains, projects, and archived knowledge.
## Domains
(none yet)
## Projects
(none yet)
## Archive
(none yet)
如果文件已存在,不要覆盖——它们可能包含已积累的学习内容。
使用 openclaw config set 更新 heartbeat 设置:
openclaw config set agents.defaults.heartbeat.every "1h"
openclaw config set agents.defaults.heartbeat.target "last"
openclaw config set agents.defaults.heartbeat.directPolicy "allow"
如果 openclaw config set 命令不可用,直接编辑 openclaw.json:
agents.defaults.heartbeat 对象存在every: "1h"target: "last"directPolicy: "allow"逐项检查并报告 pass/fail:
| # | 检查项 | 验证方法 |
|---|---|---|
| 1 | AGENTS.md 存在且非空 | test -s $WORKSPACE/AGENTS.md |
| 2 | SOUL.md 存在且非空 | test -s $WORKSPACE/SOUL.md |
| 3 | HEARTBEAT.md 存在且非空 | test -s $WORKSPACE/HEARTBEAT.md |
| 4 | BOOTSTRAP.md 存在且非空 | test -s $WORKSPACE/BOOTSTRAP.md |
| 5 | GOALS.md 存在且非空 | test -s $WORKSPACE/GOALS.md |
| 6 | USER.md 存在且非空 | test -s $WORKSPACE/USER.md |
| 7 | IDENTITY.md 存在且非空 | test -s $WORKSPACE/IDENTITY.md |
| 8 | working-memory.md 存在且非空 | test -s $WORKSPACE/working-memory.md |
| 9 | long-term-memory.md 存在且非空 | test -s $WORKSPACE/long-term-memory.md |
| 10 | EvoClaw skill 已安装 | test -f $WORKSPACE/skills/evoclaw/SKILL.md |
| 11 | evoclaw-state.json 配置正确 | 读取并验证 mode=advisory |
| 12 | Self-Improving skill 已安装 | test -f $WORKSPACE/skills/self-improving/SKILL.md |
| 13 | ~/self-improving/ 目录就绪 | 检查 memory.md, corrections.md, index.md |
| 14 | Heartbeat 配置已写入 | 读取 openclaw.json 确认 heartbeat 字段 |
| 15 | memory/entities/ 目录存在 | test -d $WORKSPACE/memory/entities |
| 16 | memory/daily/ 目录存在 | test -d $WORKSPACE/memory/daily |
| 17 | soul-revisions/ 目录存在 | test -d $WORKSPACE/soul-revisions |
输出格式:
✓ AGENTS.md — pass
✓ SOUL.md — pass
✓ GOALS.md — pass
...
✗ EvoClaw — fail (SKILL.md not found)
判断:
只有 §9 全部通过后才执行此步骤。
$WORKSPACE/BOOTSTRAP.md"🧬 openclaw-soul 部署完成!
已安装:
- 宪法(AGENTS.md)— 含 Conductor 协议和委派规范
- 可进化灵魂(SOUL.md)— 带版本快照回滚
- 结构化心跳协议(HEARTBEAT.md)— 唤醒上下文 + 阻塞去重 + 预算感知
- PARA 三层记忆(entities 知识图谱 + daily 日记 + 隐性知识)
- 目标管理(GOALS.md)— 任务追溯到目标
- EvoClaw 治理(advisory 模式)
- Self-Improving Agent
现在开始你的第一次深度对话——我要认识你,然后定义我自己的性格。"
openclaw-soul v1.1.0 — Give your AI a soul that grows.
ZIP package — ready to use