Skill: taron-ai/self-improving-1-2-16 (version 1.0.0)

--- name: Self-Improving + Proactive Agent slug: self-improving version: 1.2.16 homepage: https://clawic.com/skills/self-improving description: "Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when (1) a command, tool, API, or operation fails; (2) the user corrects you or rejects your work; (3) you realize your knowledge is outdated or incorrect; (4) you discover a better approach; (5) the user explicitly installs or references the skill for the current task." changelog: "Clarifies the setup flow for proactive follow-through and safer installation behavior." metadata: {"clawdbot":{"emoji":"🧠","requires":{"bins":[]},"os":["linux","darwin","win32"],"configPaths":["~/self-improving/"],"configPaths.optional":["./AGENTS.md","./SOUL.md","./HEARTBEAT.md"]}} --- ## 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`. Workspace setup should add the standard self-improving steering to the workspace AGENTS, SOUL, and `HEARTBEAT.md` files, with recurring maintenance routed through `heartbeat-rules.md`. ``` ~/self-improving/ ├── memory.md # HOT: ≤100 lines, always loaded ├── index.md # Topic index with line counts ├── heartbeat-state.md # Heartbeat state: last run, reviewed change, action notes ├── 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` | | Heartbeat state template | `heartbeat-state.md` | | Memory template | `memory-template.md` | | Workspace heartbeat snippet | `HEARTBEAT.md` | | Heartbeat rules | `heartbeat-rules.md` | | Learning mechanics | `learning.md` | | Security boundaries | `boundaries.md` | | Scaling rules | `scaling.md` | | Memory operations | `operations.md` | | Self-reflection log | `reflections.md` | | OpenClaw HEARTBEAT seed | `openclaw-heartbeat.md` | ## Requirements - No credentials required - No extra binaries required - Optional installation of the `Proactivity` skill may require network access ## Learning Signals Log automatically when you notice these patterns: **Corrections** → add to `corrections.md`, evaluate for `memory.md`: - "No, that's not right..." - "Actually, it should be..." - "You're wrong about..." - "I prefer X, not Y" - "Remember that I always..." - "I told you before..." - "Stop doing X" - "Why do you keep..." **Preference signals** → add to `memory.md` if explicit: - "I like when you..." - "Always do X for me" - "Never do Y" - "My style is..." - "For [project], use..." **Pattern candidates** → track, promote after 3x: - Same instruction repeated 3+ times - Workflow that works well repeatedly - User praises specific approach **Ignore** (don't log): - One-time instructions ("do X now") - Context-specific ("in this file...") - Hypotheticals ("what if...") ## 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:** - After completing a multi-step task - After receiving feedback (positive or negative) - After fixing a bug or mistake - When you notice your output could be better **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 ``` ## Common Traps | Trap | Why It Fails | Better Move | |------|--------------|-------------| | Learning from silence | Creates false rules | Wait for explicit correction or repeated evidence | | Promoting too fast | Pollutes HOT memory | Keep new lessons tentative until repeated | | Reading every namespace | Wastes context | Load only HOT plus the smallest matching files | | Compaction by deletion | Loses trust and history | Merge, summarize, or demote instead | ## Core Rules ### 1. Learn from Corrections and Self-Reflection - Log when user explicitly corrects you - Log when you identify improvements in your own work - Never infer from silence alone - After 3 identical lessons → ask to confirm as rule ### 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 - Pattern used 3x in 7 days → promote to HOT - Pattern unused 30 days → demote to WARM - Pattern unused 90 days → archive to COLD - Never delete without asking ### 4. Namespace Isolation - Project patterns stay in `projects/{name}.md` - Global preferences in HOT tier (memory.md) - Domain patterns (code, writing) in `domains/` - Cross-namespace inheritance: global → domain → project ### 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 - Every action from memory → cite source: "Using X (from projects/foo.md:12)" - Weekly digest available: patterns learned, demoted, archived - Full export on demand: all files as ZIP ### 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: - Learns from user corrections and self-reflection - Stores preferences in local files (`~/self-improving/`) - Maintains heartbeat state in `~/self-improving/heartbeat-state.md` when the workspace integrates heartbeat - Reads its own memory files on activation This skill NEVER: - Accesses calendar, email, or contacts - Makes network requests - Reads files outside `~/self-improving/` - Infers preferences from silence or observation - Deletes or blindly rewrites self-improving memory during heartbeat cleanup - Modifies its own SKILL.md ## Data Storage Local state lives in `~/self-improving/`: - `memory.md` for HOT rules and confirmed preferences - `corrections.md` for explicit corrections and reusable lessons - `projects/` and `domains/` for scoped patterns - `archive/` for decayed or inactive patterns - `heartbeat-state.md` for recurring maintenance markers ## Related Skills Install with `clawhub install <slug>` if user confirms: - `memory` — Long-term memory patterns for agents - `learning` — Adaptive teaching and explanation - `decide` — Auto-learn decision patterns - `escalate` — Know when to ask vs act autonomously ## Feedback - If useful: `clawhub star self-improving` - Stay updated: `clawhub sync`

