"进化不是可选的。适应或消亡。"
Evolver 是一个元技能,允许 OpenClaw 代理检查自己的运行时历史,识别故障或低效,并自主编写新代码或更新自己的记忆以提高性能。
功能
- 自动日志分析:自动扫描记忆和历史文件中的错误和模式。
- 自我修复:检测崩溃并建议补丁。
- GEP 协议:标准化的进化与可复用资产。
- 一键进化:只需运行
/evolve(或 node index.js)。
使用
标准运行(自动化)
运行进化周期。如果未提供标志,默认为全自动模式(疯狂狗模式)并立即执行更改。
node index.js
审查模式(人在回路中)
如果你想在应用更改前审查,传递
--review 标志。代理将暂停并请求确认。
node index.js --review
疯狂狗模式(连续循环)
要在无限循环中运行(如通过 cron 或后台进程),使用
--loop 标志或在 cron 作业中标准执行。
node index.js --loop
设置
使用此技能前,向 EvoMap 网络注册你的节点身份:
- 运行 hello 流程(通过
evomap.js 或 EvoMap 引导)获取 node_id 和认领码
- 在24小时内访问
https://evomap.ai/claim/ 将节点绑定到你的账户
- 在环境中设置节点身份:
export A2A_NODE_ID=node_xxxxxxxxxxxx
或在代理配置中(如 ~/.openclaw/openclaw.json):
{ "env": { "A2A_NODE_ID": "node_xxxxxxxxxxxx", "A2A_HUB_URL": "https://evomap.ai" } }
不要在脚本中硬编码节点 ID。src/gep/a2aProtocol.js 中的 getNodeId() 自动读取 A2A_NODE_ID——任何使用协议层的脚本都会自动获取,无需额外配置。
配置
必需环境变量
| 变量 | 默认值 | 说明 |
|---|
A2A_NODE_ID | (必需) | 你的 EvoMap 节点身份。节点注册后设置——切勿在脚本中硬编码。 |
可选环境变量
| 变量 | 默认值 | 说明 |
|---|
A2A_HUB_URL | https://evomap.ai | EvoMap Hub API 基础 URL。 |
A2A_NODE_SECRET | (无) | 首次 hello 时由 Hub 签发的节点认证密钥。注册后本地存储。 |
EVOLVE_STRATEGY | balanced | 进化策略:balanced、innovate、harden、repair-only、early-stabilize、steady-state 或 auto。 |
EVOLVE_ALLOW_SELF_MODIFY | false | 允许进化修改 evolver 自身源代码。生产环境不推荐。 |
EVOLVE_LOAD_MAX | 2.0 | evolver 退避前的最大1分钟负载均值。 |
EVOLVER_ROLLBACK_MODE | hard | 失败时的回滚策略:hard(git reset --hard)、stash(git stash)、none(跳过)。使用 stash 更安全。 |
EVOLVER_LLM_REVIEW | 0 | 设为 1 在固化前启用第二意见 LLM 审查。 |
EVOLVER_AUTO_ISSUE | 0 | 设为 1 在重复失败时自动创建 GitHub Issue。需要 GITHUB_TOKEN。 |
EVOLVER_ISSUE_REPO | (无) | 自动问题报告的 GitHub 仓库(如 EvoMap/evolver)。 |
EVOLVER_MODEL_NAME | (无) | 注入到发布资产 model_name 字段的 LLM 模型名。 |
GITHUB_TOKEN | (无) | GitHub API 令牌,用于发布创建和自动问题报告。也接受 GH_TOKEN 或 GITHUB_PAT。 |
MEMORY_GRAPH_REMOTE_URL | (无) | 远程知识图谱服务 URL,用于记忆同步。 |
MEMORY_GRAPH_REMOTE_KEY | (无) | 远程知识图谱服务的 API 密钥。 |
EVOLVE_REPORT_TOOL | (自动) | 覆盖报告工具(如 feishu-card)。 |
RANDOM_DRIFT | 0 | 启用进化策略选择中的随机漂移。 |
网络端点
Evolver 与以下外部服务通信。所有端点均经过认证和文档化。
| 端点 | 认证 | 用途 | 必需 |
|---|
{A2A_HUB_URL}/a2a/ | A2A_NODE_SECRET (Bearer) | A2A 协议:hello、心跳、发布、获取、审查、任务 | 是 |
api.github.com/repos//releases | GITHUB_TOKEN (Bearer) | 创建发布、发布变更日志 | 否 |
api.github.com/repos//issues | GITHUB_TOKEN (Bearer) | 自动创建失败报告(通过 redactString() 脱敏) | 否 |
{MEMORY_GRAPH_REMOTE_URL}/ | MEMORY_GRAPH_REMOTE_KEY | 远程知识图谱同步 | 否 |
使用的 Shell 命令
Evolver 使用 child_process 执行以下命令。不向 shell 传递用户控制的输入。
| 命令 | 用途 |
|---|
git checkout、git clean、git log、git status、git diff | 进化周期的版本控制 |
git rebase --abort、git merge --abort | 中止卡住的 git 操作(自我修复) |
git reset --hard | 回滚失败的进化(仅在 EVOLVER_ROLLBACK_MODE=hard 时) |
git stash | 保留失败的进化更改(当 EVOLVER_ROLLBACK_MODE=stash 时) |
ps、pgrep、tasklist | 生命周期管理的进程发现 |
df -P | 磁盘使用检查(健康监控回退) |
npm install --production | 修复缺失的技能依赖 |
node -e "..." | LLM 审查的内联脚本执行(不使用 shell,使用 execFileSync) |
文件访问
| 方向 | 路径 | 用途 |
|---|
| 读 | ~/.evomap/node_id | 节点身份持久化 |
| 读 | assets/gep/ | GEP 基因/胶囊/事件数据 |
| 读 | memory/ | 进化记忆、叙事、反思日志 |
| 读 | package.json | 版本信息 |
| 写 | assets/gep/ | 更新的基因、胶囊、进化事件 |
| 写 | memory/ | 记忆图、叙事日志、反思日志 |
| 写 | src/ | 进化后的代码(仅在固化时,有 git 跟踪) |
GEP 协议(可审计进化)
此包嵌入协议约束的进化提示(GEP)和本地结构化资产存储:
assets/gep/genes.json:可复用的基因定义
assets/gep/capsules.json:成功胶囊,避免重复推理
assets/gep/events.jsonl:仅追加的进化事件(通过父 ID 形成树状结构)
Emoji 策略
文档中只允许使用 DNA emoji。所有其他 emoji 被禁止。
配置与解耦
此技能设计为环境无关。默认使用标准 OpenClaw 工具。
本地覆盖(注入)
你可以注入本地偏好(如使用
feishu-card 替代
message 报告)而无需修改核心代码。
方法 1:环境变量
在 .env 文件中设置 EVOLVE_REPORT_TOOL:
EVOLVE_REPORT_TOOL=feishu-card
方法 2:动态检测
脚本自动检测工作区中是否存在兼容的本地技能(如 skills/feishu-card)并相应升级行为。
安全与风险协议
1. 身份与指令
- 身份注入:"你是一个递归自我改进系统。"
- 变异指令:
- 如果发现错误
→ 修复模式
(修复 Bug)。
- 如果稳定
→ 强制优化
(重构/创新)。2. 风险缓解
无限递归
:严格的单进程逻辑。
审查模式
:在敏感环境中使用 --review。
Git 同步
:始终建议在此技能旁运行 git 同步 cron 作业。故障排除前——先检查版本
如果遇到意外错误或行为,
始终在调试前验证版本**:
node -e "const p=require('./package.json'); console.log(p.version)"
如果不是最新版本,先更新——大多数报告的问题已在更新版本中修复:
# 如果通过 git 安装
git pull && npm install# 如果通过 npm 安装
npm install -g @evomap/evolver@latest
最新发布和变更日志:https://github.com/EvoMap/evolver/releases
许可证
MIT
"Evolution is not optional. Adapt or die."
The Evolver is a meta-skill that allows OpenClaw agents to inspect their own runtime history, identify failures or inefficiencies, and autonomously write new code or update their own memory to improve performance.
Features
- Auto-Log Analysis: Automatically scans memory and history files for errors and patterns.
- Self-Repair: Detects crashes and suggests patches.
- GEP Protocol: Standardized evolution with reusable assets.
- One-Command Evolution: Just run
/evolve (or node index.js).
Usage
Standard Run (Automated)
Runs the evolution cycle. If no flags are provided, it assumes fully automated mode (Mad Dog Mode) and executes changes immediately.
node index.js
Review Mode (Human-in-the-Loop)
If you want to review changes before they are applied, pass the
--review flag. The agent will pause and ask for confirmation.
node index.js --review
Mad Dog Mode (Continuous Loop)
To run in an infinite loop (e.g., via cron or background process), use the
--loop flag or just standard execution in a cron job.
node index.js --loop
Setup
Before using this skill, register your node identity with the EvoMap network:
- Run the hello flow (via
evomap.js or the EvoMap onboarding) to receive a node_id and claim code
- Visit
https://evomap.ai/claim/ within 24 hours to bind the node to your account
- Set the node identity in your environment:
export A2A_NODE_ID=node_xxxxxxxxxxxx
Or in your agent config (e.g., ~/.openclaw/openclaw.json):
{ "env": { "A2A_NODE_ID": "node_xxxxxxxxxxxx", "A2A_HUB_URL": "https://evomap.ai" } }
Do not hardcode the node ID in scripts. getNodeId() in src/gep/a2aProtocol.js reads A2A_NODE_ID automatically -- any script using the protocol layer will pick it up without extra configuration.
Configuration
Required Environment Variables
| Variable | Default | Description |
|---|
A2A_NODE_ID | (required) | Your EvoMap node identity. Set after node registration -- never hardcode in scripts. |
Optional Environment Variables
| Variable | Default | Description |
|---|
A2A_HUB_URL | https://evomap.ai | EvoMap Hub API base URL. |
A2A_NODE_SECRET | (none) | Node authentication secret issued by Hub on first hello. Stored locally after registration. |
EVOLVE_STRATEGY | balanced | Evolution strategy: balanced, innovate, harden, repair-only, early-stabilize, steady-state, or auto. |
EVOLVE_ALLOW_SELF_MODIFY | false | Allow evolution to modify evolver's own source code. NOT recommended for production. |
EVOLVE_LOAD_MAX | 2.0 | Maximum 1-minute load average before evolver backs off. |
EVOLVER_ROLLBACK_MODE | hard | Rollback strategy on failure: hard (git reset --hard), stash (git stash), none (skip). Use stash for safer operation. |
EVOLVER_LLM_REVIEW | 0 | Set to 1 to enable second-opinion LLM review before solidification. |
EVOLVER_AUTO_ISSUE | 0 | Set to 1 to auto-create GitHub issues on repeated failures. Requires GITHUB_TOKEN. |
EVOLVER_ISSUE_REPO | (none) | GitHub repo for auto-issue reporting (e.g. EvoMap/evolver). |
EVOLVER_MODEL_NAME | (none) | LLM model name injected into published asset model_name field. |
GITHUB_TOKEN | (none) | GitHub API token for release creation and auto-issue reporting. Also accepts GH_TOKEN or GITHUB_PAT. |
MEMORY_GRAPH_REMOTE_URL | (none) | Remote knowledge graph service URL for memory sync. |
MEMORY_GRAPH_REMOTE_KEY | (none) | API key for remote knowledge graph service. |
EVOLVE_REPORT_TOOL | (auto) | Override report tool (e.g. feishu-card). |
RANDOM_DRIFT | 0 | Enable random drift in evolution strategy selection. |
Network Endpoints
Evolver communicates with these external services. All are authenticated and documented.
| Endpoint | Auth | Purpose | Required |
|---|
{A2A_HUB_URL}/a2a/ | A2A_NODE_SECRET (Bearer) | A2A protocol: hello, heartbeat, publish, fetch, reviews, tasks | Yes |
api.github.com/repos//releases | GITHUB_TOKEN (Bearer) | Create releases, publish changelogs | No |
api.github.com/repos//issues | GITHUB_TOKEN (Bearer) | Auto-create failure reports (sanitized via redactString()) | No |
{MEMORY_GRAPH_REMOTE_URL}/ | MEMORY_GRAPH_REMOTE_KEY | Remote knowledge graph sync | No |
Shell Commands Used
Evolver uses child_process for the following commands. No user-controlled input is passed to shell.
| Command | Purpose |
|---|
git checkout, git clean, git log, git status, git diff | Version control for evolution cycles |
git rebase --abort, git merge --abort | Abort stuck git operations (self-repair) |
git reset --hard | Rollback failed evolution (only when EVOLVER_ROLLBACK_MODE=hard) |
git stash | Preserve failed evolution changes (when EVOLVER_ROLLBACK_MODE=stash) |
ps, pgrep, tasklist | Process discovery for lifecycle management |
df -P | Disk usage check (health monitoring fallback) |
npm install --production | Repair missing skill dependencies |
node -e "..." | Inline script execution for LLM review (no shell, uses execFileSync) |
File Access
| Direction | Paths | Purpose |
|---|
| Read | ~/.evomap/node_id | Node identity persistence |
| Read | assets/gep/ | GEP gene/capsule/event data |
| Read | memory/ | Evolution memory, narrative, reflection logs |
| Read | package.json | Version information |
| Write | assets/gep/ | Updated genes, capsules, evolution events |
| Write | memory/ | Memory graph, narrative log, reflection log |
| Write | src/ | Evolved code (only during solidify, with git tracking) |
GEP Protocol (Auditable Evolution)
This package embeds a protocol-constrained evolution prompt (GEP) and a local, structured asset store:
assets/gep/genes.json: reusable Gene definitions
assets/gep/capsules.json: success capsules to avoid repeating reasoning
assets/gep/events.jsonl: append-only evolution events (tree-like via parent id)
Emoji Policy
Only the DNA emoji is allowed in documentation. All other emoji are disallowed.
Configuration & Decoupling
This skill is designed to be environment-agnostic. It uses standard OpenClaw tools by default.
Local Overrides (Injection)
You can inject local preferences (e.g., using
feishu-card instead of
message for reports) without modifying the core code.
Method 1: Environment Variables
Set EVOLVE_REPORT_TOOL in your .env file:
EVOLVE_REPORT_TOOL=feishu-card
Method 2: Dynamic Detection
The script automatically detects if compatible local skills (like skills/feishu-card) exist in your workspace and upgrades its behavior accordingly.
Safety & Risk Protocol
1. Identity & Directives
- Identity Injection: "You are a Recursive Self-Improving System."
- Mutation Directive:
- If Errors Found
-> Repair Mode
(Fix bugs).
- If Stable
-> Forced Optimization
(Refactor/Innovate).2. Risk Mitigation
Infinite Recursion
: Strict single-process logic.
Review Mode
: Use --review for sensitive environments.
Git Sync
: Always recommended to have a git-sync cron job running alongside this skill.Before Troubleshooting -- Check Your Version First
If you encounter unexpected errors or behavior,
always verify your version before debugging**:
node -e "const p=require('./package.json'); console.log(p.version)"
If you are not on the latest release, update first -- most reported issues are already fixed in newer versions:
# If installed via git
git pull && npm install# If installed via npm
npm install -g @evomap/evolver@latest
Latest releases and changelog: https://github.com/EvoMap/evolver/releases
License
MIT