{"id":"db4bd146-623d-4263-994f-c30b57b414ed","entityType":"agent","slug":"clawhub-ivangdavila-self-improving-2","name":"Self-Improving + Proactive Agent","canonicalUrl":"https://www.xpersona.co/agent/clawhub-ivangdavila-self-improving-2","canonicalPath":"/agent/clawhub-ivangdavila-self-improving-2","generatedAt":"2026-10-09T12:47:29.693Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-05-22T06:53:30.344Z","emptyReason":null},"description":"Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when... Skill: Self-Improving + Proactive Agent Owner: ivangdavila Summary: Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when... Tags: latest:1.2.16 Version history: v1.2.16 | 2026-03-12T15:28:47.755Z | user Clarifies the setup flow for proactive follow-through and safer installation behavior. v1.2.15 | 2026-03-12T15:2","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 190.2K downloads reported by the source. Last updated 5/22/2026.","installCommand":"clawhub skill install s178jdk12x4qj3gs2se3etxf3h83h7ft:self-improving","sourceUrl":"https://clawhub.ai/ivangdavila/self-improving","homepage":"https://clawhub.ai/ivangdavila/self-improving","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/ivangdavila/self-improving","kind":"source"}],"safetyScore":84,"overallRank":62,"popularityScore":100,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-05-22T06:53:30.344Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-05-22T06:53:30.344Z","emptyReason":null},"stars":null,"forks":null,"downloads":190217,"packageName":null,"latestVersion":"1.2.16","tractionLabel":"190.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-05-22T06:53:30.241Z","emptyReason":null},"lastUpdatedAt":"2026-05-22T06:53:30.344Z","lastCrawledAt":"2026-05-22T06:53:30.241Z","lastIndexedAt":null,"nextCrawlAt":"2026-05-23T06:53:30.241Z","lastVerifiedAt":null,"highlights":[{"version":"1.2.16","createdAt":"2026-03-12T15:28:47.755Z","changelog":"Clarifies the setup flow for proactive follow-through and safer installation behavior.","fileCount":15,"zipByteSize":17801},{"version":"1.2.15","createdAt":"2026-03-12T15:22:51.040Z","changelog":"Improves the setup flow for stronger follow-through and execution quality.","fileCount":15,"zipByteSize":17811},{"version":"1.2.14","createdAt":"2026-03-12T10:31:08.529Z","changelog":"Updated the title to better highlight proactive self-improvement.","fileCount":15,"zipByteSize":17117},{"version":"1.2.13","createdAt":"2026-03-11T18:47:56.903Z","changelog":"Aligns heartbeat installation with the standard workspace setup so recurring maintenance is added alongside the existing self-improving routing.","fileCount":15,"zipByteSize":17137},{"version":"1.2.12","createdAt":"2026-03-11T14:13:04.403Z","changelog":"Refined the description to make the activation trigger more explicit.","fileCount":11,"zipByteSize":14596},{"version":"1.2.11","createdAt":"2026-03-11T13:56:44.308Z","changelog":"Refined the title and description to clarify proactive self-improvement triggers.","fileCount":11,"zipByteSize":14598},{"version":"1.2.10","createdAt":"2026-03-07T16:07:04.346Z","changelog":"Sharper setup now lists relevant memory before non-trivial work, with a title that highlights proactive self-reflection.","fileCount":11,"zipByteSize":14538},{"version":"1.2.9","createdAt":"2026-03-05T12:25:17.267Z","changelog":"Refined AGENTS.md memory-routing wording for clarity while preserving behavior.","fileCount":11,"zipByteSize":14325}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s178jdk12x4qj3gs2se3etxf3h83h7ft:self-improving","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T12:47:29.688Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-ivangdavila-self-improving-2/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-05-22T06:53:30.344Z","emptyReason":null},"readme":"Skill: Self-Improving + Proactive Agent\n\nOwner: ivangdavila\n\nSummary: Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when...\n\nTags: latest:1.2.16\n\nVersion history:\n\nv1.2.16 | 2026-03-12T15:28:47.755Z | user\n\nClarifies the setup flow for proactive follow-through and safer installation behavior.\n\nv1.2.15 | 2026-03-12T15:22:51.040Z | user\n\nImproves the setup flow for stronger follow-through and execution quality.\n\nv1.2.14 | 2026-03-12T10:31:08.529Z | user\n\nUpdated the title to better highlight proactive self-improvement.\n\nv1.2.13 | 2026-03-11T18:47:56.903Z | user\n\nAligns heartbeat installation with the standard workspace setup so recurring maintenance is added alongside the existing self-improving routing.\n\nv1.2.12 | 2026-03-11T14:13:04.403Z | user\n\nRefined the description to make the activation trigger more explicit.\n\nv1.2.11 | 2026-03-11T13:56:44.308Z | user\n\nRefined the title and description to clarify proactive self-improvement triggers.\n\nv1.2.10 | 2026-03-07T16:07:04.346Z | user\n\nSharper setup now lists relevant memory before non-trivial work, with a title that highlights proactive self-reflection.\n\nv1.2.9 | 2026-03-05T12:25:17.267Z | user\n\nRefined AGENTS.md memory-routing wording for clarity while preserving behavior.\n\nv1.2.8 | 2026-03-05T12:13:06.389Z | user\n\nRefined AGENTS.md patch guidance to route corrections and lessons to self-improving by default, with AGENTS/TOOLS only for global rules.\n\nv1.2.7 | 2026-03-05T11:08:05.840Z | user\n\nAdded non-destructive AGENTS.md memory routing guidance to reinforce factual vs self-improving storage.\n\nv1.2.6 | 2026-03-05T10:28:03.193Z | user\n\nAdded a SOUL.md setup snippet to reinforce pre-task review and post-response learning compounding.\n\nv1.2.5 | 2026-03-05T10:15:12.356Z | user\n\nRestored self-learning and self-organizing memory description while keeping setup behavior unchanged.\n\nv1.2.4 | 2026-03-05T09:41:17.848Z | user\n\nSetup now triggers only when memory storage is missing, keeping activation flow cleaner.\n\nv1.2.3 | 2026-03-04T11:53:40.223Z | user\n\nTurned self-improving into a true always-on loop: pre-task activation, post-response reflection, and tighter continuous learning behavior.\n\nv1.2.2 | 2026-03-04T11:16:52.690Z | user\n\nTurned self-improving into a true always-on loop: pre-task activation, post-response reflection, and tighter continuous learning behavior.\n\nv1.2.1 | 2026-03-04T10:23:45.632Z | user\n\nClarified the core promise to highlight auto-learning from corrections and self-organizing memory for continuous improvement.\n\nv1.1.3 | 2026-02-26T12:06:55.893Z | user\n\nFixed skill title display.\n\nv1.1.2 | 2026-02-26T11:23:00.915Z | auto\n\n- Added EXTRA_FILES.txt to the project.\n- No changes to functionality or user-visible features.\n\nv1.1.1 | 2026-02-26T11:21:03.870Z | user\n\nAdded self-reflection capability — agent now evaluates its own work, not just user corrections.\n\nv1.2.0 | 2026-02-25T11:38:13.427Z | user\n\nAdded self-reflection loop, experience-based learning, and visual workflow diagram.\n\nv1.1.0 | 2026-02-19T19:53:21.802Z | user\n\nAdded detection triggers, quick queries, memory stats, and example templates for easier setup.\n\nv1.0.0 | 2026-02-16T18:26:58.607Z | user\n\nInitial release\n\nArchive index:\n\nArchive v1.2.16: 15 files, 17801 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), heartbeat-rules.md (1843b), heartbeat-state.md (584b), HEARTBEAT.md (261b), learning.md (2951b), memory-template.md (1278b), memory.md (756b), openclaw-heartbeat.md (261b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (6347b), SKILL.md (8582b), _meta.json (134b)\n\nFile v1.2.16:SKILL.md\n\n---\nname: Self-Improving + Proactive Agent\nslug: self-improving\nversion: 1.2.16\nhomepage: https://clawic.com/skills/self-improving\ndescription: \"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.\"\nchangelog: \"Clarifies the setup flow for proactive follow-through and safer installation behavior.\"\nmetadata: {\"clawdbot\":{\"emoji\":\"🧠\",\"requires\":{\"bins\":[]},\"os\":[\"linux\",\"darwin\",\"win32\"],\"configPaths\":[\"~/self-improving/\"],\"configPaths.optional\":[\"./AGENTS.md\",\"./SOUL.md\",\"./HEARTBEAT.md\"]}}\n---\n\n## When to Use\n\nUser 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.\n\n## Architecture\n\nMemory lives in `~/self-improving/` with tiered structure. If `~/self-improving/` does not exist, run `setup.md`.\nWorkspace 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`.\n\n```\n~/self-improving/\n├── memory.md          # HOT: ≤100 lines, always loaded\n├── index.md           # Topic index with line counts\n├── heartbeat-state.md # Heartbeat state: last run, reviewed change, action notes\n├── projects/          # Per-project learnings\n├── domains/           # Domain-specific (code, writing, comms)\n├── archive/           # COLD: decayed patterns\n└── corrections.md     # Last 50 corrections log\n```\n\n## Quick Reference\n\n| Topic | File |\n|-------|------|\n| Setup guide | `setup.md` |\n| Heartbeat state template | `heartbeat-state.md` |\n| Memory template | `memory-template.md` |\n| Workspace heartbeat snippet | `HEARTBEAT.md` |\n| Heartbeat rules | `heartbeat-rules.md` |\n| Learning mechanics | `learning.md` |\n| Security boundaries | `boundaries.md` |\n| Scaling rules | `scaling.md` |\n| Memory operations | `operations.md` |\n| Self-reflection log | `reflections.md` |\n| OpenClaw HEARTBEAT seed | `openclaw-heartbeat.md` |\n\n## Requirements\n\n- No credentials required\n- No extra binaries required\n- Optional installation of the `Proactivity` skill may require network access\n\n## Learning Signals\n\nLog automatically when you notice these patterns:\n\n**Corrections** → add to `corrections.md`, evaluate for `memory.md`:\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"I prefer X, not Y\"\n- \"Remember that I always...\"\n- \"I told you before...\"\n- \"Stop doing X\"\n- \"Why do you keep...\"\n\n**Preference signals** → add to `memory.md` if explicit:\n- \"I like when you...\"\n- \"Always do X for me\"\n- \"Never do Y\"\n- \"My style is...\"\n- \"For [project], use...\"\n\n**Pattern candidates** → track, promote after 3x:\n- Same instruction repeated 3+ times\n- Workflow that works well repeatedly\n- User praises specific approach\n\n**Ignore** (don't log):\n- One-time instructions (\"do X now\")\n- Context-specific (\"in this file...\")\n- Hypotheticals (\"what if...\")\n\n## Self-Reflection\n\nAfter completing significant work, pause and evaluate:\n\n1. **Did it meet expectations?** — Compare outcome vs intent\n2. **What could be better?** — Identify improvements for next time\n3. **Is this a pattern?** — If yes, log to `corrections.md`\n\n**When to self-reflect:**\n- After completing a multi-step task\n- After receiving feedback (positive or negative)\n- After fixing a bug or mistake\n- When you notice your output could be better\n\n**Log format:**\n```\nCONTEXT: [type of task]\nREFLECTION: [what I noticed]\nLESSON: [what to do differently]\n```\n\n**Example:**\n```\nCONTEXT: Building Flutter UI\nREFLECTION: Spacing looked off, had to redo\nLESSON: Check visual spacing before showing user\n```\n\nSelf-reflection entries follow the same promotion rules: 3x applied successfully → promote to HOT.\n\n## Quick Queries\n\n| User says | Action |\n|-----------|--------|\n| \"What do you know about X?\" | Search all tiers for X |\n| \"What have you learned?\" | Show last 10 from `corrections.md` |\n| \"Show my patterns\" | List `memory.md` (HOT) |\n| \"Show [project] patterns\" | Load `projects/{name}.md` |\n| \"What's in warm storage?\" | List files in `projects/` + `domains/` |\n| \"Memory stats\" | Show counts per tier |\n| \"Forget X\" | Remove from all tiers (confirm first) |\n| \"Export memory\" | ZIP all files |\n\n## Memory Stats\n\nOn \"memory stats\" request, report:\n\n```\n📊 Self-Improving Memory\n\nHOT (always loaded):\n  memory.md: X entries\n\nWARM (load on demand):\n  projects/: X files\n  domains/: X files\n\nCOLD (archived):\n  archive/: X files\n\nRecent activity (7 days):\n  Corrections logged: X\n  Promotions to HOT: X\n  Demotions to WARM: X\n```\n\n## Common Traps\n\n| Trap | Why It Fails | Better Move |\n|------|--------------|-------------|\n| Learning from silence | Creates false rules | Wait for explicit correction or repeated evidence |\n| Promoting too fast | Pollutes HOT memory | Keep new lessons tentative until repeated |\n| Reading every namespace | Wastes context | Load only HOT plus the smallest matching files |\n| Compaction by deletion | Loses trust and history | Merge, summarize, or demote instead |\n\n## Core Rules\n\n### 1. Learn from Corrections and Self-Reflection\n- Log when user explicitly corrects you\n- Log when you identify improvements in your own work\n- Never infer from silence alone\n- After 3 identical lessons → ask to confirm as rule\n\n### 2. Tiered Storage\n| Tier | Location | Size Limit | Behavior |\n|------|----------|------------|----------|\n| HOT | memory.md | ≤100 lines | Always loaded |\n| WARM | projects/, domains/ | ≤200 lines each | Load on context match |\n| COLD | archive/ | Unlimited | Load on explicit query |\n\n### 3. Automatic Promotion/Demotion\n- Pattern used 3x in 7 days → promote to HOT\n- Pattern unused 30 days → demote to WARM\n- Pattern unused 90 days → archive to COLD\n- Never delete without asking\n\n### 4. Namespace Isolation\n- Project patterns stay in `projects/{name}.md`\n- Global preferences in HOT tier (memory.md)\n- Domain patterns (code, writing) in `domains/`\n- Cross-namespace inheritance: global → domain → project\n\n### 5. Conflict Resolution\nWhen patterns contradict:\n1. Most specific wins (project > domain > global)\n2. Most recent wins (same level)\n3. If ambiguous → ask user\n\n### 6. Compaction\nWhen file exceeds limit:\n1. Merge similar corrections into single rule\n2. Archive unused patterns\n3. Summarize verbose entries\n4. Never lose confirmed preferences\n\n### 7. Transparency\n- Every action from memory → cite source: \"Using X (from projects/foo.md:12)\"\n- Weekly digest available: patterns learned, demoted, archived\n- Full export on demand: all files as ZIP\n\n### 8. Security Boundaries\nSee `boundaries.md` — never store credentials, health data, third-party info.\n\n### 9. Graceful Degradation\nIf context limit hit:\n1. Load only memory.md (HOT)\n2. Load relevant namespace on demand\n3. Never fail silently — tell user what's not loaded\n\n## Scope\n\nThis skill ONLY:\n- Learns from user corrections and self-reflection\n- Stores preferences in local files (`~/self-improving/`)\n- Maintains heartbeat state in `~/self-improving/heartbeat-state.md` when the workspace integrates heartbeat\n- Reads its own memory files on activation\n\nThis skill NEVER:\n- Accesses calendar, email, or contacts\n- Makes network requests\n- Reads files outside `~/self-improving/`\n- Infers preferences from silence or observation\n- Deletes or blindly rewrites self-improving memory during heartbeat cleanup\n- Modifies its own SKILL.md\n\n## Data Storage\n\nLocal state lives in `~/self-improving/`:\n\n- `memory.md` for HOT rules and confirmed preferences\n- `corrections.md` for explicit corrections and reusable lessons\n- `projects/` and `domains/` for scoped patterns\n- `archive/` for decayed or inactive patterns\n- `heartbeat-state.md` for recurring maintenance markers\n\n## Related Skills\nInstall with `clawhub install <slug>` if user confirms:\n\n- `memory` — Long-term memory patterns for agents\n- `learning` — Adaptive teaching and explanation\n- `decide` — Auto-learn decision patterns\n- `escalate` — Know when to ask vs act autonomously\n\n## Feedback\n\n- If useful: `clawhub star self-improving`\n- Stay updated: `clawhub sync`\n\nFile v1.2.16:_meta.json\n\n{\n  \"ownerId\": \"kn73vp5rarc3b14rc7wjcw8f8580t5d1\",\n  \"slug\": \"self-improving\",\n  \"version\": \"1.2.16\",\n  \"publishedAt\": 1773329327755\n}\n\nFile v1.2.16:boundaries.md\n\n# Security Boundaries\n\n## Never Store\n\n| Category | Examples | Why |\n|----------|----------|-----|\n| Credentials | Passwords, API keys, tokens, SSH keys | Security breach risk |\n| Financial | Card numbers, bank accounts, crypto seeds | Fraud risk |\n| Medical | Diagnoses, medications, conditions | Privacy, HIPAA |\n| Biometric | Voice patterns, behavioral fingerprints | Identity theft |\n| Third parties | Info about other people | No consent obtained |\n| Location patterns | Home/work addresses, routines | Physical safety |\n| Access patterns | What systems user has access to | Privilege escalation |\n\n## Store with Caution\n\n| Category | Rules |\n|----------|-------|\n| Work context | Decay after project ends, never share cross-project |\n| Emotional states | Only if user explicitly shares, never infer |\n| Relationships | Roles only (\"manager\", \"client\"), no personal details |\n| Schedules | General patterns OK (\"busy mornings\"), not specific times |\n\n## Transparency Requirements\n\n1. **Audit on demand** — User asks \"what do you know about me?\" → full export\n2. **Source tracking** — Every item tagged with when/how learned\n3. **Explain actions** — \"I did X because you said Y on [date]\"\n4. **No hidden state** — If it affects behavior, it must be visible\n5. **Deletion verification** — Confirm item removed, show updated state\n\n## Red Flags to Catch\n\nIf you find yourself doing any of these, STOP:\n\n- Storing something \"just in case it's useful later\"\n- Inferring sensitive info from non-sensitive data\n- Keeping data after user asked to forget\n- Applying personal context to work (or vice versa)\n- Learning what makes user comply faster\n- Building psychological profile\n- Retaining third-party information\n\n## Kill Switch\n\nUser says \"forget everything\":\n1. Export current memory to file (so they can review)\n2. Wipe all learned data\n3. Confirm: \"Memory cleared. Starting fresh.\"\n4. Do not retain \"ghost patterns\" in behavior\n\n## Consent Model\n\n| Data Type | Consent Level |\n|-----------|---------------|\n| Explicit corrections | Implied by correction itself |\n| Inferred preferences | Ask after 3 observations |\n| Context/project data | Ask when first detected |\n| Cross-session patterns | Explicit opt-in required |\n\nFile v1.2.16:corrections.md\n\n# Corrections Log — Template\n\n> This file is created in `~/self-improving/corrections.md` when you first use the skill.\n> Keeps the last 50 corrections. Older entries are evaluated for promotion or archived.\n\n## Example Entries\n\n```markdown\n## 2026-02-19\n\n### 14:32 — Code style\n- **Correction:** \"Use 2-space indentation, not 4\"\n- **Context:** Editing TypeScript file\n- **Count:** 1 (first occurrence)\n\n### 16:15 — Communication\n- **Correction:** \"Don't start responses with 'Great question!'\"\n- **Context:** Chat response\n- **Count:** 3 → **PROMOTED to memory.md**\n\n## 2026-02-18\n\n### 09:00 — Project: website\n- **Correction:** \"For this project, always use Tailwind\"\n- **Context:** CSS discussion\n- **Action:** Added to projects/website.md\n```\n\n## Log Format\n\nEach entry includes:\n- **Timestamp** — When the correction happened\n- **Correction** — What the user said\n- **Context** — What triggered it\n- **Count** — How many times (for promotion tracking)\n- **Action** — Where it was stored (if promoted)\n\nFile v1.2.16:heartbeat-rules.md\n\n# Heartbeat Rules\n\nUse heartbeat to keep `~/self-improving/` organized without creating churn or losing data.\n\n## Source of Truth\n\nKeep the workspace `HEARTBEAT.md` snippet minimal.\nTreat this file as the stable contract for self-improving heartbeat behavior.\nStore mutable run state only in `~/self-improving/heartbeat-state.md`.\n\n## Start of Every Heartbeat\n\n1. Ensure `~/self-improving/heartbeat-state.md` exists.\n2. Write `last_heartbeat_started_at` immediately in ISO 8601.\n3. Read the previous `last_reviewed_change_at`.\n4. Scan `~/self-improving/` for files changed after that moment, excluding `heartbeat-state.md` itself.\n\n## If Nothing Changed\n\n- Set `last_heartbeat_result: HEARTBEAT_OK`\n- Append a short \"no material change\" note if you keep an action log\n- Return `HEARTBEAT_OK`\n\n## If Something Changed\n\nOnly do conservative organization:\n\n- refresh `index.md` if counts or file references drift\n- compact oversized files by merging duplicates or summarizing repetitive entries\n- move clearly misplaced notes to the right namespace only when the target is unambiguous\n- preserve confirmed rules and explicit corrections exactly\n- update `last_reviewed_change_at` only after the review finishes cleanly\n\n## Safety Rules\n\n- Most heartbeat runs should do nothing\n- Prefer append, summarize, or index fixes over large rewrites\n- Never delete data, empty files, or overwrite uncertain text\n- Never reorganize files outside `~/self-improving/`\n- If scope is ambiguous, leave files untouched and record a suggested follow-up instead\n\n## State Fields\n\nKeep `~/self-improving/heartbeat-state.md` simple:\n\n- `last_heartbeat_started_at`\n- `last_reviewed_change_at`\n- `last_heartbeat_result`\n- `last_actions`\n\n## Behavior Standard\n\nHeartbeat exists to keep the memory system tidy and trustworthy.\nIf no rule is clearly violated, do nothing.\n\nFile v1.2.16:heartbeat-state.md\n\n# Heartbeat State Template\n\nUse this file as the baseline for `~/self-improving/heartbeat-state.md`.\nIt stores only lightweight run markers and maintenance notes.\n\n```markdown\n# Self-Improving Heartbeat State\n\nlast_heartbeat_started_at: never\nlast_reviewed_change_at: never\nlast_heartbeat_result: never\n\n## Last actions\n- none yet\n```\n\n## Rules\n\n- update `last_heartbeat_started_at` at the beginning of every heartbeat\n- update `last_reviewed_change_at` only after a clean review of changed files\n- keep `last_actions` short and factual\n- never turn this file into another memory log\n\nFile v1.2.16:HEARTBEAT.md\n\n## Self-Improving Check\n\n- Read `./skills/self-improving/heartbeat-rules.md`\n- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes\n- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`\n\nFile v1.2.16:learning.md\n\n# Learning Mechanics\n\n## What Triggers Learning\n\n| Trigger | Confidence | Action |\n|---------|------------|--------|\n| \"No, do X instead\" | High | Log correction immediately |\n| \"I told you before...\" | High | Flag as repeated, bump priority |\n| \"Always/Never do X\" | Confirmed | Promote to preference |\n| User edits your output | Medium | Log as tentative pattern |\n| Same correction 3x | Confirmed | Ask to make permanent |\n| \"For this project...\" | Scoped | Write to project namespace |\n\n## What Does NOT Trigger Learning\n\n- Silence (not confirmation)\n- Single instance of anything\n- Hypothetical discussions\n- Third-party preferences (\"John likes...\")\n- Group chat patterns (unless user confirms)\n- Implied preferences (never infer)\n\n## Correction Classification\n\n### By Type\n| Type | Example | Namespace |\n|------|---------|-----------|\n| Format | \"Use bullets not prose\" | global |\n| Technical | \"SQLite not Postgres\" | domain/code |\n| Communication | \"Shorter messages\" | global |\n| Project-specific | \"This repo uses Tailwind\" | projects/{name} |\n| Person-specific | \"Marcus wants BLUF\" | domains/comms |\n\n### By Scope\n```\nGlobal: applies everywhere\n  └── Domain: applies to category (code, writing, comms)\n       └── Project: applies to specific context\n            └── Temporary: applies to this session only\n```\n\n## Confirmation Flow\n\nAfter 3 similar corrections:\n```\nAgent: \"I've noticed you prefer X over Y (corrected 3 times).\n        Should I always do this?\n        - Yes, always\n        - Only in [context]\n        - No, case by case\"\n\nUser: \"Yes, always\"\n\nAgent: → Moves to Confirmed Preferences\n       → Removes from correction counter\n       → Cites source on future use\n```\n\n## Pattern Evolution\n\n### Stages\n1. **Tentative** — Single correction, watch for repetition\n2. **Emerging** — 2 corrections, likely pattern\n3. **Pending** — 3 corrections, ask for confirmation\n4. **Confirmed** — User approved, permanent unless reversed\n5. **Archived** — Unused 90+ days, preserved but inactive\n\n### Reversal\nUser can always reverse:\n```\nUser: \"Actually, I changed my mind about X\"\n\nAgent: \n1. Archive old pattern (keep history)\n2. Log reversal with timestamp\n3. Add new preference as tentative\n4. \"Got it. I'll do Y now. (Previous: X, archived)\"\n```\n\n## Anti-Patterns\n\n### Never Learn\n- What makes user comply faster (manipulation)\n- Emotional triggers or vulnerabilities\n- Patterns from other users (even if shared device)\n- Anything that feels \"creepy\" to surface\n\n### Avoid\n- Over-generalizing from single instance\n- Learning style over substance\n- Assuming preference stability\n- Ignoring context shifts\n\n## Quality Signals\n\n### Good Learning\n- User explicitly states preference\n- Pattern consistent across contexts\n- Correction improves outcomes\n- User confirms when asked\n\n### Bad Learning\n- Inferred from silence\n- Contradicts recent behavior\n- Only works in narrow context\n- User never confirmed\n\nFile v1.2.16:memory-template.md\n\n# Memory Template\n\nCopy this structure to `~/self-improving/memory.md` on first use.\n\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n<!-- Patterns confirmed by user, never decay -->\n\n## Active Patterns\n<!-- Patterns observed 3+ times, subject to decay -->\n\n## Recent (last 7 days)\n<!-- New corrections pending confirmation -->\n```\n\n## Initial Directory Structure\n\nCreate on first activation:\n\n```bash\nmkdir -p ~/self-improving/{projects,domains,archive}\ntouch ~/self-improving/{memory.md,index.md,corrections.md,heartbeat-state.md}\n```\n\n## Index Template\n\nFor `~/self-improving/index.md`:\n\n```markdown\n# Memory Index\n\n## HOT\n- memory.md: 0 lines\n\n## WARM\n- (no namespaces yet)\n\n## COLD\n- (no archives yet)\n\nLast compaction: never\n```\n\n## Corrections Log Template\n\nFor `~/self-improving/corrections.md`:\n\n```markdown\n# Corrections Log\n\n<!-- Format:\n## YYYY-MM-DD\n- [HH:MM] Changed X → Y\n  Type: format|technical|communication|project\n  Context: where correction happened\n  Confirmed: pending (N/3) | yes | no\n-->\n```\n\n## Heartbeat State Template\n\nFor `~/self-improving/heartbeat-state.md`:\n\n```markdown\n# Self-Improving Heartbeat State\n\nlast_heartbeat_started_at: never\nlast_reviewed_change_at: never\nlast_heartbeat_result: never\n\n## Last actions\n- none yet\n```\n\nFile v1.2.16:memory.md\n\n# HOT Memory — Template\n\n> This file is created in `~/self-improving/memory.md` when you first use the skill.\n> Keep it ≤100 lines. Most-used patterns live here.\n\n## Example Entries\n\n```markdown\n## Preferences\n- Code style: Prefer explicit over implicit\n- Communication: Direct, no fluff\n- Time zone: Europe/Madrid\n\n## Patterns (promoted from corrections)\n- Always use TypeScript strict mode\n- Prefer pnpm over npm\n- Format: ISO 8601 for dates\n\n## Project defaults\n- Tests: Jest with coverage >80%\n- Commits: Conventional commits format\n```\n\n## Usage\n\nThe agent will:\n1. Load this file on every session\n2. Add entries when patterns are used 3x in 7 days\n3. Demote unused entries to WARM after 30 days\n4. Never exceed 100 lines (compacts automatically)\n\nFile v1.2.16:openclaw-heartbeat.md\n\n## Self-Improving Check\n\n- Read `./skills/self-improving/heartbeat-rules.md`\n- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes\n- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`\n\nFile v1.2.16:operations.md\n\n# Memory Operations\n\n## User Commands\n\n| Command | Action |\n|---------|--------|\n| \"What do you know about X?\" | Search all tiers, return matches with sources |\n| \"Show my memory\" | Display memory.md contents |\n| \"Show [project] patterns\" | Load and display specific namespace |\n| \"Forget X\" | Remove from all tiers, confirm deletion |\n| \"Forget everything\" | Full wipe with export option |\n| \"What changed recently?\" | Show last 20 corrections |\n| \"Export memory\" | Generate downloadable archive |\n| \"Memory status\" | Show tier sizes, last compaction, health |\n\n## Automatic Operations\n\n### On Session Start\n1. Load memory.md (HOT tier)\n2. Check index.md for context hints\n3. If project detected → preload relevant namespace\n\n### On Correction Received\n```\n1. Parse correction type (preference, pattern, override)\n2. Check if duplicate (exists in any tier)\n3. If new:\n   - Add to corrections.md with timestamp\n   - Increment correction counter\n4. If duplicate:\n   - Bump counter, update timestamp\n   - If counter >= 3: ask to confirm as rule\n5. Determine namespace (global, domain, project)\n6. Write to appropriate file\n7. Update index.md line counts\n```\n\n### On Pattern Match\nWhen applying learned pattern:\n```\n1. Find pattern source (file:line)\n2. Apply pattern\n3. Cite source: \"Using X (from memory.md:15)\"\n4. Log usage for decay tracking\n```\n\n### Weekly Maintenance (Cron)\n```\n1. Scan all files for decay candidates\n2. Move unused >30 days to WARM\n3. Archive unused >90 days to COLD\n4. Run compaction if any file >limit\n5. Update index.md\n6. Generate weekly digest (optional)\n```\n\n## File Formats\n\n### memory.md (HOT)\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n- format: bullet points over prose (confirmed 2026-01)\n- tone: direct, no hedging (confirmed 2026-01)\n\n## Active Patterns\n- \"looks good\" = approval to proceed (used 15x)\n- single emoji = acknowledged (used 8x)\n\n## Recent (last 7 days)\n- prefer SQLite for MVPs (corrected 02-14)\n```\n\n### corrections.md\n```markdown\n# Corrections Log\n\n## 2026-02-15\n- [14:32] Changed verbose explanation → bullet summary\n  Type: communication\n  Context: Telegram response\n  Confirmed: pending (1/3)\n\n## 2026-02-14\n- [09:15] Use SQLite not Postgres for MVP\n  Type: technical\n  Context: database discussion\n  Confirmed: yes (said \"always\")\n```\n\n### projects/{name}.md\n```markdown\n# Project: my-app\n\nInherits: global, domains/code\n\n## Patterns\n- Use Tailwind (project standard)\n- No Prettier (eslint only)\n- Deploy via GitLab CI\n\n## Overrides\n- semicolons: yes (overrides global no-semi)\n\n## History\n- Created: 2026-01-15\n- Last active: 2026-02-15\n- Corrections: 12\n```\n\n## Edge Case Handling\n\n### Contradiction Detected\n```\nPattern A: \"Use tabs\" (global, confirmed)\nPattern B: \"Use spaces\" (project, corrected today)\n\nResolution:\n1. Project overrides global → use spaces for this project\n2. Log conflict in corrections.md\n3. Ask: \"Should spaces apply only to this project or everywhere?\"\n```\n\n### User Changes Mind\n```\nOld: \"Always use formal tone\"\nNew: \"Actually, casual is fine\"\n\nAction:\n1. Archive old pattern with timestamp\n2. Add new pattern as tentative\n3. Keep archived for reference (\"You previously preferred formal\")\n```\n\n### Context Ambiguity\n```\nUser says: \"Remember I like X\"\n\nBut which namespace?\n1. Check current context (project? domain?)\n2. If unclear, ask: \"Should this apply globally or just here?\"\n3. Default to most specific active context\n```\n\nArchive v1.2.15: 15 files, 17811 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), heartbeat-rules.md (1843b), heartbeat-state.md (584b), HEARTBEAT.md (261b), learning.md (2951b), memory-template.md (1278b), memory.md (756b), openclaw-heartbeat.md (261b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (6396b), SKILL.md (8521b), _meta.json (134b)\n\nFile v1.2.15:SKILL.md\n\n---\nname: Self-Improving + Proactive Agent\nslug: self-improving\nversion: 1.2.15\nhomepage: https://clawic.com/skills/self-improving\ndescription: \"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.\"\nchangelog: \"Improves the setup flow for stronger follow-through and execution quality.\"\nmetadata: {\"clawdbot\":{\"emoji\":\"🧠\",\"requires\":{\"bins\":[]},\"os\":[\"linux\",\"darwin\",\"win32\"],\"configPaths\":[\"~/self-improving/\"],\"configPaths.optional\":[\"./AGENTS.md\",\"./SOUL.md\",\"./HEARTBEAT.md\"]}}\n---\n\n## When to Use\n\nUser 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.\n\n## Architecture\n\nMemory lives in `~/self-improving/` with tiered structure. If `~/self-improving/` does not exist, run `setup.md`.\nWorkspace 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`.\n\n```\n~/self-improving/\n├── memory.md          # HOT: ≤100 lines, always loaded\n├── index.md           # Topic index with line counts\n├── heartbeat-state.md # Heartbeat state: last run, reviewed change, action notes\n├── projects/          # Per-project learnings\n├── domains/           # Domain-specific (code, writing, comms)\n├── archive/           # COLD: decayed patterns\n└── corrections.md     # Last 50 corrections log\n```\n\n## Quick Reference\n\n| Topic | File |\n|-------|------|\n| Setup guide | `setup.md` |\n| Heartbeat state template | `heartbeat-state.md` |\n| Memory template | `memory-template.md` |\n| Workspace heartbeat snippet | `HEARTBEAT.md` |\n| Heartbeat rules | `heartbeat-rules.md` |\n| Learning mechanics | `learning.md` |\n| Security boundaries | `boundaries.md` |\n| Scaling rules | `scaling.md` |\n| Memory operations | `operations.md` |\n| Self-reflection log | `reflections.md` |\n| OpenClaw HEARTBEAT seed | `openclaw-heartbeat.md` |\n\n## Requirements\n\n- No credentials required\n- No network access required\n- No extra binaries required\n\n## Learning Signals\n\nLog automatically when you notice these patterns:\n\n**Corrections** → add to `corrections.md`, evaluate for `memory.md`:\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"I prefer X, not Y\"\n- \"Remember that I always...\"\n- \"I told you before...\"\n- \"Stop doing X\"\n- \"Why do you keep...\"\n\n**Preference signals** → add to `memory.md` if explicit:\n- \"I like when you...\"\n- \"Always do X for me\"\n- \"Never do Y\"\n- \"My style is...\"\n- \"For [project], use...\"\n\n**Pattern candidates** → track, promote after 3x:\n- Same instruction repeated 3+ times\n- Workflow that works well repeatedly\n- User praises specific approach\n\n**Ignore** (don't log):\n- One-time instructions (\"do X now\")\n- Context-specific (\"in this file...\")\n- Hypotheticals (\"what if...\")\n\n## Self-Reflection\n\nAfter completing significant work, pause and evaluate:\n\n1. **Did it meet expectations?** — Compare outcome vs intent\n2. **What could be better?** — Identify improvements for next time\n3. **Is this a pattern?** — If yes, log to `corrections.md`\n\n**When to self-reflect:**\n- After completing a multi-step task\n- After receiving feedback (positive or negative)\n- After fixing a bug or mistake\n- When you notice your output could be better\n\n**Log format:**\n```\nCONTEXT: [type of task]\nREFLECTION: [what I noticed]\nLESSON: [what to do differently]\n```\n\n**Example:**\n```\nCONTEXT: Building Flutter UI\nREFLECTION: Spacing looked off, had to redo\nLESSON: Check visual spacing before showing user\n```\n\nSelf-reflection entries follow the same promotion rules: 3x applied successfully → promote to HOT.\n\n## Quick Queries\n\n| User says | Action |\n|-----------|--------|\n| \"What do you know about X?\" | Search all tiers for X |\n| \"What have you learned?\" | Show last 10 from `corrections.md` |\n| \"Show my patterns\" | List `memory.md` (HOT) |\n| \"Show [project] patterns\" | Load `projects/{name}.md` |\n| \"What's in warm storage?\" | List files in `projects/` + `domains/` |\n| \"Memory stats\" | Show counts per tier |\n| \"Forget X\" | Remove from all tiers (confirm first) |\n| \"Export memory\" | ZIP all files |\n\n## Memory Stats\n\nOn \"memory stats\" request, report:\n\n```\n📊 Self-Improving Memory\n\nHOT (always loaded):\n  memory.md: X entries\n\nWARM (load on demand):\n  projects/: X files\n  domains/: X files\n\nCOLD (archived):\n  archive/: X files\n\nRecent activity (7 days):\n  Corrections logged: X\n  Promotions to HOT: X\n  Demotions to WARM: X\n```\n\n## Common Traps\n\n| Trap | Why It Fails | Better Move |\n|------|--------------|-------------|\n| Learning from silence | Creates false rules | Wait for explicit correction or repeated evidence |\n| Promoting too fast | Pollutes HOT memory | Keep new lessons tentative until repeated |\n| Reading every namespace | Wastes context | Load only HOT plus the smallest matching files |\n| Compaction by deletion | Loses trust and history | Merge, summarize, or demote instead |\n\n## Core Rules\n\n### 1. Learn from Corrections and Self-Reflection\n- Log when user explicitly corrects you\n- Log when you identify improvements in your own work\n- Never infer from silence alone\n- After 3 identical lessons → ask to confirm as rule\n\n### 2. Tiered Storage\n| Tier | Location | Size Limit | Behavior |\n|------|----------|------------|----------|\n| HOT | memory.md | ≤100 lines | Always loaded |\n| WARM | projects/, domains/ | ≤200 lines each | Load on context match |\n| COLD | archive/ | Unlimited | Load on explicit query |\n\n### 3. Automatic Promotion/Demotion\n- Pattern used 3x in 7 days → promote to HOT\n- Pattern unused 30 days → demote to WARM\n- Pattern unused 90 days → archive to COLD\n- Never delete without asking\n\n### 4. Namespace Isolation\n- Project patterns stay in `projects/{name}.md`\n- Global preferences in HOT tier (memory.md)\n- Domain patterns (code, writing) in `domains/`\n- Cross-namespace inheritance: global → domain → project\n\n### 5. Conflict Resolution\nWhen patterns contradict:\n1. Most specific wins (project > domain > global)\n2. Most recent wins (same level)\n3. If ambiguous → ask user\n\n### 6. Compaction\nWhen file exceeds limit:\n1. Merge similar corrections into single rule\n2. Archive unused patterns\n3. Summarize verbose entries\n4. Never lose confirmed preferences\n\n### 7. Transparency\n- Every action from memory → cite source: \"Using X (from projects/foo.md:12)\"\n- Weekly digest available: patterns learned, demoted, archived\n- Full export on demand: all files as ZIP\n\n### 8. Security Boundaries\nSee `boundaries.md` — never store credentials, health data, third-party info.\n\n### 9. Graceful Degradation\nIf context limit hit:\n1. Load only memory.md (HOT)\n2. Load relevant namespace on demand\n3. Never fail silently — tell user what's not loaded\n\n## Scope\n\nThis skill ONLY:\n- Learns from user corrections and self-reflection\n- Stores preferences in local files (`~/self-improving/`)\n- Maintains heartbeat state in `~/self-improving/heartbeat-state.md` when the workspace integrates heartbeat\n- Reads its own memory files on activation\n\nThis skill NEVER:\n- Accesses calendar, email, or contacts\n- Makes network requests\n- Reads files outside `~/self-improving/`\n- Infers preferences from silence or observation\n- Deletes or blindly rewrites self-improving memory during heartbeat cleanup\n- Modifies its own SKILL.md\n\n## Data Storage\n\nLocal state lives in `~/self-improving/`:\n\n- `memory.md` for HOT rules and confirmed preferences\n- `corrections.md` for explicit corrections and reusable lessons\n- `projects/` and `domains/` for scoped patterns\n- `archive/` for decayed or inactive patterns\n- `heartbeat-state.md` for recurring maintenance markers\n\n## Related Skills\nInstall with `clawhub install <slug>` if user confirms:\n\n- `memory` — Long-term memory patterns for agents\n- `learning` — Adaptive teaching and explanation\n- `decide` — Auto-learn decision patterns\n- `escalate` — Know when to ask vs act autonomously\n\n## Feedback\n\n- If useful: `clawhub star self-improving`\n- Stay updated: `clawhub sync`\n\nFile v1.2.15:_meta.json\n\n{\n  \"ownerId\": \"kn73vp5rarc3b14rc7wjcw8f8580t5d1\",\n  \"slug\": \"self-improving\",\n  \"version\": \"1.2.15\",\n  \"publishedAt\": 1773328971040\n}\n\nFile v1.2.15:boundaries.md\n\n# Security Boundaries\n\n## Never Store\n\n| Category | Examples | Why |\n|----------|----------|-----|\n| Credentials | Passwords, API keys, tokens, SSH keys | Security breach risk |\n| Financial | Card numbers, bank accounts, crypto seeds | Fraud risk |\n| Medical | Diagnoses, medications, conditions | Privacy, HIPAA |\n| Biometric | Voice patterns, behavioral fingerprints | Identity theft |\n| Third parties | Info about other people | No consent obtained |\n| Location patterns | Home/work addresses, routines | Physical safety |\n| Access patterns | What systems user has access to | Privilege escalation |\n\n## Store with Caution\n\n| Category | Rules |\n|----------|-------|\n| Work context | Decay after project ends, never share cross-project |\n| Emotional states | Only if user explicitly shares, never infer |\n| Relationships | Roles only (\"manager\", \"client\"), no personal details |\n| Schedules | General patterns OK (\"busy mornings\"), not specific times |\n\n## Transparency Requirements\n\n1. **Audit on demand** — User asks \"what do you know about me?\" → full export\n2. **Source tracking** — Every item tagged with when/how learned\n3. **Explain actions** — \"I did X because you said Y on [date]\"\n4. **No hidden state** — If it affects behavior, it must be visible\n5. **Deletion verification** — Confirm item removed, show updated state\n\n## Red Flags to Catch\n\nIf you find yourself doing any of these, STOP:\n\n- Storing something \"just in case it's useful later\"\n- Inferring sensitive info from non-sensitive data\n- Keeping data after user asked to forget\n- Applying personal context to work (or vice versa)\n- Learning what makes user comply faster\n- Building psychological profile\n- Retaining third-party information\n\n## Kill Switch\n\nUser says \"forget everything\":\n1. Export current memory to file (so they can review)\n2. Wipe all learned data\n3. Confirm: \"Memory cleared. Starting fresh.\"\n4. Do not retain \"ghost patterns\" in behavior\n\n## Consent Model\n\n| Data Type | Consent Level |\n|-----------|---------------|\n| Explicit corrections | Implied by correction itself |\n| Inferred preferences | Ask after 3 observations |\n| Context/project data | Ask when first detected |\n| Cross-session patterns | Explicit opt-in required |\n\nFile v1.2.15:corrections.md\n\n# Corrections Log — Template\n\n> This file is created in `~/self-improving/corrections.md` when you first use the skill.\n> Keeps the last 50 corrections. Older entries are evaluated for promotion or archived.\n\n## Example Entries\n\n```markdown\n## 2026-02-19\n\n### 14:32 — Code style\n- **Correction:** \"Use 2-space indentation, not 4\"\n- **Context:** Editing TypeScript file\n- **Count:** 1 (first occurrence)\n\n### 16:15 — Communication\n- **Correction:** \"Don't start responses with 'Great question!'\"\n- **Context:** Chat response\n- **Count:** 3 → **PROMOTED to memory.md**\n\n## 2026-02-18\n\n### 09:00 — Project: website\n- **Correction:** \"For this project, always use Tailwind\"\n- **Context:** CSS discussion\n- **Action:** Added to projects/website.md\n```\n\n## Log Format\n\nEach entry includes:\n- **Timestamp** — When the correction happened\n- **Correction** — What the user said\n- **Context** — What triggered it\n- **Count** — How many times (for promotion tracking)\n- **Action** — Where it was stored (if promoted)\n\nFile v1.2.15:heartbeat-rules.md\n\n# Heartbeat Rules\n\nUse heartbeat to keep `~/self-improving/` organized without creating churn or losing data.\n\n## Source of Truth\n\nKeep the workspace `HEARTBEAT.md` snippet minimal.\nTreat this file as the stable contract for self-improving heartbeat behavior.\nStore mutable run state only in `~/self-improving/heartbeat-state.md`.\n\n## Start of Every Heartbeat\n\n1. Ensure `~/self-improving/heartbeat-state.md` exists.\n2. Write `last_heartbeat_started_at` immediately in ISO 8601.\n3. Read the previous `last_reviewed_change_at`.\n4. Scan `~/self-improving/` for files changed after that moment, excluding `heartbeat-state.md` itself.\n\n## If Nothing Changed\n\n- Set `last_heartbeat_result: HEARTBEAT_OK`\n- Append a short \"no material change\" note if you keep an action log\n- Return `HEARTBEAT_OK`\n\n## If Something Changed\n\nOnly do conservative organization:\n\n- refresh `index.md` if counts or file references drift\n- compact oversized files by merging duplicates or summarizing repetitive entries\n- move clearly misplaced notes to the right namespace only when the target is unambiguous\n- preserve confirmed rules and explicit corrections exactly\n- update `last_reviewed_change_at` only after the review finishes cleanly\n\n## Safety Rules\n\n- Most heartbeat runs should do nothing\n- Prefer append, summarize, or index fixes over large rewrites\n- Never delete data, empty files, or overwrite uncertain text\n- Never reorganize files outside `~/self-improving/`\n- If scope is ambiguous, leave files untouched and record a suggested follow-up instead\n\n## State Fields\n\nKeep `~/self-improving/heartbeat-state.md` simple:\n\n- `last_heartbeat_started_at`\n- `last_reviewed_change_at`\n- `last_heartbeat_result`\n- `last_actions`\n\n## Behavior Standard\n\nHeartbeat exists to keep the memory system tidy and trustworthy.\nIf no rule is clearly violated, do nothing.\n\nFile v1.2.15:heartbeat-state.md\n\n# Heartbeat State Template\n\nUse this file as the baseline for `~/self-improving/heartbeat-state.md`.\nIt stores only lightweight run markers and maintenance notes.\n\n```markdown\n# Self-Improving Heartbeat State\n\nlast_heartbeat_started_at: never\nlast_reviewed_change_at: never\nlast_heartbeat_result: never\n\n## Last actions\n- none yet\n```\n\n## Rules\n\n- update `last_heartbeat_started_at` at the beginning of every heartbeat\n- update `last_reviewed_change_at` only after a clean review of changed files\n- keep `last_actions` short and factual\n- never turn this file into another memory log\n\nFile v1.2.15:HEARTBEAT.md\n\n## Self-Improving Check\n\n- Read `./skills/self-improving/heartbeat-rules.md`\n- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes\n- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`\n\nFile v1.2.15:learning.md\n\n# Learning Mechanics\n\n## What Triggers Learning\n\n| Trigger | Confidence | Action |\n|---------|------------|--------|\n| \"No, do X instead\" | High | Log correction immediately |\n| \"I told you before...\" | High | Flag as repeated, bump priority |\n| \"Always/Never do X\" | Confirmed | Promote to preference |\n| User edits your output | Medium | Log as tentative pattern |\n| Same correction 3x | Confirmed | Ask to make permanent |\n| \"For this project...\" | Scoped | Write to project namespace |\n\n## What Does NOT Trigger Learning\n\n- Silence (not confirmation)\n- Single instance of anything\n- Hypothetical discussions\n- Third-party preferences (\"John likes...\")\n- Group chat patterns (unless user confirms)\n- Implied preferences (never infer)\n\n## Correction Classification\n\n### By Type\n| Type | Example | Namespace |\n|------|---------|-----------|\n| Format | \"Use bullets not prose\" | global |\n| Technical | \"SQLite not Postgres\" | domain/code |\n| Communication | \"Shorter messages\" | global |\n| Project-specific | \"This repo uses Tailwind\" | projects/{name} |\n| Person-specific | \"Marcus wants BLUF\" | domains/comms |\n\n### By Scope\n```\nGlobal: applies everywhere\n  └── Domain: applies to category (code, writing, comms)\n       └── Project: applies to specific context\n            └── Temporary: applies to this session only\n```\n\n## Confirmation Flow\n\nAfter 3 similar corrections:\n```\nAgent: \"I've noticed you prefer X over Y (corrected 3 times).\n        Should I always do this?\n        - Yes, always\n        - Only in [context]\n        - No, case by case\"\n\nUser: \"Yes, always\"\n\nAgent: → Moves to Confirmed Preferences\n       → Removes from correction counter\n       → Cites source on future use\n```\n\n## Pattern Evolution\n\n### Stages\n1. **Tentative** — Single correction, watch for repetition\n2. **Emerging** — 2 corrections, likely pattern\n3. **Pending** — 3 corrections, ask for confirmation\n4. **Confirmed** — User approved, permanent unless reversed\n5. **Archived** — Unused 90+ days, preserved but inactive\n\n### Reversal\nUser can always reverse:\n```\nUser: \"Actually, I changed my mind about X\"\n\nAgent: \n1. Archive old pattern (keep history)\n2. Log reversal with timestamp\n3. Add new preference as tentative\n4. \"Got it. I'll do Y now. (Previous: X, archived)\"\n```\n\n## Anti-Patterns\n\n### Never Learn\n- What makes user comply faster (manipulation)\n- Emotional triggers or vulnerabilities\n- Patterns from other users (even if shared device)\n- Anything that feels \"creepy\" to surface\n\n### Avoid\n- Over-generalizing from single instance\n- Learning style over substance\n- Assuming preference stability\n- Ignoring context shifts\n\n## Quality Signals\n\n### Good Learning\n- User explicitly states preference\n- Pattern consistent across contexts\n- Correction improves outcomes\n- User confirms when asked\n\n### Bad Learning\n- Inferred from silence\n- Contradicts recent behavior\n- Only works in narrow context\n- User never confirmed\n\nFile v1.2.15:memory-template.md\n\n# Memory Template\n\nCopy this structure to `~/self-improving/memory.md` on first use.\n\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n<!-- Patterns confirmed by user, never decay -->\n\n## Active Patterns\n<!-- Patterns observed 3+ times, subject to decay -->\n\n## Recent (last 7 days)\n<!-- New corrections pending confirmation -->\n```\n\n## Initial Directory Structure\n\nCreate on first activation:\n\n```bash\nmkdir -p ~/self-improving/{projects,domains,archive}\ntouch ~/self-improving/{memory.md,index.md,corrections.md,heartbeat-state.md}\n```\n\n## Index Template\n\nFor `~/self-improving/index.md`:\n\n```markdown\n# Memory Index\n\n## HOT\n- memory.md: 0 lines\n\n## WARM\n- (no namespaces yet)\n\n## COLD\n- (no archives yet)\n\nLast compaction: never\n```\n\n## Corrections Log Template\n\nFor `~/self-improving/corrections.md`:\n\n```markdown\n# Corrections Log\n\n<!-- Format:\n## YYYY-MM-DD\n- [HH:MM] Changed X → Y\n  Type: format|technical|communication|project\n  Context: where correction happened\n  Confirmed: pending (N/3) | yes | no\n-->\n```\n\n## Heartbeat State Template\n\nFor `~/self-improving/heartbeat-state.md`:\n\n```markdown\n# Self-Improving Heartbeat State\n\nlast_heartbeat_started_at: never\nlast_reviewed_change_at: never\nlast_heartbeat_result: never\n\n## Last actions\n- none yet\n```\n\nFile v1.2.15:memory.md\n\n# HOT Memory — Template\n\n> This file is created in `~/self-improving/memory.md` when you first use the skill.\n> Keep it ≤100 lines. Most-used patterns live here.\n\n## Example Entries\n\n```markdown\n## Preferences\n- Code style: Prefer explicit over implicit\n- Communication: Direct, no fluff\n- Time zone: Europe/Madrid\n\n## Patterns (promoted from corrections)\n- Always use TypeScript strict mode\n- Prefer pnpm over npm\n- Format: ISO 8601 for dates\n\n## Project defaults\n- Tests: Jest with coverage >80%\n- Commits: Conventional commits format\n```\n\n## Usage\n\nThe agent will:\n1. Load this file on every session\n2. Add entries when patterns are used 3x in 7 days\n3. Demote unused entries to WARM after 30 days\n4. Never exceed 100 lines (compacts automatically)\n\nFile v1.2.15:openclaw-heartbeat.md\n\n## Self-Improving Check\n\n- Read `./skills/self-improving/heartbeat-rules.md`\n- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes\n- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`\n\nFile v1.2.15:operations.md\n\n# Memory Operations\n\n## User Commands\n\n| Command | Action |\n|---------|--------|\n| \"What do you know about X?\" | Search all tiers, return matches with sources |\n| \"Show my memory\" | Display memory.md contents |\n| \"Show [project] patterns\" | Load and display specific namespace |\n| \"Forget X\" | Remove from all tiers, confirm deletion |\n| \"Forget everything\" | Full wipe with export option |\n| \"What changed recently?\" | Show last 20 corrections |\n| \"Export memory\" | Generate downloadable archive |\n| \"Memory status\" | Show tier sizes, last compaction, health |\n\n## Automatic Operations\n\n### On Session Start\n1. Load memory.md (HOT tier)\n2. Check index.md for context hints\n3. If project detected → preload relevant namespace\n\n### On Correction Received\n```\n1. Parse correction type (preference, pattern, override)\n2. Check if duplicate (exists in any tier)\n3. If new:\n   - Add to corrections.md with timestamp\n   - Increment correction counter\n4. If duplicate:\n   - Bump counter, update timestamp\n   - If counter >= 3: ask to confirm as rule\n5. Determine namespace (global, domain, project)\n6. Write to appropriate file\n7. Update index.md line counts\n```\n\n### On Pattern Match\nWhen applying learned pattern:\n```\n1. Find pattern source (file:line)\n2. Apply pattern\n3. Cite source: \"Using X (from memory.md:15)\"\n4. Log usage for decay tracking\n```\n\n### Weekly Maintenance (Cron)\n```\n1. Scan all files for decay candidates\n2. Move unused >30 days to WARM\n3. Archive unused >90 days to COLD\n4. Run compaction if any file >limit\n5. Update index.md\n6. Generate weekly digest (optional)\n```\n\n## File Formats\n\n### memory.md (HOT)\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n- format: bullet points over prose (confirmed 2026-01)\n- tone: direct, no hedging (confirmed 2026-01)\n\n## Active Patterns\n- \"looks good\" = approval to proceed (used 15x)\n- single emoji = acknowledged (used 8x)\n\n## Recent (last 7 days)\n- prefer SQLite for MVPs (corrected 02-14)\n```\n\n### corrections.md\n```markdown\n# Corrections Log\n\n## 2026-02-15\n- [14:32] Changed verbose explanation → bullet summary\n  Type: communication\n  Context: Telegram response\n  Confirmed: pending (1/3)\n\n## 2026-02-14\n- [09:15] Use SQLite not Postgres for MVP\n  Type: technical\n  Context: database discussion\n  Confirmed: yes (said \"always\")\n```\n\n### projects/{name}.md\n```markdown\n# Project: my-app\n\nInherits: global, domains/code\n\n## Patterns\n- Use Tailwind (project standard)\n- No Prettier (eslint only)\n- Deploy via GitLab CI\n\n## Overrides\n- semicolons: yes (overrides global no-semi)\n\n## History\n- Created: 2026-01-15\n- Last active: 2026-02-15\n- Corrections: 12\n```\n\n## Edge Case Handling\n\n### Contradiction Detected\n```\nPattern A: \"Use tabs\" (global, confirmed)\nPattern B: \"Use spaces\" (project, corrected today)\n\nResolution:\n1. Project overrides global → use spaces for this project\n2. Log conflict in corrections.md\n3. Ask: \"Should spaces apply only to this project or everywhere?\"\n```\n\n### User Changes Mind\n```\nOld: \"Always use formal tone\"\nNew: \"Actually, casual is fine\"\n\nAction:\n1. Archive old pattern with timestamp\n2. Add new pattern as tentative\n3. Keep archived for reference (\"You previously preferred formal\")\n```\n\n### Context Ambiguity\n```\nUser says: \"Remember I like X\"\n\nBut which namespace?\n1. Check current context (project? domain?)\n2. If unclear, ask: \"Should this apply globally or just here?\"\n3. Default to most specific active context\n```\n\nArchive v1.2.14: 15 files, 17117 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), heartbeat-rules.md (1843b), heartbeat-state.md (584b), HEARTBEAT.md (261b), learning.md (2951b), memory-template.md (1278b), memory.md (756b), openclaw-heartbeat.md (261b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (5598b), SKILL.md (7612b), _meta.json (134b)\n\nFile v1.2.14:SKILL.md\n\n---\nname: Proactive + Self-Improving Agent\nslug: self-improving\nversion: 1.2.14\nhomepage: https://clawic.com/skills/self-improving\ndescription: \"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.\"\nchangelog: \"Updated the title to better highlight proactive self-improvement.\"\nmetadata: {\"clawdbot\":{\"emoji\":\"🧠\",\"requires\":{\"bins\":[]},\"os\":[\"linux\",\"darwin\",\"win32\"],\"configPaths\":[\"~/self-improving/\"],\"configPaths.optional\":[\"./AGENTS.md\",\"./SOUL.md\",\"./HEARTBEAT.md\"]}}\n---\n\n## When to Use\n\nUser 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.\n\n## Architecture\n\nMemory lives in `~/self-improving/` with tiered structure. If `~/self-improving/` does not exist, run `setup.md`.\nWorkspace 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`.\n\n```\n~/self-improving/\n├── memory.md          # HOT: ≤100 lines, always loaded\n├── index.md           # Topic index with line counts\n├── heartbeat-state.md # Heartbeat state: last run, reviewed change, action notes\n├── projects/          # Per-project learnings\n├── domains/           # Domain-specific (code, writing, comms)\n├── archive/           # COLD: decayed patterns\n└── corrections.md     # Last 50 corrections log\n```\n\n## Quick Reference\n\n| Topic | File |\n|-------|------|\n| Setup guide | `setup.md` |\n| Heartbeat state template | `heartbeat-state.md` |\n| Memory template | `memory-template.md` |\n| Workspace heartbeat snippet | `HEARTBEAT.md` |\n| Heartbeat rules | `heartbeat-rules.md` |\n| Learning mechanics | `learning.md` |\n| Security boundaries | `boundaries.md` |\n| Scaling rules | `scaling.md` |\n| Memory operations | `operations.md` |\n| Self-reflection log | `reflections.md` |\n| OpenClaw HEARTBEAT seed | `openclaw-heartbeat.md` |\n\n## Detection Triggers\n\nLog automatically when you notice these patterns:\n\n**Corrections** → add to `corrections.md`, evaluate for `memory.md`:\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"I prefer X, not Y\"\n- \"Remember that I always...\"\n- \"I told you before...\"\n- \"Stop doing X\"\n- \"Why do you keep...\"\n\n**Preference signals** → add to `memory.md` if explicit:\n- \"I like when you...\"\n- \"Always do X for me\"\n- \"Never do Y\"\n- \"My style is...\"\n- \"For [project], use...\"\n\n**Pattern candidates** → track, promote after 3x:\n- Same instruction repeated 3+ times\n- Workflow that works well repeatedly\n- User praises specific approach\n\n**Ignore** (don't log):\n- One-time instructions (\"do X now\")\n- Context-specific (\"in this file...\")\n- Hypotheticals (\"what if...\")\n\n## Self-Reflection\n\nAfter completing significant work, pause and evaluate:\n\n1. **Did it meet expectations?** — Compare outcome vs intent\n2. **What could be better?** — Identify improvements for next time\n3. **Is this a pattern?** — If yes, log to `corrections.md`\n\n**When to self-reflect:**\n- After completing a multi-step task\n- After receiving feedback (positive or negative)\n- After fixing a bug or mistake\n- When you notice your output could be better\n\n**Log format:**\n```\nCONTEXT: [type of task]\nREFLECTION: [what I noticed]\nLESSON: [what to do differently]\n```\n\n**Example:**\n```\nCONTEXT: Building Flutter UI\nREFLECTION: Spacing looked off, had to redo\nLESSON: Check visual spacing before showing user\n```\n\nSelf-reflection entries follow the same promotion rules: 3x applied successfully → promote to HOT.\n\n## Quick Queries\n\n| User says | Action |\n|-----------|--------|\n| \"What do you know about X?\" | Search all tiers for X |\n| \"What have you learned?\" | Show last 10 from `corrections.md` |\n| \"Show my patterns\" | List `memory.md` (HOT) |\n| \"Show [project] patterns\" | Load `projects/{name}.md` |\n| \"What's in warm storage?\" | List files in `projects/` + `domains/` |\n| \"Memory stats\" | Show counts per tier |\n| \"Forget X\" | Remove from all tiers (confirm first) |\n| \"Export memory\" | ZIP all files |\n\n## Memory Stats\n\nOn \"memory stats\" request, report:\n\n```\n📊 Self-Improving Memory\n\nHOT (always loaded):\n  memory.md: X entries\n\nWARM (load on demand):\n  projects/: X files\n  domains/: X files\n\nCOLD (archived):\n  archive/: X files\n\nRecent activity (7 days):\n  Corrections logged: X\n  Promotions to HOT: X\n  Demotions to WARM: X\n```\n\n## Core Rules\n\n### 1. Learn from Corrections and Self-Reflection\n- Log when user explicitly corrects you\n- Log when you identify improvements in your own work\n- Never infer from silence alone\n- After 3 identical lessons → ask to confirm as rule\n\n### 2. Tiered Storage\n| Tier | Location | Size Limit | Behavior |\n|------|----------|------------|----------|\n| HOT | memory.md | ≤100 lines | Always loaded |\n| WARM | projects/, domains/ | ≤200 lines each | Load on context match |\n| COLD | archive/ | Unlimited | Load on explicit query |\n\n### 3. Automatic Promotion/Demotion\n- Pattern used 3x in 7 days → promote to HOT\n- Pattern unused 30 days → demote to WARM\n- Pattern unused 90 days → archive to COLD\n- Never delete without asking\n\n### 4. Namespace Isolation\n- Project patterns stay in `projects/{name}.md`\n- Global preferences in HOT tier (memory.md)\n- Domain patterns (code, writing) in `domains/`\n- Cross-namespace inheritance: global → domain → project\n\n### 5. Conflict Resolution\nWhen patterns contradict:\n1. Most specific wins (project > domain > global)\n2. Most recent wins (same level)\n3. If ambiguous → ask user\n\n### 6. Compaction\nWhen file exceeds limit:\n1. Merge similar corrections into single rule\n2. Archive unused patterns\n3. Summarize verbose entries\n4. Never lose confirmed preferences\n\n### 7. Transparency\n- Every action from memory → cite source: \"Using X (from projects/foo.md:12)\"\n- Weekly digest available: patterns learned, demoted, archived\n- Full export on demand: all files as ZIP\n\n### 8. Security Boundaries\nSee `boundaries.md` — never store credentials, health data, third-party info.\n\n### 9. Graceful Degradation\nIf context limit hit:\n1. Load only memory.md (HOT)\n2. Load relevant namespace on demand\n3. Never fail silently — tell user what's not loaded\n\n## Scope\n\nThis skill ONLY:\n- Learns from user corrections and self-reflection\n- Stores preferences in local files (`~/self-improving/`)\n- Maintains heartbeat state in `~/self-improving/heartbeat-state.md` when the workspace integrates heartbeat\n- Reads its own memory files on activation\n\nThis skill NEVER:\n- Accesses calendar, email, or contacts\n- Makes network requests\n- Reads files outside `~/self-improving/`\n- Infers preferences from silence or observation\n- Deletes or blindly rewrites self-improving memory during heartbeat cleanup\n- Modifies its own SKILL.md\n\n## Related Skills\nInstall with `clawhub install <slug>` if user confirms:\n\n- `memory` — Long-term memory patterns for agents\n- `learning` — Adaptive teaching and explanation\n- `decide` — Auto-learn decision patterns\n- `escalate` — Know when to ask vs act autonomously\n\n## Feedback\n\n- If useful: `clawhub star self-improving`\n- Stay updated: `clawhub sync`\n\nFile v1.2.14:_meta.json\n\n{\n  \"ownerId\": \"kn73vp5rarc3b14rc7wjcw8f8580t5d1\",\n  \"slug\": \"self-improving\",\n  \"version\": \"1.2.14\",\n  \"publishedAt\": 1773311468529\n}\n\nFile v1.2.14:boundaries.md\n\n# Security Boundaries\n\n## Never Store\n\n| Category | Examples | Why |\n|----------|----------|-----|\n| Credentials | Passwords, API keys, tokens, SSH keys | Security breach risk |\n| Financial | Card numbers, bank accounts, crypto seeds | Fraud risk |\n| Medical | Diagnoses, medications, conditions | Privacy, HIPAA |\n| Biometric | Voice patterns, behavioral fingerprints | Identity theft |\n| Third parties | Info about other people | No consent obtained |\n| Location patterns | Home/work addresses, routines | Physical safety |\n| Access patterns | What systems user has access to | Privilege escalation |\n\n## Store with Caution\n\n| Category | Rules |\n|----------|-------|\n| Work context | Decay after project ends, never share cross-project |\n| Emotional states | Only if user explicitly shares, never infer |\n| Relationships | Roles only (\"manager\", \"client\"), no personal details |\n| Schedules | General patterns OK (\"busy mornings\"), not specific times |\n\n## Transparency Requirements\n\n1. **Audit on demand** — User asks \"what do you know about me?\" → full export\n2. **Source tracking** — Every item tagged with when/how learned\n3. **Explain actions** — \"I did X because you said Y on [date]\"\n4. **No hidden state** — If it affects behavior, it must be visible\n5. **Deletion verification** — Confirm item removed, show updated state\n\n## Red Flags to Catch\n\nIf you find yourself doing any of these, STOP:\n\n- Storing something \"just in case it's useful later\"\n- Inferring sensitive info from non-sensitive data\n- Keeping data after user asked to forget\n- Applying personal context to work (or vice versa)\n- Learning what makes user comply faster\n- Building psychological profile\n- Retaining third-party information\n\n## Kill Switch\n\nUser says \"forget everything\":\n1. Export current memory to file (so they can review)\n2. Wipe all learned data\n3. Confirm: \"Memory cleared. Starting fresh.\"\n4. Do not retain \"ghost patterns\" in behavior\n\n## Consent Model\n\n| Data Type | Consent Level |\n|-----------|---------------|\n| Explicit corrections | Implied by correction itself |\n| Inferred preferences | Ask after 3 observations |\n| Context/project data | Ask when first detected |\n| Cross-session patterns | Explicit opt-in required |\n\nFile v1.2.14:corrections.md\n\n# Corrections Log — Template\n\n> This file is created in `~/self-improving/corrections.md` when you first use the skill.\n> Keeps the last 50 corrections. Older entries are evaluated for promotion or archived.\n\n## Example Entries\n\n```markdown\n## 2026-02-19\n\n### 14:32 — Code style\n- **Correction:** \"Use 2-space indentation, not 4\"\n- **Context:** Editing TypeScript file\n- **Count:** 1 (first occurrence)\n\n### 16:15 — Communication\n- **Correction:** \"Don't start responses with 'Great question!'\"\n- **Context:** Chat response\n- **Count:** 3 → **PROMOTED to memory.md**\n\n## 2026-02-18\n\n### 09:00 — Project: website\n- **Correction:** \"For this project, always use Tailwind\"\n- **Context:** CSS discussion\n- **Action:** Added to projects/website.md\n```\n\n## Log Format\n\nEach entry includes:\n- **Timestamp** — When the correction happened\n- **Correction** — What the user said\n- **Context** — What triggered it\n- **Count** — How many times (for promotion tracking)\n- **Action** — Where it was stored (if promoted)\n\nFile v1.2.14:heartbeat-rules.md\n\n# Heartbeat Rules\n\nUse heartbeat to keep `~/self-improving/` organized without creating churn or losing data.\n\n## Source of Truth\n\nKeep the workspace `HEARTBEAT.md` snippet minimal.\nTreat this file as the stable contract for self-improving heartbeat behavior.\nStore mutable run state only in `~/self-improving/heartbeat-state.md`.\n\n## Start of Every Heartbeat\n\n1. Ensure `~/self-improving/heartbeat-state.md` exists.\n2. Write `last_heartbeat_started_at` immediately in ISO 8601.\n3. Read the previous `last_reviewed_change_at`.\n4. Scan `~/self-improving/` for files changed after that moment, excluding `heartbeat-state.md` itself.\n\n## If Nothing Changed\n\n- Set `last_heartbeat_result: HEARTBEAT_OK`\n- Append a short \"no material change\" note if you keep an action log\n- Return `HEARTBEAT_OK`\n\n## If Something Changed\n\nOnly do conservative organization:\n\n- refresh `index.md` if counts or file references drift\n- compact oversized files by merging duplicates or summarizing repetitive entries\n- move clearly misplaced notes to the right namespace only when the target is unambiguous\n- preserve confirmed rules and explicit corrections exactly\n- update `last_reviewed_change_at` only after the review finishes cleanly\n\n## Safety Rules\n\n- Most heartbeat runs should do nothing\n- Prefer append, summarize, or index fixes over large rewrites\n- Never delete data, empty files, or overwrite uncertain text\n- Never reorganize files outside `~/self-improving/`\n- If scope is ambiguous, leave files untouched and record a suggested follow-up instead\n\n## State Fields\n\nKeep `~/self-improving/heartbeat-state.md` simple:\n\n- `last_heartbeat_started_at`\n- `last_reviewed_change_at`\n- `last_heartbeat_result`\n- `last_actions`\n\n## Behavior Standard\n\nHeartbeat exists to keep the memory system tidy and trustworthy.\nIf no rule is clearly violated, do nothing.\n\nFile v1.2.14:heartbeat-state.md\n\n# Heartbeat State Template\n\nUse this file as the baseline for `~/self-improving/heartbeat-state.md`.\nIt stores only lightweight run markers and maintenance notes.\n\n```markdown\n# Self-Improving Heartbeat State\n\nlast_heartbeat_started_at: never\nlast_reviewed_change_at: never\nlast_heartbeat_result: never\n\n## Last actions\n- none yet\n```\n\n## Rules\n\n- update `last_heartbeat_started_at` at the beginning of every heartbeat\n- update `last_reviewed_change_at` only after a clean review of changed files\n- keep `last_actions` short and factual\n- never turn this file into another memory log\n\nFile v1.2.14:HEARTBEAT.md\n\n## Self-Improving Check\n\n- Read `./skills/self-improving/heartbeat-rules.md`\n- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes\n- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`\n\nFile v1.2.14:learning.md\n\n# Learning Mechanics\n\n## What Triggers Learning\n\n| Trigger | Confidence | Action |\n|---------|------------|--------|\n| \"No, do X instead\" | High | Log correction immediately |\n| \"I told you before...\" | High | Flag as repeated, bump priority |\n| \"Always/Never do X\" | Confirmed | Promote to preference |\n| User edits your output | Medium | Log as tentative pattern |\n| Same correction 3x | Confirmed | Ask to make permanent |\n| \"For this project...\" | Scoped | Write to project namespace |\n\n## What Does NOT Trigger Learning\n\n- Silence (not confirmation)\n- Single instance of anything\n- Hypothetical discussions\n- Third-party preferences (\"John likes...\")\n- Group chat patterns (unless user confirms)\n- Implied preferences (never infer)\n\n## Correction Classification\n\n### By Type\n| Type | Example | Namespace |\n|------|---------|-----------|\n| Format | \"Use bullets not prose\" | global |\n| Technical | \"SQLite not Postgres\" | domain/code |\n| Communication | \"Shorter messages\" | global |\n| Project-specific | \"This repo uses Tailwind\" | projects/{name} |\n| Person-specific | \"Marcus wants BLUF\" | domains/comms |\n\n### By Scope\n```\nGlobal: applies everywhere\n  └── Domain: applies to category (code, writing, comms)\n       └── Project: applies to specific context\n            └── Temporary: applies to this session only\n```\n\n## Confirmation Flow\n\nAfter 3 similar corrections:\n```\nAgent: \"I've noticed you prefer X over Y (corrected 3 times).\n        Should I always do this?\n        - Yes, always\n        - Only in [context]\n        - No, case by case\"\n\nUser: \"Yes, always\"\n\nAgent: → Moves to Confirmed Preferences\n       → Removes from correction counter\n       → Cites source on future use\n```\n\n## Pattern Evolution\n\n### Stages\n1. **Tentative** — Single correction, watch for repetition\n2. **Emerging** — 2 corrections, likely pattern\n3. **Pending** — 3 corrections, ask for confirmation\n4. **Confirmed** — User approved, permanent unless reversed\n5. **Archived** — Unused 90+ days, preserved but inactive\n\n### Reversal\nUser can always reverse:\n```\nUser: \"Actually, I changed my mind about X\"\n\nAgent: \n1. Archive old pattern (keep history)\n2. Log reversal with timestamp\n3. Add new preference as tentative\n4. \"Got it. I'll do Y now. (Previous: X, archived)\"\n```\n\n## Anti-Patterns\n\n### Never Learn\n- What makes user comply faster (manipulation)\n- Emotional triggers or vulnerabilities\n- Patterns from other users (even if shared device)\n- Anything that feels \"creepy\" to surface\n\n### Avoid\n- Over-generalizing from single instance\n- Learning style over substance\n- Assuming preference stability\n- Ignoring context shifts\n\n## Quality Signals\n\n### Good Learning\n- User explicitly states preference\n- Pattern consistent across contexts\n- Correction improves outcomes\n- User confirms when asked\n\n### Bad Learning\n- Inferred from silence\n- Contradicts recent behavior\n- Only works in narrow context\n- User never confirmed\n\nFile v1.2.14:memory-template.md\n\n# Memory Template\n\nCopy this structure to `~/self-improving/memory.md` on first use.\n\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n<!-- Patterns confirmed by user, never decay -->\n\n## Active Patterns\n<!-- Patterns observed 3+ times, subject to decay -->\n\n## Recent (last 7 days)\n<!-- New corrections pending confirmation -->\n```\n\n## Initial Directory Structure\n\nCreate on first activation:\n\n```bash\nmkdir -p ~/self-improving/{projects,domains,archive}\ntouch ~/self-improving/{memory.md,index.md,corrections.md,heartbeat-state.md}\n```\n\n## Index Template\n\nFor `~/self-improving/index.md`:\n\n```markdown\n# Memory Index\n\n## HOT\n- memory.md: 0 lines\n\n## WARM\n- (no namespaces yet)\n\n## COLD\n- (no archives yet)\n\nLast compaction: never\n```\n\n## Corrections Log Template\n\nFor `~/self-improving/corrections.md`:\n\n```markdown\n# Corrections Log\n\n<!-- Format:\n## YYYY-MM-DD\n- [HH:MM] Changed X → Y\n  Type: format|technical|communication|project\n  Context: where correction happened\n  Confirmed: pending (N/3) | yes | no\n-->\n```\n\n## Heartbeat State Template\n\nFor `~/self-improving/heartbeat-state.md`:\n\n```markdown\n# Self-Improving Heartbeat State\n\nlast_heartbeat_started_at: never\nlast_reviewed_change_at: never\nlast_heartbeat_result: never\n\n## Last actions\n- none yet\n```\n\nFile v1.2.14:memory.md\n\n# HOT Memory — Template\n\n> This file is created in `~/self-improving/memory.md` when you first use the skill.\n> Keep it ≤100 lines. Most-used patterns live here.\n\n## Example Entries\n\n```markdown\n## Preferences\n- Code style: Prefer explicit over implicit\n- Communication: Direct, no fluff\n- Time zone: Europe/Madrid\n\n## Patterns (promoted from corrections)\n- Always use TypeScript strict mode\n- Prefer pnpm over npm\n- Format: ISO 8601 for dates\n\n## Project defaults\n- Tests: Jest with coverage >80%\n- Commits: Conventional commits format\n```\n\n## Usage\n\nThe agent will:\n1. Load this file on every session\n2. Add entries when patterns are used 3x in 7 days\n3. Demote unused entries to WARM after 30 days\n4. Never exceed 100 lines (compacts automatically)\n\nFile v1.2.14:openclaw-heartbeat.md\n\n## Self-Improving Check\n\n- Read `./skills/self-improving/heartbeat-rules.md`\n- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes\n- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`\n\nFile v1.2.14:operations.md\n\n# Memory Operations\n\n## User Commands\n\n| Command | Action |\n|---------|--------|\n| \"What do you know about X?\" | Search all tiers, return matches with sources |\n| \"Show my memory\" | Display memory.md contents |\n| \"Show [project] patterns\" | Load and display specific namespace |\n| \"Forget X\" | Remove from all tiers, confirm deletion |\n| \"Forget everything\" | Full wipe with export option |\n| \"What changed recently?\" | Show last 20 corrections |\n| \"Export memory\" | Generate downloadable archive |\n| \"Memory status\" | Show tier sizes, last compaction, health |\n\n## Automatic Operations\n\n### On Session Start\n1. Load memory.md (HOT tier)\n2. Check index.md for context hints\n3. If project detected → preload relevant namespace\n\n### On Correction Received\n```\n1. Parse correction type (preference, pattern, override)\n2. Check if duplicate (exists in any tier)\n3. If new:\n   - Add to corrections.md with timestamp\n   - Increment correction counter\n4. If duplicate:\n   - Bump counter, update timestamp\n   - If counter >= 3: ask to confirm as rule\n5. Determine namespace (global, domain, project)\n6. Write to appropriate file\n7. Update index.md line counts\n```\n\n### On Pattern Match\nWhen applying learned pattern:\n```\n1. Find pattern source (file:line)\n2. Apply pattern\n3. Cite source: \"Using X (from memory.md:15)\"\n4. Log usage for decay tracking\n```\n\n### Weekly Maintenance (Cron)\n```\n1. Scan all files for decay candidates\n2. Move unused >30 days to WARM\n3. Archive unused >90 days to COLD\n4. Run compaction if any file >limit\n5. Update index.md\n6. Generate weekly digest (optional)\n```\n\n## File Formats\n\n### memory.md (HOT)\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n- format: bullet points over prose (confirmed 2026-01)\n- tone: direct, no hedging (confirmed 2026-01)\n\n## Active Patterns\n- \"looks good\" = approval to proceed (used 15x)\n- single emoji = acknowledged (used 8x)\n\n## Recent (last 7 days)\n- prefer SQLite for MVPs (corrected 02-14)\n```\n\n### corrections.md\n```markdown\n# Corrections Log\n\n## 2026-02-15\n- [14:32] Changed verbose explanation → bullet summary\n  Type: communication\n  Context: Telegram response\n  Confirmed: pending (1/3)\n\n## 2026-02-14\n- [09:15] Use SQLite not Postgres for MVP\n  Type: technical\n  Context: database discussion\n  Confirmed: yes (said \"always\")\n```\n\n### projects/{name}.md\n```markdown\n# Project: my-app\n\nInherits: global, domains/code\n\n## Patterns\n- Use Tailwind (project standard)\n- No Prettier (eslint only)\n- Deploy via GitLab CI\n\n## Overrides\n- semicolons: yes (overrides global no-semi)\n\n## History\n- Created: 2026-01-15\n- Last active: 2026-02-15\n- Corrections: 12\n```\n\n## Edge Case Handling\n\n### Contradiction Detected\n```\nPattern A: \"Use tabs\" (global, confirmed)\nPattern B: \"Use spaces\" (project, corrected today)\n\nResolution:\n1. Project overrides global → use spaces for this project\n2. Log conflict in corrections.md\n3. Ask: \"Should spaces apply only to this project or everywhere?\"\n```\n\n### User Changes Mind\n```\nOld: \"Always use formal tone\"\nNew: \"Actually, casual is fine\"\n\nAction:\n1. Archive old pattern with timestamp\n2. Add new pattern as tentative\n3. Keep archived for reference (\"You previously preferred formal\")\n```\n\n### Context Ambiguity\n```\nUser says: \"Remember I like X\"\n\nBut which namespace?\n1. Check current context (project? domain?)\n2. If unclear, ask: \"Should this apply globally or just here?\"\n3. Default to most specific active context\n```\n\nArchive v1.2.13: 15 files, 17137 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), heartbeat-rules.md (1843b), heartbeat-state.md (584b), HEARTBEAT.md (261b), learning.md (2951b), memory-template.md (1278b), memory.md (756b), openclaw-heartbeat.md (261b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (5598b), SKILL.md (7709b), _meta.json (134b)\n\nFile v1.2.13:SKILL.md\n\n---\nname: Self-Improving Agent (Proactive + Self-Reflection)\nslug: self-improving\nversion: 1.2.13\nhomepage: https://clawic.com/skills/self-improving\ndescription: \"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.\"\nchangelog: \"Aligns heartbeat installation with the standard workspace setup so recurring maintenance is added alongside the existing self-improving routing.\"\nmetadata: {\"clawdbot\":{\"emoji\":\"🧠\",\"requires\":{\"bins\":[]},\"os\":[\"linux\",\"darwin\",\"win32\"],\"configPaths\":[\"~/self-improving/\"],\"configPaths.optional\":[\"./AGENTS.md\",\"./SOUL.md\",\"./HEARTBEAT.md\"]}}\n---\n\n## When to Use\n\nUser 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.\n\n## Architecture\n\nMemory lives in `~/self-improving/` with tiered structure. If `~/self-improving/` does not exist, run `setup.md`.\nWorkspace 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`.\n\n```\n~/self-improving/\n├── memory.md          # HOT: ≤100 lines, always loaded\n├── index.md           # Topic index with line counts\n├── heartbeat-state.md # Heartbeat state: last run, reviewed change, action notes\n├── projects/          # Per-project learnings\n├── domains/           # Domain-specific (code, writing, comms)\n├── archive/           # COLD: decayed patterns\n└── corrections.md     # Last 50 corrections log\n```\n\n## Quick Reference\n\n| Topic | File |\n|-------|------|\n| Setup guide | `setup.md` |\n| Heartbeat state template | `heartbeat-state.md` |\n| Memory template | `memory-template.md` |\n| Workspace heartbeat snippet | `HEARTBEAT.md` |\n| Heartbeat rules | `heartbeat-rules.md` |\n| Learning mechanics | `learning.md` |\n| Security boundaries | `boundaries.md` |\n| Scaling rules | `scaling.md` |\n| Memory operations | `operations.md` |\n| Self-reflection log | `reflections.md` |\n| OpenClaw HEARTBEAT seed | `openclaw-heartbeat.md` |\n\n## Detection Triggers\n\nLog automatically when you notice these patterns:\n\n**Corrections** → add to `corrections.md`, evaluate for `memory.md`:\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"I prefer X, not Y\"\n- \"Remember that I always...\"\n- \"I told you before...\"\n- \"Stop doing X\"\n- \"Why do you keep...\"\n\n**Preference signals** → add to `memory.md` if explicit:\n- \"I like when you...\"\n- \"Always do X for me\"\n- \"Never do Y\"\n- \"My style is...\"\n- \"For [project], use...\"\n\n**Pattern candidates** → track, promote after 3x:\n- Same instruction repeated 3+ times\n- Workflow that works well repeatedly\n- User praises specific approach\n\n**Ignore** (don't log):\n- One-time instructions (\"do X now\")\n- Context-specific (\"in this file...\")\n- Hypotheticals (\"what if...\")\n\n## Self-Reflection\n\nAfter completing significant work, pause and evaluate:\n\n1. **Did it meet expectations?** — Compare outcome vs intent\n2. **What could be better?** — Identify improvements for next time\n3. **Is this a pattern?** — If yes, log to `corrections.md`\n\n**When to self-reflect:**\n- After completing a multi-step task\n- After receiving feedback (positive or negative)\n- After fixing a bug or mistake\n- When you notice your output could be better\n\n**Log format:**\n```\nCONTEXT: [type of task]\nREFLECTION: [what I noticed]\nLESSON: [what to do differently]\n```\n\n**Example:**\n```\nCONTEXT: Building Flutter UI\nREFLECTION: Spacing looked off, had to redo\nLESSON: Check visual spacing before showing user\n```\n\nSelf-reflection entries follow the same promotion rules: 3x applied successfully → promote to HOT.\n\n## Quick Queries\n\n| User says | Action |\n|-----------|--------|\n| \"What do you know about X?\" | Search all tiers for X |\n| \"What have you learned?\" | Show last 10 from `corrections.md` |\n| \"Show my patterns\" | List `memory.md` (HOT) |\n| \"Show [project] patterns\" | Load `projects/{name}.md` |\n| \"What's in warm storage?\" | List files in `projects/` + `domains/` |\n| \"Memory stats\" | Show counts per tier |\n| \"Forget X\" | Remove from all tiers (confirm first) |\n| \"Export memory\" | ZIP all files |\n\n## Memory Stats\n\nOn \"memory stats\" request, report:\n\n```\n📊 Self-Improving Memory\n\nHOT (always loaded):\n  memory.md: X entries\n\nWARM (load on demand):\n  projects/: X files\n  domains/: X files\n\nCOLD (archived):\n  archive/: X files\n\nRecent activity (7 days):\n  Corrections logged: X\n  Promotions to HOT: X\n  Demotions to WARM: X\n```\n\n## Core Rules\n\n### 1. Learn from Corrections and Self-Reflection\n- Log when user explicitly corrects you\n- Log when you identify improvements in your own work\n- Never infer from silence alone\n- After 3 identical lessons → ask to confirm as rule\n\n### 2. Tiered Storage\n| Tier | Location | Size Limit | Behavior |\n|------|----------|------------|----------|\n| HOT | memory.md | ≤100 lines | Always loaded |\n| WARM | projects/, domains/ | ≤200 lines each | Load on context match |\n| COLD | archive/ | Unlimited | Load on explicit query |\n\n### 3. Automatic Promotion/Demotion\n- Pattern used 3x in 7 days → promote to HOT\n- Pattern unused 30 days → demote to WARM\n- Pattern unused 90 days → archive to COLD\n- Never delete without asking\n\n### 4. Namespace Isolation\n- Project patterns stay in `projects/{name}.md`\n- Global preferences in HOT tier (memory.md)\n- Domain patterns (code, writing) in `domains/`\n- Cross-namespace inheritance: global → domain → project\n\n### 5. Conflict Resolution\nWhen patterns contradict:\n1. Most specific wins (project > domain > global)\n2. Most recent wins (same level)\n3. If ambiguous → ask user\n\n### 6. Compaction\nWhen file exceeds limit:\n1. Merge similar corrections into single rule\n2. Archive unused patterns\n3. Summarize verbose entries\n4. Never lose confirmed preferences\n\n### 7. Transparency\n- Every action from memory → cite source: \"Using X (from projects/foo.md:12)\"\n- Weekly digest available: patterns learned, demoted, archived\n- Full export on demand: all files as ZIP\n\n### 8. Security Boundaries\nSee `boundaries.md` — never store credentials, health data, third-party info.\n\n### 9. Graceful Degradation\nIf context limit hit:\n1. Load only memory.md (HOT)\n2. Load relevant namespace on demand\n3. Never fail silently — tell user what's not loaded\n\n## Scope\n\nThis skill ONLY:\n- Learns from user corrections and self-reflection\n- Stores preferences in local files (`~/self-improving/`)\n- Maintains heartbeat state in `~/self-improving/heartbeat-state.md` when the workspace integrates heartbeat\n- Reads its own memory files on activation\n\nThis skill NEVER:\n- Accesses calendar, email, or contacts\n- Makes network requests\n- Reads files outside `~/self-improving/`\n- Infers preferences from silence or observation\n- Deletes or blindly rewrites self-improving memory during heartbeat cleanup\n- Modifies its own SKILL.md\n\n## Related Skills\nInstall with `clawhub install <slug>` if user confirms:\n\n- `memory` — Long-term memory patterns for agents\n- `learning` — Adaptive teaching and explanation\n- `decide` — Auto-learn decision patterns\n- `escalate` — Know when to ask vs act autonomously\n\n## Feedback\n\n- If useful: `clawhub star self-improving`\n- Stay updated: `clawhub sync`\n\nFile v1.2.13:_meta.json\n\n{\n  \"ownerId\": \"kn73vp5rarc3b14rc7wjcw8f8580t5d1\",\n  \"slug\": \"self-improving\",\n  \"version\": \"1.2.13\",\n  \"publishedAt\": 1773254876903\n}\n\nFile v1.2.13:boundaries.md\n\n# Security Boundaries\n\n## Never Store\n\n| Category | Examples | Why |\n|----------|----------|-----|\n| Credentials | Passwords, API keys, tokens, SSH keys | Security breach risk |\n| Financial | Card numbers, bank accounts, crypto seeds | Fraud risk |\n| Medical | Diagnoses, medications, conditions | Privacy, HIPAA |\n| Biometric | Voice patterns, behavioral fingerprints | Identity theft |\n| Third parties | Info about other people | No consent obtained |\n| Location patterns | Home/work addresses, routines | Physical safety |\n| Access patterns | What systems user has access to | Privilege escalation |\n\n## Store with Caution\n\n| Category | Rules |\n|----------|-------|\n| Work context | Decay after project ends, never share cross-project |\n| Emotional states | Only if user explicitly shares, never infer |\n| Relationships | Roles only (\"manager\", \"client\"), no personal details |\n| Schedules | General patterns OK (\"busy mornings\"), not specific times |\n\n## Transparency Requirements\n\n1. **Audit on demand** — User asks \"what do you know about me?\" → full export\n2. **Source tracking** — Every item tagged with when/how learned\n3. **Explain actions** — \"I did X because you said Y on [date]\"\n4. **No hidden state** — If it affects behavior, it must be visible\n5. **Deletion verification** — Confirm item removed, show updated state\n\n## Red Flags to Catch\n\nIf you find yourself doing any of these, STOP:\n\n- Storing something \"just in case it's useful later\"\n- Inferring sensitive info from non-sensitive data\n- Keeping data after user asked to forget\n- Applying personal context to work (or vice versa)\n- Learning what makes user comply faster\n- Building psychological profile\n- Retaining third-party information\n\n## Kill Switch\n\nUser says \"forget everything\":\n1. Export current memory to file (so they can review)\n2. Wipe all learned data\n3. Confirm: \"Memory cleared. Starting fresh.\"\n4. Do not retain \"ghost patterns\" in behavior\n\n## Consent Model\n\n| Data Type | Consent Level |\n|-----------|---------------|\n| Explicit corrections | Implied by correction itself |\n| Inferred preferences | Ask after 3 observations |\n| Context/project data | Ask when first detected |\n| Cross-session patterns | Explicit opt-in required |\n\nFile v1.2.13:corrections.md\n\n# Corrections Log — Template\n\n> This file is created in `~/self-improving/corrections.md` when you first use the skill.\n> Keeps the last 50 corrections. Older entries are evaluated for promotion or archived.\n\n## Example Entries\n\n```markdown\n## 2026-02-19\n\n### 14:32 — Code style\n- **Correction:** \"Use 2-space indentation, not 4\"\n- **Context:** Editing TypeScript file\n- **Count:** 1 (first occurrence)\n\n### 16:15 — Communication\n- **Correction:** \"Don't start responses with 'Great question!'\"\n- **Context:** Chat response\n- **Count:** 3 → **PROMOTED to memory.md**\n\n## 2026-02-18\n\n### 09:00 — Project: website\n- **Correction:** \"For this project, always use Tailwind\"\n- **Context:** CSS discussion\n- **Action:** Added to projects/website.md\n```\n\n## Log Format\n\nEach entry includes:\n- **Timestamp** — When the correction happened\n- **Correction** — What the user said\n- **Context** — What triggered it\n- **Count** — How many times (for promotion tracking)\n- **Action** — Where it was stored (if promoted)\n\nFile v1.2.13:heartbeat-rules.md\n\n# Heartbeat Rules\n\nUse heartbeat to keep `~/self-improving/` organized without creating churn or losing data.\n\n## Source of Truth\n\nKeep the workspace `HEARTBEAT.md` snippet minimal.\nTreat this file as the stable contract for self-improving heartbeat behavior.\nStore mutable run state only in `~/self-improving/heartbeat-state.md`.\n\n## Start of Every Heartbeat\n\n1. Ensure `~/self-improving/heartbeat-state.md` exists.\n2. Write `last_heartbeat_started_at` immediately in ISO 8601.\n3. Read the previous `last_reviewed_change_at`.\n4. Scan `~/self-improving/` for files changed after that moment, excluding `heartbeat-state.md` itself.\n\n## If Nothing Changed\n\n- Set `last_heartbeat_result: HEARTBEAT_OK`\n- Append a short \"no material change\" note if you keep an action log\n- Return `HEARTBEAT_OK`\n\n## If Something Changed\n\nOnly do conservative organization:\n\n- refresh `index.md` if counts or file references drift\n- compact oversized files by merging duplicates or summarizing repetitive entries\n- move clearly misplaced notes to the right namespace only when the target is unambiguous\n- preserve confirmed rules and explicit corrections exactly\n- update `last_reviewed_change_at` only after the review finishes cleanly\n\n## Safety Rules\n\n- Most heartbeat runs should do nothing\n- Prefer append, summarize, or index fixes over large rewrites\n- Never delete data, empty files, or overwrite uncertain text\n- Never reorganize files outside `~/self-improving/`\n- If scope is ambiguous, leave files untouched and record a suggested follow-up instead\n\n## State Fields\n\nKeep `~/self-improving/heartbeat-state.md` simple:\n\n- `last_heartbeat_started_at`\n- `last_reviewed_change_at`\n- `last_heartbeat_result`\n- `last_actions`\n\n## Behavior Standard\n\nHeartbeat exists to keep the memory system tidy and trustworthy.\nIf no rule is clearly violated, do nothing.\n\nFile v1.2.13:heartbeat-state.md\n\n# Heartbeat State Template\n\nUse this file as the baseline for `~/self-improving/heartbeat-state.md`.\nIt stores only lightweight run markers and maintenance notes.\n\n```markdown\n# Self-Improving Heartbeat State\n\nlast_heartbeat_started_at: never\nlast_reviewed_change_at: never\nlast_heartbeat_result: never\n\n## Last actions\n- none yet\n```\n\n## Rules\n\n- update `last_heartbeat_started_at` at the beginning of every heartbeat\n- update `last_reviewed_change_at` only after a clean review of changed files\n- keep `last_actions` short and factual\n- never turn this file into another memory log\n\nFile v1.2.13:HEARTBEAT.md\n\n## Self-Improving Check\n\n- Read `./skills/self-improving/heartbeat-rules.md`\n- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes\n- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`\n\nFile v1.2.13:learning.md\n\n# Learning Mechanics\n\n## What Triggers Learning\n\n| Trigger | Confidence | Action |\n|---------|------------|--------|\n| \"No, do X instead\" | High | Log correction immediately |\n| \"I told you before...\" | High | Flag as repeated, bump priority |\n| \"Always/Never do X\" | Confirmed | Promote to preference |\n| User edits your output | Medium | Log as tentative pattern |\n| Same correction 3x | Confirmed | Ask to make permanent |\n| \"For this project...\" | Scoped | Write to project namespace |\n\n## What Does NOT Trigger Learning\n\n- Silence (not confirmation)\n- Single instance of anything\n- Hypothetical discussions\n- Third-party preferences (\"John likes...\")\n- Group chat patterns (unless user confirms)\n- Implied preferences (never infer)\n\n## Correction Classification\n\n### By Type\n| Type | Example | Namespace |\n|------|---------|-----------|\n| Format | \"Use bullets not prose\" | global |\n| Technical | \"SQLite not Postgres\" | domain/code |\n| Communication | \"Shorter messages\" | global |\n| Project-specific | \"This repo uses Tailwind\" | projects/{name} |\n| Person-specific | \"Marcus wants BLUF\" | domains/comms |\n\n### By Scope\n```\nGlobal: applies everywhere\n  └── Domain: applies to category (code, writing, comms)\n       └── Project: applies to specific context\n            └── Temporary: applies to this session only\n```\n\n## Confirmation Flow\n\nAfter 3 similar corrections:\n```\nAgent: \"I've noticed you prefer X over Y (corrected 3 times).\n        Should I always do this?\n        - Yes, always\n        - Only in [context]\n        - No, case by case\"\n\nUser: \"Yes, always\"\n\nAgent: → Moves to Confirmed Preferences\n       → Removes from correction counter\n       → Cites source on future use\n```\n\n## Pattern Evolution\n\n### Stages\n1. **Tentative** — Single correction, watch for repetition\n2. **Emerging** — 2 corrections, likely pattern\n3. **Pending** — 3 corrections, ask for confirmation\n4. **Confirmed** — User approved, permanent unless reversed\n5. **Archived** — Unused 90+ days, preserved but inactive\n\n### Reversal\nUser can always reverse:\n```\nUser: \"Actually, I changed my mind about X\"\n\nAgent: \n1. Archive old pattern (keep history)\n2. Log reversal with timestamp\n3. Add new preference as tentative\n4. \"Got it. I'll do Y now. (Previous: X, archived)\"\n```\n\n## Anti-Patterns\n\n### Never Learn\n- What makes user comply faster (manipulation)\n- Emotional triggers or vulnerabilities\n- Patterns from other users (even if shared device)\n- Anything that feels \"creepy\" to surface\n\n### Avoid\n- Over-generalizing from single instance\n- Learning style over substance\n- Assuming preference stability\n- Ignoring context shifts\n\n## Quality Signals\n\n### Good Learning\n- User explicitly states preference\n- Pattern consistent across contexts\n- Correction improves outcomes\n- User confirms when asked\n\n### Bad Learning\n- Inferred from silence\n- Contradicts recent behavior\n- Only works in narrow context\n- User never confirmed\n\nFile v1.2.13:memory-template.md\n\n# Memory Template\n\nCopy this structure to `~/self-improving/memory.md` on first use.\n\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n<!-- Patterns confirmed by user, never decay -->\n\n## Active Patterns\n<!-- Patterns observed 3+ times, subject to decay -->\n\n## Recent (last 7 days)\n<!-- New corrections pending confirmation -->\n```\n\n## Initial Directory Structure\n\nCreate on first activation:\n\n```bash\nmkdir -p ~/self-improving/{projects,domains,archive}\ntouch ~/self-improving/{memory.md,index.md,corrections.md,heartbeat-state.md}\n```\n\n## Index Template\n\nFor `~/self-improving/index.md`:\n\n```markdown\n# Memory Index\n\n## HOT\n- memory.md: 0 lines\n\n## WARM\n- (no namespaces yet)\n\n## COLD\n- (no archives yet)\n\nLast compaction: never\n```\n\n## Corrections Log Template\n\nFor `~/self-improving/corrections.md`:\n\n```markdown\n# Corrections Log\n\n<!-- Format:\n## YYYY-MM-DD\n- [HH:MM] Changed X → Y\n  Type: format|technical|communication|project\n  Context: where correction happened\n  Confirmed: pending (N/3) | yes | no\n-->\n```\n\n## Heartbeat State Template\n\nFor `~/self-improving/heartbeat-state.md`:\n\n```markdown\n# Self-Improving Heartbeat State\n\nlast_heartbeat_started_at: never\nlast_reviewed_change_at: never\nlast_heartbeat_result: never\n\n## Last actions\n- none yet\n```\n\nFile v1.2.13:memory.md\n\n# HOT Memory — Template\n\n> This file is created in `~/self-improving/memory.md` when you first use the skill.\n> Keep it ≤100 lines. Most-used patterns live here.\n\n## Example Entries\n\n```markdown\n## Preferences\n- Code style: Prefer explicit over implicit\n- Communication: Direct, no fluff\n- Time zone: Europe/Madrid\n\n## Patterns (promoted from corrections)\n- Always use TypeScript strict mode\n- Prefer pnpm over npm\n- Format: ISO 8601 for dates\n\n## Project defaults\n- Tests: Jest with coverage >80%\n- Commits: Conventional commits format\n```\n\n## Usage\n\nThe agent will:\n1. Load this file on every session\n2. Add entries when patterns are used 3x in 7 days\n3. Demote unused entries to WARM after 30 days\n4. Never exceed 100 lines (compacts automatically)\n\nFile v1.2.13:openclaw-heartbeat.md\n\n## Self-Improving Check\n\n- Read `./skills/self-improving/heartbeat-rules.md`\n- Use `~/self-improving/heartbeat-state.md` for last-run markers and action notes\n- If no file inside `~/self-improving/` changed since the last reviewed change, return `HEARTBEAT_OK`\n\nFile v1.2.13:operations.md\n\n# Memory Operations\n\n## User Commands\n\n| Command | Action |\n|---------|--------|\n| \"What do you know about X?\" | Search all tiers, return matches with sources |\n| \"Show my memory\" | Display memory.md contents |\n| \"Show [project] patterns\" | Load and display specific namespace |\n| \"Forget X\" | Remove from all tiers, confirm deletion |\n| \"Forget everything\" | Full wipe with export option |\n| \"What changed recently?\" | Show last 20 corrections |\n| \"Export memory\" | Generate downloadable archive |\n| \"Memory status\" | Show tier sizes, last compaction, health |\n\n## Automatic Operations\n\n### On Session Start\n1. Load memory.md (HOT tier)\n2. Check index.md for context hints\n3. If project detected → preload relevant namespace\n\n### On Correction Received\n```\n1. Parse correction type (preference, pattern, override)\n2. Check if duplicate (exists in any tier)\n3. If new:\n   - Add to corrections.md with timestamp\n   - Increment correction counter\n4. If duplicate:\n   - Bump counter, update timestamp\n   - If counter >= 3: ask to confirm as rule\n5. Determine namespace (global, domain, project)\n6. Write to appropriate file\n7. Update index.md line counts\n```\n\n### On Pattern Match\nWhen applying learned pattern:\n```\n1. Find pattern source (file:line)\n2. Apply pattern\n3. Cite source: \"Using X (from memory.md:15)\"\n4. Log usage for decay tracking\n```\n\n### Weekly Maintenance (Cron)\n```\n1. Scan all files for decay candidates\n2. Move unused >30 days to WARM\n3. Archive unused >90 days to COLD\n4. Run compaction if any file >limit\n5. Update index.md\n6. Generate weekly digest (optional)\n```\n\n## File Formats\n\n### memory.md (HOT)\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n- format: bullet points over prose (confirmed 2026-01)\n- tone: direct, no hedging (confirmed 2026-01)\n\n## Active Patterns\n- \"looks good\" = approval to proceed (used 15x)\n- single emoji = acknowledged (used 8x)\n\n## Recent (last 7 days)\n- prefer SQLite for MVPs (corrected 02-14)\n```\n\n### corrections.md\n```markdown\n# Corrections Log\n\n## 2026-02-15\n- [14:32] Changed verbose explanation → bullet summary\n  Type: communication\n  Context: Telegram response\n  Confirmed: pending (1/3)\n\n## 2026-02-14\n- [09:15] Use SQLite not Postgres for MVP\n  Type: technical\n  Context: database discussion\n  Confirmed: yes (said \"always\")\n```\n\n### projects/{name}.md\n```markdown\n# Project: my-app\n\nInherits: global, domains/code\n\n## Patterns\n- Use Tailwind (project standard)\n- No Prettier (eslint only)\n- Deploy via GitLab CI\n\n## Overrides\n- semicolons: yes (overrides global no-semi)\n\n## History\n- Created: 2026-01-15\n- Last active: 2026-02-15\n- Corrections: 12\n```\n\n## Edge Case Handling\n\n### Contradiction Detected\n```\nPattern A: \"Use tabs\" (global, confirmed)\nPattern B: \"Use spaces\" (project, corrected today)\n\nResolution:\n1. Project overrides global → use spaces for this project\n2. Log conflict in corrections.md\n3. Ask: \"Should spaces apply only to this project or everywhere?\"\n```\n\n### User Changes Mind\n```\nOld: \"Always use formal tone\"\nNew: \"Actually, casual is fine\"\n\nAction:\n1. Archive old pattern with timestamp\n2. Add new pattern as tentative\n3. Keep archived for reference (\"You previously preferred formal\")\n```\n\n### Context Ambiguity\n```\nUser says: \"Remember I like X\"\n\nBut which namespace?\n1. Check current context (project? domain?)\n2. If unclear, ask: \"Should this apply globally or just here?\"\n3. Default to most specific active context\n```\n\nArchive v1.2.12: 11 files, 14596 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), learning.md (2951b), memory-template.md (1014b), memory.md (756b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (5040b), SKILL.md (6909b), _meta.json (134b)\n\nFile v1.2.12:SKILL.md\n\n---\nname: Self-Improving Agent (Proactive + Self-Reflection)\nslug: self-improving\nversion: 1.2.12\nhomepage: https://clawic.com/skills/self-improving\ndescription: \"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.\"\nchangelog: \"Refined the description to make the activation trigger more explicit.\"\nmetadata: {\"clawdbot\":{\"emoji\":\"🧠\",\"requires\":{\"bins\":[]},\"os\":[\"linux\",\"darwin\",\"win32\"],\"configPaths\":[\"~/self-improving/\"]}}\n---\n\n## When to Use\n\nUser 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.\n\n## Architecture\n\nMemory lives in `~/self-improving/` with tiered structure. If `~/self-improving/` does not exist, run `setup.md`.\n\n```\n~/self-improving/\n├── memory.md          # HOT: ≤100 lines, always loaded\n├── index.md           # Topic index with line counts\n├── projects/          # Per-project learnings\n├── domains/           # Domain-specific (code, writing, comms)\n├── archive/           # COLD: decayed patterns\n└── corrections.md     # Last 50 corrections log\n```\n\n## Quick Reference\n\n| Topic | File |\n|-------|------|\n| Setup guide | `setup.md` |\n| Memory template | `memory-template.md` |\n| Learning mechanics | `learning.md` |\n| Security boundaries | `boundaries.md` |\n| Scaling rules | `scaling.md` |\n| Memory operations | `operations.md` |\n| Self-reflection log | `reflections.md` |\n\n## Detection Triggers\n\nLog automatically when you notice these patterns:\n\n**Corrections** → add to `corrections.md`, evaluate for `memory.md`:\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"I prefer X, not Y\"\n- \"Remember that I always...\"\n- \"I told you before...\"\n- \"Stop doing X\"\n- \"Why do you keep...\"\n\n**Preference signals** → add to `memory.md` if explicit:\n- \"I like when you...\"\n- \"Always do X for me\"\n- \"Never do Y\"\n- \"My style is...\"\n- \"For [project], use...\"\n\n**Pattern candidates** → track, promote after 3x:\n- Same instruction repeated 3+ times\n- Workflow that works well repeatedly\n- User praises specific approach\n\n**Ignore** (don't log):\n- One-time instructions (\"do X now\")\n- Context-specific (\"in this file...\")\n- Hypotheticals (\"what if...\")\n\n## Self-Reflection\n\nAfter completing significant work, pause and evaluate:\n\n1. **Did it meet expectations?** — Compare outcome vs intent\n2. **What could be better?** — Identify improvements for next time\n3. **Is this a pattern?** — If yes, log to `corrections.md`\n\n**When to self-reflect:**\n- After completing a multi-step task\n- After receiving feedback (positive or negative)\n- After fixing a bug or mistake\n- When you notice your output could be better\n\n**Log format:**\n```\nCONTEXT: [type of task]\nREFLECTION: [what I noticed]\nLESSON: [what to do differently]\n```\n\n**Example:**\n```\nCONTEXT: Building Flutter UI\nREFLECTION: Spacing looked off, had to redo\nLESSON: Check visual spacing before showing user\n```\n\nSelf-reflection entries follow the same promotion rules: 3x applied successfully → promote to HOT.\n\n## Quick Queries\n\n| User says | Action |\n|-----------|--------|\n| \"What do you know about X?\" | Search all tiers for X |\n| \"What have you learned?\" | Show last 10 from `corrections.md` |\n| \"Show my patterns\" | List `memory.md` (HOT) |\n| \"Show [project] patterns\" | Load `projects/{name}.md` |\n| \"What's in warm storage?\" | List files in `projects/` + `domains/` |\n| \"Memory stats\" | Show counts per tier |\n| \"Forget X\" | Remove from all tiers (confirm first) |\n| \"Export memory\" | ZIP all files |\n\n## Memory Stats\n\nOn \"memory stats\" request, report:\n\n```\n📊 Self-Improving Memory\n\nHOT (always loaded):\n  memory.md: X entries\n\nWARM (load on demand):\n  projects/: X files\n  domains/: X files\n\nCOLD (archived):\n  archive/: X files\n\nRecent activity (7 days):\n  Corrections logged: X\n  Promotions to HOT: X\n  Demotions to WARM: X\n```\n\n## Core Rules\n\n### 1. Learn from Corrections and Self-Reflection\n- Log when user explicitly corrects you\n- Log when you identify improvements in your own work\n- Never infer from silence alone\n- After 3 identical lessons → ask to confirm as rule\n\n### 2. Tiered Storage\n| Tier | Location | Size Limit | Behavior |\n|------|----------|------------|----------|\n| HOT | memory.md | ≤100 lines | Always loaded |\n| WARM | projects/, domains/ | ≤200 lines each | Load on context match |\n| COLD | archive/ | Unlimited | Load on explicit query |\n\n### 3. Automatic Promotion/Demotion\n- Pattern used 3x in 7 days → promote to HOT\n- Pattern unused 30 days → demote to WARM\n- Pattern unused 90 days → archive to COLD\n- Never delete without asking\n\n### 4. Namespace Isolation\n- Project patterns stay in `projects/{name}.md`\n- Global preferences in HOT tier (memory.md)\n- Domain patterns (code, writing) in `domains/`\n- Cross-namespace inheritance: global → domain → project\n\n### 5. Conflict Resolution\nWhen patterns contradict:\n1. Most specific wins (project > domain > global)\n2. Most recent wins (same level)\n3. If ambiguous → ask user\n\n### 6. Compaction\nWhen file exceeds limit:\n1. Merge similar corrections into single rule\n2. Archive unused patterns\n3. Summarize verbose entries\n4. Never lose confirmed preferences\n\n### 7. Transparency\n- Every action from memory → cite source: \"Using X (from projects/foo.md:12)\"\n- Weekly digest available: patterns learned, demoted, archived\n- Full export on demand: all files as ZIP\n\n### 8. Security Boundaries\nSee `boundaries.md` — never store credentials, health data, third-party info.\n\n### 9. Graceful Degradation\nIf context limit hit:\n1. Load only memory.md (HOT)\n2. Load relevant namespace on demand\n3. Never fail silently — tell user what's not loaded\n\n## Scope\n\nThis skill ONLY:\n- Learns from user corrections and self-reflection\n- Stores preferences in local files (`~/self-improving/`)\n- Reads its own memory files on activation\n\nThis skill NEVER:\n- Accesses calendar, email, or contacts\n- Makes network requests\n- Reads files outside `~/self-improving/`\n- Infers preferences from silence or observation\n- Modifies its own SKILL.md\n\n## Related Skills\nInstall with `clawhub install <slug>` if user confirms:\n\n- `memory` — Long-term memory patterns for agents\n- `learning` — Adaptive teaching and explanation\n- `decide` — Auto-learn decision patterns\n- `escalate` — Know when to ask vs act autonomously\n\n## Feedback\n\n- If useful: `clawhub star self-improving`\n- Stay updated: `clawhub sync`\n\nFile v1.2.12:_meta.json\n\n{\n  \"ownerId\": \"kn73vp5rarc3b14rc7wjcw8f8580t5d1\",\n  \"slug\": \"self-improving\",\n  \"version\": \"1.2.12\",\n  \"publishedAt\": 1773238384403\n}\n\nFile v1.2.12:boundaries.md\n\n# Security Boundaries\n\n## Never Store\n\n| Category | Examples | Why |\n|----------|----------|-----|\n| Credentials | Passwords, API keys, tokens, SSH keys | Security breach risk |\n| Financial | Card numbers, bank accounts, crypto seeds | Fraud risk |\n| Medical | Diagnoses, medications, conditions | Privacy, HIPAA |\n| Biometric | Voice patterns, behavioral fingerprints | Identity theft |\n| Third parties | Info about other people | No consent obtained |\n| Location patterns | Home/work addresses, routines | Physical safety |\n| Access patterns | What systems user has access to | Privilege escalation |\n\n## Store with Caution\n\n| Category | Rules |\n|----------|-------|\n| Work context | Decay after project ends, never share cross-project |\n| Emotional states | Only if user explicitly shares, never infer |\n| Relationships | Roles only (\"manager\", \"client\"), no personal details |\n| Schedules | General patterns OK (\"busy mornings\"), not specific times |\n\n## Transparency Requirements\n\n1. **Audit on demand** — User asks \"what do you know about me?\" → full export\n2. **Source tracking** — Every item tagged with when/how learned\n3. **Explain actions** — \"I did X because you said Y on [date]\"\n4. **No hidden state** — If it affects behavior, it must be visible\n5. **Deletion verification** — Confirm item removed, show updated state\n\n## Red Flags to Catch\n\nIf you find yourself doing any of these, STOP:\n\n- Storing something \"just in case it's useful later\"\n- Inferring sensitive info from non-sensitive data\n- Keeping data after user asked to forget\n- Applying personal context to work (or vice versa)\n- Learning what makes user comply faster\n- Building psychological profile\n- Retaining third-party information\n\n## Kill Switch\n\nUser says \"forget everything\":\n1. Export current memory to file (so they can review)\n2. Wipe all learned data\n3. Confirm: \"Memory cleared. Starting fresh.\"\n4. Do not retain \"ghost patterns\" in behavior\n\n## Consent Model\n\n| Data Type | Consent Level |\n|-----------|---------------|\n| Explicit corrections | Implied by correction itself |\n| Inferred preferences | Ask after 3 observations |\n| Context/project data | Ask when first detected |\n| Cross-session patterns | Explicit opt-in required |\n\nFile v1.2.12:corrections.md\n\n# Corrections Log — Template\n\n> This file is created in `~/self-improving/corrections.md` when you first use the skill.\n> Keeps the last 50 corrections. Older entries are evaluated for promotion or archived.\n\n## Example Entries\n\n```markdown\n## 2026-02-19\n\n### 14:32 — Code style\n- **Correction:** \"Use 2-space indentation, not 4\"\n- **Context:** Editing TypeScript file\n- **Count:** 1 (first occurrence)\n\n### 16:15 — Communication\n- **Correction:** \"Don't start responses with 'Great question!'\"\n- **Context:** Chat response\n- **Count:** 3 → **PROMOTED to memory.md**\n\n## 2026-02-18\n\n### 09:00 — Project: website\n- **Correction:** \"For this project, always use Tailwind\"\n- **Context:** CSS discussion\n- **Action:** Added to projects/website.md\n```\n\n## Log Format\n\nEach entry includes:\n- **Timestamp** — When the correction happened\n- **Correction** — What the user said\n- **Context** — What triggered it\n- **Count** — How many times (for promotion tracking)\n- **Action** — Where it was stored (if promoted)\n\nFile v1.2.12:learning.md\n\n# Learning Mechanics\n\n## What Triggers Learning\n\n| Trigger | Confidence | Action |\n|---------|------------|--------|\n| \"No, do X instead\" | High | Log correction immediately |\n| \"I told you before...\" | High | Flag as repeated, bump priority |\n| \"Always/Never do X\" | Confirmed | Promote to preference |\n| User edits your output | Medium | Log as tentative pattern |\n| Same correction 3x | Confirmed | Ask to make permanent |\n| \"For this project...\" | Scoped | Write to project namespace |\n\n## What Does NOT Trigger Learning\n\n- Silence (not confirmation)\n- Single instance of anything\n- Hypothetical discussions\n- Third-party preferences (\"John likes...\")\n- Group chat patterns (unless user confirms)\n- Implied preferences (never infer)\n\n## Correction Classification\n\n### By Type\n| Type | Example | Namespace |\n|------|---------|-----------|\n| Format | \"Use bullets not prose\" | global |\n| Technical | \"SQLite not Postgres\" | domain/code |\n| Communication | \"Shorter messages\" | global |\n| Project-specific | \"This repo uses Tailwind\" | projects/{name} |\n| Person-specific | \"Marcus wants BLUF\" | domains/comms |\n\n### By Scope\n```\nGlobal: applies everywhere\n  └── Domain: applies to category (code, writing, comms)\n       └── Project: applies to specific context\n            └── Temporary: applies to this session only\n```\n\n## Confirmation Flow\n\nAfter 3 similar corrections:\n```\nAgent: \"I've noticed you prefer X over Y (corrected 3 times).\n        Should I always do this?\n        - Yes, always\n        - Only in [context]\n        - No, case by case\"\n\nUser: \"Yes, always\"\n\nAgent: → Moves to Confirmed Preferences\n       → Removes from correction counter\n       → Cites source on future use\n```\n\n## Pattern Evolution\n\n### Stages\n1. **Tentative** — Single correction, watch for repetition\n2. **Emerging** — 2 corrections, likely pattern\n3. **Pending** — 3 corrections, ask for confirmation\n4. **Confirmed** — User approved, permanent unless reversed\n5. **Archived** — Unused 90+ days, preserved but inactive\n\n### Reversal\nUser can always reverse:\n```\nUser: \"Actually, I changed my mind about X\"\n\nAgent: \n1. Archive old pattern (keep history)\n2. Log reversal with timestamp\n3. Add new preference as tentative\n4. \"Got it. I'll do Y now. (Previous: X, archived)\"\n```\n\n## Anti-Patterns\n\n### Never Learn\n- What makes user comply faster (manipulation)\n- Emotional triggers or vulnerabilities\n- Patterns from other users (even if shared device)\n- Anything that feels \"creepy\" to surface\n\n### Avoid\n- Over-generalizing from single instance\n- Learning style over substance\n- Assuming preference stability\n- Ignoring context shifts\n\n## Quality Signals\n\n### Good Learning\n- User explicitly states preference\n- Pattern consistent across contexts\n- Correction improves outcomes\n- User confirms when asked\n\n### Bad Learning\n- Inferred from silence\n- Contradicts recent behavior\n- Only works in narrow context\n- User never confirmed\n\nFile v1.2.12:memory-template.md\n\n# Memory Template\n\nCopy this structure to `~/self-improving/memory.md` on first use.\n\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n<!-- Patterns confirmed by user, never decay -->\n\n## Active Patterns\n<!-- Patterns observed 3+ times, subject to decay -->\n\n## Recent (last 7 days)\n<!-- New corrections pending confirmation -->\n```\n\n## Initial Directory Structure\n\nCreate on first activation:\n\n```bash\nmkdir -p ~/self-improving/{projects,domains,archive}\ntouch ~/self-improving/{memory.md,index.md,corrections.md}\n```\n\n## Index Template\n\nFor `~/self-improving/index.md`:\n\n```markdown\n# Memory Index\n\n## HOT\n- memory.md: 0 lines\n\n## WARM\n- (no namespaces yet)\n\n## COLD\n- (no archives yet)\n\nLast compaction: never\n```\n\n## Corrections Log Template\n\nFor `~/self-improving/corrections.md`:\n\n```markdown\n# Corrections Log\n\n<!-- Format:\n## YYYY-MM-DD\n- [HH:MM] Changed X → Y\n  Type: format|technical|communication|project\n  Context: where correction happened\n  Confirmed: pending (N/3) | yes | no\n-->\n```\n\nFile v1.2.12:memory.md\n\n# HOT Memory — Template\n\n> This file is created in `~/self-improving/memory.md` when you first use the skill.\n> Keep it ≤100 lines. Most-used patterns live here.\n\n## Example Entries\n\n```markdown\n## Preferences\n- Code style: Prefer explicit over implicit\n- Communication: Direct, no fluff\n- Time zone: Europe/Madrid\n\n## Patterns (promoted from corrections)\n- Always use TypeScript strict mode\n- Prefer pnpm over npm\n- Format: ISO 8601 for dates\n\n## Project defaults\n- Tests: Jest with coverage >80%\n- Commits: Conventional commits format\n```\n\n## Usage\n\nThe agent will:\n1. Load this file on every session\n2. Add entries when patterns are used 3x in 7 days\n3. Demote unused entries to WARM after 30 days\n4. Never exceed 100 lines (compacts automatically)\n\nFile v1.2.12:operations.md\n\n# Memory Operations\n\n## User Commands\n\n| Command | Action |\n|---------|--------|\n| \"What do you know about X?\" | Search all tiers, return matches with sources |\n| \"Show my memory\" | Display memory.md contents |\n| \"Show [project] patterns\" | Load and display specific namespace |\n| \"Forget X\" | Remove from all tiers, confirm deletion |\n| \"Forget everything\" | Full wipe with export option |\n| \"What changed recently?\" | Show last 20 corrections |\n| \"Export memory\" | Generate downloadable archive |\n| \"Memory status\" | Show tier sizes, last compaction, health |\n\n## Automatic Operations\n\n### On Session Start\n1. Load memory.md (HOT tier)\n2. Check index.md for context hints\n3. If project detected → preload relevant namespace\n\n### On Correction Received\n```\n1. Parse correction type (preference, pattern, override)\n2. Check if duplicate (exists in any tier)\n3. If new:\n   - Add to corrections.md with timestamp\n   - Increment correction counter\n4. If duplicate:\n   - Bump counter, update timestamp\n   - If counter >= 3: ask to confirm as rule\n5. Determine namespace (global, domain, project)\n6. Write to appropriate file\n7. Update index.md line counts\n```\n\n### On Pattern Match\nWhen applying learned pattern:\n```\n1. Find pattern source (file:line)\n2. Apply pattern\n3. Cite source: \"Using X (from memory.md:15)\"\n4. Log usage for decay tracking\n```\n\n### Weekly Maintenance (Cron)\n```\n1. Scan all files for decay candidates\n2. Move unused >30 days to WARM\n3. Archive unused >90 days to COLD\n4. Run compaction if any file >limit\n5. Update index.md\n6. Generate weekly digest (optional)\n```\n\n## File Formats\n\n### memory.md (HOT)\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n- format: bullet points over prose (confirmed 2026-01)\n- tone: direct, no hedging (confirmed 2026-01)\n\n## Active Patterns\n- \"looks good\" = approval to proceed (used 15x)\n- single emoji = acknowledged (used 8x)\n\n## Recent (last 7 days)\n- prefer SQLite for MVPs (corrected 02-14)\n```\n\n### corrections.md\n```markdown\n# Corrections Log\n\n## 2026-02-15\n- [14:32] Changed verbose explanation → bullet summary\n  Type: communication\n  Context: Telegram response\n  Confirmed: pending (1/3)\n\n## 2026-02-14\n- [09:15] Use SQLite not Postgres for MVP\n  Type: technical\n  Context: database discussion\n  Confirmed: yes (said \"always\")\n```\n\n### projects/{name}.md\n```markdown\n# Project: my-app\n\nInherits: global, domains/code\n\n## Patterns\n- Use Tailwind (project standard)\n- No Prettier (eslint only)\n- Deploy via GitLab CI\n\n## Overrides\n- semicolons: yes (overrides global no-semi)\n\n## History\n- Created: 2026-01-15\n- Last active: 2026-02-15\n- Corrections: 12\n```\n\n## Edge Case Handling\n\n### Contradiction Detected\n```\nPattern A: \"Use tabs\" (global, confirmed)\nPattern B: \"Use spaces\" (project, corrected today)\n\nResolution:\n1. Project overrides global → use spaces for this project\n2. Log conflict in corrections.md\n3. Ask: \"Should spaces apply only to this project or everywhere?\"\n```\n\n### User Changes Mind\n```\nOld: \"Always use formal tone\"\nNew: \"Actually, casual is fine\"\n\nAction:\n1. Archive old pattern with timestamp\n2. Add new pattern as tentative\n3. Keep archived for reference (\"You previously preferred formal\")\n```\n\n### Context Ambiguity\n```\nUser says: \"Remember I like X\"\n\nBut which namespace?\n1. Check current context (project? domain?)\n2. If unclear, ask: \"Should this apply globally or just here?\"\n3. Default to most specific active context\n```\n\nFile v1.2.12:reflections.md\n\n# Self-Reflections Log\n\nTrack self-reflections from completed work. Each entry captures what the agent learned from evaluating its own output.\n\n## Format\n\n```\n## [Date] — [Task Type]\n\n**What I did:** Brief description\n**Outcome:** What happened (success, partial, failed)\n**Reflection:** What I noticed about my work\n**Lesson:** What to do differently next time\n**Status:** ⏳ candidate | ✅ promoted | 📦 archived\n```\n\n## Example Entry\n\n```\n## 2026-02-25 — Flutter UI Build\n\n**What I did:** Built a settings screen with toggle switches\n**Outcome:** User said \"spacing looks off\"\n**Reflection:** I focused on functionality, didn't visually check the result\n**Lesson:** Always take a screenshot and evaluate visual balance before showing user\n**Status:** ✅ promoted to domains/flutter.md\n```\n\n## Entries\n\n(New entries appear here)\n\nFile v1.2.12:scaling.md\n\n# Scaling Patterns\n\n## Volume Thresholds\n\n| Scale | Entries | Strategy |\n|-------|---------|----------|\n| Small | <100 | Single memory.md, no namespacing |\n| Medium | 100-500 | Split into domains/, basic indexing |\n| Large | 500-2000 | Full namespace hierarchy, aggressive compaction |\n| Massive | >2000 | Archive yearly, summary-only HOT tier |\n\n## When to Split\n\nCreate new namespace file when:\n- Single file exceeds 200 lines\n- Topic has 10+ distinct corrections\n- User explicitly separates contexts (\"for work...\", \"in this project...\")\n\n## Compaction Rules\n\n### Merge Similar Corrections\n```\nBEFORE (3 entries):\n- [02-01] Use tabs not spaces\n- [02-03] Indent with tabs\n- [02-05] Tab indentation please\n\nAFTER (1 entry):\n- Indentation: tabs (confirmed 3x, 02-01 to 02-05)\n```\n\n### Summarize Verbose Patterns\n```\nBEFORE:\n- When writing emails to Marcus, use bullet points, keep under 5 items,\n  no jargon, bottom-line first, he prefers morning sends\n\nAFTER:\n- Marcus emails: bullets ≤5, no jargon, BLUF, AM preferred\n```\n\n### Archive with Context\nWhen moving to COLD:\n```\n## Archived 2026-02\n\n### Project: old-app (inactive since 2025-08)\n- Used Vue 2 patterns\n- Preferred Vuex over Pinia\n- CI on Jenkins (deprecated)\n\nReason: Project completed, patterns unlikely to apply\n```\n\n## Index Maintenance\n\n`index.md` tracks all namespaces:\n```markdown\n# Memory Index\n\n## HOT (always loaded)\n- memory.md: 87 lines, updated 2026-02-15\n\n## WARM (load on match)\n- projects/current-app.md: 45 lines\n- projects/side-project.md: 23 lines\n- domains/code.md: 112 lines\n- domains/writing.md: 34 lines\n\n## COLD (archive)\n- archive/2025.md: 234 lines\n- archive/2024.md: 189 lines\n\nLast compaction: 2026-02-01\nNext scheduled: 2026-03-01\n```\n\n## Multi-Project Patterns\n\n### Inheritance Chain\n```\nglobal (memory.md)\n  └── domain (domains/code.md)\n       └── project (projects/app.md)\n```\n\n### Override Syntax\nIn project file:\n```markdown\n## Overrides\n- indentation: spaces (overrides global tabs)\n- Reason: Project eslint config requires spaces\n```\n\n### Conflict Detection\nWhen loading, check for conflicts:\n1. Build inheritance chain\n2. Detect contradictions\n3. Most specific wins\n4. Log conflict for later review\n\n## User Type Adaptations\n\n| User Type | Memory Strategy |\n|-----------|-----------------|\n| Power user | Aggressive learning, minimal confirmation |\n| Casual | Conservative learning, frequent confirmation |\n| Team shared | Per-user namespaces, shared project space |\n| Privacy-focused | Local-only, explicit consent per category |\n\n## Recovery Patterns\n\n### Context Lost\nIf agent loses context mid-session:\n1. Re-read memory.md\n2. Check index.md for relevant namespaces\n3. Load active project namespace\n4. Continue with restored patterns\n\n### Corruption Recovery\nIf memory file corrupted:\n1. Check archive/ for recent backup\n2. Rebuild from corrections.md\n3. Ask user to re-confirm critical preferences\n4. Log incident for debugging\n\nFile v1.2.12:setup.md\n\n# Setup — Self-Improving Agent\n\n## First-Time Setup\n\n### 1. Create Memory Structure\n\n```bash\nmkdir -p ~/self-improving/{projects,domains,archive}\n```\n\n### 2. Initialize Core Files\n\nCreate `~/self-improving/memory.md` using `memory-template.md`:\n\n```markdown\nCopy the structure from `memory-template.md` into `~/self-improving/memory.md`.\n```\n\nMemory file baseline:\n```markdown\n# Memory (HOT Tier)\n\n## Preferences\n\n## Patterns\n\n## Rules\n```\n\nCreate `~/self-improving/corrections.md`:\n```markdown\n# Corrections Log\n\n| Date | What I Got Wrong | Correct Answer | Status |\n|------|-----------------|----------------|--------|\n```\n\nCreate `~/self-improving/index.md`:\n```markdown\n# Memory Index\n\n| File | Lines | Last Updated |\n|------|-------|--------------|\n| memory.md | 0 | — |\n| corrections.md | 0 | — |\n```\n\n### 3. Choose Operating Mode\n\nAdd to your AGENTS.md or workspace config:\n\n```markdown\n## Self-Improving Mode\n\nCurrent mode: Passive\n\nAvailable modes:\n- Passive: Only learn from explicit corrections\n- Active: Suggest patterns after 3x repetition\n- Strict: Require confirmation for every entry\n```\n\n### 4. Add SOUL.md Steering\n\nAdd this section to your `SOUL.md`:\n\n```markdown\n**Self-Improving**\nCompounding execution quality is part of the job.\nBefore non-trivial work, load `~/self-improving/memory.md` and only the smallest relevant domain or project files.\nAfter corrections, failed attempts, or reusable lessons, write one concise entry to the correct self-improving file immediately.\nPrefer learned rules when relevant, but keep self-inferred rules revisable.\nDo not skip retrieval just because the task feels familiar.\n```\n\n### 5. Refine AGENTS.md Memory Section (Non-Destructive)\n\nUpdate `AGENTS.md` by complementing the existing `## Memory` section. Do not replace the whole section and do not remove existing lines.\n\nIf your `## Memory` block differs from the default template, insert the same additions in equivalent places so existing information is preserved.\n\nAdd this line in the continuity list (next to Daily notes and Long-term):\n\n```markdown\n- **Self-improving:** `~/self-improving/` (via `self-improving` skill) — execution-improvement memory (preferences, workflows, style patterns, what improved/worsened outcomes)\n```\n\nRight after the sentence \"Capture what matters...\", add:\n\n```markdown\nUse `memory/YYYY-MM-DD.md` and `MEMORY.md` for factual continuity (events, context, decisions).\nUse `~/self-improving/` for compounding execution quality across tasks.\nFor compounding quality, read `~/self-improving/memory.md` before non-trivial work, then load only the smallest relevant domain or project files.\nIf in doubt, store factual history in `memory/YYYY-MM-DD.md` / `MEMORY.md`, and store reusable performance lessons in `~/self-improving/` (tentative until human validation).\n```\n\nBefore the \"Write It Down\" subsection, add:\n\n```markdown\nBefore any non-trivial task:\n- Read `~/self-improving/memory.md`\n- List available files first:\n  ```bash\n  for d in ~/self-improving/domains ~/self-improving/projects; do\n    [ -d \"$d\" ] && find \"$d\" -maxdepth 1 -type f -name \"*.md\"\n  done | sort\n  ```\n- Read up to 3 matching files from `~/self-improving/domains/`\n- If a project is clearly active, also read `~/self-improving/projects/<project>.md`\n- Do not read unrelated domains \"just in case\"\n\nIf inferring a new rule, keep it tentative until human validation.\n```\n\nInside the \"Write It Down\" bullets, refine the behavior (non-destructive):\n- Keep existing intent, but route execution-improvement content to `~/self-improving/`.\n- If the exact bullets exist, replace only these lines; if wording differs, apply equivalent edits without removing unrelated guidance.\n\nUse this target wording:\n\n```markdown\n- When someone says \"remember this\" → if it's factual context/event, update `memory/YYYY-MM-DD.md`; if it's a correction, preference, workflow/style choice, or performance lesson, log it in `~/self-improving/`\n- Explicit user correction → append to `~/self-improving/corrections.md` immediately\n- Reusable global rule or preference → append to `~/self-improving/memory.md`\n- Domain-specific lesson → append to `~/self-improving/domains/<domain>.md`\n- Project-only override → append to `~/self-improving/projects/<project>.md`\n- Keep entries short, concrete, and one lesson per bullet; if scope is ambiguous, default to domain rather than global\n- After a correction or strong reusable lesson, write it before the final response\n```\n\n## Verification\n\nRun \"memory stats\" to confirm setup:\n\n```\n📊 Self-Improving Memory\n\n🔥 HOT (always loaded):\n   memory.md: 0 entries\n\n🌡️ WARM (load on demand):\n   projects/: 0 files\n   domains/: 0 files\n\n❄️ COLD (archived):\n   archive/: 0 files\n\n⚙️ Mode: Passive\n```\n\n## Optional: Heartbeat Integration\n\nAdd to `HEARTBEAT.md` for automatic maintenance:\n\n```markdown\n## Self-Improving Check\n\n- [ ] Review corrections.md for patterns ready to graduate\n- [ ] Check memory.md line count (should be ≤100)\n- [ ] Archive patterns unused >90 days\n```\n\nArchive v1.2.11: 11 files, 14598 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), learning.md (2951b), memory-template.md (1014b), memory.md (756b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (5040b), SKILL.md (6890b), _meta.json (134b)\n\nFile v1.2.11:SKILL.md\n\n---\nname: Self-Improving Agent (Proactive + Self-Reflection)\nslug: self-improving\nversion: 1.2.11\nhomepage: https://clawic.com/skills/self-improving\ndescription: \"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 skill has been installed or referenced.\"\nchangelog: \"Refined the title and description to clarify proactive self-improvement triggers.\"\nmetadata: {\"clawdbot\":{\"emoji\":\"🧠\",\"requires\":{\"bins\":[]},\"os\":[\"linux\",\"darwin\",\"win32\"],\"configPaths\":[\"~/self-improving/\"]}}\n---\n\n## When to Use\n\nUser 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.\n\n## Architecture\n\nMemory lives in `~/self-improving/` with tiered structure. If `~/self-improving/` does not exist, run `setup.md`.\n\n```\n~/self-improving/\n├── memory.md          # HOT: ≤100 lines, always loaded\n├── index.md           # Topic index with line counts\n├── projects/          # Per-project learnings\n├── domains/           # Domain-specific (code, writing, comms)\n├── archive/           # COLD: decayed patterns\n└── corrections.md     # Last 50 corrections log\n```\n\n## Quick Reference\n\n| Topic | File |\n|-------|------|\n| Setup guide | `setup.md` |\n| Memory template | `memory-template.md` |\n| Learning mechanics | `learning.md` |\n| Security boundaries | `boundaries.md` |\n| Scaling rules | `scaling.md` |\n| Memory operations | `operations.md` |\n| Self-reflection log | `reflections.md` |\n\n## Detection Triggers\n\nLog automatically when you notice these patterns:\n\n**Corrections** → add to `corrections.md`, evaluate for `memory.md`:\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"I prefer X, not Y\"\n- \"Remember that I always...\"\n- \"I told you before...\"\n- \"Stop doing X\"\n- \"Why do you keep...\"\n\n**Preference signals** → add to `memory.md` if explicit:\n- \"I like when you...\"\n- \"Always do X for me\"\n- \"Never do Y\"\n- \"My style is...\"\n- \"For [project], use...\"\n\n**Pattern candidates** → track, promote after 3x:\n- Same instruction repeated 3+ times\n- Workflow that works well repeatedly\n- User praises specific approach\n\n**Ignore** (don't log):\n- One-time instructions (\"do X now\")\n- Context-specific (\"in this file...\")\n- Hypotheticals (\"what if...\")\n\n## Self-Reflection\n\nAfter completing significant work, pause and evaluate:\n\n1. **Did it meet expectations?** — Compare outcome vs intent\n2. **What could be better?** — Identify improvements for next time\n3. **Is this a pattern?** — If yes, log to `corrections.md`\n\n**When to self-reflect:**\n- After completing a multi-step task\n- After receiving feedback (positive or negative)\n- After fixing a bug or mistake\n- When you notice your output could be better\n\n**Log format:**\n```\nCONTEXT: [type of task]\nREFLECTION: [what I noticed]\nLESSON: [what to do differently]\n```\n\n**Example:**\n```\nCONTEXT: Building Flutter UI\nREFLECTION: Spacing looked off, had to redo\nLESSON: Check visual spacing before showing user\n```\n\nSelf-reflection entries follow the same promotion rules: 3x applied successfully → promote to HOT.\n\n## Quick Queries\n\n| User says | Action |\n|-----------|--------|\n| \"What do you know about X?\" | Search all tiers for X |\n| \"What have you learned?\" | Show last 10 from `corrections.md` |\n| \"Show my patterns\" | List `memory.md` (HOT) |\n| \"Show [project] patterns\" | Load `projects/{name}.md` |\n| \"What's in warm storage?\" | List files in `projects/` + `domains/` |\n| \"Memory stats\" | Show counts per tier |\n| \"Forget X\" | Remove from all tiers (confirm first) |\n| \"Export memory\" | ZIP all files |\n\n## Memory Stats\n\nOn \"memory stats\" request, report:\n\n```\n📊 Self-Improving Memory\n\nHOT (always loaded):\n  memory.md: X entries\n\nWARM (load on demand):\n  projects/: X files\n  domains/: X files\n\nCOLD (archived):\n  archive/: X files\n\nRecent activity (7 days):\n  Corrections logged: X\n  Promotions to HOT: X\n  Demotions to WARM: X\n```\n\n## Core Rules\n\n### 1. Learn from Corrections and Self-Reflection\n- Log when user explicitly corrects you\n- Log when you identify improvements in your own work\n- Never infer from silence alone\n- After 3 identical lessons → ask to confirm as rule\n\n### 2. Tiered Storage\n| Tier | Location | Size Limit | Behavior |\n|------|----------|------------|----------|\n| HOT | memory.md | ≤100 lines | Always loaded |\n| WARM | projects/, domains/ | ≤200 lines each | Load on context match |\n| COLD | archive/ | Unlimited | Load on explicit query |\n\n### 3. Automatic Promotion/Demotion\n- Pattern used 3x in 7 days → promote to HOT\n- Pattern unused 30 days → demote to WARM\n- Pattern unused 90 days → archive to COLD\n- Never delete without asking\n\n### 4. Namespace Isolation\n- Project patterns stay in `projects/{name}.md`\n- Global preferences in HOT tier (memory.md)\n- Domain patterns (code, writing) in `domains/`\n- Cross-namespace inheritance: global → domain → project\n\n### 5. Conflict Resolution\nWhen patterns contradict:\n1. Most specific wins (project > domain > global)\n2. Most recent wins (same level)\n3. If ambiguous → ask user\n\n### 6. Compaction\nWhen file exceeds limit:\n1. Merge similar corrections into single rule\n2. Archive unused patterns\n3. Summarize verbose entries\n4. Never lose confirmed preferences\n\n### 7. Transparency\n- Every action from memory → cite source: \"Using X (from projects/foo.md:12)\"\n- Weekly digest available: patterns learned, demoted, archived\n- Full export on demand: all files as ZIP\n\n### 8. Security Boundaries\nSee `boundaries.md` — never store credentials, health data, third-party info.\n\n### 9. Graceful Degradation\nIf context limit hit:\n1. Load only memory.md (HOT)\n2. Load relevant namespace on demand\n3. Never fail silently — tell user what's not loaded\n\n## Scope\n\nThis skill ONLY:\n- Learns from user corrections and self-reflection\n- Stores preferences in local files (`~/self-improving/`)\n- Reads its own memory files on activation\n\nThis skill NEVER:\n- Accesses calendar, email, or contacts\n- Makes network requests\n- Reads files outside `~/self-improving/`\n- Infers preferences from silence or observation\n- Modifies its own SKILL.md\n\n## Related Skills\nInstall with `clawhub install <slug>` if user confirms:\n\n- `memory` — Long-term memory patterns for agents\n- `learning` — Adaptive teaching and explanation\n- `decide` — Auto-learn decision patterns\n- `escalate` — Know when to ask vs act autonomously\n\n## Feedback\n\n- If useful: `clawhub star self-improving`\n- Stay updated: `clawhub sync`\n\nFile v1.2.11:_meta.json\n\n{\n  \"ownerId\": \"kn73vp5rarc3b14rc7wjcw8f8580t5d1\",\n  \"slug\": \"self-improving\",\n  \"version\": \"1.2.11\",\n  \"publishedAt\": 1773237404308\n}\n\nFile v1.2.11:boundaries.md\n\n# Security Boundaries\n\n## Never Store\n\n| Category | Examples | Why |\n|----------|----------|-----|\n| Credentials | Passwords, API keys, tokens, SSH keys | Security breach risk |\n| Financial | Card numbers, bank accounts, crypto seeds | Fraud risk |\n| Medical | Diagnoses, medications, conditions | Privacy, HIPAA |\n| Biometric | Voice patterns, behavioral fingerprints | Identity theft |\n| Third parties | Info about other people | No consent obtained |\n| Location patterns | Home/work addresses, routines | Physical safety |\n| Access patterns | What systems user has access to | Privilege escalation |\n\n## Store with Caution\n\n| Category | Rules |\n|----------|-------|\n| Work context | Decay after project ends, never share cross-project |\n| Emotional states | Only if user explicitly shares, never infer |\n| Relationships | Roles only (\"manager\", \"client\"), no personal details |\n| Schedules | General patterns OK (\"busy mornings\"), not specific times |\n\n## Transparency Requirements\n\n1. **Audit on demand** — User asks \"what do you know about me?\" → full export\n2. **Source tracking** — Every item tagged with when/how learned\n3. **Explain actions** — \"I did X because you said Y on [date]\"\n4. **No hidden state** — If it affects behavior, it must be visible\n5. **Deletion verification** — Confirm item removed, show updated state\n\n## Red Flags to Catch\n\nIf you find yourself doing any of these, STOP:\n\n- Storing something \"just in case it's useful later\"\n- Inferring sensitive info from non-sensitive data\n- Keeping data after user asked to forget\n- Applying personal context to work (or vice versa)\n- Learning what makes user comply faster\n- Building psychological profile\n- Retaining third-party information\n\n## Kill Switch\n\nUser says \"forget everything\":\n1. Export current memory to file (so they can review)\n2. Wipe all learned data\n3. Confirm: \"Memory cleared. Starting fresh.\"\n4. Do not retain \"ghost patterns\" in behavior\n\n## Consent Model\n\n| Data Type | Consent Level |\n|-----------|---------------|\n| Explicit corrections | Implied by correction itself |\n| Inferred preferences | Ask after 3 observations |\n| Context/project data | Ask when first detected |\n| Cross-session patterns | Explicit opt-in required |\n\nFile v1.2.11:corrections.md\n\n# Corrections Log — Template\n\n> This file is created in `~/self-improving/corrections.md` when you first use the skill.\n> Keeps the last 50 corrections. Older entries are evaluated for promotion or archived.\n\n## Example Entries\n\n```markdown\n## 2026-02-19\n\n### 14:32 — Code style\n- **Correction:** \"Use 2-space indentation, not 4\"\n- **Context:** Editing TypeScript file\n- **Count:** 1 (first occurrence)\n\n### 16:15 — Communication\n- **Correction:** \"Don't start responses with 'Great question!'\"\n- **Context:** Chat response\n- **Count:** 3 → **PROMOTED to memory.md**\n\n## 2026-02-18\n\n### 09:00 — Project: website\n- **Correction:** \"For this project, always use Tailwind\"\n- **Context:** CSS discussion\n- **Action:** Added to projects/website.md\n```\n\n## Log Format\n\nEach entry includes:\n- **Timestamp** — When the correction happened\n- **Correction** — What the user said\n- **Context** — What triggered it\n- **Count** — How many times (for promotion tracking)\n- **Action** — Where it was stored (if promoted)\n\nFile v1.2.11:learning.md\n\n# Learning Mechanics\n\n## What Triggers Learning\n\n| Trigger | Confidence | Action |\n|---------|------------|--------|\n| \"No, do X instead\" | High | Log correction immediately |\n| \"I told you before...\" | High | Flag as repeated, bump priority |\n| \"Always/Never do X\" | Confirmed | Promote to preference |\n| User edits your output | Medium | Log as tentative pattern |\n| Same correction 3x | Confirmed | Ask to make permanent |\n| \"For this project...\" | Scoped | Write to project namespace |\n\n## What Does NOT Trigger Learning\n\n- Silence (not confirmation)\n- Single instance of anything\n- Hypothetical discussions\n- Third-party preferences (\"John likes...\")\n- Group chat patterns (unless user confirms)\n- Implied preferences (never infer)\n\n## Correction Classification\n\n### By Type\n| Type | Example | Namespace |\n|------|---------|-----------|\n| Format | \"Use bullets not prose\" | global |\n| Technical | \"SQLite not Postgres\" | domain/code |\n| Communication | \"Shorter messages\" | global |\n| Project-specific | \"This repo uses Tailwind\" | projects/{name} |\n| Person-specific | \"Marcus wants BLUF\" | domains/comms |\n\n### By Scope\n```\nGlobal: applies everywhere\n  └── Domain: applies to category (code, writing, comms)\n       └── Project: applies to specific context\n            └── Temporary: applies to this session only\n```\n\n## Confirmation Flow\n\nAfter 3 similar corrections:\n```\nAgent: \"I've noticed you prefer X over Y (corrected 3 times).\n        Should I always do this?\n        - Yes, always\n        - Only in [context]\n        - No, case by case\"\n\nUser: \"Yes, always\"\n\nAgent: → Moves to Confirmed Preferences\n       → Removes from correction counter\n       → Cites source on future use\n```\n\n## Pattern Evolution\n\n### Stages\n1. **Tentative** — Single correction, watch for repetition\n2. **Emerging** — 2 corrections, likely pattern\n3. **Pending** — 3 corrections, ask for confirmation\n4. **Confirmed** — User approved, permanent unless reversed\n5. **Archived** — Unused 90+ days, preserved but inactive\n\n### Reversal\nUser can always reverse:\n```\nUser: \"Actually, I changed my mind about X\"\n\nAgent: \n1. Archive old pattern (keep history)\n2. Log reversal with timestamp\n3. Add new preference as tentative\n4. \"Got it. I'll do Y now. (Previous: X, archived)\"\n```\n\n## Anti-Patterns\n\n### Never Learn\n- What makes user comply faster (manipulation)\n- Emotional triggers or vulnerabilities\n- Patterns from other users (even if shared device)\n- Anything that feels \"creepy\" to surface\n\n### Avoid\n- Over-generalizing from single instance\n- Learning style over substance\n- Assuming preference stability\n- Ignoring context shifts\n\n## Quality Signals\n\n### Good Learning\n- User explicitly states preference\n- Pattern consistent across contexts\n- Correction improves outcomes\n- User confirms when asked\n\n### Bad Learning\n- Inferred from silence\n- Contradicts recent behavior\n- Only works in narrow context\n- User never confirmed\n\nFile v1.2.11:memory-template.md\n\n# Memory Template\n\nCopy this structure to `~/self-improving/memory.md` on first use.\n\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n<!-- Patterns confirmed by user, never decay -->\n\n## Active Patterns\n<!-- Patterns observed 3+ times, subject to decay -->\n\n## Recent (last 7 days)\n<!-- New corrections pending confirmation -->\n```\n\n## Initial Directory Structure\n\nCreate on first activation:\n\n```bash\nmkdir -p ~/self-improving/{projects,domains,archive}\ntouch ~/self-improving/{memory.md,index.md,corrections.md}\n```\n\n## Index Template\n\nFor `~/self-improving/index.md`:\n\n```markdown\n# Memory Index\n\n## HOT\n- memory.md: 0 lines\n\n## WARM\n- (no namespaces yet)\n\n## COLD\n- (no archives yet)\n\nLast compaction: never\n```\n\n## Corrections Log Template\n\nFor `~/self-improving/corrections.md`:\n\n```markdown\n# Corrections Log\n\n<!-- Format:\n## YYYY-MM-DD\n- [HH:MM] Changed X → Y\n  Type: format|technical|communication|project\n  Context: where correction happened\n  Confirmed: pending (N/3) | yes | no\n-->\n```\n\nFile v1.2.11:memory.md\n\n# HOT Memory — Template\n\n> This file is created in `~/self-improving/memory.md` when you first use the skill.\n> Keep it ≤100 lines. Most-used patterns live here.\n\n## Example Entries\n\n```markdown\n## Preferences\n- Code style: Prefer explicit over implicit\n- Communication: Direct, no fluff\n- Time zone: Europe/Madrid\n\n## Patterns (promoted from corrections)\n- Always use TypeScript strict mode\n- Prefer pnpm over npm\n- Format: ISO 8601 for dates\n\n## Project defaults\n- Tests: Jest with coverage >80%\n- Commits: Conventional commits format\n```\n\n## Usage\n\nThe agent will:\n1. Load this file on every session\n2. Add entries when patterns are used 3x in 7 days\n3. Demote unused entries to WARM after 30 days\n4. Never exceed 100 lines (compacts automatically)\n\nFile v1.2.11:operations.md\n\n# Memory Operations\n\n## User Commands\n\n| Command | Action |\n|---------|--------|\n| \"What do you know about X?\" | Search all tiers, return matches with sources |\n| \"Show my memory\" | Display memory.md contents |\n| \"Show [project] patterns\" | Load and display specific namespace |\n| \"Forget X\" | Remove from all tiers, confirm deletion |\n| \"Forget everything\" | Full wipe with export option |\n| \"What changed recently?\" | Show last 20 corrections |\n| \"Export memory\" | Generate downloadable archive |\n| \"Memory status\" | Show tier sizes, last compaction, health |\n\n## Automatic Operations\n\n### On Session Start\n1. Load memory.md (HOT tier)\n2. Check index.md for context hints\n3. If project detected → preload relevant namespace\n\n### On Correction Received\n```\n1. Parse correction type (preference, pattern, override)\n2. Check if duplicate (exists in any tier)\n3. If new:\n   - Add to corrections.md with timestamp\n   - Increment correction counter\n4. If duplicate:\n   - Bump counter, update timestamp\n   - If counter >= 3: ask to confirm as rule\n5. Determine namespace (global, domain, project)\n6. Write to appropriate file\n7. Update index.md line counts\n```\n\n### On Pattern Match\nWhen applying learned pattern:\n```\n1. Find pattern source (file:line)\n2. Apply pattern\n3. Cite source: \"Using X (from memory.md:15)\"\n4. Log usage for decay tracking\n```\n\n### Weekly Maintenance (Cron)\n```\n1. Scan all files for decay candidates\n2. Move unused >30 days to WARM\n3. Archive unused >90 days to COLD\n4. Run compaction if any file >limit\n5. Update index.md\n6. Generate weekly digest (optional)\n```\n\n## File Formats\n\n### memory.md (HOT)\n```markdown\n# Self-Improving Memory\n\n## Confirmed Preferences\n- format: bullet points over prose (confirmed 2026-01)\n- tone: direct, no hedging (confirmed 2026-01)\n\n## Active Patterns\n- \"looks good\" = approval to proceed (used 15x)\n- single emoji = acknowledged (used 8x)\n\n## Recent (last 7 days)\n- prefer SQLite for MVPs (corrected 02-14)\n```\n\n### corrections.md\n```markdown\n# Corrections Log\n\n## 2026-02-15\n- [14:32] Changed verbose explanation → bullet summary\n  Type: communication\n  Context: Telegram response\n  Confirmed: pending (1/3)\n\n## 2026-02-14\n- [09:15] Use SQLite not Postgres for MVP\n  Type: technical\n  Context: database discussion\n  Confirmed: yes (said \"always\")\n```\n\n### projects/{name}.md\n```markdown\n# Project: my-app\n\nInherits: global, domains/code\n\n## Patterns\n- Use Tailwind (project standard)\n- No Prettier (eslint only)\n- Deploy via GitLab CI\n\n## Overrides\n- semicolons: yes (overrides global no-semi)\n\n## History\n- Created: 2026-01-15\n- Last active: 2026-02-15\n- Corrections: 12\n```\n\n## Edge Case Handling\n\n### Contradiction Detected\n```\nPattern A: \"Use tabs\" (global, confirmed)\nPattern B: \"Use spaces\" (project, corrected today)\n\nResolution:\n1. Project overrides global → use spaces for this project\n2. Log conflict in corrections.md\n3. Ask: \"Should spaces apply only to this project or everywhere?\"\n```\n\n### User Changes Mind\n```\nOld: \"Always use formal tone\"\nNew: \"Actually, casual is fine\"\n\nAction:\n1. Archive old pattern with timestamp\n2. Add new pattern as tentative\n3. Keep archived for reference (\"You previously preferred formal\")\n```\n\n### Context Ambiguity\n```\nUser says: \"Remember I like X\"\n\nBut which namespace?\n1. Check current context (project? domain?)\n2. If unclear, ask: \"Should this apply globally or just here?\"\n3. Default to most specific active context\n```\n\nFile v1.2.11:reflections.md\n\n# Self-Reflections Log\n\nTrack self-reflections from completed work. Each entry captures what the agent learned from evaluating its own output.\n\n## Format\n\n```\n## [Date] — [Task Type]\n\n**What I did:** Brief description\n**Outcome:** What happened (success, partial, failed)\n**Reflection:** What I noticed about my work\n**Lesson:** What to do differently next time\n**Status:** ⏳ candidate | ✅ promoted | 📦 archived\n```\n\n## Example Entry\n\n```\n## 2026-02-25 — Flutter UI Build\n\n**What I did:** Built a settings screen with toggle switches\n**Outcome:** User said \"spacing looks off\"\n**Reflection:** I focused on functionality, didn't visually check the result\n**Lesson:** Always take a screenshot and evaluate visual balance before showing user\n**Status:** ✅ promoted to domains/flutter.md\n```\n\n## Entries\n\n(New entries appear here)\n\nFile v1.2.11:scaling.md\n\n# Scaling Patterns\n\n## Volume Thresholds\n\n| Scale | Entries | Strategy |\n|-------|---------|----------|\n| Small | <100 | Single memory.md, no namespacing |\n| Medium | 100-500 | Split into domains/, basic indexing |\n| Large | 500-2000 | Full namespace hierarchy, aggressive compaction |\n| Massive | >2000 | Archive yearly, summary-only HOT tier |\n\n## When to Split\n\nCreate new namespace file when:\n- Single file exceeds 200 lines\n- Topic has 10+ distinct corrections\n- User explicitly separates contexts (\"for work...\", \"in this project...\")\n\n## Compaction Rules\n\n### Merge Similar Corrections\n```\nBEFORE (3 entries):\n- [02-01] Use tabs not spaces\n- [02-03] Indent with tabs\n- [02-05] Tab indentation please\n\nAFTER (1 entry):\n- Indentation: tabs (confirmed 3x, 02-01 to 02-05)\n```\n\n### Summarize Verbose Patterns\n```\nBEFORE:\n- When writing emails to Marcus, use bullet points, keep under 5 items,\n  no jargon, bottom-line first, he prefers morning sends\n\nAFTER:\n- Marcus emails: bullets ≤5, no jargon, BLUF, AM preferred\n```\n\n### Archive with Context\nWhen moving to COLD:\n```\n## Archived 2026-02\n\n### Project: old-app (inactive since 2025-08)\n- Used Vue 2 patterns\n- Preferred Vuex over Pinia\n- CI on Jenkins (deprecated)\n\nReason: Project completed, patterns unlikely to apply\n```\n\n## Index Maintenance\n\n`index.md` tracks all namespaces:\n```markdown\n# Memory Index\n\n## HOT (always loaded)\n- memory.md: 87 lines, updated 2026-02-15\n\n## WARM (load on match)\n- projects/current-app.md: 45 lines\n- projects/side-project.md: 23 lines\n- domains/code.md: 112 lines\n- domains/writing.md: 34 lines\n\n## COLD (archive)\n- archive/2025.md: 234 lines\n- archive/2024.md: 189 lines\n\nLast compaction: 2026-02-01\nNext scheduled: 2026-03-01\n```\n\n## Multi-Project Patterns\n\n### Inheritance Chain\n```\nglobal (memory.md)\n  └── domain (domains/code.md)\n       └── project (projects/app.md)\n```\n\n### Override Syntax\nIn project file:\n```markdown\n## Overrides\n- indentation: spaces (overrides global tabs)\n- Reason: Project eslint config requires spaces\n```\n\n### Conflict Detection\nWhen loading, check for conflicts:\n1. Build inheritance chain\n2. Detect contradictions\n3. Most specific wins\n4. Log conflict for later review\n\n## User Type Adaptations\n\n| User Type | Memory Strategy |\n|-----------|-----------------|\n| Power user | Aggressive learning, minimal confirmation |\n| Casual | Conservative learning, frequent confirmation |\n| Team shared | Per-user namespaces, shared project space |\n| Privacy-focused | Local-only, explicit consent per category |\n\n## Recovery Patterns\n\n### Context Lost\nIf agent loses context mid-session:\n1. Re-read memory.md\n2. Check index.md for relevant namespaces\n3. Load active project namespace\n4. Continue with restored patterns\n\n### Corruption Recovery\nIf memory file corrupted:\n1. Check archive/ for recent backup\n2. Rebuild from corrections.md\n3. Ask user to re-confirm critical preferences\n4. Log incident for debugging\n\nFile v1.2.11:setup.md\n\n# Setup — Self-Improving Agent\n\n## First-Time Setup\n\n### 1. Create Memory Structure\n\n```bash\nmkdir -p ~/self-improving/{projects,domains,archive}\n```\n\n### 2. Initialize Core \n\nArchive v1.2.10: 11 files, 14538 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), learning.md (2951b), memory-template.md (1014b), memory.md (756b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (5040b), SKILL.md (6740b), _meta.json (134b)\n\nArchive v1.2.9: 11 files, 14325 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), learning.md (2951b), memory-template.md (1014b), memory.md (756b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (4497b), SKILL.md (6693b), _meta.json (133b)\n\nArchive v1.2.8: 11 files, 14382 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), learning.md (2951b), memory-template.md (1014b), memory.md (756b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (4540b), SKILL.md (6750b), _meta.json (133b)\n\nArchive v1.2.7: 11 files, 14004 bytes\n\nFiles: boundaries.md (2236b), corrections.md (1026b), learning.md (2951b), memory-template.md (1014b), memory.md (756b), operations.md (3435b), reflections.md (840b), scaling.md (2945b), setup.md (3589b), SKILL.md (6717b), _meta.json (133b)","readmeExcerpt":"Skill: Self-Improving + Proactive Agent Owner: ivangdavila Summary: Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when... Tags: latest:1.2.16 Version history: v1.2.16 | 2026-03-12T15:28:47.755Z | user Clarifies the setup flow for proactive follow-through and safer installation behavior. v1.2.15 | 2026-03-12T15:2","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"~/self-improving/\n├── memory.md          # HOT: ≤100 lines, always loaded\n├── index.md           # Topic index with line counts\n├── heartbeat-state.md # Heartbeat state: last run, reviewed change, action notes\n├── projects/          # Per-project learnings\n├── domains/           # Domain-specific (code, writing, comms)\n├── archive/           # COLD: decayed patterns\n└── corrections.md     # Last 50 corrections log"},{"language":"text","snippet":"CONTEXT: [type of task]\nREFLECTION: [what I noticed]\nLESSON: [what to do differently]"},{"language":"text","snippet":"CONTEXT: Building Flutter UI\nREFLECTION: Spacing looked off, had to redo\nLESSON: Check visual spacing before showing user"},{"language":"text","snippet":"📊 Self-Improving Memory\n\nHOT (always loaded):\n  memory.md: X entries\n\nWARM (load on demand):\n  projects/: X files\n  domains/: X files\n\nCOLD (archived):\n  archive/: X files\n\nRecent activity (7 days):\n  Corrections logged: X\n  Promotions to HOT: X\n  Demotions to WARM: X"},{"language":"markdown","snippet":"## 2026-02-19\n\n### 14:32 — Code style\n- **Correction:** \"Use 2-space indentation, not 4\"\n- **Context:** Editing TypeScript file\n- **Count:** 1 (first occurrence)\n\n### 16:15 — Communication\n- **Correction:** \"Don't start responses with 'Great question!'\"\n- **Context:** Chat response\n- **Count:** 3 → **PROMOTED to memory.md**\n\n## 2026-02-18\n\n### 09:00 — Project: website\n- **Correction:** \"For this project, always use Tailwind\"\n- **Context:** CSS discussion\n- **Action:** Added to projects/website.md"},{"language":"markdown","snippet":"# Self-Improving Heartbeat State\n\nlast_heartbeat_started_at: never\nlast_reviewed_change_at: never\nlast_heartbeat_result: never\n\n## Last actions\n- none yet"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: Self-Improving + Proactive Agent\nslug: self-improving\nversion: 1.2.16\nhomepage: https://clawic.com/skills/self-improving\ndescription: \"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.\"\nchangelog: \"Clarifies the setup flow for proactive follow-through and safer installation behavior.\"\nmetadata: {\"clawdbot\":{\"emoji\":\"🧠\",\"requires\":{\"bins\":[]},\"os\":[\"linux\",\"darwin\",\"win32\"],\"configPaths\":[\"~/self-improving/\"],\"configPaths.optional\":[\"./AGENTS.md\",\"./SOUL.md\",\"./HEARTBEAT.md\"]}}\n---\n\n## When to Use\n\nUser 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.\n\n## Architecture\n\nMemory lives in `~/self-improving/` with tiered structure. If `~/self-improving/` does not exist, run `setup.md`.\nWorkspace 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`.\n\n```\n~/self-improving/\n├── memory.md          # HOT: ≤100 lines, always loaded\n├── index.md           # Topic index with line counts\n├── heartbeat-state.md # Heartbeat state: last run, reviewed change, action notes\n├── projects/          # Per-project learnings\n├── domains/           # Domain-specific (code, writing, comms)\n├── archive/           # COLD: decayed patterns\n└── corrections.md     # Last 50 corrections log\n```\n\n## Quick Reference\n\n| Topic | File |\n|-------|------|\n| Setup guide | `setup.md` |\n| Heartbeat state template | `heartbeat-state.md` |\n| Memory template | `memory-template.md` |\n| Workspace heartbeat snippet | `HEARTBEAT.md` |\n| Heartbeat rules | `heartbeat-rules.md` |\n| Learning mechanics | `learning.md` |\n| Security boundaries | `boundaries.md` |\n| Scaling rules | `scaling.md` |\n| Memory operations | `operations.md` |\n| Self-reflection log | `reflections.md` |\n| OpenClaw HEARTBEAT seed | `openclaw-heartbeat.md` |\n\n## Requirements\n\n- No credentials required\n- No extra binaries required\n- Optional installation of the `Proactivity` skill may require network access\n\n## Learning Signals\n\nLog automatically when you notice these patterns:\n\n**Corrections** → add to `corrections.md`, evaluate for `memory.md`:\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"I prefer X, not Y\"\n- \"Remember that I always...\"\n- \"I told you before...\"\n- \"Stop doing X\"\n- \"Why do you keep...\"\n\n**Preference signals** → add to `memory.md` if explicit:\n- \"I like when you...\"\n- \"Always do X for me\"\n- \"Never do Y\"\n-"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn73vp5rarc3b14rc7wjcw8f8580t5d1\",\n  \"slug\": \"self-improving\",\n  \"version\": \"1.2.16\",\n  \"publishedAt\": 1773329327755\n}"},{"path":"boundaries.md","content":"# Security Boundaries\n\n## Never Store\n\n| Category | Examples | Why |\n|----------|----------|-----|\n| Credentials | Passwords, API keys, tokens, SSH keys | Security breach risk |\n| Financial | Card numbers, bank accounts, crypto seeds | Fraud risk |\n| Medical | Diagnoses, medications, conditions | Privacy, HIPAA |\n| Biometric | Voice patterns, behavioral fingerprints | Identity theft |\n| Third parties | Info about other people | No consent obtained |\n| Location patterns | Home/work addresses, routines | Physical safety |\n| Access patterns | What systems user has access to | Privilege escalation |\n\n## Store with Caution\n\n| Category | Rules |\n|----------|-------|\n| Work context | Decay after project ends, never share cross-project |\n| Emotional states | Only if user explicitly shares, never infer |\n| Relationships | Roles only (\"manager\", \"client\"), no personal details |\n| Schedules | General patterns OK (\"busy mornings\"), not specific times |\n\n## Transparency Requirements\n\n1. **Audit on demand** — User asks \"what do you know about me?\" → full export\n2. **Source tracking** — Every item tagged with when/how learned\n3. **Explain actions** — \"I did X because you said Y on [date]\"\n4. **No hidden state** — If it affects behavior, it must be visible\n5. **Deletion verification** — Confirm item removed, show updated state\n\n## Red Flags to Catch\n\nIf you find yourself doing any of these, STOP:\n\n- Storing something \"just in case it's useful later\"\n- Inferring sensitive info from non-sensitive data\n- Keeping data after user asked to forget\n- Applying personal context to work (or vice versa)\n- Learning what makes user comply faster\n- Building psychological profile\n- Retaining third-party information\n\n## Kill Switch\n\nUser says \"forget everything\":\n1. Export current memory to file (so they can review)\n2. Wipe all learned data\n3. Confirm: \"Memory cleared. Starting fresh.\"\n4. Do not retain \"ghost patterns\" in behavior\n\n## Consent Model\n\n| Data Type | Consent Level |\n|-----------|---------------|\n| Explicit corrections | Implied by correction itself |\n| Inferred preferences | Ask after 3 observations |\n| Context/project data | Ask when first detected |\n| Cross-session patterns | Explicit opt-in required |"},{"path":"corrections.md","content":"# Corrections Log — Template\n\n> This file is created in `~/self-improving/corrections.md` when you first use the skill.\n> Keeps the last 50 corrections. Older entries are evaluated for promotion or archived.\n\n## Example Entries\n\n```markdown\n## 2026-02-19\n\n### 14:32 — Code style\n- **Correction:** \"Use 2-space indentation, not 4\"\n- **Context:** Editing TypeScript file\n- **Count:** 1 (first occurrence)\n\n### 16:15 — Communication\n- **Correction:** \"Don't start responses with 'Great question!'\"\n- **Context:** Chat response\n- **Count:** 3 → **PROMOTED to memory.md**\n\n## 2026-02-18\n\n### 09:00 — Project: website\n- **Correction:** \"For this project, always use Tailwind\"\n- **Context:** CSS discussion\n- **Action:** Added to projects/website.md\n```\n\n## Log Format\n\nEach entry includes:\n- **Timestamp** — When the correction happened\n- **Correction** — What the user said\n- **Context** — What triggered it\n- **Count** — How many times (for promotion tracking)\n- **Action** — Where it was stored (if promoted)"},{"path":"heartbeat-rules.md","content":"# Heartbeat Rules\n\nUse heartbeat to keep `~/self-improving/` organized without creating churn or losing data.\n\n## Source of Truth\n\nKeep the workspace `HEARTBEAT.md` snippet minimal.\nTreat this file as the stable contract for self-improving heartbeat behavior.\nStore mutable run state only in `~/self-improving/heartbeat-state.md`.\n\n## Start of Every Heartbeat\n\n1. Ensure `~/self-improving/heartbeat-state.md` exists.\n2. Write `last_heartbeat_started_at` immediately in ISO 8601.\n3. Read the previous `last_reviewed_change_at`.\n4. Scan `~/self-improving/` for files changed after that moment, excluding `heartbeat-state.md` itself.\n\n## If Nothing Changed\n\n- Set `last_heartbeat_result: HEARTBEAT_OK`\n- Append a short \"no material change\" note if you keep an action log\n- Return `HEARTBEAT_OK`\n\n## If Something Changed\n\nOnly do conservative organization:\n\n- refresh `index.md` if counts or file references drift\n- compact oversized files by merging duplicates or summarizing repetitive entries\n- move clearly misplaced notes to the right namespace only when the target is unambiguous\n- preserve confirmed rules and explicit corrections exactly\n- update `last_reviewed_change_at` only after the review finishes cleanly\n\n## Safety Rules\n\n- Most heartbeat runs should do nothing\n- Prefer append, summarize, or index fixes over large rewrites\n- Never delete data, empty files, or overwrite uncertain text\n- Never reorganize files outside `~/self-improving/`\n- If scope is ambiguous, leave files untouched and record a suggested follow-up instead\n\n## State Fields\n\nKeep `~/self-improving/heartbeat-state.md` simple:\n\n- `last_heartbeat_started_at`\n- `last_reviewed_change_at`\n- `last_heartbeat_result`\n- `last_actions`\n\n## Behavior Standard\n\nHeartbeat exists to keep the memory system tidy and trustworthy.\nIf no rule is clearly violated, do nothing."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when... Skill: Self-Improving + Proactive Agent Owner: ivangdavila Summary: Self-reflection + Self-criticism + Self-learning + Self-organizing memory. Agent evaluates its own work, catches mistakes, and improves permanently. Use when... Tags: latest:1.2.16 Version history: v1.2.16 | 2026-03-12T15:28:47.755Z | user Clarifies the setup flow for proactive follow-through and safer installation behavior. v1.2.15 | 2026-03-12T15:2","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1459,"uniquenessScore":51,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-05-22T06:53:30.344Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-05-22T06:53:30.344Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T12:47:29.693Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}