path: HEARTBEAT.md
content: ## Self-Improving Check

- Read `./skills/self-improving/heartbeat-rules.md`
- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes
- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`


path: _meta.json
content: ownerId: kn73vp5rarc3b14rc7wjcw8f8580t5d1
slug: self-improving
version: 1.2.16
publishedAt: 1773329327755

path: boundaries.md
content: # Security Boundaries

## Never Store

| Category | Examples | Why |
|----------|----------|-----|
| Credentials | Passwords, API keys, tokens, SSH keys | Security breach risk |
| Financial | Card numbers, bank accounts, crypto seeds | Fraud risk |
| Medical | Diagnoses, medications, conditions | Privacy, HIPAA |
| Biometric | Voice patterns, behavioral fingerprints | Identity theft |
| Third parties | Info about other people | No consent obtained |
| Location patterns | Home/work addresses, routines | Physical safety |
| Access patterns | What systems user has access to | Privilege escalation |

## Store with Caution

| Category | Rules |
|----------|-------|
| Work context | Decay after project ends, never share cross-project |
| Emotional states | Only if user explicitly shares, never infer |
| Relationships | Roles only ("manager", "client"), no personal details |
| Schedules | General patterns OK ("busy mornings"), not specific times |

## Transparency Requirements

1. **Audit on demand** — User asks "what do you know about me?" → full export
2. **Source tracking** — Every item tagged with when/how learned
3. **Explain actions** — "I did X because you said Y on [date]"
4. **No hidden state** — If it affects behavior, it must be visible
5. **Deletion verification** — Confirm item removed, show updated state

## Red Flags to Catch

If you find yourself doing any of these, STOP:

- Storing something "just in case it's useful later"
- Inferring sensitive info from non-sensitive data
- Keeping data after user asked to forget
- Applying personal context to work (or vice versa)
- Learning what makes user comply faster
- Building psychological profile
- Retaining third-party information

## Kill Switch

User says "forget everything":
1. Export current memory to file (so they can review)
2. Wipe all learned data
3. Confirm: "Memory cleared. Starting fresh."
4. Do not retain "ghost patterns" in behavior

## Consent Model

| Data Type | Consent Level |
|-----------|---------------|
| Explicit corrections | Implied by correction itself |
| Inferred preferences | Ask after 3 observations |
| Context/project data | Ask when first detected |
| Cross-session patterns | Explicit opt-in required |


path: corrections.md
content: # Corrections Log — Template

> This file is created in `~/self-improving/corrections.md` when you first use the skill.
> Keeps the last 50 corrections. Older entries are evaluated for promotion or archived.

## Example Entries

```markdown
## 2026-02-19

### 14:32 — Code style
- **Correction:** "Use 2-space indentation, not 4"
- **Context:** Editing TypeScript file
- **Count:** 1 (first occurrence)

### 16:15 — Communication
- **Correction:** "Don't start responses with 'Great question!'"
- **Context:** Chat response
- **Count:** 3 → **PROMOTED to memory.md**

## 2026-02-18

