self-optimization
Turn mistakes, corrections, dead ends, and repeated fixes into durable improvements. Use when work reveals a non-obvious lesson, a recurring failure, a missing capability, or a rule that should be promoted into agent memory, workflow guidance, or a reusable skill.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/alethean-kaw/self-optimizationSelf-Optimization
Use this skill to close the loop after real work. The goal is not just to log what went wrong. The goal is to convert signal from mistakes, corrections, and repeated effort into stronger future behavior.
Core Loop
- Detect meaningful signal.
- Capture it in
.learnings/. - De-duplicate and link related entries.
- Promote stable patterns into durable guidance.
- Extract reusable skills when the pattern is broad and proven.
Quick Reference
| Situation | Action |
|---|---|
| Command, tool, or integration fails unexpectedly | Append an entry to .learnings/ERRORS.md |
| User corrects the agent or provides missing facts | Append an entry to .learnings/LEARNINGS.md |
| A better repeatable approach is discovered | Append an entry to .learnings/LEARNINGS.md |
| User asks for a missing capability | Append an entry to .learnings/FEATURE_REQUESTS.md |
| Same issue keeps reappearing | Link entries, bump priority, and consider promotion |
| Pattern is stable across tasks | Promote to AGENTS.md, CLAUDE.md, TOOLS.md, SOUL.md, or .github/copilot-instructions.md |
| Pattern is reusable beyond one repo | Extract a new skill scaffold |
Detection Triggers
Capture a learning when any of these happen:
- The first attempt was wrong and needed correction.
- A tool or command failed in a non-obvious way.
- The user revealed a project convention that was not documented.
- The agent discovered a stronger pattern than the one it started with.
- The same workaround or warning has appeared more than once.
- The user asked for a capability the current system does not provide.
Skip noisy one-off trivia. Capture things that would realistically save a future session time, confusion, or rework.
Log Files
Create a local .learnings/ directory in the workspace or in the OpenClaw workspace.
.learnings/
├── LEARNINGS.md
├── ERRORS.md
└── FEATURE_REQUESTS.md
LEARNINGS.md
Use for:
- corrections
- knowledge gaps
- best practices
- project conventions
- improved workflows
Template:
## [LRN-YYYYMMDD-XXX] category
**Logged**: 2026-04-01T10:00:00Z
**Priority**: low | medium | high | critical
**Status**: pending
**Area**: frontend | backend | infra | tests | docs | config
### Summary
One-line statement of the lesson.
### Details
What was wrong, what changed, and what is now known to be correct.
### Suggested Action
What to do differently next time.
### Metadata
- Source: conversation | debugging | user_feedback | simplify-and-harden
- Related Files: path/to/file
- Tags: tag-a, tag-b
- See Also: LRN-20260401-001
- Pattern-Key: optional.stable.key
- Recurrence-Count: 1
- First-Seen: 2026-04-01
- Last-Seen: 2026-04-01
---
ERRORS.md
Use for:
- command failures
- exceptions
- bad tool assumptions
- API or integration breakage
Template:
## [ERR-YYYY...
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-alethean-kaw-self-optimization": {
"enabled": true,
"auto_update": true
}
}
}