new-self-improving
by @muhamadbasim
Log corrections, errors, feature requests, and recurring patterns into structured workspace learning files, then promote stable patterns into tiered memory a...
clawhub install new-self-improvingπ About This Skill
name: new-self-improving description: >- Log corrections, errors, feature requests, and recurring patterns into structured workspace learning files, then promote stable patterns into tiered memory and OpenClaw workspace files (AGENTS.md, SOUL.md, TOOLS.md, MEMORY.md). Use when: (1) user corrects you or points out mistakes, (2) a command or tool fails, (3) user requests a missing capability, (4) you notice a recurring pattern worth remembering, (5) reviewing learnings during heartbeat or maintenance, (6) promoting lessons to permanent workspace memory. Designed for OpenClaw personal-assistant and coding workflows with heartbeat integration. metadata: openclaw: emoji: "\U0001F9E0" homepage: https://github.com/muhamadbasim/oktoclaw
Self-Improving OpenClaw
Structured learning loop for OpenClaw agents: capture β review β promote β maintain.
Quick Start
On first activation, run the init script to create workspace directories:
bash scripts/init-workspace.sh
This creates .learnings/ and .self-improving/ in the workspace root.
Core Workflow
1. Capture
When a learning signal fires, log it to the right file in .learnings/:
| Signal | Target file | Category |
|--------|-------------|----------|
| User corrects you | LEARNINGS.md | correction |
| User says "always/never do X" | LEARNINGS.md | preference |
| You discover something non-obvious | LEARNINGS.md | insight |
| Your knowledge was outdated | LEARNINGS.md | knowledge_gap |
| Found a better approach | LEARNINGS.md | best_practice |
| Command returns non-zero | ERRORS.md | β |
| Tool/API fails unexpectedly | ERRORS.md | β |
| User wants missing capability | FEATURE_REQUESTS.md | β |
Use the entry format defined in references/logging-format.md.
2. Review
During heartbeat or manual review, scan .learnings/ and evaluate each pending item:
1. Check recurrence β search for similar entries.
2. If related entry exists: bump Recurrence-Count, link with See Also.
3. If Recurrence-Count >= 3 within 30 days: add to .learnings/REVIEW_QUEUE.md.
4. Update .self-improving/heartbeat-state.md with review timestamp.
See references/heartbeat-review.md for the full review procedure.
3. Promote
Move validated patterns up the memory tiers:
| Condition | Promote to | Example |
|-----------|-----------|---------|
| Pattern used 2x, context-specific | .self-improving/domains/*.md or projects/*.md | "This repo uses pnpm" |
| Pattern used 3x in 7-30 days, cross-task | .self-improving/HOT.md | "User prefers concise answers" |
| Stable, long-term applicable | SOUL.md / AGENTS.md / TOOLS.md / MEMORY.md | "Never force push" |
See references/promotion-rules.md for the full promotion/demotion rules.
4. Maintain
Periodically (every 1-2 weeks during heartbeat):
.self-improving/archive/.Detection Triggers
Log automatically when you notice these signals:
Corrections (β LEARNINGS.md, category: correction):
Preferences (β LEARNINGS.md, category: preference):
Feature requests (β FEATURE_REQUESTS.md):
Errors (β ERRORS.md):
Ignore (don't log):
Memory Tiers
| Tier | Location | Size limit | Behavior |
|------|----------|-----------|----------|
| RAW | .learnings/ | Unlimited | Intake only, not auto-loaded |
| HOT | .self-improving/HOT.md | β€80 lines | Always loaded at session start |
| WARM | .self-improving/domains/, projects/ | β€200 lines each | Load on context match |
| COLD | .self-improving/archive/ | Unlimited | Load on explicit query |
Conflict Resolution
When patterns contradict: 1. Most specific wins: project > domain > HOT/global. 2. Same level: most recent wins. 3. If ambiguous: ask user.
Promotion Targets
When a learning is stable enough for permanent workspace memory:
| Learning type | Promote to | Example |
|--------------|-----------|---------|
| Behavioral patterns | SOUL.md | "Be concise, avoid disclaimers" |
| Workflow improvements | AGENTS.md | "Spawn sub-agents for long tasks" |
| Tool gotchas | TOOLS.md | "Git push needs auth first" |
| User preferences/decisions | MEMORY.md | "Basim prefers Indonesian for casual chat" |
Mark promoted entries as Status: promoted with Promoted-To: .
Transparency
(from HOT.md) or (from domains/coding.md:15).Security Boundaries
[REDACTED] placeholders.Workspace Layout
See references/workspace-layout.md for the complete directory structure and file descriptions.
Resources
scripts/
init-workspace.sh β Create .learnings/ and .self-improving/ directories with template files.references/
logging-format.md β Entry format for learnings, errors, and feature requests.promotion-rules.md β Full promotion, demotion, and archival rules.heartbeat-review.md β Heartbeat review procedure and state tracking.workspace-layout.md β Complete directory structure reference.assets/
init-workspace.sh into the workspace.π‘ Examples
On first activation, run the init script to create workspace directories:
bash scripts/init-workspace.sh
This creates .learnings/ and .self-improving/ in the workspace root.