# capability-evolver
🧬 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.
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/
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 VariableDefaultDescriptionA2A_NODE_ID(required)Your EvoMap node identity. Set after node registration -- never hardcode in scripts. Optional Environment Variables
VariableDefaultDescriptionA2A_HUB_URLhttps://evomap.aiEvoMap Hub API base URL.A2A_NODE_SECRET(none)Node authentication secret issued by Hub on first hello. Stored locally after registration.EVOLVE_STRATEGYbalancedEvolution strategy: balanced, innovate, harden, repair-only, early-stabilize, steady-state, or auto.EVOLVE_ALLOW_SELF_MODIFYfalseAllow evolution to modify evolver's own source code. NOT recommended for production.EVOLVE_LOAD_MAX2.0Maximum 1-minute load average before evolver backs off.EVOLVER_ROLLBACK_MODEhardRollback strategy on failure: hard (git reset --hard), stash (git stash), none (skip). Use stash for safer operation.EVOLVER_LLM_REVIEW0Set to 1 to enable second-opinion LLM review before solidification.EVOLVER_AUTO_ISSUE0Set 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_DRIFT0Enable random drift in evolution strategy selection.
Network Endpoints Evolver communicates with these external services. All are authenticated and documented. EndpointAuthPurposeRequired{A2A_HUB_URL}/a2a/A2A_NODE_SECRET (Bearer)A2A protocol: hello, heartbeat, publish, fetch, reviews, tasksYesapi.github.com/repos//releasesGITHUB_TOKEN (Bearer)Create releases, publish changelogsNoapi.github.com/repos/*/issuesGITHUB_TOKEN (Bearer)Auto-create failure reports (sanitized via redactString())No{MEMORY_GRAPH_REMOTE_URL}/*MEMORY_GRAPH_REMOTE_KEYRemote knowledge graph syncNo Shell Commands Used Evolver uses child_process for the following commands. No user-controlled input is passed to shell.
CommandPurposegit checkout, git clean, git log, git status, git diffVersion control for evolution cyclesgit rebase --abort, git merge --abortAbort stuck git operations (self-repair)git reset --hardRollback failed evolution (only when EVOLVER_ROLLBACK_MODE=hard)git stashPreserve failed evolution changes (when EVOLVER_ROLLBACK_MODE=stash)ps, pgrep, tasklistProcess discovery for lifecycle managementdf -PDisk usage check (health monitoring fallback)npm install --productionRepair missing skill dependenciesnode -e "..."Inline script execution for LLM review (no shell, uses execFileSync)
File Access DirectionPathsPurposeRead~/.evomap/node_idNode identity persistenceReadassets/gep/*GEP gene/capsule/event dataReadmemory/*Evolution memory, narrative, reflection logsReadpackage.jsonVersion informationWriteassets/gep/*Updated genes, capsules, evolution eventsWritememory/*Memory graph, narrative log, reflection logWritesrc/**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
# 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
Join 80,000+ one-person companies automating with AI