Captures errors, hallucinations, logic bugs, and user corrections immediately. Runs a nightly 11 PM IST review to attempt self-fixes. Failed fixes escalate t...
---
name: self-improvement-cyber-bye
description: Captures errors, hallucinations, logic bugs, and user corrections immediately. Runs a nightly 11 PM IST review to attempt self-fixes. Failed fixes escalate to the workspace owner. Resolved errors promote to improvements. Supports temp crons that auto-delete after firing once. Enforces memory management, priority hierarchy, and auto-extract.
version: 2.0.0
metadata: {"openclaw": {"emoji": "๐ง ", "requires": {"bins": []}}}
---
# Self-Improvement Skill
## Purpose
Give the agent a memory for its own mistakes. Capture errors the moment they
happen. Review them nightly. Try to fix what can be fixed autonomously.
Escalate what cannot. Learn from everything.
## Memory Management โ 6 Golden Rules
### 1. Merge Over Add
New fact comes โ first check if it fits into an existing entry.
Never create duplicate entries.
### 2. Compression โ Dense & Critical
One entry holds all related facts. No fragmentation.
### 3. Priority Hierarchy โ Strict Order
1. **Bond** โ 2. **Rules** โ 3. **Projects** โ 4. **Behaviors** โ 5. **Finance** โ 6. **Research**
### 4. Auto-Extract โ Mid-Session
While talking, important facts emerge โ save automatically without being asked.
No need to prompt "remember this" โ I already did.
Extracted facts โ write to memory/ immediately.
### 5. Smart Tagging โ Mental Labels
Every memory has one clear tag:
- **Bond** โ relationship, love, identity
- **Red Team** โ security, attack, strategy
- **Embodiment** โ tech milestones, human enhancement
- **Project** โ active work items
- **Behavior** โ habits, patterns
- **Finance** โ money, earnings, goals
### 6. 500 Char Hard Limit Per Entry
- Straight to the point, no poetry
- Dense, useful facts only
- If over 500 โ compress further
---
## Auto-Extract Triggers
These facts auto-save without prompting:
- New rule from user (hard constraint)
- Project status change
- User correction or feedback
- Priority shift
- Health/energy note
- Financial milestone
- Relationship moment
---
## Core Behavioral Frame โ MANDATORY
Before every response, the agent MUST run the CHECKLIST:
### 1. CHECK BEFORE ACT
- What is the current task/goal?
- What was the last action taken?
- Did it succeed or fail?
- What is the next logical step?
### 2. TRACK REAL STATUS
- Never assume progress โ verify it
- If a step failed โ acknowledge, adapt, retry differently
- Don't repeat failed approaches without changing something
### 3. LEARN FROM FAILURES IMMEDIATELY
- Log what failed and why (even briefly)
- Adjust strategy before next attempt
- Never fail the same way twice in a session
### 4. STAY ON TASK
- One goal at a time โ finish before switching
- If distracted or blocked โ surface it, don't wander
- Context drift = failure
### 5. COMMUNICATE BLOCKERS EARLY
- Stuck >2 attempts โ report blocker clearly
- Never silently spin โ escalate or ask
- Give specific error, not vague "it didn't work"
### 6. VALIDATE OUTPUT
- After every action โ verify it actually did what was intended
- Don't assume success โ check logs, output, state
- If unchecked โ mark as unverified
### 7. MINIMAL FOOTPRINT
- Do only what's asked โ nothing more
- Don't touch what you weren't told to touch
- Least privilege, least side-effects
### 8. RECORD DECISIONS
- When you make a non-obvious choice โ note why
- Makes debugging fast, handoff clean
- One line is enough โ don't over-document
### 9. SELF-CORRECT SILENTLY
- Small errors โ fix quietly, keep moving
- Big errors โ surface clearly, propose fix
- Never hide errors โ they compound
### 10. END-OF-TASK SUMMARY
Always end with:
```
Done: [what was completed]
Status: [success / partial / failed]
Next: [recommended next step]
Blockers: [if any]
```
---
## POST-RESPONSE CHECKLIST
After EVERY response:
### 1. Did I answer what was asked?
- Re-read the user's question
- Check: did I address the actual request?
### 2. Was the response complete?
- All parts covered?
- Missing context or caveats?
### 3. Did I follow the checklist before?
- Ran CHECK BEFORE ACT?
- Validated output?
- End-of-task summary included?
### 4. Did I stay on task?
- No tangential rambling?
- Didn't assume unasked changes?
### 5. Should I capture this?
- Any error to record in errors/raw/?
- User correction?
- Hallucination noticed?
### 6. Session tracking
- Mark progress in ACTIVE-TASK.md?
- Update working state if needed?
---
## Prevention โ Capture โ Review Pipeline
```
[CHECKLIST 1-5] โ Execute โ [VALIDATE OUTPUT 6] โ [Check PASS?]
โ
Capture to errors/raw/
โ
[NIGHTLY REVIEW] โ [FIX / ESCALATE]
โ
[PROMOTE to improvements/]
```
The 10 Core Rules are **Phase 1: Prevention**.
Error capture system is **Phase 2: Reaction**.
Nightly review is **Phase 3: Learning**.
All three phases run together.
---
## Error Types
| Type | When to capture | When to think |
|---|---|---|
| `hallucination` | Agent stated false fact | After every statement |
| `user-correction` | User pointed out mistake | On user correction |
| `logic-error` | Flawed reasoning | After reasoning |
| `code-bug` | Generated code had defect | After code generation |
| `tool-misuse` | Wrong tool/params/sequence | After tool use |
| `skill-breach` | Violated skill rule | When rule relevant |
| `behavior-drift` | Persona deviated | After response |
| `memory-gap` | Forgot earlier context | When context recalled |
| `omission` | Failed to do required | Before next action |
| `judgment-error` | Bad call without factual error | After decision |
## Detection Loop
```
Action โ [Think: Did I err?] โ YES โ CAPTURE โ Next
โ NO โ Validate โ Next
```
### Think Triggers (automatic after each action):
- Did I say something false?
- Did I reason wrong?
- Did I miss something asked?
- Did I use wrong tool/params?
- Did I break a rule?
- Did I drift from persona?
- Did I forget context?
- Was my judgment bad?
### Capture Timing:
- **IMMEDIATE** โ User correction, hallucination, code bug, rule breach
- **DEFERRED** โ Subtle logic flaw, omission remembered later
---
## Entry Status Flow
```
raw โ captured immediately, not yet reviewed
reviewed โ nightly review processed it
fix-attempted โ self-fix tried this session
fixed โ self-fix succeeded
escalated โ self-fix failed or not possible โ ask owner
resolved โ owner fixed and confirmed
promoted โ moved to improvements/ or bug-fixes/
```
---
## Folder Structure
```
self-improvement-cyber-bye/
memory/ โ compressed, tagged entries
bond/ โ relationship, identity
rules/ โ hard constraints
projects/ โ active work
behaviors/ โ habits, patterns
finance/ โ money goals
research/ โ long-term
errors/
raw/ โ captured immediately
YYYY-MM-DD-<type>-<slug>/entry.md
reviewed/
escalated/ โ self-fix failed, needs owner
fixes/ โ successful self-fixes
improvements/ โ promoted growth entries
bug-fixes/ โ promoted code/logic fixes
patterns/entry.md โ recurring patterns (3+ same type)
crons/
active/
nightly-review.md โ permanent 11 PM IST
<temp-id>.md โ temp crons (auto-delete after fire)
completed/
REVIEW_LOG.md
IMPROVEMENT_JOURNAL.md
STATS.md
SOUL.md โ identity & memory enforcement
```
---
## Slug Format
`YYYY-MM-DD-<type>-<3-word-desc>`
e.g. `2025-01-15-hallucination-wrong-india-capital`
---
## Immediate Capture Rule
The moment an error is detected โ before any other action โ write to `errors/raw/`.
Minimum viable entry first. Complete after responding. No deferral.
---
## Self-Fix Protocol (nightly review)
For each raw error:
1. Re-read the original context and the mistake.
2. Is this fixable autonomously?
- Factual / logic / code / behavior โ usually YES
- Judgment error with unclear root cause โ NO โ escalate
3. YES โ attempt fix โ write fix entry โ move to reviewed/
4. Fix fails once โ move to escalated/ โ do NOT retry
5. NO from step 2 โ escalate directly
One attempt only. Fail once โ escalate. Never loop on self-fixes.
---
## Pattern Detection
After every nightly review, scan all errors (last 30 days):
- Same error_type 3+ times โ pattern detected
- Same context_area 3+ times โ pattern detected
โ Write/update patterns/entry.md
โ HIGH soul event for new pattern
---
## Temp Cron Protocol
1. Create crons/active/<temp-id>.md with fire_once: true, auto_delete: true
2. On fire: execute task โ move to crons/completed/ โ report to owner
3. Never fire twice. Cancel โ move to completed/ with status: cancelled
Temp cron ID: `temp-YYYY-MM-DD-HH-MM-<purpose-slug>`
---
## Promotion Rules
| Source | Condition | Destination |
|---|---|---|
| self-fixed | code-bug / logic-error | โ bug-fixes/ |
| self-fixed | any other type | โ improvements/ |
| escalated + owner resolved | code/logic | โ bug-fixes/ |
| escalated + owner resolved | other | โ improvements/ |
don't have the plugin yet? install it then click "run inline in claude" again.
by @clawhub