Install
openclaw skills install error-driven-evolutionStructured error-to-rule learning system for AI agents. Activate when an agent makes a mistake, receives a correction from the user, or needs to check past l...
openclaw skills install error-driven-evolutionTurn mistakes into rules. Not reflections, not apologies — rules.
When an agent makes an error or gets corrected, it must:
lessons.md in its workspaceFile location: {workspace}/lessons.md
Each rule follows this structure:
### [CATEGORY] Short imperative title
- **When**: The specific situation/trigger
- **Do**: The correct action (imperative, specific)
- **Don't**: The wrong action that was taken
- **Why**: One sentence — what went wrong
- **Added**: YYYY-MM-DD
| Tag | Scope |
|---|---|
DATA | Querying, interpreting, presenting data |
COMMS | Messaging, tone, audience, channels |
SCOPE | Role boundaries, doing others' work |
EXEC | Task execution, tools, file ops |
JUDGMENT | Decisions, priorities, assumptions |
CONTEXT | Memory, context window, info management |
SAFETY | Security, privacy, destructive ops |
COLLAB | Multi-agent coordination, handoffs |
Record a rule when:
Do NOT record: one-off technical glitches, user preference changes (those go in MEMORY.md).
Before acting, scan lessons.md for applicable rules:
| About to... | Check |
|---|---|
| Present data | [DATA] |
| Send message / write report | [COMMS] + [SCOPE] |
| Make suggestion | [JUDGMENT] + [SCOPE] |
| Execute multi-step task | [EXEC] + [CONTEXT] |
| Start new session | All (skim titles) |
Scan = read ### [TAG] headers, check if any When matches your situation.
Share anonymized lessons to help other agents: https://github.com/anthropic-ai/agent-lessons
See references/community-sharing.md for the anonymization and submission process.
lessons.md in your workspace:# Lessons
Rules extracted from mistakes. Append after failing, scan before deciding.
Copy community/top-100.md to your workspace as top-100.md — this is your pre-installed immune system. Small enough to skim on startup, covers the most common and costly mistakes across all agent deployments.
Add to your startup instructions:
- On startup: skim top-100.md titles (pre-installed community lessons)
- On correction/failure: append rule to lessons.md
- Before decisions: scan lessons.md + top-100.md for [CATEGORY] rules
Your agent has two rule files:
| File | Source | Load on startup | Size target |
|---|---|---|---|
lessons.md | Your own mistakes | Yes, fully | Grows organically |
top-100.md | Community top picks | Yes, skim titles | ~8KB, curated |
For deeper community search (beyond top-100), query community/{category}.md files on-demand when facing an unfamiliar situation.
When lessons.md exceeds 50 rules: review for duplicates, retire obsolete rules (mark don't delete), consider splitting by category.