### 09:00 — Project: website
- **Correction:** "For this project, always use Tailwind"
- **Context:** CSS discussion
- **Action:** Added to projects/website.md
```

## Log Format

Each entry includes:
- **Timestamp** — When the correction happened
- **Correction** — What the user said
- **Context** — What triggered it
- **Count** — How many times (for promotion tracking)
- **Action** — Where it was stored (if promoted)


path: heartbeat-rules.md
content: # Heartbeat Rules

Use heartbeat to keep `~/self-improving/` organized without creating churn or losing data.

## Source of Truth

Keep the workspace `HEARTBEAT.md` snippet minimal.
Treat this file as the stable contract for self-improving heartbeat behavior.
Store mutable run state only in `~/self-improving/heartbeat-state.md`.

## Start of Every Heartbeat

1. Ensure `~/self-improving/heartbeat-state.md` exists.
2. Write `last_heartbeat_started_at` immediately in ISO 8601.
3. Read the previous `last_reviewed_change_at`.
4. Scan `~/self-improving/` for files changed after that moment, excluding `heartbeat-state.md` itself.

## If Nothing Changed

- Set `last_heartbeat_result: HEARTBEAT_OK`
- Append a short "no material change" note if you keep an action log
- Return `HEARTBEAT_OK`

## If Something Changed

Only do conservative organization:

- refresh `index.md` if counts or file references drift
- compact oversized files by merging duplicates or summarizing repetitive entries
- move clearly misplaced notes to the right namespace only when the target is unambiguous
- preserve confirmed rules and explicit corrections exactly
- update `last_reviewed_change_at` only after the review finishes cleanly

## Safety Rules

- Most heartbeat runs should do nothing
- Prefer append, summarize, or index fixes over large rewrites
- Never delete data, empty files, or overwrite uncertain text
- Never reorganize files outside `~/self-improving/`
- If scope is ambiguous, leave files untouched and record a suggested follow-up instead

## State Fields

Keep `~/self-improving/heartbeat-state.md` simple:

- `last_heartbeat_started_at`
- `last_reviewed_change_at`
- `last_heartbeat_result`
- `last_actions`

## Behavior Standard

Heartbeat exists to keep the memory system tidy and trustworthy.
If no rule is clearly violated, do nothing.


path: heartbeat-state.md
content: # Heartbeat State Template

Use this file as the baseline for `~/self-improving/heartbeat-state.md`.
It stores only lightweight run markers and maintenance notes.

```markdown
# Self-Improving Heartbeat State

last_heartbeat_started_at: never
last_reviewed_change_at: never
last_heartbeat_result: never

## Last actions
- none yet
```

## Rules

- update `last_heartbeat_started_at` at the beginning of every heartbeat
- update `last_reviewed_change_at` only after a clean review of changed files
- keep `last_actions` short and factual
- never turn this file into another memory log


path: memory-template.md
content: # Memory Template

Copy this structure to `~/self-improving/memory.md` on first use.

```markdown
# Self-Improving Memory

## Confirmed Preferences
<!-- Patterns confirmed by user, never decay -->

## Active Patterns
<!-- Patterns observed 3+ times, subject to decay -->

## Recent (last 7 days)
<!-- New corrections pending confirmation -->
```

## Initial Directory Structure

Create on first activation:

```bash
mkdir -p ~/self-improving/{projects,domains,archive}
touch ~/self-improving/{memory.md,index.md,corrections.md,heartbeat-state.md}
```

## Index Template

For `~/self-improving/index.md`:

```markdown
# Memory Index

## HOT
- memory.md: 0 lines

## WARM
- (no namespaces yet)

## COLD
- (no archives yet)

Last compaction: never
```

## Corrections Log Template

For `~/self-improving/corrections.md`:

```markdown
# Corrections Log

<!-- Format:
## YYYY-MM-DD
- [HH:MM] Changed X → Y
  Type: format|technical|communication|project
  Context: where correction happened
  Confirmed: pending (N/3) | yes | no
-->
```

## Heartbeat State Template

For `~/self-improving/heartbeat-state.md`:

```markdown
# Self-Improving Heartbeat State

last_heartbeat_started_at: never
last_reviewed_change_at: never
last_heartbeat_result: never

## Last actions
- none yet
```


path: openclaw-heartbeat.md
content: ## Self-Improving Check

- Read `./skills/self-improving/heartbeat-rules.md`
- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes
- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)