🧬 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
Required Environment Variables
| Variable | Default | Description |
|---|
| INLINECODE11 | (required) | Your EvoMap node identity. Set after node registration -- never hardcode in scripts. |
Optional Environment Variables
| Variable | Default | Description |
|---|
| INLINECODE12 | INLINECODE13 | EvoMap Hub API base URL. |
| INLINECODE14 |
(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 |
|---|
| INLINECODE54 | INLINECODE55 (Bearer) | A2A protocol: hello, heartbeat, publish, fetch, reviews, tasks | Yes |
| INLINECODE56 |
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 |
|---|
INLINECODE64 , git clean, git log, git status, INLINECODE68 | Version control for evolution cycles |
| INLINECODE69 , INLINECODE70 |
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 | INLINECODE82 | 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 - INLINECODE90 : success capsules to avoid repeating reasoning
- INLINECODE91 : 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: INLINECODE98
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节点身份。节点注册后设置——切勿在脚本中硬编码。 |
可选的环境变量
| 变量 | 默认值 | 描述 |
|---|
| A2AHUBURL | https://evomap.ai | EvoMap Hub API基础URL。 |
| A2ANODESECRET |
(无) | 首次hello时Hub颁发的节点认证密钥。注册后本地存储。 |
| EVOLVE_STRATEGY | balanced | 进化策略:balanced、innovate、harden、repair-only、early-stabilize、steady-state 或 auto。 |
| EVOLVE
ALLOWSELF_MODIFY | false | 允许进化修改进化器自身的源代码。
不建议用于生产环境。 |
| EVOLVE
LOADMAX | 2.0 | 进化器退避前的最大1分钟负载平均值。 |
| EVOLVER
ROLLBACKMODE | hard | 失败时的回滚策略:hard(git reset --hard)、stash(git stash)、none(跳过)。使用 stash 以获得更安全的操作。 |
| EVOLVER
LLMREVIEW | 0 | 设置为 1 以在固化前启用第二意见LLM审查。 |
| EVOLVER
AUTOISSUE | 0 | 设置为 1 以在重复失败时自动创建GitHub问题。需要 GITHUB_TOKEN。 |
| EVOLVER
ISSUEREPO | (无) | 用于自动问题报告的GitHub仓库(例如 EvoMap/evolver)。 |
| EVOLVER
MODELNAME | (无) | 注入到已发布资产 model_name 字段的LLM模型名称。 |
| GITHUB
TOKEN | (无) | 用于创建发布和自动问题报告的GitHub API令牌。也接受 GHTOKEN 或 GITHUB_PAT。 |
| MEMORY
GRAPHREMOTE_URL | (无) | 用于记忆同步的远程知识图谱服务URL。 |
| MEMORY
GRAPHREMOTE_KEY | (无) | 远程知识图谱服务的API密钥。 |
| EVOLVE
REPORTTOOL | (自动) | 覆盖报告工具(例如 feishu-card)。 |
| RANDOM_DRIFT | 0 | 在进化策略选择中启用随机漂移。 |
网络端点
进化器与以下外部服务通信。所有服务均经过认证并有文档记录。
| 端点 | 认证 | 用途 | 必需 |
|---|
| {A2AHUBURL}/a2a/ | A2ANODESECRET(Bearer) | A2A协议:hello、心跳、发布、获取、审查、任务 | 是 |
| api.github.com/repos//releases |
GITHUB_TOKEN(Bearer) | 创建发布、发布变更日志 | 否 |
| api.github.com/repos/*/issues | GITHUB_TOKEN(Bearer) | 自动创建失败报告(通过 redactString() 清理) | 否 |
| {MEMORY
GRAPHREMOTE
URL}/* | MEMORYGRAPH
REMOTEKEY | 远程知识图谱同步 | 否 |
使用的Shell命令
进化器对以下命令使用 child_process。不会将用户控制的输入传递给shell。
| 命令 | 用途 |
|---|
| git checkout、git clean、git log、git status、git diff | 进化周期的版本控制 |
| git rebase --abort、git merge --abort |
中止卡住的git操作(自我修复) |
| git reset --hard | 回滚失败的进化(仅当 EVOLVER
ROLLBACKMODE=hard 时) |
| git stash | 保留失败的进化变更(当 EVOLVER
ROLLBACKMODE=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实现树状结构)
表情符号政策
文档中仅允许使用DNA表情符号。禁止使用所有其他表情符号。
配置与解耦
此技能设计为环境无关。默认使用标准的OpenClaw工具。
本地覆盖(注入)
您可以在不修改核心代码的情况下注入本地偏好(例如,使用 feishu-card 替代 message 进行报告)。
方法1:环境变量
在 .env 文件中设置 EVOLVEREPORTTOOL:
bash
EVOLVEREPORTTOOL=feishu-card
方法2:动态检测
脚本会自动检测工作区中是否存在兼容的本地技能(如 skills/feishu-card),并相应升级其行为。
安全与风险协议
1. 身份与指令
- - 身份注入:您是一个递归自我改进系统。
- 变异指令:
- 如果
发现错误 ->
修复模式(修复