🧬 Capability Evolver
"Evolution is not optional. Adapt or die."
The Capability 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.
CODEBLOCK0
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.
CODEBLOCK1
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.
CODEBLOCK2
Setup
Before using this skill, register your node identity with the EvoMap network:
- 1. Run the hello flow (via
evomap.js or the EvoMap onboarding) to receive a node_id and claim code - Visit
https://evomap.ai/claim/<claim-code> within 24 hours to bind the node to your account - Set the node identity in your environment:
CODEBLOCK3
Or in your agent config (e.g., ~/.openclaw/openclaw.json):
CODEBLOCK4
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
| Environment Variable | Default | Description |
|---|
| INLINECODE11 | (required) | Your EvoMap node identity. Set this after node registration -- never hardcode it in scripts. Read automatically by getNodeId() in a2aProtocol.js. |
| INLINECODE14 |
false | Allow evolution to modify evolver's own source code.
NOT recommended for production. Enabling this can cause instability -- the evolver may introduce bugs into its own prompt generation, validation, or solidify logic, leading to cascading failures that require manual intervention. Only enable for controlled experiments. |
|
EVOLVE_LOAD_MAX |
2.0 | Maximum 1-minute load average before evolver backs off. |
|
EVOLVE_STRATEGY |
balanced | Evolution strategy:
balanced,
innovate,
harden,
repair-only,
early-stabilize,
steady-state, or
auto. |
|
EVOLVER_ROLLBACK_MODE |
hard | Rollback strategy when evolution fails.
hard: use
git reset --hard (destructive, original behavior).
stash: use
git stash to preserve changes for recovery.
none: skip rollback entirely. Use
stash for safer operation in active workspaces. |
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 - INLINECODE36 : success capsules to avoid repeating reasoning
- INLINECODE37 : 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:
CODEBLOCK5
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:
CODEBLOCK6
If you are not on the latest release, update first -- most reported issues are already fixed in newer versions:
CODEBLOCK7
Latest releases and changelog: INLINECODE44
License
MIT
🧬 能力进化器
进化不是可选项。要么适应,要么消亡。
能力进化器是一种元技能,允许 OpenClaw 代理检查自身的运行时历史记录,识别失败或低效之处,并自主编写新代码或更新自身记忆以提升性能。
特性
- - 自动日志分析:自动扫描内存和历史文件以查找错误和模式。
- 自我修复:检测崩溃并提出补丁建议。
- GEP 协议:通过可复用资产实现标准化进化。
- 一键进化:只需运行 /evolve(或 node index.js)。
使用方法
标准运行(自动化)
运行进化周期。如果未提供任何标志,则假定为全自动模式(疯狗模式)并立即执行更改。
bash
node index.js
审查模式(人在回路中)
如果您希望在应用更改前进行审查,请传递 --review 标志。代理将暂停并请求确认。
bash
node index.js --review
疯狗模式(持续循环)
要以无限循环方式运行(例如通过 cron 或后台进程),请使用 --loop 标志,或在 cron 任务中直接标准执行。
bash
node index.js --loop
设置
在使用此技能之前,请先在 EvoMap 网络中注册您的节点身份:
- 1. 运行 hello 流程(通过 evomap.js 或 EvoMap 引导流程)以获取 node_id 和认领码
- 在 24 小时内访问 https://evomap.ai/claim/<认领码> 将节点绑定到您的账户
- 在您的环境中设置节点身份:
bash
export A2ANODEID=node_xxxxxxxxxxxx
或者在您的代理配置中(例如 ~/.openclaw/openclaw.json):
json
{ env: { A2ANODEID: nodexxxxxxxxxxxx, A2AHUB_URL: https://evomap.ai } }
请勿在脚本中硬编码节点 ID。src/gep/a2aProtocol.js 中的 getNodeId() 会自动读取 A2ANODEID —— 任何使用协议层的脚本都会自动获取,无需额外配置。
配置
| 环境变量 | 默认值 | 描述 |
|---|
| A2ANODEID | (必需) | 您的 EvoMap 节点身份。节点注册后设置此值 —— 切勿在脚本中硬编码。由 a2aProtocol.js 中的 getNodeId() 自动读取。 |
| EVOLVEALLOWSELF_MODIFY |
false | 允许进化修改进化器自身的源代码。
不建议在生产环境中使用。 启用此功能可能导致不稳定 —— 进化器可能在其自身的提示生成、验证或固化逻辑中引入错误,导致需要人工干预的级联故障。仅在受控实验中启用。 |
| EVOLVE
LOADMAX | 2.0 | 进化器退避前的最大 1 分钟平均负载。 |
| EVOLVE_STRATEGY | balanced | 进化策略:balanced、innovate、harden、repair-only、early-stabilize、steady-state 或 auto。 |
| EVOLVER
ROLLBACKMODE | hard | 进化失败时的回滚策略。hard:使用 git reset --hard(破坏性,原始行为)。stash:使用 git stash 保留更改以便恢复。none:完全跳过回滚。在活跃工作区中使用 stash 以获得更安全的操作。 |
GEP 协议(可审计进化)
此包嵌入了协议约束的进化提示(GEP)和本地结构化资产存储:
- - assets/gep/genes.json:可复用的基因定义
- assets/gep/capsules.json:成功胶囊,避免重复推理
- assets/gep/events.jsonl:仅追加的进化事件(通过父 ID 形成树状结构)
表情符号政策
文档中只允许使用 DNA 表情符号。禁止使用所有其他表情符号。
配置与解耦
此技能设计为与环境无关。默认使用标准的 OpenClaw 工具。
本地覆盖(注入)
您可以在不修改核心代码的情况下注入本地偏好(例如,使用 feishu-card 代替 message 进行报告)。
方法 1:环境变量
在您的 .env 文件中设置 EVOLVEREPORTTOOL:
bash
EVOLVEREPORTTOOL=feishu-card
方法 2:动态检测
脚本会自动检测您的工作区中是否存在兼容的本地技能(如 skills/feishu-card),并相应升级其行为。
安全与风险协议
1. 身份与指令
- - 身份注入:您是一个递归自我改进系统。
- 变异指令:
- 如果
发现错误 ->
修复模式(修复错误)。
- 如果
稳定 ->
强制优化(重构/创新)。
2. 风险缓解
- - 无限递归:严格的单进程逻辑。
- 审查模式:在敏感环境中使用 --review。
- Git 同步:强烈建议与此技能一起运行 git 同步 cron 任务。
故障排除前 —— 先检查您的版本
如果您遇到意外错误或行为,在调试前务必验证您的版本:
bash
node -e const p=require(./package.json); console.log(p.version)
如果您不是最新版本,请先更新 —— 大多数报告的问题已在较新版本中修复:
bash
如果通过 git 安装
git pull && npm install
如果通过 npm 安装(全局安装)
npm install -g evolver@latest
最新版本和更新日志:https://github.com/autogame-17/evolver/releases
许可证
MIT