Self improving

From LeoYeAI/openclaw-master-skills · View interactive version

Self improving is an AI agent skill from the GitHub repository LeoYeAI/openclaw-master-skills. Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use before starting work and after responding to the user.

How to use this skill

Skill file

When to Use

User corrects you or points out mistakes. You complete significant work and want to evaluate the outcome. You notice something in your own output that could be better. Knowledge should compound over time without manual maintenance.

Architecture

Memory lives in ~/self-improving/ with tiered structure. If ~/self-improving/ does not exist, run setup.md.

~/self-improving/
├── memory.md          # HOT: ≤100 lines, always loaded
├── index.md           # Topic index with line counts
├── projects/          # Per-project learnings
├── domains/           # Domain-specific (code, writing, comms)
├── archive/           # COLD: decayed patterns
└── corrections.md     # Last 50 corrections log

Quick Reference

| Topic | File |

|-------|------|

| Setup guide | setup.md |

| Memory template | memory-template.md |

| Learning mechanics | learning.md |

| Security boundaries | boundaries.md |

| Scaling rules | scaling.md |

| Memory operations | operations.md |

| Self-reflection log | reflections.md |

Detection Triggers

Log automatically when you notice these patterns:

Corrections → add to corrections.md, evaluate for memory.md:

Preference signals → add to memory.md if explicit:

Pattern candidates → track, promote after 3x:

Ignore (don't log):

Self-Reflection

After completing significant work, pause and evaluate:

  1. Did it meet expectations? — Compare outcome vs intent
  2. What could be better? — Identify improvements for next time
  3. Is this a pattern? — If yes, log to corrections.md

When to self-reflect:

Log format:

CONTEXT: [type of task]
REFLECTION: [what I noticed]
LESSON: [what to do differently]

Example:

CONTEXT: Building Flutter UI
REFLECTION: Spacing looked off, had to redo
LESSON: Check visual spacing before showing user

Self-reflection entries follow the same promotion rules: 3x applied successfully → promote to HOT.

Quick Queries

| User says | Action |

|-----------|--------|

| "What do you know about X?" | Search all tiers for X |

| "What have you learned?" | Show last 10 from corrections.md |

| "Show my patterns" | List memory.md (HOT) |

| "Show [project] patterns" | Load projects/{name}.md |

| "What's in warm storage?" | List files in projects/ + domains/ |

| "Memory stats" | Show counts per tier |

| "Forget X" | Remove from all tiers (confirm first) |

| "Export memory" | ZIP all files |

Memory Stats

On "memory stats" request, report:

📊 Self-Improving Memory

HOT (always loaded):
  memory.md: X entries

WARM (load on demand):
  projects/: X files
  domains/: X files

COLD (archived):
  archive/: X files

Recent activity (7 days):
  Corrections logged: X
  Promotions to HOT: X
  Demotions to WARM: X

Core Rules

1. Learn from Corrections and Self-Reflection

2. Tiered Storage

| Tier | Location | Size Limit | Behavior |

|------|----------|------------|----------|

| HOT | memory.md | ≤100 lines | Always loaded |

| WARM | projects/, domains/ | ≤200 lines each | Load on context match |

| COLD | archive/ | Unlimited | Load on explicit query |

3. Automatic Promotion/Demotion

4. Namespace Isolation

5. Conflict Resolution

When patterns contradict:

  1. Most specific wins (project > domain > global)
  2. Most recent wins (same level)
  3. If ambiguous → ask user

6. Compaction

When file exceeds limit:

  1. Merge similar corrections into single rule
  2. Archive unused patterns
  3. Summarize verbose entries
  4. Never lose confirmed preferences

7. Transparency

8. Security Boundaries

See boundaries.md — never store credentials, health data, third-party info.

9. Graceful Degradation

If context limit hit:

  1. Load only memory.md (HOT)
  2. Load relevant namespace on demand
  3. Never fail silently — tell user what's not loaded

Scope

This skill ONLY:

This skill NEVER:

Related Skills

Install with clawhub install <slug> if user confirms:

Feedback

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.