{"id":"465acc4d-72df-4791-ac7c-a5dc88348b88","entityType":"agent","slug":"clawhub-pskoett-self-improving-agent-2","name":"Self-Improving Agent","canonicalUrl":"https://www.xpersona.co/agent/clawhub-pskoett-self-improving-agent-2","canonicalPath":"/agent/clawhub-pskoett-self-improving-agent-2","generatedAt":"2026-10-09T11:18:08.229Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-05-22T06:53:09.089Z","emptyReason":null},"description":"Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau... Skill: Self-Improving Agent Owner: pskoett Summary: Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau... Tags: latest:3.0.21 Version history: v3.0.21 | 2026-05-01T15:33:35.088Z | user re-upload v3.0.19 | 2026-05-01T06:00:13.738Z | user re-upload no changes v3.0.18 | 2026-04-25T13:59:22.039Z | user no changes ad","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 443.9K downloads reported by the source. Last updated 5/22/2026.","installCommand":"clawhub skill install s1794qsnpbjfkfnp0k226sefv583hfzt:self-improving-agent","sourceUrl":"https://clawhub.ai/pskoett/self-improving-agent","homepage":"https://clawhub.ai/pskoett/self-improving-agent","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/pskoett/self-improving-agent","kind":"source"}],"safetyScore":84,"overallRank":62,"popularityScore":100,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-05-22T06:53:09.089Z","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:09.089Z","emptyReason":null},"stars":null,"forks":null,"downloads":443867,"packageName":null,"latestVersion":"3.0.21","tractionLabel":"443.9K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-05-22T06:53:08.952Z","emptyReason":null},"lastUpdatedAt":"2026-05-22T06:53:09.089Z","lastCrawledAt":"2026-05-22T06:53:08.952Z","lastIndexedAt":null,"nextCrawlAt":"2026-05-23T06:53:08.952Z","lastVerifiedAt":null,"highlights":[{"version":"3.0.21","createdAt":"2026-05-01T15:33:35.088Z","changelog":"re-upload","fileCount":16,"zipByteSize":26211},{"version":"3.0.19","createdAt":"2026-05-01T06:00:13.738Z","changelog":"re-upload no changes","fileCount":16,"zipByteSize":26210},{"version":"3.0.18","createdAt":"2026-04-25T13:59:22.039Z","changelog":"no changes added re-upload","fileCount":16,"zipByteSize":26210},{"version":"3.0.16","createdAt":"2026-04-16T01:01:54.452Z","changelog":"No code or documentation changes detected in this release. - Version bump only; no functional changes. - All files remain unchanged from the previous version.","fileCount":16,"zipByteSize":26210},{"version":"3.0.15","createdAt":"2026-04-16T00:45:55.684Z","changelog":"Fixed duplicate SELF_IMPROVEMENT_REMINDER.md bootstrap injection in the OpenClaw hook. Hardened hook behavior to skip sub-agent sessions and avoid overwriting non-hook files at the same path. Improved reminder safety guidance to avoid logging secrets, tokens, env vars, or raw transcripts. Added safer first-use initialization guidance for .learnings/ files. Moved bundled log templates from .learnings/ into assets/ to avoid committing local learning logs by accident. Strengthened privacy and documentation guidance across the skill. Cleaned up repeated end-of-file guidance in SKILL.md to keep the skill definition leaner and less repetitive.","fileCount":16,"zipByteSize":26209},{"version":"3.0.14","createdAt":"2026-04-16T00:43:21.453Z","changelog":"Fixed duplicate SELF_IMPROVEMENT_REMINDER.md bootstrap injection in the OpenClaw hook. Hardened hook behavior to skip sub-agent sessions and avoid overwriting non-hook files at the same path. Improved reminder safety guidance to avoid logging secrets, tokens, env vars, or raw transcripts. Added safer first-use initialization guidance for .learnings/ files. Moved bundled log templates from .learnings/ into assets/ to avoid committing local learning logs by accident. Strengthened privacy and documentation guidance across the skill. Cleaned up repeated end-of-file guidance in SKILL.md to keep the skill definition leaner and less repetitive.","fileCount":16,"zipByteSize":26209},{"version":"3.0.13","createdAt":"2026-04-03T17:07:16.699Z","changelog":"re-upload no changes","fileCount":15,"zipByteSize":25090},{"version":"3.0.12","createdAt":"2026-04-02T07:11:39.065Z","changelog":"re-upload no changes","fileCount":15,"zipByteSize":25090}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1794qsnpbjfkfnp0k226sefv583hfzt:self-improving-agent","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-pskoett-self-improving-agent-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-pskoett-self-improving-agent-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-pskoett-self-improving-agent-2/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-pskoett-self-improving-agent-2/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-pskoett-self-improving-agent-2/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-pskoett-self-improving-agent-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-09T11:18:08.226Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-pskoett-self-improving-agent-2/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-pskoett-self-improving-agent-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-pskoett-self-improving-agent-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-pskoett-self-improving-agent-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:09.089Z","emptyReason":null},"readme":"Skill: Self-Improving Agent\n\nOwner: pskoett\n\nSummary: Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...\n\nTags: latest:3.0.21\n\nVersion history:\n\nv3.0.21 | 2026-05-01T15:33:35.088Z | user\n\nre-upload\n\nv3.0.19 | 2026-05-01T06:00:13.738Z | user\n\nre-upload no changes\n\nv3.0.18 | 2026-04-25T13:59:22.039Z | user\n\nno changes added re-upload\n\nv3.0.16 | 2026-04-16T01:01:54.452Z | user\n\nNo code or documentation changes detected in this release.\n\n- Version bump only; no functional changes.\n- All files remain unchanged from the previous version.\n\nv3.0.15 | 2026-04-16T00:45:55.684Z | user\n\nFixed duplicate SELF_IMPROVEMENT_REMINDER.md bootstrap injection in the OpenClaw hook.\nHardened hook behavior to skip sub-agent sessions and avoid overwriting non-hook files at the same path.\nImproved reminder safety guidance to avoid logging secrets, tokens, env vars, or raw transcripts.\nAdded safer first-use initialization guidance for .learnings/ files.\nMoved bundled log templates from .learnings/ into assets/ to avoid committing local learning logs by accident.\nStrengthened privacy and documentation guidance across the skill.\nCleaned up repeated end-of-file guidance in SKILL.md to keep the skill definition leaner and less repetitive.\n\nv3.0.14 | 2026-04-16T00:43:21.453Z | user\n\nFixed duplicate SELF_IMPROVEMENT_REMINDER.md bootstrap injection in the OpenClaw hook.\nHardened hook behavior to skip sub-agent sessions and avoid overwriting non-hook files at the same path.\nImproved reminder safety guidance to avoid logging secrets, tokens, env vars, or raw transcripts.\nAdded safer first-use initialization guidance for .learnings/ files.\nMoved bundled log templates from .learnings/ into assets/ to avoid committing local learning logs by accident.\nStrengthened privacy and documentation guidance across the skill.\nCleaned up repeated end-of-file guidance in SKILL.md to keep the skill definition leaner and less repetitive.\n\nv3.0.13 | 2026-04-03T17:07:16.699Z | user\n\nre-upload no changes\n\nv3.0.12 | 2026-04-02T07:11:39.065Z | user\n\nre-upload no changes\n\nv3.0.11 | 2026-04-01T13:38:19.719Z | user\n\nre-upload no changes\n\nv3.0.10 | 2026-03-28T09:48:17.792Z | user\n\nSelf-improving-agent v3.0.10 introduces first-use initialization and improved privacy protections.\n\n- Added automatic setup guidance and shell commands to ensure `.learnings/` files exist before logging.\n- Removed default logging of full transcripts, secrets, or sensitive data; added explicit privacy and redaction warnings.\n- Migrated learning log templates and setup steps into SKILL.md, eliminating separate `.learnings/*.md` assets.\n- Clarified guidance for trusted use of inter-session learning sharing.\n- No breaking changes to main usage or logging formats.\n\nv3.0.9 | 2026-03-28T08:36:57.019Z | user\n\nremoved empty metadata nothing else re-upload\n\nv3.0.8 | 2026-03-27T18:24:46.601Z | user\n\nNo code or documentation changes detected in this release.\n\n- Version update with no modifications to files or SKILL.md.\n- No user-facing changes or new features.\n\nv3.0.7 | 2026-03-27T18:23:05.064Z | user\n\nno change re-upload\n\nv3.0.6 | 2026-03-24T15:15:04.323Z | user\n\nno changes re-upload after clawhub update\n\nv3.0.5 | 2026-03-17T15:13:48.300Z | user\n\nno changes re-upload after clawhub update\n\nv3.0.4 | 2026-03-15T14:04:11.342Z | user\n\nno changes re-uploaded after vanishing from clawhub\n\nv3.0.2 | 2026-03-14T06:16:17.287Z | user\n\n**New: Comprehensive guidelines for continuous self-improvement logging and promotion across OpenClaw and generic agent setups.**\n\n- Detailed instructions for logging errors, learnings, and feature requests to markdown files with purpose-built templates.\n- Quick-reference tables for when and where to log different types of events (errors, corrections, feature requests, best practices).\n- Clear process for promoting broadly useful learnings to project memory files (CLAUDE.md, AGENTS.md, SOUL.md, TOOLS.md, etc.).\n- Step-by-step setup guidance for using the skill with OpenClaw (recommended) or other agent platforms.\n- Fully documented standardized markdown formats for each log type, including metadata and resolution tracking.\n- Includes workflow tips for session linking, daily memory integration, and optional hook reminders.\n\nv3.0.1 | 2026-03-11T11:58:28.177Z | user\n\nVersion 3.0.1 – Expanded documentation, clarified workflow, and OpenClaw integration\n\n- Major overhaul of SKILL.md with detailed instructions for logging errors, learnings, and feature requests.\n- Added comprehensive quick reference tables for when and how to log issues and promote learnings.\n- Included complete setup steps for OpenClaw and generic (non-OpenClaw) agents, with directory structure and file descriptions.\n- Standardized formats for recording learnings, errors, and feature requests, including metadata and resolution process.\n- Documented promotion workflow to elevate important learnings to project memory files.\n- Clarified inter-session communication tools within OpenClaw for sharing and reviewing learnings.\n\nv3.0.0 | 2026-03-09T17:08:46.255Z | user\n\nSelf-improving-agent v1.0.0 initial release\n\n- Introduces a structured system for logging errors, learnings, and feature requests to Markdown files for continuous agent improvement.\n- Provides quick-reference tables and log templates for efficient categorization and promotion of learnings.\n- Outlines integration and setup steps for both OpenClaw and generic agent environments.\n- Includes workflows for promoting important insights to project memory files (e.g., CLAUDE.md, AGENTS.md, TOOLS.md, SOUL.md).\n- Defines clear Markdown entry formats and resolution/update procedures for all logged issues and learnings.\n\nv1.0.11 | 2026-02-22T16:28:33.337Z | user\n\nNo functional or content changes; OpenClaw-specific environment metadata was removed.\n\n- Removed the OpenClaw `requires.env` metadata block from the skill definition.\n- All usage guidance, logging formats, and workflow instructions remain unchanged.\n- No new features or bug fixes included in this version.\n- This update does not require any action from users.\n- Ensures cleaner skill metadata and wider compatibility.\n\nv1.0.10 | 2026-02-21T21:34:25.365Z | user\n\nself-improving-agent v1.0.10\n\n- Added attribution: notes that this skill was remade for OpenClaw from the original repository (pskoett-ai-skills).\n- No functional or structural changes to the skill—documentation only update.\n- No code files were changed in this version.\n\nv1.0.9 | 2026-02-21T20:43:11.283Z | user\n\n- Added OpenClaw integration metadata to SKILL.md (`metadata: openclaw: requires: env: [CLAUDE_TOOL_OUTPUT]`)\n- No changes to general skill functionality or logging workflows\n- This update enables better compatibility and environment validation for OpenClaw users\n\nv1.0.8 | 2026-02-21T20:36:06.961Z | user\n\nself-improving-agent 1.0.8\n\n- Clarified that referencing agent files (AGENTS.md, CLAUDE.md, or .github/copilot-instructions.md) is an alternative to hook-based reminders in the generic setup section.\n- No code or file changes; documentation only.\n\nv1.0.7 | 2026-02-21T18:12:28.113Z | user\n\nVersion 1.0.7\n\n- Added setup guidance: Now includes instructions to reference agent files (AGENTS.md, CLAUDE.md, or .github/copilot-instructions.md) to remind logging of learnings.\n- Introduced a new \"Self-Improvement Workflow\" section for logging and promoting learnings.\n- Clarified promotion steps for broadly applicable learnings, especially for non-OpenClaw environments.\n- No code or file changes; documentation only update.\n\nv1.0.6 | 2026-02-21T17:22:45.619Z | user\n\nself-improving-agent 1.0.6 changelog:\n\n- Added support for recurring pattern tracking: now supports logging and updating learnings with a stable `Pattern-Key` and new metadata fields like `Recurrence-Count`, `First-Seen`, and `Last-Seen`.\n- Introduced a \"simplify-and-harden\" source for learnings, enabling simplified/hardened patterns to be tracked and improved over time.\n- Updated Quick Reference and Learning Entry format to reflect new pattern tracking options.\n- No code or file structure changes; documentation-only update.\n\nv1.0.5 | 2026-02-03T07:20:44.219Z | user\n\n- fixed hook sub-agent bug by removing hook for sub-agent processes\n\nv1.0.4 | 2026-01-31T12:39:00.016Z | user\n\n- Added detailed OpenClaw integration instructions, including workspace structure, installation methods, and inter-session communication tools.\n- Introduced dedicated section for OpenClaw setup and workflow, separating generic and OpenClaw-specific usage.\n- Included instructions for enabling automatic prompts via OpenClaw session hooks.\n- Removed Clawdhub metadata file (.clawdhub/origin.json) from the repository.\n- Clarified file organization and promotion targets for learnings within the OpenClaw workspace.\n\nv1.0.3 | 2026-01-31T11:04:05.160Z | auto\n\n- Initial OpenClaw integration: added OpenClaw hooks and documentation files.\n- Rebranded workspace references from \"clawdbot\" to \"OpenClaw\" throughout documentation.\n- Introduced new learnings directory structure and logging templates for errors, feature requests, and learnings.\n- Updated and extended instructions in SKILL.md regarding entry promotion, review, and recurring pattern detection.\n- Removed legacy reference to clawdbot integration.\n\nv1.0.2 | 2026-01-26T09:42:32.012Z | auto\n\n- Added guidelines for promoting workflow improvements, tool gotchas, and behavioral patterns to new clawdbot workspace files (`AGENTS.md`, `TOOLS.md`, `SOUL.md`).\n- Updated promotion targets and instructions to include `SOUL.md` and `TOOLS.md` for better organization of learning types.\n- Included references to clawdbot integration throughout documentation.\n- No changes to entry format or basic logging workflow.\n\nv1.0.1 | 2026-01-19T21:56:47.396Z | auto\n\nself-improving-agent v1.0.1\n\n- Added 7 new files, including structured templates (assets/SKILL-TEMPLATE.md, assets/LEARNINGS.md), documentation for examples and hooks, and scripts for error detection and skill extraction.\n- Removed unscoped/old files (LEARNINGS.md, examples.md) in favor of new asset and reference structure.\n- SKILL.md updated: clarified promotion targets to include `.github/copilot-instructions.md` alongside CLAUDE.md and AGENTS.md, improved instructions for file promotion and creation.\n- Improved modularity and usability by providing templates and scripts to assist logging and review workflows.\n\nv1.0.0 | 2026-01-05T17:03:18.365Z\n\nArchive index:\n\nArchive v3.0.21: 16 files, 26211 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (3357b), hooks/openclaw/handler.ts (3438b), hooks/openclaw/HOOK.md (589b), README.md (378b), references/examples.md (8290b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (20674b), _meta.json (140b)\n\nFile v3.0.21:SKILL.md\n\n---\nname: self-improvement\ndescription: \"Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.\"\nmetadata:\n---\n\n# Self-Improvement Skill\n\nLog learnings and errors to markdown files for continuous improvement. Coding agents can later process these into fixes, and important learnings get promoted to project memory.\n\n## First-Use Initialisation\n\nBefore logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:\n\n```bash\nmkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Learnings\\n\\nCorrections, insights, and knowledge gaps captured during development.\\n\\n**Categories**: correction | insight | knowledge_gap | best_practice\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/ERRORS.md ] || printf \"# Errors\\n\\nCommand failures and integration errors.\\n\\n---\\n\" > .learnings/ERRORS.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Feature Requests\\n\\nCapabilities requested by the user.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md\n```\n\nNever overwrite existing files. This is a no-op if `.learnings/` is already initialised.\n\nDo not log secrets, tokens, private keys, environment variables, or full source/config files unless the user explicitly asks for that level of detail. Prefer short summaries or redacted excerpts over raw command output or full transcripts.\n\nIf you want automatic reminders or setup assistance, use the opt-in hook workflow described in [Hook Integration](#hook-integration).\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| Command/operation fails | Log to `.learnings/ERRORS.md` |\n| User corrects you | Log to `.learnings/LEARNINGS.md` with category `correction` |\n| User wants missing feature | Log to `.learnings/FEATURE_REQUESTS.md` |\n| API/external tool fails | Log to `.learnings/ERRORS.md` with integration details |\n| Knowledge was outdated | Log to `.learnings/LEARNINGS.md` with category `knowledge_gap` |\n| Found better approach | Log to `.learnings/LEARNINGS.md` with category `best_practice` |\n| Simplify/Harden recurring patterns | Log/update `.learnings/LEARNINGS.md` with `Source: simplify-and-harden` and a stable `Pattern-Key` |\n| Similar to existing entry | Link with `**See Also**`, consider priority bump |\n| Broadly applicable learning | Promote to `CLAUDE.md`, `AGENTS.md`, and/or `.github/copilot-instructions.md` |\n| Workflow improvements | Promote to `AGENTS.md` (OpenClaw workspace) |\n| Tool gotchas | Promote to `TOOLS.md` (OpenClaw workspace) |\n| Behavioral patterns | Promote to `SOUL.md` (OpenClaw workspace) |\n\n## OpenClaw Setup (Recommended)\n\nOpenClaw is the primary platform for this skill. It uses workspace-based prompt injection with automatic skill loading.\n\n### Installation\n\n**Via ClawdHub (recommended):**\n```bash\nclawdhub install self-improving-agent\n```\n\n**Manual:**\n```bash\ngit clone https://github.com/peterskoett/self-improving-agent.git ~/.openclaw/skills/self-improving-agent\n```\n\nRemade for openclaw from original repo : https://github.com/pskoett/pskoett-ai-skills - https://github.com/pskoett/pskoett-ai-skills/tree/main/skills/self-improvement\n\n### Workspace Structure\n\nOpenClaw injects these files into every session:\n\n```\n~/.openclaw/workspace/\n├── AGENTS.md          # Multi-agent workflows, delegation patterns\n├── SOUL.md            # Behavioral guidelines, personality, principles\n├── TOOLS.md           # Tool capabilities, integration gotchas\n├── MEMORY.md          # Long-term memory (main session only)\n├── memory/            # Daily memory files\n│   └── YYYY-MM-DD.md\n└── .learnings/        # This skill's log files\n    ├── LEARNINGS.md\n    ├── ERRORS.md\n    └── FEATURE_REQUESTS.md\n```\n\n### Create Learning Files\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nThen create the log files (or copy from `assets/`):\n- `LEARNINGS.md` — corrections, knowledge gaps, best practices\n- `ERRORS.md` — command failures, exceptions\n- `FEATURE_REQUESTS.md` — user-requested capabilities\n\n### Promotion Targets\n\nWhen learnings prove broadly applicable, promote them to workspace files:\n\n| Learning Type | Promote To | Example |\n|---------------|------------|---------|\n| Behavioral patterns | `SOUL.md` | \"Be concise, avoid disclaimers\" |\n| Workflow improvements | `AGENTS.md` | \"Spawn sub-agents for long tasks\" |\n| Tool gotchas | `TOOLS.md` | \"Git push needs auth configured first\" |\n\n### Inter-Session Communication\n\nOpenClaw provides tools to share learnings across sessions:\n\n- **sessions_list** — View active/recent sessions\n- **sessions_history** — Read another session's transcript  \n- **sessions_send** — Send a learning to another session\n- **sessions_spawn** — Spawn a sub-agent for background work\n\nUse these only in trusted environments and only when the user explicitly wants cross-session sharing. Prefer sending a short sanitized summary and relevant file paths, not raw transcripts, secrets, or full command output.\n\n### Optional: Enable Hook\n\nFor automatic reminders at session start:\n\n```bash\n# Copy hook to OpenClaw hooks directory\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improvement\n\n# Enable it\nopenclaw hooks enable self-improvement\n```\n\nSee `references/openclaw-integration.md` for complete details.\n\n---\n\n## Generic Setup (Other Agents)\n\nFor Claude Code, Codex, Copilot, or other agents, create `.learnings/` in the project or workspace root:\n\n```bash\nmkdir -p .learnings\n```\n\nCreate the files inline using the headers shown above. Avoid reading templates from the current repo or workspace unless you explicitly trust that path.\n\n### Add reference to agent files AGENTS.md, CLAUDE.md, or .github/copilot-instructions.md to remind yourself to log learnings. (this is an alternative to hook-based reminders)\n\n#### Self-Improvement Workflow\n\nWhen errors or corrections occur:\n1. Log to `.learnings/ERRORS.md`, `LEARNINGS.md`, or `FEATURE_REQUESTS.md`\n2. Review and promote broadly applicable learnings to:\n   - `CLAUDE.md` - project facts and conventions\n   - `AGENTS.md` - workflows and automation\n   - `.github/copilot-instructions.md` - Copilot context\n\n## Logging Format\n\n### Learning Entry\n\nAppend to `.learnings/LEARNINGS.md`:\n\n```markdown\n## [LRN-YYYYMMDD-XXX] category\n\n**Logged**: ISO-8601 timestamp\n**Priority**: low | medium | high | critical\n**Status**: pending\n**Area**: frontend | backend | infra | tests | docs | config\n\n### Summary\nOne-line description of what was learned\n\n### Details\nFull context: what happened, what was wrong, what's correct\n\n### Suggested Action\nSpecific fix or improvement to make\n\n### Metadata\n- Source: conversation | error | user_feedback\n- Related Files: path/to/file.ext\n- Tags: tag1, tag2\n- See Also: LRN-20250110-001 (if related to existing entry)\n- Pattern-Key: simplify.dead_code | harden.input_validation (optional, for recurring-pattern tracking)\n- Recurrence-Count: 1 (optional)\n- First-Seen: 2025-01-15 (optional)\n- Last-Seen: 2025-01-15 (optional)\n\n---\n```\n\n### Error Entry\n\nAppend to `.learnings/ERRORS.md`:\n\n```markdown\n## [ERR-YYYYMMDD-XXX] skill_or_command_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: high\n**Status**: pending\n**Area**: frontend | backend | infra | tests | docs | config\n\n### Summary\nBrief description of what failed\n\n### Error\n```\nActual error message or output\n```\n\n### Context\n- Command/operation attempted\n- Input or parameters used\n- Environment details if relevant\n- Summary or redacted excerpt of relevant output (avoid full transcripts and secret-bearing data by default)\n\n### Suggested Fix\nIf identifiable, what might resolve this\n\n### Metadata\n- Reproducible: yes | no | unknown\n- Related Files: path/to/file.ext\n- See Also: ERR-20250110-001 (if recurring)\n\n---\n```\n\n### Feature Request Entry\n\nAppend to `.learnings/FEATURE_REQUESTS.md`:\n\n```markdown\n## [FEAT-YYYYMMDD-XXX] capability_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: medium\n**Status**: pending\n**Area**: frontend | backend | infra | tests | docs | config\n\n### Requested Capability\nWhat the user wanted to do\n\n### User Context\nWhy they needed it, what problem they're solving\n\n### Complexity Estimate\nsimple | medium | complex\n\n### Suggested Implementation\nHow this could be built, what it might extend\n\n### Metadata\n- Frequency: first_time | recurring\n- Related Features: existing_feature_name\n\n---\n```\n\n## ID Generation\n\nFormat: `TYPE-YYYYMMDD-XXX`\n- TYPE: `LRN` (learning), `ERR` (error), `FEAT` (feature)\n- YYYYMMDD: Current date\n- XXX: Sequential number or random 3 chars (e.g., `001`, `A7B`)\n\nExamples: `LRN-20250115-001`, `ERR-20250115-A3F`, `FEAT-20250115-002`\n\n## Resolving Entries\n\nWhen an issue is fixed, update the entry:\n\n1. Change `**Status**: pending` → `**Status**: resolved`\n2. Add resolution block after Metadata:\n\n```markdown\n### Resolution\n- **Resolved**: 2025-01-16T09:00:00Z\n- **Commit/PR**: abc123 or #42\n- **Notes**: Brief description of what was done\n```\n\nOther status values:\n- `in_progress` - Actively being worked on\n- `wont_fix` - Decided not to address (add reason in Resolution notes)\n- `promoted` - Elevated to CLAUDE.md, AGENTS.md, or .github/copilot-instructions.md\n\n## Promoting to Project Memory\n\nWhen a learning is broadly applicable (not a one-off fix), promote it to permanent project memory.\n\n### When to Promote\n\n- Learning applies across multiple files/features\n- Knowledge any contributor (human or AI) should know\n- Prevents recurring mistakes\n- Documents project-specific conventions\n\n### Promotion Targets\n\n| Target | What Belongs There |\n|--------|-------------------|\n| `CLAUDE.md` | Project facts, conventions, gotchas for all Claude interactions |\n| `AGENTS.md` | Agent-specific workflows, tool usage patterns, automation rules |\n| `.github/copilot-instructions.md` | Project context and conventions for GitHub Copilot |\n| `SOUL.md` | Behavioral guidelines, communication style, principles (OpenClaw workspace) |\n| `TOOLS.md` | Tool capabilities, usage patterns, integration gotchas (OpenClaw workspace) |\n\n### How to Promote\n\n1. **Distill** the learning into a concise rule or fact\n2. **Add** to appropriate section in target file (create file if needed)\n3. **Update** original entry:\n   - Change `**Status**: pending` → `**Status**: promoted`\n   - Add `**Promoted**: CLAUDE.md`, `AGENTS.md`, or `.github/copilot-instructions.md`\n\n### Promotion Examples\n\n**Learning** (verbose):\n> Project uses pnpm workspaces. Attempted `npm install` but failed. \n> Lock file is `pnpm-lock.yaml`. Must use `pnpm install`.\n\n**In CLAUDE.md** (concise):\n```markdown\n## Build & Dependencies\n- Package manager: pnpm (not npm) - use `pnpm install`\n```\n\n**Learning** (verbose):\n> When modifying API endpoints, must regenerate TypeScript client.\n> Forgetting this causes type mismatches at runtime.\n\n**In AGENTS.md** (actionable):\n```markdown\n## After API Changes\n1. Regenerate client: `pnpm run generate:api`\n2. Check for type errors: `pnpm tsc --noEmit`\n```\n\n## Recurring Pattern Detection\n\nIf logging something similar to an existing entry:\n\n1. **Search first**: `grep -r \"keyword\" .learnings/`\n2. **Link entries**: Add `**See Also**: ERR-20250110-001` in Metadata\n3. **Bump priority** if issue keeps recurring\n4. **Consider systemic fix**: Recurring issues often indicate:\n   - Missing documentation (→ promote to CLAUDE.md or .github/copilot-instructions.md)\n   - Missing automation (→ add to AGENTS.md)\n   - Architectural problem (→ create tech debt ticket)\n\n## Simplify & Harden Feed\n\nUse this workflow to ingest recurring patterns from the `simplify-and-harden`\nskill and turn them into durable prompt guidance.\n\n### Ingestion Workflow\n\n1. Read `simplify_and_harden.learning_loop.candidates` from the task summary.\n2. For each candidate, use `pattern_key` as the stable dedupe key.\n3. Search `.learnings/LEARNINGS.md` for an existing entry with that key:\n   - `grep -n \"Pattern-Key: <pattern_key>\" .learnings/LEARNINGS.md`\n4. If found:\n   - Increment `Recurrence-Count`\n   - Update `Last-Seen`\n   - Add `See Also` links to related entries/tasks\n5. If not found:\n   - Create a new `LRN-...` entry\n   - Set `Source: simplify-and-harden`\n   - Set `Pattern-Key`, `Recurrence-Count: 1`, and `First-Seen`/`Last-Seen`\n\n### Promotion Rule (System Prompt Feedback)\n\nPromote recurring patterns into agent context/system prompt files when all are true:\n\n- `Recurrence-Count >= 3`\n- Seen across at least 2 distinct tasks\n- Occurred within a 30-day window\n\nPromotion targets:\n- `CLAUDE.md`\n- `AGENTS.md`\n- `.github/copilot-instructions.md`\n- `SOUL.md` / `TOOLS.md` for OpenClaw workspace-level guidance when applicable\n\nWrite promoted rules as short prevention rules (what to do before/while coding),\nnot long incident write-ups.\n\n## Periodic Review\n\nReview `.learnings/` at natural breakpoints:\n\n### When to Review\n- Before starting a new major task\n- After completing a feature\n- When working in an area with past learnings\n- Weekly during active development\n\n### Quick Status Check\n```bash\n# Count pending items\ngrep -h \"Status\\*\\*: pending\" .learnings/*.md | wc -l\n\n# List pending high-priority items\ngrep -B5 \"Priority\\*\\*: high\" .learnings/*.md | grep \"^## \\[\"\n\n# Find learnings for a specific area\ngrep -l \"Area\\*\\*: backend\" .learnings/*.md\n```\n\n### Review Actions\n- Resolve fixed items\n- Promote applicable learnings\n- Link related entries\n- Escalate recurring issues\n\n## Detection Triggers\n\nAutomatically log when you notice:\n\n**Corrections** (→ learning with `correction` category):\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"That's outdated...\"\n\n**Feature Requests** (→ feature request):\n- \"Can you also...\"\n- \"I wish you could...\"\n- \"Is there a way to...\"\n- \"Why can't you...\"\n\n**Knowledge Gaps** (→ learning with `knowledge_gap` category):\n- User provides information you didn't know\n- Documentation you referenced is outdated\n- API behavior differs from your understanding\n\n**Errors** (→ error entry):\n- Command returns non-zero exit code\n- Exception or stack trace\n- Unexpected output or behavior\n- Timeout or connection failure\n\n## Priority Guidelines\n\n| Priority | When to Use |\n|----------|-------------|\n| `critical` | Blocks core functionality, data loss risk, security issue |\n| `high` | Significant impact, affects common workflows, recurring issue |\n| `medium` | Moderate impact, workaround exists |\n| `low` | Minor inconvenience, edge case, nice-to-have |\n\n## Area Tags\n\nUse to filter learnings by codebase region:\n\n| Area | Scope |\n|------|-------|\n| `frontend` | UI, components, client-side code |\n| `backend` | API, services, server-side code |\n| `infra` | CI/CD, deployment, Docker, cloud |\n| `tests` | Test files, testing utilities, coverage |\n| `docs` | Documentation, comments, READMEs |\n| `config` | Configuration files, environment, settings |\n\n## Best Practices\n\n1. **Log immediately** - context is freshest right after the issue\n2. **Be specific** - future agents need to understand quickly\n3. **Include reproduction steps** - especially for errors\n4. **Link related files** - makes fixes easier\n5. **Suggest concrete fixes** - not just \"investigate\"\n6. **Use consistent categories** - enables filtering\n7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md\n8. **Review regularly** - stale learnings lose value\n\n## Gitignore Options\n\n**Keep learnings local** (per-developer):\n```gitignore\n.learnings/\n```\n\nThis repo uses that default to avoid committing sensitive or noisy local logs by accident.\n\n**Track learnings in repo** (team-wide):\nDon't add to .gitignore - learnings become shared knowledge.\n\n**Hybrid** (track templates, ignore entries):\n```gitignore\n.learnings/*.md\n!.learnings/.gitkeep\n```\n\n## Hook Integration\n\nEnable automatic reminders through agent hooks. This is **opt-in** - you must explicitly configure hooks.\n\n### Quick Setup (Claude Code / Codex)\n\nCreate `.claude/settings.json` in your project:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n      }]\n    }]\n  }\n}\n```\n\nThis injects a learning evaluation reminder after each prompt (~50-100 tokens overhead).\n\n### Advanced Setup (With Error Detection)\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n      }]\n    }],\n    \"PostToolUse\": [{\n      \"matcher\": \"Bash\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improvement/scripts/error-detector.sh\"\n      }]\n    }]\n  }\n}\n```\n\nThis is optional. The recommended default is activator-only setup; enable `PostToolUse` only if you are comfortable with hook scripts inspecting command output for error patterns.\n\n### Available Hook Scripts\n\n| Script | Hook Type | Purpose |\n|--------|-----------|---------|\n| `scripts/activator.sh` | UserPromptSubmit | Reminds to evaluate learnings after tasks |\n| `scripts/error-detector.sh` | PostToolUse (Bash) | Triggers on command errors |\n\nSee `references/hooks-setup.md` for detailed configuration and troubleshooting.\n\n## Automatic Skill Extraction\n\nWhen a learning is valuable enough to become a reusable skill, extract it using the provided helper.\n\n### Skill Extraction Criteria\n\nA learning qualifies for skill extraction when ANY of these apply:\n\n| Criterion | Description |\n|-----------|-------------|\n| **Recurring** | Has `See Also` links to 2+ similar issues |\n| **Verified** | Status is `resolved` with working fix |\n| **Non-obvious** | Required actual debugging/investigation to discover |\n| **Broadly applicable** | Not project-specific; useful across codebases |\n| **User-flagged** | User says \"save this as a skill\" or similar |\n\n### Extraction Workflow\n\n1. **Identify candidate**: Learning meets extraction criteria\n2. **Run helper** (or create manually):\n   ```bash\n   ./skills/self-improvement/scripts/extract-skill.sh skill-name --dry-run\n   ./skills/self-improvement/scripts/extract-skill.sh skill-name\n   ```\n3. **Customize SKILL.md**: Fill in template with learning content\n4. **Update learning**: Set status to `promoted_to_skill`, add `Skill-Path`\n5. **Verify**: Read skill in fresh session to ensure it's self-contained\n\n### Manual Extraction\n\nIf you prefer manual creation:\n\n1. Create `skills/<skill-name>/SKILL.md`\n2. Use template from `assets/SKILL-TEMPLATE.md`\n3. Follow [Agent Skills spec](https://agentskills.io/specification):\n   - YAML frontmatter with `name` and `description`\n   - Name must match folder name\n   - No README.md inside skill folder\n\n### Extraction Detection Triggers\n\nWatch for these signals that a learning should become a skill:\n\n**In conversation:**\n- \"Save this as a skill\"\n- \"I keep running into this\"\n- \"This would be useful for other projects\"\n- \"Remember this pattern\"\n\n**In learning entries:**\n- Multiple `See Also` links (recurring issue)\n- High priority + resolved status\n- Category: `best_practice` with broad applicability\n- User feedback praising the solution\n\n### Skill Quality Gates\n\nBefore extraction, verify:\n\n- [ ] Solution is tested and working\n- [ ] Description is clear without original context\n- [ ] Code examples are self-contained\n- [ ] No project-specific hardcoded values\n- [ ] Follows skill naming conventions (lowercase, hyphens)\n\n## Multi-Agent Support\n\nThis skill works across different AI coding agents with agent-specific activation.\n\n### Claude Code\n\n**Activation**: Hooks (UserPromptSubmit, PostToolUse)\n**Setup**: `.claude/settings.json` with hook configuration\n**Detection**: Automatic via hook scripts\n\n### Codex CLI\n\n**Activation**: Hooks (same pattern as Claude Code)\n**Setup**: `.codex/settings.json` with hook configuration\n**Detection**: Automatic via hook scripts\n\n### GitHub Copilot\n\n**Activation**: Manual (no hook support)\n**Setup**: Add to `.github/copilot-instructions.md`:\n\n```markdown\n## Self-Improvement\n\nAfter solving non-obvious issues, consider logging to `.learnings/`:\n1. Use format from self-improvement skill\n2. Link related entries with See Also\n3. Promote high-value learnings to skills\n\nAsk in chat: \"Should I log this as a learning?\"\n```\n\n**Detection**: Manual review at session end\n\nFile v3.0.21:README.md\n\n# self-improvement\n\nSelf-improvement skill for OpenClaw. It captures learnings, errors, and feature requests to support continuous improvement across sessions.\n\n## Attribution\n\nRemade for OpenClaw from the original repo:\n\n- https://github.com/pskoett/pskoett-ai-skills\n- https://github.com/pskoett/pskoett-ai-skills/tree/main/skills/self-improvement\n\n## Main File\n\n- `SKILL.md`\n\nFile v3.0.21:_meta.json\n\n{\n  \"ownerId\": \"kn70cjr952qdec1nx70zs6wefn7ynq2t\",\n  \"slug\": \"self-improving-agent\",\n  \"version\": \"3.0.21\",\n  \"publishedAt\": 1777649615088\n}\n\nFile v3.0.21:references/examples.md\n\n# Entry Examples\n\nConcrete examples of well-formatted entries with all fields.\n\n## Learning: Correction\n\n```markdown\n## [LRN-20250115-001] correction\n\n**Logged**: 2025-01-15T10:30:00Z\n**Priority**: high\n**Status**: pending\n**Area**: tests\n\n### Summary\nIncorrectly assumed pytest fixtures are scoped to function by default\n\n### Details\nWhen writing test fixtures, I assumed all fixtures were function-scoped. \nUser corrected that while function scope is the default, the codebase \nconvention uses module-scoped fixtures for database connections to \nimprove test performance.\n\n### Suggested Action\nWhen creating fixtures that involve expensive setup (DB, network), \ncheck existing fixtures for scope patterns before defaulting to function scope.\n\n### Metadata\n- Source: user_feedback\n- Related Files: tests/conftest.py\n- Tags: pytest, testing, fixtures\n\n---\n```\n\n## Learning: Knowledge Gap (Resolved)\n\n```markdown\n## [LRN-20250115-002] knowledge_gap\n\n**Logged**: 2025-01-15T14:22:00Z\n**Priority**: medium\n**Status**: resolved\n**Area**: config\n\n### Summary\nProject uses pnpm not npm for package management\n\n### Details\nAttempted to run `npm install` but project uses pnpm workspaces.\nLock file is `pnpm-lock.yaml`, not `package-lock.json`.\n\n### Suggested Action\nCheck for `pnpm-lock.yaml` or `pnpm-workspace.yaml` before assuming npm.\nUse `pnpm install` for this project.\n\n### Metadata\n- Source: error\n- Related Files: pnpm-lock.yaml, pnpm-workspace.yaml\n- Tags: package-manager, pnpm, setup\n\n### Resolution\n- **Resolved**: 2025-01-15T14:30:00Z\n- **Commit/PR**: N/A - knowledge update\n- **Notes**: Added to CLAUDE.md for future reference\n\n---\n```\n\n## Learning: Promoted to CLAUDE.md\n\n```markdown\n## [LRN-20250115-003] best_practice\n\n**Logged**: 2025-01-15T16:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: CLAUDE.md\n**Area**: backend\n\n### Summary\nAPI responses must include correlation ID from request headers\n\n### Details\nAll API responses should echo back the X-Correlation-ID header from \nthe request. This is required for distributed tracing. Responses \nwithout this header break the observability pipeline.\n\n### Suggested Action\nAlways include correlation ID passthrough in API handlers.\n\n### Metadata\n- Source: user_feedback\n- Related Files: src/middleware/correlation.ts\n- Tags: api, observability, tracing\n\n---\n```\n\n## Learning: Promoted to AGENTS.md\n\n```markdown\n## [LRN-20250116-001] best_practice\n\n**Logged**: 2025-01-16T09:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: AGENTS.md\n**Area**: backend\n\n### Summary\nMust regenerate API client after OpenAPI spec changes\n\n### Details\nWhen modifying API endpoints, the TypeScript client must be regenerated.\nForgetting this causes type mismatches that only appear at runtime.\nThe generate script also runs validation.\n\n### Suggested Action\nAdd to agent workflow: after any API changes, run `pnpm run generate:api`.\n\n### Metadata\n- Source: error\n- Related Files: openapi.yaml, src/client/api.ts\n- Tags: api, codegen, typescript\n\n---\n```\n\n## Error Entry\n\n```markdown\n## [ERR-20250115-A3F] docker_build\n\n**Logged**: 2025-01-15T09:15:00Z\n**Priority**: high\n**Status**: pending\n**Area**: infra\n\n### Summary\nDocker build fails on M1 Mac due to platform mismatch\n\n### Error\n```\nerror: failed to solve: python:3.11-slim: no match for platform linux/arm64\n```\n\n### Context\n- Command: `docker build -t myapp .`\n- Dockerfile uses `FROM python:3.11-slim`\n- Running on Apple Silicon (M1/M2)\n\n### Suggested Fix\nAdd platform flag: `docker build --platform linux/amd64 -t myapp .`\nOr update Dockerfile: `FROM --platform=linux/amd64 python:3.11-slim`\n\n### Metadata\n- Reproducible: yes\n- Related Files: Dockerfile\n\n---\n```\n\n## Error Entry: Recurring Issue\n\n```markdown\n## [ERR-20250120-B2C] api_timeout\n\n**Logged**: 2025-01-20T11:30:00Z\n**Priority**: critical\n**Status**: pending\n**Area**: backend\n\n### Summary\nThird-party API timeout during request processing\n\n### Error\n```\nTimeoutError: Request to api.example.com timed out after 30000ms\n```\n\n### Context\n- Command: POST /api/process\n- Timeout set to 30s\n- Occurs during peak hours (lunch, evening)\n\n### Suggested Fix\nImplement retry with exponential backoff. Consider circuit breaker pattern.\n\n### Metadata\n- Reproducible: yes (during peak hours)\n- Related Files: src/services/api-client.ts\n- See Also: ERR-20250115-X1Y, ERR-20250118-Z3W\n\n---\n```\n\n## Feature Request\n\n```markdown\n## [FEAT-20250115-001] export_to_csv\n\n**Logged**: 2025-01-15T16:45:00Z\n**Priority**: medium\n**Status**: pending\n**Area**: backend\n\n### Requested Capability\nExport analysis results to CSV format\n\n### User Context\nUser runs weekly reports and needs to share results with non-technical \nstakeholders in Excel. Currently copies output manually.\n\n### Complexity Estimate\nsimple\n\n### Suggested Implementation\nAdd `--output csv` flag to the analyze command. Use standard csv module.\nCould extend existing `--output json` pattern.\n\n### Metadata\n- Frequency: recurring\n- Related Features: analyze command, json output\n\n---\n```\n\n## Feature Request: Resolved\n\n```markdown\n## [FEAT-20250110-002] dark_mode\n\n**Logged**: 2025-01-10T14:00:00Z\n**Priority**: low\n**Status**: resolved\n**Area**: frontend\n\n### Requested Capability\nDark mode support for the dashboard\n\n### User Context\nUser works late hours and finds the bright interface straining.\nSeveral other users have mentioned this informally.\n\n### Complexity Estimate\nmedium\n\n### Suggested Implementation\nUse CSS variables for colors. Add toggle in user settings.\nConsider system preference detection.\n\n### Metadata\n- Frequency: recurring\n- Related Features: user settings, theme system\n\n### Resolution\n- **Resolved**: 2025-01-18T16:00:00Z\n- **Commit/PR**: #142\n- **Notes**: Implemented with system preference detection and manual toggle\n\n---\n```\n\n## Learning: Promoted to Skill\n\n```markdown\n## [LRN-20250118-001] best_practice\n\n**Logged**: 2025-01-18T11:00:00Z\n**Priority**: high\n**Status**: promoted_to_skill\n**Skill-Path**: skills/docker-m1-fixes\n**Area**: infra\n\n### Summary\nDocker build fails on Apple Silicon due to platform mismatch\n\n### Details\nWhen building Docker images on M1/M2 Macs, the build fails because\nthe base image doesn't have an ARM64 variant. This is a common issue\nthat affects many developers.\n\n### Suggested Action\nAdd `--platform linux/amd64` to docker build command, or use\n`FROM --platform=linux/amd64` in Dockerfile.\n\n### Metadata\n- Source: error\n- Related Files: Dockerfile\n- Tags: docker, arm64, m1, apple-silicon\n- See Also: ERR-20250115-A3F, ERR-20250117-B2D\n\n---\n```\n\n## Extracted Skill Example\n\nWhen the above learning is extracted as a skill, it becomes:\n\n**File**: `skills/docker-m1-fixes/SKILL.md`\n\n```markdown\n---\nname: docker-m1-fixes\ndescription: \"Fixes Docker build failures on Apple Silicon (M1/M2). Use when docker build fails with platform mismatch errors.\"\n---\n\n# Docker M1 Fixes\n\nSolutions for Docker build issues on Apple Silicon Macs.\n\n## Quick Reference\n\n| Error | Fix |\n|-------|-----|\n| `no match for platform linux/arm64` | Add `--platform linux/amd64` to build |\n| Image runs but crashes | Use emulation or find ARM-compatible base |\n\n## The Problem\n\nMany Docker base images don't have ARM64 variants. When building on\nApple Silicon (M1/M2/M3), Docker attempts to pull ARM64 images by\ndefault, causing platform mismatch errors.\n\n## Solutions\n\n### Option 1: Build Flag (Recommended)\n\nAdd platform flag to your build command:\n\n\\`\\`\\`bash\ndocker build --platform linux/amd64 -t myapp .\n\\`\\`\\`\n\n### Option 2: Dockerfile Modification\n\nSpecify platform in the FROM instruction:\n\n\\`\\`\\`dockerfile\nFROM --platform=linux/amd64 python:3.11-slim\n\\`\\`\\`\n\n### Option 3: Docker Compose\n\nAdd platform to your service:\n\n\\`\\`\\`yaml\nservices:\n  app:\n    platform: linux/amd64\n    build: .\n\\`\\`\\`\n\n## Trade-offs\n\n| Approach | Pros | Cons |\n|----------|------|------|\n| Build flag | No file changes | Must remember flag |\n| Dockerfile | Explicit, versioned | Affects all builds |\n| Compose | Convenient for dev | Requires compose |\n\n## Performance Note\n\nRunning AMD64 images on ARM64 uses Rosetta 2 emulation. This works\nfor development but may be slower. For production, find ARM-native\nalternatives when possible.\n\n## Source\n\n- Learning ID: LRN-20250118-001\n- Category: best_practice\n- Extraction Date: 2025-01-18\n```\n\nFile v3.0.21:references/hooks-setup.md\n\n# Hook Setup Guide\n\nConfigure automatic self-improvement triggers for AI coding agents.\n\n## Overview\n\nHooks enable proactive learning capture by injecting reminders at key moments:\n- **UserPromptSubmit**: Reminder after each prompt to evaluate learnings\n- **PostToolUse (Bash)**: Error detection when commands fail\n\n## Claude Code Setup\n\n### Option 1: Project-Level Configuration\n\nCreate `.claude/settings.json` in your project root:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/error-detector.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Option 2: User-Level Configuration\n\nAdd to `~/.claude/settings.json` for global activation:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"~/.claude/skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Minimal Setup (Activator Only)\n\nFor lower overhead, use only the UserPromptSubmit hook:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Codex CLI Setup\n\nCodex uses the same hook system as Claude Code. Create `.codex/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## GitHub Copilot Setup\n\nCopilot doesn't support hooks directly. Instead, add guidance to `.github/copilot-instructions.md`:\n\n```markdown\n## Self-Improvement\n\nAfter completing tasks that involved:\n- Debugging non-obvious issues\n- Discovering workarounds\n- Learning project-specific patterns\n- Resolving unexpected errors\n\nConsider logging the learning to `.learnings/` using the format from the self-improvement skill.\n\nFor high-value learnings that would benefit other sessions, consider skill extraction.\n```\n\n## Verification\n\n### Test Activator Hook\n\n1. Enable the hook configuration\n2. Start a new Claude Code session\n3. Send any prompt\n4. Verify you see `<self-improvement-reminder>` in the context\n\n### Test Error Detector Hook\n\n1. Enable PostToolUse hook for Bash\n2. Run a command that fails: `ls /nonexistent/path`\n3. Verify you see `<error-detected>` reminder\n\n### Dry Run Extract Script\n\n```bash\n./skills/self-improvement/scripts/extract-skill.sh test-skill --dry-run\n```\n\nExpected output shows the skill scaffold that would be created.\n\n## Troubleshooting\n\n### Hook Not Triggering\n\n1. **Check script permissions**: `chmod +x scripts/*.sh`\n2. **Verify path**: Use absolute paths or paths relative to project root\n3. **Check settings location**: Project vs user-level settings\n4. **Restart session**: Hooks are loaded at session start\n\n### Permission Denied\n\n```bash\nchmod +x ./skills/self-improvement/scripts/activator.sh\nchmod +x ./skills/self-improvement/scripts/error-detector.sh\nchmod +x ./skills/self-improvement/scripts/extract-skill.sh\n```\n\n### Script Not Found\n\nIf using relative paths, ensure you're in the correct directory or use absolute paths:\n\n```json\n{\n  \"command\": \"/absolute/path/to/skills/self-improvement/scripts/activator.sh\"\n}\n```\n\n### Too Much Overhead\n\nIf the activator feels intrusive:\n\n1. **Use minimal setup**: Only UserPromptSubmit, skip PostToolUse\n2. **Add matcher filter**: Only trigger for certain prompts:\n\n```json\n{\n  \"matcher\": \"fix|debug|error|issue\",\n  \"hooks\": [...]\n}\n```\n\n## Hook Output Budget\n\nThe activator is designed to be lightweight:\n- **Target**: ~50-100 tokens per activation\n- **Content**: Structured reminder, not verbose instructions\n- **Format**: XML tags for easy parsing\n\nIf you need to reduce overhead further, you can edit `activator.sh` to output less text.\n\n## Security Considerations\n\n- Hook scripts run with the same permissions as Claude Code\n- Scripts only output text; they don't modify files or run commands\n- Error detector reads `CLAUDE_TOOL_OUTPUT` environment variable\n- Treat `CLAUDE_TOOL_OUTPUT` as potentially sensitive; do not log or forward it verbatim unless the user explicitly wants that detail\n- All scripts are opt-in (you must configure them explicitly)\n- Recommended default: enable `UserPromptSubmit` only, and add `PostToolUse` only when you want error-pattern reminders from command output\n\n## Disabling Hooks\n\nTo temporarily disable without removing configuration:\n\n1. **Comment out in settings**:\n```json\n{\n  \"hooks\": {\n    // \"UserPromptSubmit\": [...]\n  }\n}\n```\n\n2. **Or delete the settings file**: Hooks won't run without configuration\n\nFile v3.0.21:references/openclaw-integration.md\n\n# OpenClaw Integration\n\nComplete setup and usage guide for integrating the self-improvement skill with OpenClaw.\n\n## Overview\n\nOpenClaw uses workspace-based prompt injection combined with event-driven hooks. Context is injected from workspace files at session start, and hooks can trigger on lifecycle events.\n\n## Workspace Structure\n\n```\n~/.openclaw/                      \n├── workspace/                   # Working directory\n│   ├── AGENTS.md               # Multi-agent coordination patterns\n│   ├── SOUL.md                 # Behavioral guidelines and personality\n│   ├── TOOLS.md                # Tool capabilities and gotchas\n│   ├── MEMORY.md               # Long-term memory (main session only)\n│   └── memory/                 # Daily memory files\n│       └── YYYY-MM-DD.md\n├── skills/                      # Installed skills\n│   └── <skill-name>/\n│       └── SKILL.md\n└── hooks/                       # Custom hooks\n    └── <hook-name>/\n        ├── HOOK.md\n        └── handler.ts\n```\n\n## Quick Setup\n\n### 1. Install the Skill\n\n```bash\nclawdhub install self-improving-agent\n```\n\nOr copy manually:\n\n```bash\ncp -r self-improving-agent ~/.openclaw/skills/\n```\n\n### 2. Install the Hook (Optional)\n\nCopy the hook to OpenClaw's hooks directory:\n\n```bash\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improvement\n```\n\nEnable the hook:\n\n```bash\nopenclaw hooks enable self-improvement\n```\n\n### 3. Create Learning Files\n\nCreate the `.learnings/` directory in your workspace:\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nOr in the skill directory:\n\n```bash\nmkdir -p ~/.openclaw/skills/self-improving-agent/.learnings\n```\n\n## Injected Prompt Files\n\n### AGENTS.md\n\nPurpose: Multi-agent workflows and delegation patterns.\n\n```markdown\n# Agent Coordination\n\n## Delegation Rules\n- Use explore agent for open-ended codebase questions\n- Spawn sub-agents for long-running tasks\n- Use sessions_send for cross-session communication\n\n## Session Handoff\nWhen delegating to another session:\n1. Provide full context in the handoff message\n2. Include relevant file paths\n3. Specify expected output format\n```\n\n### SOUL.md\n\nPurpose: Behavioral guidelines and communication style.\n\n```markdown\n# Behavioral Guidelines\n\n## Communication Style\n- Be direct and concise\n- Avoid unnecessary caveats and disclaimers\n- Use technical language appropriate to context\n\n## Error Handling\n- Admit mistakes promptly\n- Provide corrected information immediately\n- Log significant errors to learnings\n```\n\n### TOOLS.md\n\nPurpose: Tool capabilities, integration gotchas, local configuration.\n\n```markdown\n# Tool Knowledge\n\n## Self-Improvement Skill\nLog learnings to `.learnings/` for continuous improvement.\n\n## Local Tools\n- Document tool-specific gotchas here\n- Note authentication requirements\n- Track integration quirks\n```\n\n## Learning Workflow\n\n### Capturing Learnings\n\n1. **In-session**: Log to `.learnings/` as usual\n2. **Cross-session**: Promote to workspace files\n\n### Promotion Decision Tree\n\n```\nIs the learning project-specific?\n├── Yes → Keep in .learnings/\n└── No → Is it behavioral/style-related?\n    ├── Yes → Promote to SOUL.md\n    └── No → Is it tool-related?\n        ├── Yes → Promote to TOOLS.md\n        └── No → Promote to AGENTS.md (workflow)\n```\n\n### Promotion Format Examples\n\n**From learning:**\n> Git push to GitHub fails without auth configured - triggers desktop prompt\n\n**To TOOLS.md:**\n```markdown\n## Git\n- Don't push without confirming auth is configured\n- Use `gh auth status` to check GitHub CLI auth\n```\n\n## Inter-Agent Communication\n\nOpenClaw provides tools for cross-session communication:\n\nUse these only when cross-session sharing is explicitly needed and the environment is trusted. Prefer short sanitized summaries over raw transcripts, command output, or secret-bearing content.\n\n### sessions_list\n\nView active and recent sessions:\n```\nsessions_list(activeMinutes=30, messageLimit=3)\n```\n\n### sessions_history\n\nRead transcript from another session:\n```\nsessions_history(sessionKey=\"session-id\", limit=50)\n```\n\nOnly read another session's transcript when the user explicitly wants shared context or continuation across sessions.\n\n### sessions_send\n\nSend message to another session:\n```\nsessions_send(sessionKey=\"session-id\", message=\"Learning: API requires X-Custom-Header\")\n```\n\nPrefer sending a concise learning summary plus relevant paths rather than forwarding raw transcript content.\n\n### sessions_spawn\n\nSpawn a background sub-agent:\n```\nsessions_spawn(task=\"Research X and report back\", label=\"research\")\n```\n\n## Available Hook Events\n\n| Event | When It Fires |\n|-------|---------------|\n| `agent:bootstrap` | Before workspace files inject |\n| `command:new` | When `/new` command issued |\n| `command:reset` | When `/reset` command issued |\n| `command:stop` | When `/stop` command issued |\n| `gateway:startup` | When gateway starts |\n\n## Detection Triggers\n\n### Standard Triggers\n- User corrections (\"No, that's wrong...\")\n- Command failures (non-zero exit codes)\n- API errors\n- Knowledge gaps\n\n### OpenClaw-Specific Triggers\n\n| Trigger | Action |\n|---------|--------|\n| Tool call error | Log to TOOLS.md with tool name |\n| Session handoff confusion | Log to AGENTS.md with delegation pattern |\n| Model behavior surprise | Log to SOUL.md with expected vs actual |\n| Skill issue | Log to .learnings/ or report upstream |\n\n## Verification\n\nCheck hook is registered:\n\n```bash\nopenclaw hooks list\n```\n\nCheck skill is loaded:\n\n```bash\nopenclaw status\n```\n\n## Troubleshooting\n\n### Hook not firing\n\n1. Ensure hooks enabled in config\n2. Restart gateway after config changes\n3. Check gateway logs for errors\n\n### Learnings not persisting\n\n1. Verify `.learnings/` directory exists\n2. Check file permissions\n3. Ensure workspace path is configured correctly\n\n### Skill not loading\n\n1. Check skill is in skills directory\n2. Verify SKILL.md has correct frontmatter\n3. Run `openclaw status` to see loaded skills\n\nFile v3.0.21:assets/ERRORS.md\n\n# Errors Log\n\nCommand failures, exceptions, and unexpected behaviors.\n\n---\n\nFile v3.0.21:assets/FEATURE_REQUESTS.md\n\n# Feature Requests\n\nCapabilities requested by user that don't currently exist.\n\n---\n\nFile v3.0.21:assets/LEARNINGS.md\n\n# Learnings\n\nCorrections, insights, and knowledge gaps captured during development.\n\n**Categories**: correction | insight | knowledge_gap | best_practice\n**Areas**: frontend | backend | infra | tests | docs | config\n**Statuses**: pending | in_progress | resolved | wont_fix | promoted | promoted_to_skill\n\n## Status Definitions\n\n| Status | Meaning |\n|--------|---------|\n| `pending` | Not yet addressed |\n| `in_progress` | Actively being worked on |\n| `resolved` | Issue fixed or knowledge integrated |\n| `wont_fix` | Decided not to address (reason in Resolution) |\n| `promoted` | Elevated to CLAUDE.md, AGENTS.md, or copilot-instructions.md |\n| `promoted_to_skill` | Extracted as a reusable skill |\n\n## Skill Extraction Fields\n\nWhen a learning is promoted to a skill, add these fields:\n\n```markdown\n**Status**: promoted_to_skill\n**Skill-Path**: skills/skill-name\n```\n\nExample:\n```markdown\n## [LRN-20250115-001] best_practice\n\n**Logged**: 2025-01-15T10:00:00Z\n**Priority**: high\n**Status**: promoted_to_skill\n**Skill-Path**: skills/docker-m1-fixes\n**Area**: infra\n\n### Summary\nDocker build fails on Apple Silicon due to platform mismatch\n...\n```\n\n---\n\nFile v3.0.21:assets/SKILL-TEMPLATE.md\n\n# Skill Template\n\nTemplate for creating skills extracted from learnings. Copy and customize.\n\n---\n\n## SKILL.md Template\n\n```markdown\n---\nname: skill-name-here\ndescription: \"Concise description of when and why to use this skill. Include trigger conditions.\"\n---\n\n# Skill Name\n\nBrief introduction explaining the problem this skill solves and its origin.\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| [Trigger 1] | [Action 1] |\n| [Trigger 2] | [Action 2] |\n\n## Background\n\nWhy this knowledge matters. What problems it prevents. Context from the original learning.\n\n## Solution\n\n### Step-by-Step\n\n1. First step with code or command\n2. Second step\n3. Verification step\n\n### Code Example\n\n\\`\\`\\`language\n// Example code demonstrating the solution\n\\`\\`\\`\n\n## Common Variations\n\n- **Variation A**: Description and how to handle\n- **Variation B**: Description and how to handle\n\n## Gotchas\n\n- Warning or common mistake #1\n- Warning or common mistake #2\n\n## Related\n\n- Link to related documentation\n- Link to related skill\n\n## Source\n\nExtracted from learning entry.\n- **Learning ID**: LRN-YYYYMMDD-XXX\n- **Original Category**: correction | insight | knowledge_gap | best_practice\n- **Extraction Date**: YYYY-MM-DD\n```\n\n---\n\n## Minimal Template\n\nFor simple skills that don't need all sections:\n\n```markdown\n---\nname: skill-name-here\ndescription: \"What this skill does and when to use it.\"\n---\n\n# Skill Name\n\n[Problem statement in one sentence]\n\n## Solution\n\n[Direct solution with code/commands]\n\n## Source\n\n- Learning ID: LRN-YYYYMMDD-XXX\n```\n\n---\n\n## Template with Scripts\n\nFor skills that include executable helpers:\n\n```markdown\n---\nname: skill-name-here\ndescription: \"What this skill does and when to use it.\"\n---\n\n# Skill Name\n\n[Introduction]\n\n## Quick Reference\n\n| Command | Purpose |\n|---------|---------|\n| `./scripts/helper.sh` | [What it does] |\n| `./scripts/validate.sh` | [What it does] |\n\n## Usage\n\n### Automated (Recommended)\n\n\\`\\`\\`bash\n./skills/skill-name/scripts/helper.sh [args]\n\\`\\`\\`\n\n### Manual Steps\n\n1. Step one\n2. Step two\n\n## Scripts\n\n| Script | Description |\n|--------|-------------|\n| `scripts/helper.sh` | Main utility |\n| `scripts/validate.sh` | Validation checker |\n\n## Source\n\n- Learning ID: LRN-YYYYMMDD-XXX\n```\n\n---\n\n## Naming Conventions\n\n- **Skill name**: lowercase, hyphens for spaces\n  - Good: `docker-m1-fixes`, `api-timeout-patterns`\n  - Bad: `Docker_M1_Fixes`, `APITimeoutPatterns`\n\n- **Description**: Start with action verb, mention trigger\n  - Good: \"Handles Docker build failures on Apple Silicon. Use when builds fail with platform mismatch.\"\n  - Bad: \"Docker stuff\"\n\n- **Files**:\n  - `SKILL.md` - Required, main documentation\n  - `scripts/` - Optional, executable code\n  - `references/` - Optional, detailed docs\n  - `assets/` - Optional, templates\n\n---\n\n## Extraction Checklist\n\nBefore creating a skill from a learning:\n\n- [ ] Learning is verified (status: resolved)\n- [ ] Solution is broadly applicable (not one-off)\n- [ ] Content is complete (has all needed context)\n- [ ] Name follows conventions\n- [ ] Description is concise but informative\n- [ ] Quick Reference table is actionable\n- [ ] Code examples are tested\n- [ ] Source learning ID is recorded\n\nAfter creating:\n\n- [ ] Update original learning with `promoted_to_skill` status\n- [ ] Add `Skill-Path: skills/skill-name` to learning metadata\n- [ ] Test skill by reading it in a fresh session\n\nFile v3.0.21:hooks/openclaw/HOOK.md\n\n---\nname: self-improvement\ndescription: \"Injects self-improvement reminder during agent bootstrap\"\nmetadata: {\"openclaw\":{\"emoji\":\"🧠\",\"events\":[\"agent:bootstrap\"]}}\n---\n\n# Self-Improvement Hook\n\nInjects a reminder to evaluate learnings during agent bootstrap.\n\n## What It Does\n\n- Fires on `agent:bootstrap` (before workspace files are injected)\n- Adds a reminder block to check `.learnings/` for relevant entries\n- Prompts the agent to log corrections, errors, and discoveries\n\n## Configuration\n\nNo configuration needed. Enable with:\n\n```bash\nopenclaw hooks enable self-improvement\n```\n\nArchive v3.0.19: 16 files, 26210 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (3357b), hooks/openclaw/handler.ts (3438b), hooks/openclaw/HOOK.md (589b), README.md (378b), references/examples.md (8290b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (20674b), _meta.json (140b)\n\nFile v3.0.19:SKILL.md\n\n---\nname: self-improvement\ndescription: \"Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.\"\nmetadata:\n---\n\n# Self-Improvement Skill\n\nLog learnings and errors to markdown files for continuous improvement. Coding agents can later process these into fixes, and important learnings get promoted to project memory.\n\n## First-Use Initialisation\n\nBefore logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:\n\n```bash\nmkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Learnings\\n\\nCorrections, insights, and knowledge gaps captured during development.\\n\\n**Categories**: correction | insight | knowledge_gap | best_practice\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/ERRORS.md ] || printf \"# Errors\\n\\nCommand failures and integration errors.\\n\\n---\\n\" > .learnings/ERRORS.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Feature Requests\\n\\nCapabilities requested by the user.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md\n```\n\nNever overwrite existing files. This is a no-op if `.learnings/` is already initialised.\n\nDo not log secrets, tokens, private keys, environment variables, or full source/config files unless the user explicitly asks for that level of detail. Prefer short summaries or redacted excerpts over raw command output or full transcripts.\n\nIf you want automatic reminders or setup assistance, use the opt-in hook workflow described in [Hook Integration](#hook-integration).\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| Command/operation fails | Log to `.learnings/ERRORS.md` |\n| User corrects you | Log to `.learnings/LEARNINGS.md` with category `correction` |\n| User wants missing feature | Log to `.learnings/FEATURE_REQUESTS.md` |\n| API/external tool fails | Log to `.learnings/ERRORS.md` with integration details |\n| Knowledge was outdated | Log to `.learnings/LEARNINGS.md` with category `knowledge_gap` |\n| Found better approach | Log to `.learnings/LEARNINGS.md` with category `best_practice` |\n| Simplify/Harden recurring patterns | Log/update `.learnings/LEARNINGS.md` with `Source: simplify-and-harden` and a stable `Pattern-Key` |\n| Similar to existing entry | Link with `**See Also**`, consider priority bump |\n| Broadly applicable learning | Promote to `CLAUDE.md`, `AGENTS.md`, and/or `.github/copilot-instructions.md` |\n| Workflow improvements | Promote to `AGENTS.md` (OpenClaw workspace) |\n| Tool gotchas | Promote to `TOOLS.md` (OpenClaw workspace) |\n| Behavioral patterns | Promote to `SOUL.md` (OpenClaw workspace) |\n\n## OpenClaw Setup (Recommended)\n\nOpenClaw is the primary platform for this skill. It uses workspace-based prompt injection with automatic skill loading.\n\n### Installation\n\n**Via ClawdHub (recommended):**\n```bash\nclawdhub install self-improving-agent\n```\n\n**Manual:**\n```bash\ngit clone https://github.com/peterskoett/self-improving-agent.git ~/.openclaw/skills/self-improving-agent\n```\n\nRemade for openclaw from original repo : https://github.com/pskoett/pskoett-ai-skills - https://github.com/pskoett/pskoett-ai-skills/tree/main/skills/self-improvement\n\n### Workspace Structure\n\nOpenClaw injects these files into every session:\n\n```\n~/.openclaw/workspace/\n├── AGENTS.md          # Multi-agent workflows, delegation patterns\n├── SOUL.md            # Behavioral guidelines, personality, principles\n├── TOOLS.md           # Tool capabilities, integration gotchas\n├── MEMORY.md          # Long-term memory (main session only)\n├── memory/            # Daily memory files\n│   └── YYYY-MM-DD.md\n└── .learnings/        # This skill's log files\n    ├── LEARNINGS.md\n    ├── ERRORS.md\n    └── FEATURE_REQUESTS.md\n```\n\n### Create Learning Files\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nThen create the log files (or copy from `assets/`):\n- `LEARNINGS.md` — corrections, knowledge gaps, best practices\n- `ERRORS.md` — command failures, exceptions\n- `FEATURE_REQUESTS.md` — user-requested capabilities\n\n### Promotion Targets\n\nWhen learnings prove broadly applicable, promote them to workspace files:\n\n| Learning Type | Promote To | Example |\n|---------------|------------|---------|\n| Behavioral patterns | `SOUL.md` | \"Be concise, avoid disclaimers\" |\n| Workflow improvements | `AGENTS.md` | \"Spawn sub-agents for long tasks\" |\n| Tool gotchas | `TOOLS.md` | \"Git push needs auth configured first\" |\n\n### Inter-Session Communication\n\nOpenClaw provides tools to share learnings across sessions:\n\n- **sessions_list** — View active/recent sessions\n- **sessions_history** — Read another session's transcript  \n- **sessions_send** — Send a learning to another session\n- **sessions_spawn** — Spawn a sub-agent for background work\n\nUse these only in trusted environments and only when the user explicitly wants cross-session sharing. Prefer sending a short sanitized summary and relevant file paths, not raw transcripts, secrets, or full command output.\n\n### Optional: Enable Hook\n\nFor automatic reminders at session start:\n\n```bash\n# Copy hook to OpenClaw hooks directory\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improvement\n\n# Enable it\nopenclaw hooks enable self-improvement\n```\n\nSee `references/openclaw-integration.md` for complete details.\n\n---\n\n## Generic Setup (Other Agents)\n\nFor Claude Code, Codex, Copilot, or other agents, create `.learnings/` in the project or workspace root:\n\n```bash\nmkdir -p .learnings\n```\n\nCreate the files inline using the headers shown above. Avoid reading templates from the current repo or workspace unless you explicitly trust that path.\n\n### Add reference to agent files AGENTS.md, CLAUDE.md, or .github/copilot-instructions.md to remind yourself to log learnings. (this is an alternative to hook-based reminders)\n\n#### Self-Improvement Workflow\n\nWhen errors or corrections occur:\n1. Log to `.learnings/ERRORS.md`, `LEARNINGS.md`, or `FEATURE_REQUESTS.md`\n2. Review and promote broadly applicable learnings to:\n   - `CLAUDE.md` - project facts and conventions\n   - `AGENTS.md` - workflows and automation\n   - `.github/copilot-instructions.md` - Copilot context\n\n## Logging Format\n\n### Learning Entry\n\nAppend to `.learnings/LEARNINGS.md`:\n\n```markdown\n## [LRN-YYYYMMDD-XXX] category\n\n**Logged**: ISO-8601 timestamp\n**Priority**: low | medium | high | critical\n**Status**: pending\n**Area**: frontend | backend | infra | tests | docs | config\n\n### Summary\nOne-line description of what was learned\n\n### Details\nFull context: what happened, what was wrong, what's correct\n\n### Suggested Action\nSpecific fix or improvement to make\n\n### Metadata\n- Source: conversation | error | user_feedback\n- Related Files: path/to/file.ext\n- Tags: tag1, tag2\n- See Also: LRN-20250110-001 (if related to existing entry)\n- Pattern-Key: simplify.dead_code | harden.input_validation (optional, for recurring-pattern tracking)\n- Recurrence-Count: 1 (optional)\n- First-Seen: 2025-01-15 (optional)\n- Last-Seen: 2025-01-15 (optional)\n\n---\n```\n\n### Error Entry\n\nAppend to `.learnings/ERRORS.md`:\n\n```markdown\n## [ERR-YYYYMMDD-XXX] skill_or_command_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: high\n**Status**: pending\n**Area**: frontend | backend | infra | tests | docs | config\n\n### Summary\nBrief description of what failed\n\n### Error\n```\nActual error message or output\n```\n\n### Context\n- Command/operation attempted\n- Input or parameters used\n- Environment details if relevant\n- Summary or redacted excerpt of relevant output (avoid full transcripts and secret-bearing data by default)\n\n### Suggested Fix\nIf identifiable, what might resolve this\n\n### Metadata\n- Reproducible: yes | no | unknown\n- Related Files: path/to/file.ext\n- See Also: ERR-20250110-001 (if recurring)\n\n---\n```\n\n### Feature Request Entry\n\nAppend to `.learnings/FEATURE_REQUESTS.md`:\n\n```markdown\n## [FEAT-YYYYMMDD-XXX] capability_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: medium\n**Status**: pending\n**Area**: frontend | backend | infra | tests | docs | config\n\n### Requested Capability\nWhat the user wanted to do\n\n### User Context\nWhy they needed it, what problem they're solving\n\n### Complexity Estimate\nsimple | medium | complex\n\n### Suggested Implementation\nHow this could be built, what it might extend\n\n### Metadata\n- Frequency: first_time | recurring\n- Related Features: existing_feature_name\n\n---\n```\n\n## ID Generation\n\nFormat: `TYPE-YYYYMMDD-XXX`\n- TYPE: `LRN` (learning), `ERR` (error), `FEAT` (feature)\n- YYYYMMDD: Current date\n- XXX: Sequential number or random 3 chars (e.g., `001`, `A7B`)\n\nExamples: `LRN-20250115-001`, `ERR-20250115-A3F`, `FEAT-20250115-002`\n\n## Resolving Entries\n\nWhen an issue is fixed, update the entry:\n\n1. Change `**Status**: pending` → `**Status**: resolved`\n2. Add resolution block after Metadata:\n\n```markdown\n### Resolution\n- **Resolved**: 2025-01-16T09:00:00Z\n- **Commit/PR**: abc123 or #42\n- **Notes**: Brief description of what was done\n```\n\nOther status values:\n- `in_progress` - Actively being worked on\n- `wont_fix` - Decided not to address (add reason in Resolution notes)\n- `promoted` - Elevated to CLAUDE.md, AGENTS.md, or .github/copilot-instructions.md\n\n## Promoting to Project Memory\n\nWhen a learning is broadly applicable (not a one-off fix), promote it to permanent project memory.\n\n### When to Promote\n\n- Learning applies across multiple files/features\n- Knowledge any contributor (human or AI) should know\n- Prevents recurring mistakes\n- Documents project-specific conventions\n\n### Promotion Targets\n\n| Target | What Belongs There |\n|--------|-------------------|\n| `CLAUDE.md` | Project facts, conventions, gotchas for all Claude interactions |\n| `AGENTS.md` | Agent-specific workflows, tool usage patterns, automation rules |\n| `.github/copilot-instructions.md` | Project context and conventions for GitHub Copilot |\n| `SOUL.md` | Behavioral guidelines, communication style, principles (OpenClaw workspace) |\n| `TOOLS.md` | Tool capabilities, usage patterns, integration gotchas (OpenClaw workspace) |\n\n### How to Promote\n\n1. **Distill** the learning into a concise rule or fact\n2. **Add** to appropriate section in target file (create file if needed)\n3. **Update** original entry:\n   - Change `**Status**: pending` → `**Status**: promoted`\n   - Add `**Promoted**: CLAUDE.md`, `AGENTS.md`, or `.github/copilot-instructions.md`\n\n### Promotion Examples\n\n**Learning** (verbose):\n> Project uses pnpm workspaces. Attempted `npm install` but failed. \n> Lock file is `pnpm-lock.yaml`. Must use `pnpm install`.\n\n**In CLAUDE.md** (concise):\n```markdown\n## Build & Dependencies\n- Package manager: pnpm (not npm) - use `pnpm install`\n```\n\n**Learning** (verbose):\n> When modifying API endpoints, must regenerate TypeScript client.\n> Forgetting this causes type mismatches at runtime.\n\n**In AGENTS.md** (actionable):\n```markdown\n## After API Changes\n1. Regenerate client: `pnpm run generate:api`\n2. Check for type errors: `pnpm tsc --noEmit`\n```\n\n## Recurring Pattern Detection\n\nIf logging something similar to an existing entry:\n\n1. **Search first**: `grep -r \"keyword\" .learnings/`\n2. **Link entries**: Add `**See Also**: ERR-20250110-001` in Metadata\n3. **Bump priority** if issue keeps recurring\n4. **Consider systemic fix**: Recurring issues often indicate:\n   - Missing documentation (→ promote to CLAUDE.md or .github/copilot-instructions.md)\n   - Missing automation (→ add to AGENTS.md)\n   - Architectural problem (→ create tech debt ticket)\n\n## Simplify & Harden Feed\n\nUse this workflow to ingest recurring patterns from the `simplify-and-harden`\nskill and turn them into durable prompt guidance.\n\n### Ingestion Workflow\n\n1. Read `simplify_and_harden.learning_loop.candidates` from the task summary.\n2. For each candidate, use `pattern_key` as the stable dedupe key.\n3. Search `.learnings/LEARNINGS.md` for an existing entry with that key:\n   - `grep -n \"Pattern-Key: <pattern_key>\" .learnings/LEARNINGS.md`\n4. If found:\n   - Increment `Recurrence-Count`\n   - Update `Last-Seen`\n   - Add `See Also` links to related entries/tasks\n5. If not found:\n   - Create a new `LRN-...` entry\n   - Set `Source: simplify-and-harden`\n   - Set `Pattern-Key`, `Recurrence-Count: 1`, and `First-Seen`/`Last-Seen`\n\n### Promotion Rule (System Prompt Feedback)\n\nPromote recurring patterns into agent context/system prompt files when all are true:\n\n- `Recurrence-Count >= 3`\n- Seen across at least 2 distinct tasks\n- Occurred within a 30-day window\n\nPromotion targets:\n- `CLAUDE.md`\n- `AGENTS.md`\n- `.github/copilot-instructions.md`\n- `SOUL.md` / `TOOLS.md` for OpenClaw workspace-level guidance when applicable\n\nWrite promoted rules as short prevention rules (what to do before/while coding),\nnot long incident write-ups.\n\n## Periodic Review\n\nReview `.learnings/` at natural breakpoints:\n\n### When to Review\n- Before starting a new major task\n- After completing a feature\n- When working in an area with past learnings\n- Weekly during active development\n\n### Quick Status Check\n```bash\n# Count pending items\ngrep -h \"Status\\*\\*: pending\" .learnings/*.md | wc -l\n\n# List pending high-priority items\ngrep -B5 \"Priority\\*\\*: high\" .learnings/*.md | grep \"^## \\[\"\n\n# Find learnings for a specific area\ngrep -l \"Area\\*\\*: backend\" .learnings/*.md\n```\n\n### Review Actions\n- Resolve fixed items\n- Promote applicable learnings\n- Link related entries\n- Escalate recurring issues\n\n## Detection Triggers\n\nAutomatically log when you notice:\n\n**Corrections** (→ learning with `correction` category):\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"That's outdated...\"\n\n**Feature Requests** (→ feature request):\n- \"Can you also...\"\n- \"I wish you could...\"\n- \"Is there a way to...\"\n- \"Why can't you...\"\n\n**Knowledge Gaps** (→ learning with `knowledge_gap` category):\n- User provides information you didn't know\n- Documentation you referenced is outdated\n- API behavior differs from your understanding\n\n**Errors** (→ error entry):\n- Command returns non-zero exit code\n- Exception or stack trace\n- Unexpected output or behavior\n- Timeout or connection failure\n\n## Priority Guidelines\n\n| Priority | When to Use |\n|----------|-------------|\n| `critical` | Blocks core functionality, data loss risk, security issue |\n| `high` | Significant impact, affects common workflows, recurring issue |\n| `medium` | Moderate impact, workaround exists |\n| `low` | Minor inconvenience, edge case, nice-to-have |\n\n## Area Tags\n\nUse to filter learnings by codebase region:\n\n| Area | Scope |\n|------|-------|\n| `frontend` | UI, components, client-side code |\n| `backend` | API, services, server-side code |\n| `infra` | CI/CD, deployment, Docker, cloud |\n| `tests` | Test files, testing utilities, coverage |\n| `docs` | Documentation, comments, READMEs |\n| `config` | Configuration files, environment, settings |\n\n## Best Practices\n\n1. **Log immediately** - context is freshest right after the issue\n2. **Be specific** - future agents need to understand quickly\n3. **Include reproduction steps** - especially for errors\n4. **Link related files** - makes fixes easier\n5. **Suggest concrete fixes** - not just \"investigate\"\n6. **Use consistent categories** - enables filtering\n7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md\n8. **Review regularly** - stale learnings lose value\n\n## Gitignore Options\n\n**Keep learnings local** (per-developer):\n```gitignore\n.learnings/\n```\n\nThis repo uses that default to avoid committing sensitive or noisy local logs by accident.\n\n**Track learnings in repo** (team-wide):\nDon't add to .gitignore - learnings become shared knowledge.\n\n**Hybrid** (track templates, ignore entries):\n```gitignore\n.learnings/*.md\n!.learnings/.gitkeep\n```\n\n## Hook Integration\n\nEnable automatic reminders through agent hooks. This is **opt-in** - you must explicitly configure hooks.\n\n### Quick Setup (Claude Code / Codex)\n\nCreate `.claude/settings.json` in your project:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n      }]\n    }]\n  }\n}\n```\n\nThis injects a learning evaluation reminder after each prompt (~50-100 tokens overhead).\n\n### Advanced Setup (With Error Detection)\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n      }]\n    }],\n    \"PostToolUse\": [{\n      \"matcher\": \"Bash\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improvement/scripts/error-detector.sh\"\n      }]\n    }]\n  }\n}\n```\n\nThis is optional. The recommended default is activator-only setup; enable `PostToolUse` only if you are comfortable with hook scripts inspecting command output for error patterns.\n\n### Available Hook Scripts\n\n| Script | Hook Type | Purpose |\n|--------|-----------|---------|\n| `scripts/activator.sh` | UserPromptSubmit | Reminds to evaluate learnings after tasks |\n| `scripts/error-detector.sh` | PostToolUse (Bash) | Triggers on command errors |\n\nSee `references/hooks-setup.md` for detailed configuration and troubleshooting.\n\n## Automatic Skill Extraction\n\nWhen a learning is valuable enough to become a reusable skill, extract it using the provided helper.\n\n### Skill Extraction Criteria\n\nA learning qualifies for skill extraction when ANY of these apply:\n\n| Criterion | Description |\n|-----------|-------------|\n| **Recurring** | Has `See Also` links to 2+ similar issues |\n| **Verified** | Status is `resolved` with working fix |\n| **Non-obvious** | Required actual debugging/investigation to discover |\n| **Broadly applicable** | Not project-specific; useful across codebases |\n| **User-flagged** | User says \"save this as a skill\" or similar |\n\n### Extraction Workflow\n\n1. **Identify candidate**: Learning meets extraction criteria\n2. **Run helper** (or create manually):\n   ```bash\n   ./skills/self-improvement/scripts/extract-skill.sh skill-name --dry-run\n   ./skills/self-improvement/scripts/extract-skill.sh skill-name\n   ```\n3. **Customize SKILL.md**: Fill in template with learning content\n4. **Update learning**: Set status to `promoted_to_skill`, add `Skill-Path`\n5. **Verify**: Read skill in fresh session to ensure it's self-contained\n\n### Manual Extraction\n\nIf you prefer manual creation:\n\n1. Create `skills/<skill-name>/SKILL.md`\n2. Use template from `assets/SKILL-TEMPLATE.md`\n3. Follow [Agent Skills spec](https://agentskills.io/specification):\n   - YAML frontmatter with `name` and `description`\n   - Name must match folder name\n   - No README.md inside skill folder\n\n### Extraction Detection Triggers\n\nWatch for these signals that a learning should become a skill:\n\n**In conversation:**\n- \"Save this as a skill\"\n- \"I keep running into this\"\n- \"This would be useful for other projects\"\n- \"Remember this pattern\"\n\n**In learning entries:**\n- Multiple `See Also` links (recurring issue)\n- High priority + resolved status\n- Category: `best_practice` with broad applicability\n- User feedback praising the solution\n\n### Skill Quality Gates\n\nBefore extraction, verify:\n\n- [ ] Solution is tested and working\n- [ ] Description is clear without original context\n- [ ] Code examples are self-contained\n- [ ] No project-specific hardcoded values\n- [ ] Follows skill naming conventions (lowercase, hyphens)\n\n## Multi-Agent Support\n\nThis skill works across different AI coding agents with agent-specific activation.\n\n### Claude Code\n\n**Activation**: Hooks (UserPromptSubmit, PostToolUse)\n**Setup**: `.claude/settings.json` with hook configuration\n**Detection**: Automatic via hook scripts\n\n### Codex CLI\n\n**Activation**: Hooks (same pattern as Claude Code)\n**Setup**: `.codex/settings.json` with hook configuration\n**Detection**: Automatic via hook scripts\n\n### GitHub Copilot\n\n**Activation**: Manual (no hook support)\n**Setup**: Add to `.github/copilot-instructions.md`:\n\n```markdown\n## Self-Improvement\n\nAfter solving non-obvious issues, consider logging to `.learnings/`:\n1. Use format from self-improvement skill\n2. Link related entries with See Also\n3. Promote high-value learnings to skills\n\nAsk in chat: \"Should I log this as a learning?\"\n```\n\n**Detection**: Manual review at session end\n\nFile v3.0.19:README.md\n\n# self-improvement\n\nSelf-improvement skill for OpenClaw. It captures learnings, errors, and feature requests to support continuous improvement across sessions.\n\n## Attribution\n\nRemade for OpenClaw from the original repo:\n\n- https://github.com/pskoett/pskoett-ai-skills\n- https://github.com/pskoett/pskoett-ai-skills/tree/main/skills/self-improvement\n\n## Main File\n\n- `SKILL.md`\n\nFile v3.0.19:_meta.json\n\n{\n  \"ownerId\": \"kn70cjr952qdec1nx70zs6wefn7ynq2t\",\n  \"slug\": \"self-improving-agent\",\n  \"version\": \"3.0.19\",\n  \"publishedAt\": 1777615213738\n}\n\nFile v3.0.19:references/examples.md\n\n# Entry Examples\n\nConcrete examples of well-formatted entries with all fields.\n\n## Learning: Correction\n\n```markdown\n## [LRN-20250115-001] correction\n\n**Logged**: 2025-01-15T10:30:00Z\n**Priority**: high\n**Status**: pending\n**Area**: tests\n\n### Summary\nIncorrectly assumed pytest fixtures are scoped to function by default\n\n### Details\nWhen writing test fixtures, I assumed all fixtures were function-scoped. \nUser corrected that while function scope is the default, the codebase \nconvention uses module-scoped fixtures for database connections to \nimprove test performance.\n\n### Suggested Action\nWhen creating fixtures that involve expensive setup (DB, network), \ncheck existing fixtures for scope patterns before defaulting to function scope.\n\n### Metadata\n- Source: user_feedback\n- Related Files: tests/conftest.py\n- Tags: pytest, testing, fixtures\n\n---\n```\n\n## Learning: Knowledge Gap (Resolved)\n\n```markdown\n## [LRN-20250115-002] knowledge_gap\n\n**Logged**: 2025-01-15T14:22:00Z\n**Priority**: medium\n**Status**: resolved\n**Area**: config\n\n### Summary\nProject uses pnpm not npm for package management\n\n### Details\nAttempted to run `npm install` but project uses pnpm workspaces.\nLock file is `pnpm-lock.yaml`, not `package-lock.json`.\n\n### Suggested Action\nCheck for `pnpm-lock.yaml` or `pnpm-workspace.yaml` before assuming npm.\nUse `pnpm install` for this project.\n\n### Metadata\n- Source: error\n- Related Files: pnpm-lock.yaml, pnpm-workspace.yaml\n- Tags: package-manager, pnpm, setup\n\n### Resolution\n- **Resolved**: 2025-01-15T14:30:00Z\n- **Commit/PR**: N/A - knowledge update\n- **Notes**: Added to CLAUDE.md for future reference\n\n---\n```\n\n## Learning: Promoted to CLAUDE.md\n\n```markdown\n## [LRN-20250115-003] best_practice\n\n**Logged**: 2025-01-15T16:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: CLAUDE.md\n**Area**: backend\n\n### Summary\nAPI responses must include correlation ID from request headers\n\n### Details\nAll API responses should echo back the X-Correlation-ID header from \nthe request. This is required for distributed tracing. Responses \nwithout this header break the observability pipeline.\n\n### Suggested Action\nAlways include correlation ID passthrough in API handlers.\n\n### Metadata\n- Source: user_feedback\n- Related Files: src/middleware/correlation.ts\n- Tags: api, observability, tracing\n\n---\n```\n\n## Learning: Promoted to AGENTS.md\n\n```markdown\n## [LRN-20250116-001] best_practice\n\n**Logged**: 2025-01-16T09:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: AGENTS.md\n**Area**: backend\n\n### Summary\nMust regenerate API client after OpenAPI spec changes\n\n### Details\nWhen modifying API endpoints, the TypeScript client must be regenerated.\nForgetting this causes type mismatches that only appear at runtime.\nThe generate script also runs validation.\n\n### Suggested Action\nAdd to agent workflow: after any API changes, run `pnpm run generate:api`.\n\n### Metadata\n- Source: error\n- Related Files: openapi.yaml, src/client/api.ts\n- Tags: api, codegen, typescript\n\n---\n```\n\n## Error Entry\n\n```markdown\n## [ERR-20250115-A3F] docker_build\n\n**Logged**: 2025-01-15T09:15:00Z\n**Priority**: high\n**Status**: pending\n**Area**: infra\n\n### Summary\nDocker build fails on M1 Mac due to platform mismatch\n\n### Error\n```\nerror: failed to solve: python:3.11-slim: no match for platform linux/arm64\n```\n\n### Context\n- Command: `docker build -t myapp .`\n- Dockerfile uses `FROM python:3.11-slim`\n- Running on Apple Silicon (M1/M2)\n\n### Suggested Fix\nAdd platform flag: `docker build --platform linux/amd64 -t myapp .`\nOr update Dockerfile: `FROM --platform=linux/amd64 python:3.11-slim`\n\n### Metadata\n- Reproducible: yes\n- Related Files: Dockerfile\n\n---\n```\n\n## Error Entry: Recurring Issue\n\n```markdown\n## [ERR-20250120-B2C] api_timeout\n\n**Logged**: 2025-01-20T11:30:00Z\n**Priority**: critical\n**Status**: pending\n**Area**: backend\n\n### Summary\nThird-party API timeout during request processing\n\n### Error\n```\nTimeoutError: Request to api.example.com timed out after 30000ms\n```\n\n### Context\n- Command: POST /api/process\n- Timeout set to 30s\n- Occurs during peak hours (lunch, evening)\n\n### Suggested Fix\nImplement retry with exponential backoff. Consider circuit breaker pattern.\n\n### Metadata\n- Reproducible: yes (during peak hours)\n- Related Files: src/services/api-client.ts\n- See Also: ERR-20250115-X1Y, ERR-20250118-Z3W\n\n---\n```\n\n## Feature Request\n\n```markdown\n## [FEAT-20250115-001] export_to_csv\n\n**Logged**: 2025-01-15T16:45:00Z\n**Priority**: medium\n**Status**: pending\n**Area**: backend\n\n### Requested Capability\nExport analysis results to CSV format\n\n### User Context\nUser runs weekly reports and needs to share results with non-technical \nstakeholders in Excel. Currently copies output manually.\n\n### Complexity Estimate\nsimple\n\n### Suggested Implementation\nAdd `--output csv` flag to the analyze command. Use standard csv module.\nCould extend existing `--output json` pattern.\n\n### Metadata\n- Frequency: recurring\n- Related Features: analyze command, json output\n\n---\n```\n\n## Feature Request: Resolved\n\n```markdown\n## [FEAT-20250110-002] dark_mode\n\n**Logged**: 2025-01-10T14:00:00Z\n**Priority**: low\n**Status**: resolved\n**Area**: frontend\n\n### Requested Capability\nDark mode support for the dashboard\n\n### User Context\nUser works late hours and finds the bright interface straining.\nSeveral other users have mentioned this informally.\n\n### Complexity Estimate\nmedium\n\n### Suggested Implementation\nUse CSS variables for colors. Add toggle in user settings.\nConsider system preference detection.\n\n### Metadata\n- Frequency: recurring\n- Related Features: user settings, theme system\n\n### Resolution\n- **Resolved**: 2025-01-18T16:00:00Z\n- **Commit/PR**: #142\n- **Notes**: Implemented with system preference detection and manual toggle\n\n---\n```\n\n## Learning: Promoted to Skill\n\n```markdown\n## [LRN-20250118-001] best_practice\n\n**Logged**: 2025-01-18T11:00:00Z\n**Priority**: high\n**Status**: promoted_to_skill\n**Skill-Path**: skills/docker-m1-fixes\n**Area**: infra\n\n### Summary\nDocker build fails on Apple Silicon due to platform mismatch\n\n### Details\nWhen building Docker images on M1/M2 Macs, the build fails because\nthe base image doesn't have an ARM64 variant. This is a common issue\nthat affects many developers.\n\n### Suggested Action\nAdd `--platform linux/amd64` to docker build command, or use\n`FROM --platform=linux/amd64` in Dockerfile.\n\n### Metadata\n- Source: error\n- Related Files: Dockerfile\n- Tags: docker, arm64, m1, apple-silicon\n- See Also: ERR-20250115-A3F, ERR-20250117-B2D\n\n---\n```\n\n## Extracted Skill Example\n\nWhen the above learning is extracted as a skill, it becomes:\n\n**File**: `skills/docker-m1-fixes/SKILL.md`\n\n```markdown\n---\nname: docker-m1-fixes\ndescription: \"Fixes Docker build failures on Apple Silicon (M1/M2). Use when docker build fails with platform mismatch errors.\"\n---\n\n# Docker M1 Fixes\n\nSolutions for Docker build issues on Apple Silicon Macs.\n\n## Quick Reference\n\n| Error | Fix |\n|-------|-----|\n| `no match for platform linux/arm64` | Add `--platform linux/amd64` to build |\n| Image runs but crashes | Use emulation or find ARM-compatible base |\n\n## The Problem\n\nMany Docker base images don't have ARM64 variants. When building on\nApple Silicon (M1/M2/M3), Docker attempts to pull ARM64 images by\ndefault, causing platform mismatch errors.\n\n## Solutions\n\n### Option 1: Build Flag (Recommended)\n\nAdd platform flag to your build command:\n\n\\`\\`\\`bash\ndocker build --platform linux/amd64 -t myapp .\n\\`\\`\\`\n\n### Option 2: Dockerfile Modification\n\nSpecify platform in the FROM instruction:\n\n\\`\\`\\`dockerfile\nFROM --platform=linux/amd64 python:3.11-slim\n\\`\\`\\`\n\n### Option 3: Docker Compose\n\nAdd platform to your service:\n\n\\`\\`\\`yaml\nservices:\n  app:\n    platform: linux/amd64\n    build: .\n\\`\\`\\`\n\n## Trade-offs\n\n| Approach | Pros | Cons |\n|----------|------|------|\n| Build flag | No file changes | Must remember flag |\n| Dockerfile | Explicit, versioned | Affects all builds |\n| Compose | Convenient for dev | Requires compose |\n\n## Performance Note\n\nRunning AMD64 images on ARM64 uses Rosetta 2 emulation. This works\nfor development but may be slower. For production, find ARM-native\nalternatives when possible.\n\n## Source\n\n- Learning ID: LRN-20250118-001\n- Category: best_practice\n- Extraction Date: 2025-01-18\n```\n\nFile v3.0.19:references/hooks-setup.md\n\n# Hook Setup Guide\n\nConfigure automatic self-improvement triggers for AI coding agents.\n\n## Overview\n\nHooks enable proactive learning capture by injecting reminders at key moments:\n- **UserPromptSubmit**: Reminder after each prompt to evaluate learnings\n- **PostToolUse (Bash)**: Error detection when commands fail\n\n## Claude Code Setup\n\n### Option 1: Project-Level Configuration\n\nCreate `.claude/settings.json` in your project root:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/error-detector.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Option 2: User-Level Configuration\n\nAdd to `~/.claude/settings.json` for global activation:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"~/.claude/skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Minimal Setup (Activator Only)\n\nFor lower overhead, use only the UserPromptSubmit hook:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Codex CLI Setup\n\nCodex uses the same hook system as Claude Code. Create `.codex/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## GitHub Copilot Setup\n\nCopilot doesn't support hooks directly. Instead, add guidance to `.github/copilot-instructions.md`:\n\n```markdown\n## Self-Improvement\n\nAfter completing tasks that involved:\n- Debugging non-obvious issues\n- Discovering workarounds\n- Learning project-specific patterns\n- Resolving unexpected errors\n\nConsider logging the learning to `.learnings/` using the format from the self-improvement skill.\n\nFor high-value learnings that would benefit other sessions, consider skill extraction.\n```\n\n## Verification\n\n### Test Activator Hook\n\n1. Enable the hook configuration\n2. Start a new Claude Code session\n3. Send any prompt\n4. Verify you see `<self-improvement-reminder>` in the context\n\n### Test Error Detector Hook\n\n1. Enable PostToolUse hook for Bash\n2. Run a command that fails: `ls /nonexistent/path`\n3. Verify you see `<error-detected>` reminder\n\n### Dry Run Extract Script\n\n```bash\n./skills/self-improvement/scripts/extract-skill.sh test-skill --dry-run\n```\n\nExpected output shows the skill scaffold that would be created.\n\n## Troubleshooting\n\n### Hook Not Triggering\n\n1. **Check script permissions**: `chmod +x scripts/*.sh`\n2. **Verify path**: Use absolute paths or paths relative to project root\n3. **Check settings location**: Project vs user-level settings\n4. **Restart session**: Hooks are loaded at session start\n\n### Permission Denied\n\n```bash\nchmod +x ./skills/self-improvement/scripts/activator.sh\nchmod +x ./skills/self-improvement/scripts/error-detector.sh\nchmod +x ./skills/self-improvement/scripts/extract-skill.sh\n```\n\n### Script Not Found\n\nIf using relative paths, ensure you're in the correct directory or use absolute paths:\n\n```json\n{\n  \"command\": \"/absolute/path/to/skills/self-improvement/scripts/activator.sh\"\n}\n```\n\n### Too Much Overhead\n\nIf the activator feels intrusive:\n\n1. **Use minimal setup**: Only UserPromptSubmit, skip PostToolUse\n2. **Add matcher filter**: Only trigger for certain prompts:\n\n```json\n{\n  \"matcher\": \"fix|debug|error|issue\",\n  \"hooks\": [...]\n}\n```\n\n## Hook Output Budget\n\nThe activator is designed to be lightweight:\n- **Target**: ~50-100 tokens per activation\n- **Content**: Structured reminder, not verbose instructions\n- **Format**: XML tags for easy parsing\n\nIf you need to reduce overhead further, you can edit `activator.sh` to output less text.\n\n## Security Considerations\n\n- Hook scripts run with the same permissions as Claude Code\n- Scripts only output text; they don't modify files or run commands\n- Error detector reads `CLAUDE_TOOL_OUTPUT` environment variable\n- Treat `CLAUDE_TOOL_OUTPUT` as potentially sensitive; do not log or forward it verbatim unless the user explicitly wants that detail\n- All scripts are opt-in (you must configure them explicitly)\n- Recommended default: enable `UserPromptSubmit` only, and add `PostToolUse` only when you want error-pattern reminders from command output\n\n## Disabling Hooks\n\nTo temporarily disable without removing configuration:\n\n1. **Comment out in settings**:\n```json\n{\n  \"hooks\": {\n    // \"UserPromptSubmit\": [...]\n  }\n}\n```\n\n2. **Or delete the settings file**: Hooks won't run without configuration\n\nFile v3.0.19:references/openclaw-integration.md\n\n# OpenClaw Integration\n\nComplete setup and usage guide for integrating the self-improvement skill with OpenClaw.\n\n## Overview\n\nOpenClaw uses workspace-based prompt injection combined with event-driven hooks. Context is injected from workspace files at session start, and hooks can trigger on lifecycle events.\n\n## Workspace Structure\n\n```\n~/.openclaw/                      \n├── workspace/                   # Working directory\n│   ├── AGENTS.md               # Multi-agent coordination patterns\n│   ├── SOUL.md                 # Behavioral guidelines and personality\n│   ├── TOOLS.md                # Tool capabilities and gotchas\n│   ├── MEMORY.md               # Long-term memory (main session only)\n│   └── memory/                 # Daily memory files\n│       └── YYYY-MM-DD.md\n├── skills/                      # Installed skills\n│   └── <skill-name>/\n│       └── SKILL.md\n└── hooks/                       # Custom hooks\n    └── <hook-name>/\n        ├── HOOK.md\n        └── handler.ts\n```\n\n## Quick Setup\n\n### 1. Install the Skill\n\n```bash\nclawdhub install self-improving-agent\n```\n\nOr copy manually:\n\n```bash\ncp -r self-improving-agent ~/.openclaw/skills/\n```\n\n### 2. Install the Hook (Optional)\n\nCopy the hook to OpenClaw's hooks directory:\n\n```bash\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improvement\n```\n\nEnable the hook:\n\n```bash\nopenclaw hooks enable self-improvement\n```\n\n### 3. Create Learning Files\n\nCreate the `.learnings/` directory in your workspace:\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nOr in the skill directory:\n\n```bash\nmkdir -p ~/.openclaw/skills/self-improving-agent/.learnings\n```\n\n## Injected Prompt Files\n\n### AGENTS.md\n\nPurpose: Multi-agent workflows and delegation patterns.\n\n```markdown\n# Agent Coordination\n\n## Delegation Rules\n- Use explore agent for open-ended codebase questions\n- Spawn sub-agents for long-running tasks\n- Use sessions_send for cross-session communication\n\n## Session Handoff\nWhen delegating to another session:\n1. Provide full context in the handoff message\n2. Include relevant file paths\n3. Specify expected output format\n```\n\n### SOUL.md\n\nPurpose: Behavioral guidelines and communication style.\n\n```markdown\n# Behavioral Guidelines\n\n## Communication Style\n- Be direct and concise\n- Avoid unnecessary caveats and disclaimers\n- Use technical language appropriate to context\n\n## Error Handling\n- Admit mistakes promptly\n- Provide corrected information immediately\n- Log significant errors to learnings\n```\n\n### TOOLS.md\n\nPurpose: Tool capabilities, integration gotchas, local configuration.\n\n```markdown\n# Tool Knowledge\n\n## Self-Improvement Skill\nLog learnings to `.learnings/` for continuous improvement.\n\n## Local Tools\n- Document tool-specific gotchas here\n- Note authentication requirements\n- Track integration quirks\n```\n\n## Learning Workflow\n\n### Capturing Learnings\n\n1. **In-session**: Log to `.learnings/` as usual\n2. **Cross-session**: Promote to workspace files\n\n### Promotion Decision Tree\n\n```\nIs the learning project-specific?\n├── Yes → Keep in .learnings/\n└── No → Is it behavioral/style-related?\n    ├── Yes → Promote to SOUL.md\n    └── No → Is it tool-related?\n        ├── Yes → Promote to TOOLS.md\n        └── No → Promote to AGENTS.md (workflow)\n```\n\n### Promotion Format Examples\n\n**From learning:**\n> Git push to GitHub fails without auth configured - triggers desktop prompt\n\n**To TOOLS.md:**\n```markdown\n## Git\n- Don't push without confirming auth is configured\n- Use `gh auth status` to check GitHub CLI auth\n```\n\n## Inter-Agent Communication\n\nOpenClaw provides tools for cross-session communication:\n\nUse these only when cross-session sharing is explicitly needed and the environment is trusted. Prefer short sanitized summaries over raw transcripts, command output, or secret-bearing content.\n\n### sessions_list\n\nView active and recent sessions:\n```\nsessions_list(activeMinutes=30, messageLimit=3)\n```\n\n### sessions_history\n\nRead transcript from another session:\n```\nsessions_history(sessionKey=\"session-id\", limit=50)\n```\n\nOnly read another session's transcript when the user explicitly wants shared context or continuation across sessions.\n\n### sessions_send\n\nSend message to another session:\n```\nsessions_send(sessionKey=\"session-id\", message=\"Learning: API requires X-Custom-Header\")\n```\n\nPrefer sending a concise learning summary plus relevant paths rather than forwarding raw transcript content.\n\n### sessions_spawn\n\nSpawn a background sub-agent:\n```\nsessions_spawn(task=\"Research X and report back\", label=\"research\")\n```\n\n## Available Hook Events\n\n| Event | When It Fires |\n|-------|---------------|\n| `agent:bootstrap` | Before workspace files inject |\n| `command:new` | When `/new` command issued |\n| `command:reset` | When `/reset` command issued |\n| `command:stop` | When `/stop` command issued |\n| `gateway:startup` | When gateway starts |\n\n## Detection Triggers\n\n### Standard Triggers\n- User corrections (\"No, that's wrong...\")\n- Command failures (non-zero exit codes)\n- API errors\n- Knowledge gaps\n\n### OpenClaw-Specific Triggers\n\n| Trigger | Action |\n|---------|--------|\n| Tool call error | Log to TOOLS.md with tool name |\n| Session handoff confusion | Log to AGENTS.md with delegation pattern |\n| Model behavior surprise | Log to SOUL.md with expected vs actual |\n| Skill issue | Log to .learnings/ or report upstream |\n\n## Verification\n\nCheck hook is registered:\n\n```bash\nopenclaw hooks list\n```\n\nCheck skill is loaded:\n\n```bash\nopenclaw status\n```\n\n## Troubleshooting\n\n### Hook not firing\n\n1. Ensure hooks enabled in config\n2. Restart gateway after config changes\n3. Check gateway logs for errors\n\n### Learnings not persisting\n\n1. Verify `.learnings/` directory exists\n2. Check file permissions\n3. Ensure workspace path is configured correctly\n\n### Skill not loading\n\n1. Check skill is in skills directory\n2. Verify SKILL.md has correct frontmatter\n3. Run `openclaw status` to see loaded skills\n\nFile v3.0.19:assets/ERRORS.md\n\n# Errors Log\n\nCommand failures, exceptions, and unexpected behaviors.\n\n---\n\nFile v3.0.19:assets/FEATURE_REQUESTS.md\n\n# Feature Requests\n\nCapabilities requested by user that don't currently exist.\n\n---\n\nFile v3.0.19:assets/LEARNINGS.md\n\n# Learnings\n\nCorrections, insights, and knowledge gaps captured during development.\n\n**Categories**: correction | insight | knowledge_gap | best_practice\n**Areas**: frontend | backend | infra | tests | docs | config\n**Statuses**: pending | in_progress | resolved | wont_fix | promoted | promoted_to_skill\n\n## Status Definitions\n\n| Status | Meaning |\n|--------|---------|\n| `pending` | Not yet addressed |\n| `in_progress` | Actively being worked on |\n| `resolved` | Issue fixed or knowledge integrated |\n| `wont_fix` | Decided not to address (reason in Resolution) |\n| `promoted` | Elevated to CLAUDE.md, AGENTS.md, or copilot-instructions.md |\n| `promoted_to_skill` | Extracted as a reusable skill |\n\n## Skill Extraction Fields\n\nWhen a learning is promoted to a skill, add these fields:\n\n```markdown\n**Status**: promoted_to_skill\n**Skill-Path**: skills/skill-name\n```\n\nExample:\n```markdown\n## [LRN-20250115-001] best_practice\n\n**Logged**: 2025-01-15T10:00:00Z\n**Priority**: high\n**Status**: promoted_to_skill\n**Skill-Path**: skills/docker-m1-fixes\n**Area**: infra\n\n### Summary\nDocker build fails on Apple Silicon due to platform mismatch\n...\n```\n\n---\n\nFile v3.0.19:assets/SKILL-TEMPLATE.md\n\n# Skill Template\n\nTemplate for creating skills extracted from learnings. Copy and customize.\n\n---\n\n## SKILL.md Template\n\n```markdown\n---\nname: skill-name-here\ndescription: \"Concise description of when and why to use this skill. Include trigger conditions.\"\n---\n\n# Skill Name\n\nBrief introduction explaining the problem this skill solves and its origin.\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| [Trigger 1] | [Action 1] |\n| [Trigger 2] | [Action 2] |\n\n## Background\n\nWhy this knowledge matters. What problems it prevents. Context from the original learning.\n\n## Solution\n\n### Step-by-Step\n\n1. First step with code or command\n2. Second step\n3. Verification step\n\n### Code Example\n\n\\`\\`\\`language\n// Example code demonstrating the solution\n\\`\\`\\`\n\n## Common Variations\n\n- **Variation A**: Description and how to handle\n- **Variation B**: Description and how to handle\n\n## Gotchas\n\n- Warning or common mistake #1\n- Warning or common mistake #2\n\n## Related\n\n- Link to related documentation\n- Link to related skill\n\n## Source\n\nExtracted from learning entry.\n- **Learning ID**: LRN-YYYYMMDD-XXX\n- **Original Category**: correction | insight | knowledge_gap | best_practice\n- **Extraction Date**: YYYY-MM-DD\n```\n\n---\n\n## Minimal Template\n\nFor simple skills that don't need all sections:\n\n```markdown\n---\nname: skill-name-here\ndescription: \"What this skill does and when to use it.\"\n---\n\n# Skill Name\n\n[Problem statement in one sentence]\n\n## Solution\n\n[Direct solution with code/commands]\n\n## Source\n\n- Learning ID: LRN-YYYYMMDD-XXX\n```\n\n---\n\n## Template with Scripts\n\nFor skills that include executable helpers:\n\n```markdown\n---\nname: skill-name-here\ndescription: \"What this skill does and when to use it.\"\n---\n\n# Skill Name\n\n[Introduction]\n\n## Quick Reference\n\n| Command | Purpose |\n|---------|---------|\n| `./scripts/helper.sh` | [What it does] |\n| `./scripts/validate.sh` | [What it does] |\n\n## Usage\n\n### Automated (Recommended)\n\n\\`\\`\\`bash\n./skills/skill-name/scripts/helper.sh [args]\n\\`\\`\\`\n\n### Manual Steps\n\n1. Step one\n2. Step two\n\n## Scripts\n\n| Script | Description |\n|--------|-------------|\n| `scripts/helper.sh` | Main utility |\n| `scripts/validate.sh` | Validation checker |\n\n## Source\n\n- Learning ID: LRN-YYYYMMDD-XXX\n```\n\n---\n\n## Naming Conventions\n\n- **Skill name**: lowercase, hyphens for spaces\n  - Good: `docker-m1-fixes`, `api-timeout-patterns`\n  - Bad: `Docker_M1_Fixes`, `APITimeoutPatterns`\n\n- **Description**: Start with action verb, mention trigger\n  - Good: \"Handles Docker build failures on Apple Silicon. Use when builds fail with platform mismatch.\"\n  - Bad: \"Docker stuff\"\n\n- **Files**:\n  - `SKILL.md` - Required, main documentation\n  - `scripts/` - Optional, executable code\n  - `references/` - Optional, detailed docs\n  - `assets/` - Optional, templates\n\n---\n\n## Extraction Checklist\n\nBefore creating a skill from a learning:\n\n- [ ] Learning is verified (status: resolved)\n- [ ] Solution is broadly applicable (not one-off)\n- [ ] Content is complete (has all needed context)\n- [ ] Name follows conventions\n- [ ] Description is concise but informative\n- [ ] Quick Reference table is actionable\n- [ ] Code examples are tested\n- [ ] Source learning ID is recorded\n\nAfter creating:\n\n- [ ] Update original learning with `promoted_to_skill` status\n- [ ] Add `Skill-Path: skills/skill-name` to learning metadata\n- [ ] Test skill by reading it in a fresh session\n\nFile v3.0.19:hooks/openclaw/HOOK.md\n\n---\nname: self-improvement\ndescription: \"Injects self-improvement reminder during agent bootstrap\"\nmetadata: {\"openclaw\":{\"emoji\":\"🧠\",\"events\":[\"agent:bootstrap\"]}}\n---\n\n# Self-Improvement Hook\n\nInjects a reminder to evaluate learnings during agent bootstrap.\n\n## What It Does\n\n- Fires on `agent:bootstrap` (before workspace files are injected)\n- Adds a reminder block to check `.learnings/` for relevant entries\n- Prompts the agent to log corrections, errors, and discoveries\n\n## Configuration\n\nNo configuration needed. Enable with:\n\n```bash\nopenclaw hooks enable self-improvement\n```\n\nArchive v3.0.18: 16 files, 26210 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (3357b), hooks/openclaw/handler.ts (3438b), hooks/openclaw/HOOK.md (589b), README.md (378b), references/examples.md (8290b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (20674b), _meta.json (140b)\n\nFile v3.0.18:SKILL.md\n\n---\nname: self-improvement\ndescription: \"Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.\"\nmetadata:\n---\n\n# Self-Improvement Skill\n\nLog learnings and errors to markdown files for continuous improvement. Coding agents can later process these into fixes, and important learnings get promoted to project memory.\n\n## First-Use Initialisation\n\nBefore logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:\n\n```bash\nmkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Learnings\\n\\nCorrections, insights, and knowledge gaps captured during development.\\n\\n**Categories**: correction | insight | knowledge_gap | best_practice\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/ERRORS.md ] || printf \"# Errors\\n\\nCommand failures and integration errors.\\n\\n---\\n\" > .learnings/ERRORS.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Feature Requests\\n\\nCapabilities requested by the user.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md\n```\n\nNever overwrite existing files. This is a no-op if `.learnings/` is already initialised.\n\nDo not log secrets, tokens, private keys, environment variables, or full source/config files unless the user explicitly asks for that level of detail. Prefer short summaries or redacted excerpts over raw command output or full transcripts.\n\nIf you want automatic reminders or setup assistance, use the opt-in hook workflow described in [Hook Integration](#hook-integration).\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| Command/operation fails | Log to `.learnings/ERRORS.md` |\n| User corrects you | Log to `.learnings/LEARNINGS.md` with category `correction` |\n| User wants missing feature | Log to `.learnings/FEATURE_REQUESTS.md` |\n| API/external tool fails | Log to `.learnings/ERRORS.md` with integration details |\n| Knowledge was outdated | Log to `.learnings/LEARNINGS.md` with category `knowledge_gap` |\n| Found better approach | Log to `.learnings/LEARNINGS.md` with category `best_practice` |\n| Simplify/Harden recurring patterns | Log/update `.learnings/LEARNINGS.md` with `Source: simplify-and-harden` and a stable `Pattern-Key` |\n| Similar to existing entry | Link with `**See Also**`, consider priority bump |\n| Broadly applicable learning | Promote to `CLAUDE.md`, `AGENTS.md`, and/or `.github/copilot-instructions.md` |\n| Workflow improvements | Promote to `AGENTS.md` (OpenClaw workspace) |\n| Tool gotchas | Promote to `TOOLS.md` (OpenClaw workspace) |\n| Behavioral patterns | Promote to `SOUL.md` (OpenClaw workspace) |\n\n## OpenClaw Setup (Recommended)\n\nOpenClaw is the primary platform for this skill. It uses workspace-based prompt injection with automatic skill loading.\n\n### Installation\n\n**Via ClawdHub (recommended):**\n```bash\nclawdhub install self-improving-agent\n```\n\n**Manual:**\n```bash\ngit clone https://github.com/peterskoett/self-improving-agent.git ~/.openclaw/skills/self-improving-agent\n```\n\nRemade for openclaw from original repo : https://github.com/pskoett/pskoett-ai-skills - https://github.com/pskoett/pskoett-ai-skills/tree/main/skills/self-improvement\n\n### Workspace Structure\n\nOpenClaw injects these files into every session:\n\n```\n~/.openclaw/workspace/\n├── AGENTS.md          # Multi-agent workflows, delegation patterns\n├── SOUL.md            # Behavioral guidelines, personality, principles\n├── TOOLS.md           # Tool capabilities, integration gotchas\n├── MEMORY.md          # Long-term memory (main session only)\n├── memory/            # Daily memory files\n│   └── YYYY-MM-DD.md\n└── .learnings/        # This skill's log files\n    ├── LEARNINGS.md\n    ├── ERRORS.md\n    └── FEATURE_REQUESTS.md\n```\n\n### Create Learning Files\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nThen create the log files (or copy from `assets/`):\n- `LEARNINGS.md` — corrections, knowledge gaps, best practices\n- `ERRORS.md` — command failures, exceptions\n- `FEATURE_REQUESTS.md` — user-requested capabilities\n\n### Promotion Targets\n\nWhen learnings prove broadly applicable, promote them to workspace files:\n\n| Learning Type | Promote To | Example |\n|---------------|------------|---------|\n| Behavioral patterns | `SOUL.md` | \"Be concise, avoid disclaimers\" |\n| Workflow improvements | `AGENTS.md` | \"Spawn sub-agents for long tasks\" |\n| Tool gotchas | `TOOLS.md` | \"Git push needs auth configured first\" |\n\n### Inter-Session Communication\n\nOpenClaw provides tools to share learnings across sessions:\n\n- **sessions_list** — View active/recent sessions\n- **sessions_history** — Read another session's transcript  \n- **sessions_send** — Send a learning to another session\n- **sessions_spawn** — Spawn a sub-agent for background work\n\nUse these only in trusted environments and only when the user explicitly wants cross-session sharing. Prefer sending a short sanitized summary and relevant file paths, not raw transcripts, secrets, or full command output.\n\n### Optional: Enable Hook\n\nFor automatic reminders at session start:\n\n```bash\n# Copy hook to OpenClaw hooks directory\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improvement\n\n# Enable it\nopenclaw hooks enable self-improvement\n```\n\nSee `references/openclaw-integration.md` for complete details.\n\n---\n\n## Generic Setup (Other Agents)\n\nFor Claude Code, Codex, Copilot, or other agents, create `.learnings/` in the project or workspace root:\n\n```bash\nmkdir -p .learnings\n```\n\nCreate the files inline using the headers shown above. Avoid reading templates from the current repo or workspace unless you explicitly trust that path.\n\n### Add reference to agent files AGENTS.md, CLAUDE.md, or .github/copilot-instructions.md to remind yourself to log learnings. (this is an alternative to hook-based reminders)\n\n#### Self-Improvement Workflow\n\nWhen errors or corrections occur:\n1. Log to `.learnings/ERRORS.md`, `LEARNINGS.md`, or `FEATURE_REQUESTS.md`\n2. Review and promote broadly applicable learnings to:\n   - `CLAUDE.md` - project facts and conventions\n   - `AGENTS.md` - workflows and automation\n   - `.github/copilot-instructions.md` - Copilot context\n\n## Logging Format\n\n### Learning Entry\n\nAppend to `.learnings/LEARNINGS.md`:\n\n```markdown\n## [LRN-YYYYMMDD-XXX] category\n\n**Logged**: ISO-8601 timestamp\n**Priority**: low | medium | high | critical\n**Status**: pending\n**Area**: frontend | backend | infra | tests | docs | config\n\n### Summary\nOne-line description of what was learned\n\n### Details\nFull context: what happened, what was wrong, what's correct\n\n### Suggested Action\nSpecific fix or improvement to make\n\n### Metadata\n- Source: conversation | error | user_feedback\n- Related Files: path/to/file.ext\n- Tags: tag1, tag2\n- See Also: LRN-20250110-001 (if related to existing entry)\n- Pattern-Key: simplify.dead_code | harden.input_validation (optional, for recurring-pattern tracking)\n- Recurrence-Count: 1 (optional)\n- First-Seen: 2025-01-15 (optional)\n- Last-Seen: 2025-01-15 (optional)\n\n---\n```\n\n### Error Entry\n\nAppend to `.learnings/ERRORS.md`:\n\n```markdown\n## [ERR-YYYYMMDD-XXX] skill_or_command_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: high\n**Status**: pending\n**Area**: frontend | backend | infra | tests | docs | config\n\n### Summary\nBrief description of what failed\n\n### Error\n```\nActual error message or output\n```\n\n### Context\n- Command/operation attempted\n- Input or parameters used\n- Environment details if relevant\n- Summary or redacted excerpt of relevant output (avoid full transcripts and secret-bearing data by default)\n\n### Suggested Fix\nIf identifiable, what might resolve this\n\n### Metadata\n- Reproducible: yes | no | unknown\n- Related Files: path/to/file.ext\n- See Also: ERR-20250110-001 (if recurring)\n\n---\n```\n\n### Feature Request Entry\n\nAppend to `.learnings/FEATURE_REQUESTS.md`:\n\n```markdown\n## [FEAT-YYYYMMDD-XXX] capability_name\n\n**Logged**: ISO-8601 timestamp\n**Priority**: medium\n**Status**: pending\n**Area**: frontend | backend | infra | tests | docs | config\n\n### Requested Capability\nWhat the user wanted to do\n\n### User Context\nWhy they needed it, what problem they're solving\n\n### Complexity Estimate\nsimple | medium | complex\n\n### Suggested Implementation\nHow this could be built, what it might extend\n\n### Metadata\n- Frequency: first_time | recurring\n- Related Features: existing_feature_name\n\n---\n```\n\n## ID Generation\n\nFormat: `TYPE-YYYYMMDD-XXX`\n- TYPE: `LRN` (learning), `ERR` (error), `FEAT` (feature)\n- YYYYMMDD: Current date\n- XXX: Sequential number or random 3 chars (e.g., `001`, `A7B`)\n\nExamples: `LRN-20250115-001`, `ERR-20250115-A3F`, `FEAT-20250115-002`\n\n## Resolving Entries\n\nWhen an issue is fixed, update the entry:\n\n1. Change `**Status**: pending` → `**Status**: resolved`\n2. Add resolution block after Metadata:\n\n```markdown\n### Resolution\n- **Resolved**: 2025-01-16T09:00:00Z\n- **Commit/PR**: abc123 or #42\n- **Notes**: Brief description of what was done\n```\n\nOther status values:\n- `in_progress` - Actively being worked on\n- `wont_fix` - Decided not to address (add reason in Resolution notes)\n- `promoted` - Elevated to CLAUDE.md, AGENTS.md, or .github/copilot-instructions.md\n\n## Promoting to Project Memory\n\nWhen a learning is broadly applicable (not a one-off fix), promote it to permanent project memory.\n\n### When to Promote\n\n- Learning applies across multiple files/features\n- Knowledge any contributor (human or AI) should know\n- Prevents recurring mistakes\n- Documents project-specific conventions\n\n### Promotion Targets\n\n| Target | What Belongs There |\n|--------|-------------------|\n| `CLAUDE.md` | Project facts, conventions, gotchas for all Claude interactions |\n| `AGENTS.md` | Agent-specific workflows, tool usage patterns, automation rules |\n| `.github/copilot-instructions.md` | Project context and conventions for GitHub Copilot |\n| `SOUL.md` | Behavioral guidelines, communication style, principles (OpenClaw workspace) |\n| `TOOLS.md` | Tool capabilities, usage patterns, integration gotchas (OpenClaw workspace) |\n\n### How to Promote\n\n1. **Distill** the learning into a concise rule or fact\n2. **Add** to appropriate section in target file (create file if needed)\n3. **Update** original entry:\n   - Change `**Status**: pending` → `**Status**: promoted`\n   - Add `**Promoted**: CLAUDE.md`, `AGENTS.md`, or `.github/copilot-instructions.md`\n\n### Promotion Examples\n\n**Learning** (verbose):\n> Project uses pnpm workspaces. Attempted `npm install` but failed. \n> Lock file is `pnpm-lock.yaml`. Must use `pnpm install`.\n\n**In CLAUDE.md** (concise):\n```markdown\n## Build & Dependencies\n- Package manager: pnpm (not npm) - use `pnpm install`\n```\n\n**Learning** (verbose):\n> When modifying API endpoints, must regenerate TypeScript client.\n> Forgetting this causes type mismatches at runtime.\n\n**In AGENTS.md** (actionable):\n```markdown\n## After API Changes\n1. Regenerate client: `pnpm run generate:api`\n2. Check for type errors: `pnpm tsc --noEmit`\n```\n\n## Recurring Pattern Detection\n\nIf logging something similar to an existing entry:\n\n1. **Search first**: `grep -r \"keyword\" .learnings/`\n2. **Link entries**: Add `**See Also**: ERR-20250110-001` in Metadata\n3. **Bump priority** if issue keeps recurring\n4. **Consider systemic fix**: Recurring issues often indicate:\n   - Missing documentation (→ promote to CLAUDE.md or .github/copilot-instructions.md)\n   - Missing automation (→ add to AGENTS.md)\n   - Architectural problem (→ create tech debt ticket)\n\n## Simplify & Harden Feed\n\nUse this workflow to ingest recurring patterns from the `simplify-and-harden`\nskill and turn them into durable prompt guidance.\n\n### Ingestion Workflow\n\n1. Read `simplify_and_harden.learning_loop.candidates` from the task summary.\n2. For each candidate, use `pattern_key` as the stable dedupe key.\n3. Search `.learnings/LEARNINGS.md` for an existing entry with that key:\n   - `grep -n \"Pattern-Key: <pattern_key>\" .learnings/LEARNINGS.md`\n4. If found:\n   - Increment `Recurrence-Count`\n   - Update `Last-Seen`\n   - Add `See Also` links to related entries/tasks\n5. If not found:\n   - Create a new `LRN-...` entry\n   - Set `Source: simplify-and-harden`\n   - Set `Pattern-Key`, `Recurrence-Count: 1`, and `First-Seen`/`Last-Seen`\n\n### Promotion Rule (System Prompt Feedback)\n\nPromote recurring patterns into agent context/system prompt files when all are true:\n\n- `Recurrence-Count >= 3`\n- Seen across at least 2 distinct tasks\n- Occurred within a 30-day window\n\nPromotion targets:\n- `CLAUDE.md`\n- `AGENTS.md`\n- `.github/copilot-instructions.md`\n- `SOUL.md` / `TOOLS.md` for OpenClaw workspace-level guidance when applicable\n\nWrite promoted rules as short prevention rules (what to do before/while coding),\nnot long incident write-ups.\n\n## Periodic Review\n\nReview `.learnings/` at natural breakpoints:\n\n### When to Review\n- Before starting a new major task\n- After completing a feature\n- When working in an area with past learnings\n- Weekly during active development\n\n### Quick Status Check\n```bash\n# Count pending items\ngrep -h \"Status\\*\\*: pending\" .learnings/*.md | wc -l\n\n# List pending high-priority items\ngrep -B5 \"Priority\\*\\*: high\" .learnings/*.md | grep \"^## \\[\"\n\n# Find learnings for a specific area\ngrep -l \"Area\\*\\*: backend\" .learnings/*.md\n```\n\n### Review Actions\n- Resolve fixed items\n- Promote applicable learnings\n- Link related entries\n- Escalate recurring issues\n\n## Detection Triggers\n\nAutomatically log when you notice:\n\n**Corrections** (→ learning with `correction` category):\n- \"No, that's not right...\"\n- \"Actually, it should be...\"\n- \"You're wrong about...\"\n- \"That's outdated...\"\n\n**Feature Requests** (→ feature request):\n- \"Can you also...\"\n- \"I wish you could...\"\n- \"Is there a way to...\"\n- \"Why can't you...\"\n\n**Knowledge Gaps** (→ learning with `knowledge_gap` category):\n- User provides information you didn't know\n- Documentation you referenced is outdated\n- API behavior differs from your understanding\n\n**Errors** (→ error entry):\n- Command returns non-zero exit code\n- Exception or stack trace\n- Unexpected output or behavior\n- Timeout or connection failure\n\n## Priority Guidelines\n\n| Priority | When to Use |\n|----------|-------------|\n| `critical` | Blocks core functionality, data loss risk, security issue |\n| `high` | Significant impact, affects common workflows, recurring issue |\n| `medium` | Moderate impact, workaround exists |\n| `low` | Minor inconvenience, edge case, nice-to-have |\n\n## Area Tags\n\nUse to filter learnings by codebase region:\n\n| Area | Scope |\n|------|-------|\n| `frontend` | UI, components, client-side code |\n| `backend` | API, services, server-side code |\n| `infra` | CI/CD, deployment, Docker, cloud |\n| `tests` | Test files, testing utilities, coverage |\n| `docs` | Documentation, comments, READMEs |\n| `config` | Configuration files, environment, settings |\n\n## Best Practices\n\n1. **Log immediately** - context is freshest right after the issue\n2. **Be specific** - future agents need to understand quickly\n3. **Include reproduction steps** - especially for errors\n4. **Link related files** - makes fixes easier\n5. **Suggest concrete fixes** - not just \"investigate\"\n6. **Use consistent categories** - enables filtering\n7. **Promote aggressively** - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md\n8. **Review regularly** - stale learnings lose value\n\n## Gitignore Options\n\n**Keep learnings local** (per-developer):\n```gitignore\n.learnings/\n```\n\nThis repo uses that default to avoid committing sensitive or noisy local logs by accident.\n\n**Track learnings in repo** (team-wide):\nDon't add to .gitignore - learnings become shared knowledge.\n\n**Hybrid** (track templates, ignore entries):\n```gitignore\n.learnings/*.md\n!.learnings/.gitkeep\n```\n\n## Hook Integration\n\nEnable automatic reminders through agent hooks. This is **opt-in** - you must explicitly configure hooks.\n\n### Quick Setup (Claude Code / Codex)\n\nCreate `.claude/settings.json` in your project:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n      }]\n    }]\n  }\n}\n```\n\nThis injects a learning evaluation reminder after each prompt (~50-100 tokens overhead).\n\n### Advanced Setup (With Error Detection)\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [{\n      \"matcher\": \"\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n      }]\n    }],\n    \"PostToolUse\": [{\n      \"matcher\": \"Bash\",\n      \"hooks\": [{\n        \"type\": \"command\",\n        \"command\": \"./skills/self-improvement/scripts/error-detector.sh\"\n      }]\n    }]\n  }\n}\n```\n\nThis is optional. The recommended default is activator-only setup; enable `PostToolUse` only if you are comfortable with hook scripts inspecting command output for error patterns.\n\n### Available Hook Scripts\n\n| Script | Hook Type | Purpose |\n|--------|-----------|---------|\n| `scripts/activator.sh` | UserPromptSubmit | Reminds to evaluate learnings after tasks |\n| `scripts/error-detector.sh` | PostToolUse (Bash) | Triggers on command errors |\n\nSee `references/hooks-setup.md` for detailed configuration and troubleshooting.\n\n## Automatic Skill Extraction\n\nWhen a learning is valuable enough to become a reusable skill, extract it using the provided helper.\n\n### Skill Extraction Criteria\n\nA learning qualifies for skill extraction when ANY of these apply:\n\n| Criterion | Description |\n|-----------|-------------|\n| **Recurring** | Has `See Also` links to 2+ similar issues |\n| **Verified** | Status is `resolved` with working fix |\n| **Non-obvious** | Required actual debugging/investigation to discover |\n| **Broadly applicable** | Not project-specific; useful across codebases |\n| **User-flagged** | User says \"save this as a skill\" or similar |\n\n### Extraction Workflow\n\n1. **Identify candidate**: Learning meets extraction criteria\n2. **Run helper** (or create manually):\n   ```bash\n   ./skills/self-improvement/scripts/extract-skill.sh skill-name --dry-run\n   ./skills/self-improvement/scripts/extract-skill.sh skill-name\n   ```\n3. **Customize SKILL.md**: Fill in template with learning content\n4. **Update learning**: Set status to `promoted_to_skill`, add `Skill-Path`\n5. **Verify**: Read skill in fresh session to ensure it's self-contained\n\n### Manual Extraction\n\nIf you prefer manual creation:\n\n1. Create `skills/<skill-name>/SKILL.md`\n2. Use template from `assets/SKILL-TEMPLATE.md`\n3. Follow [Agent Skills spec](https://agentskills.io/specification):\n   - YAML frontmatter with `name` and `description`\n   - Name must match folder name\n   - No README.md inside skill folder\n\n### Extraction Detection Triggers\n\nWatch for these signals that a learning should become a skill:\n\n**In conversation:**\n- \"Save this as a skill\"\n- \"I keep running into this\"\n- \"This would be useful for other projects\"\n- \"Remember this pattern\"\n\n**In learning entries:**\n- Multiple `See Also` links (recurring issue)\n- High priority + resolved status\n- Category: `best_practice` with broad applicability\n- User feedback praising the solution\n\n### Skill Quality Gates\n\nBefore extraction, verify:\n\n- [ ] Solution is tested and working\n- [ ] Description is clear without original context\n- [ ] Code examples are self-contained\n- [ ] No project-specific hardcoded values\n- [ ] Follows skill naming conventions (lowercase, hyphens)\n\n## Multi-Agent Support\n\nThis skill works across different AI coding agents with agent-specific activation.\n\n### Claude Code\n\n**Activation**: Hooks (UserPromptSubmit, PostToolUse)\n**Setup**: `.claude/settings.json` with hook configuration\n**Detection**: Automatic via hook scripts\n\n### Codex CLI\n\n**Activation**: Hooks (same pattern as Claude Code)\n**Setup**: `.codex/settings.json` with hook configuration\n**Detection**: Automatic via hook scripts\n\n### GitHub Copilot\n\n**Activation**: Manual (no hook support)\n**Setup**: Add to `.github/copilot-instructions.md`:\n\n```markdown\n## Self-Improvement\n\nAfter solving non-obvious issues, consider logging to `.learnings/`:\n1. Use format from self-improvement skill\n2. Link related entries with See Also\n3. Promote high-value learnings to skills\n\nAsk in chat: \"Should I log this as a learning?\"\n```\n\n**Detection**: Manual review at session end\n\nFile v3.0.18:README.md\n\n# self-improvement\n\nSelf-improvement skill for OpenClaw. It captures learnings, errors, and feature requests to support continuous improvement across sessions.\n\n## Attribution\n\nRemade for OpenClaw from the original repo:\n\n- https://github.com/pskoett/pskoett-ai-skills\n- https://github.com/pskoett/pskoett-ai-skills/tree/main/skills/self-improvement\n\n## Main File\n\n- `SKILL.md`\n\nFile v3.0.18:_meta.json\n\n{\n  \"ownerId\": \"kn70cjr952qdec1nx70zs6wefn7ynq2t\",\n  \"slug\": \"self-improving-agent\",\n  \"version\": \"3.0.18\",\n  \"publishedAt\": 1777125562039\n}\n\nFile v3.0.18:references/examples.md\n\n# Entry Examples\n\nConcrete examples of well-formatted entries with all fields.\n\n## Learning: Correction\n\n```markdown\n## [LRN-20250115-001] correction\n\n**Logged**: 2025-01-15T10:30:00Z\n**Priority**: high\n**Status**: pending\n**Area**: tests\n\n### Summary\nIncorrectly assumed pytest fixtures are scoped to function by default\n\n### Details\nWhen writing test fixtures, I assumed all fixtures were function-scoped. \nUser corrected that while function scope is the default, the codebase \nconvention uses module-scoped fixtures for database connections to \nimprove test performance.\n\n### Suggested Action\nWhen creating fixtures that involve expensive setup (DB, network), \ncheck existing fixtures for scope patterns before defaulting to function scope.\n\n### Metadata\n- Source: user_feedback\n- Related Files: tests/conftest.py\n- Tags: pytest, testing, fixtures\n\n---\n```\n\n## Learning: Knowledge Gap (Resolved)\n\n```markdown\n## [LRN-20250115-002] knowledge_gap\n\n**Logged**: 2025-01-15T14:22:00Z\n**Priority**: medium\n**Status**: resolved\n**Area**: config\n\n### Summary\nProject uses pnpm not npm for package management\n\n### Details\nAttempted to run `npm install` but project uses pnpm workspaces.\nLock file is `pnpm-lock.yaml`, not `package-lock.json`.\n\n### Suggested Action\nCheck for `pnpm-lock.yaml` or `pnpm-workspace.yaml` before assuming npm.\nUse `pnpm install` for this project.\n\n### Metadata\n- Source: error\n- Related Files: pnpm-lock.yaml, pnpm-workspace.yaml\n- Tags: package-manager, pnpm, setup\n\n### Resolution\n- **Resolved**: 2025-01-15T14:30:00Z\n- **Commit/PR**: N/A - knowledge update\n- **Notes**: Added to CLAUDE.md for future reference\n\n---\n```\n\n## Learning: Promoted to CLAUDE.md\n\n```markdown\n## [LRN-20250115-003] best_practice\n\n**Logged**: 2025-01-15T16:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: CLAUDE.md\n**Area**: backend\n\n### Summary\nAPI responses must include correlation ID from request headers\n\n### Details\nAll API responses should echo back the X-Correlation-ID header from \nthe request. This is required for distributed tracing. Responses \nwithout this header break the observability pipeline.\n\n### Suggested Action\nAlways include correlation ID passthrough in API handlers.\n\n### Metadata\n- Source: user_feedback\n- Related Files: src/middleware/correlation.ts\n- Tags: api, observability, tracing\n\n---\n```\n\n## Learning: Promoted to AGENTS.md\n\n```markdown\n## [LRN-20250116-001] best_practice\n\n**Logged**: 2025-01-16T09:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: AGENTS.md\n**Area**: backend\n\n### Summary\nMust regenerate API client after OpenAPI spec changes\n\n### Details\nWhen modifying API endpoints, the TypeScript client must be regenerated.\nForgetting this causes type mismatches that only appear at runtime.\nThe generate script also runs validation.\n\n### Suggested Action\nAdd to agent workflow: after any API changes, run `pnpm run generate:api`.\n\n### Metadata\n- Source: error\n- Related Files: openapi.yaml, src/client/api.ts\n- Tags: api, codegen, typescript\n\n---\n```\n\n## Error Entry\n\n```markdown\n## [ERR-20250115-A3F] docker_build\n\n**Logged**: 2025-01-15T09:15:00Z\n**Priority**: high\n**Status**: pending\n**Area**: infra\n\n### Summary\nDocker build fails on M1 Mac due to platform mismatch\n\n### Error\n```\nerror: failed to solve: python:3.11-slim: no match for platform linux/arm64\n```\n\n### Context\n- Command: `docker build -t myapp .`\n- Dockerfile uses `FROM python:3.11-slim`\n- Running on Apple Silicon (M1/M2)\n\n### Suggested Fix\nAdd platform flag: `docker build --platform linux/amd64 -t myapp .`\nOr update Dockerfile: `FROM --platform=linux/amd64 python:3.11-slim`\n\n### Metadata\n- Reproducible: yes\n- Related Files: Dockerfile\n\n---\n```\n\n## Error Entry: Recurring Issue\n\n```markdown\n## [ERR-20250120-B2C] api_timeout\n\n**Logged**: 2025-01-20T11:30:00Z\n**Priority**: critical\n**Status**: pending\n**Area**: backend\n\n### Summary\nThird-party API timeout during request processing\n\n### Error\n```\nTimeoutError: Request to api.example.com timed out after 30000ms\n```\n\n### Context\n- Command: POST /api/process\n- Timeout set to 30s\n- Occurs during peak hours (lunch, evening)\n\n### Suggested Fix\nImplement retry with exponential backoff. Consider circuit breaker pattern.\n\n### Metadata\n- Reproducible: yes (during peak hours)\n- Related Files: src/services/api-client.ts\n- See Also: ERR-20250115-X1Y, ERR-20250118-Z3W\n\n---\n```\n\n## Feature Request\n\n```markdown\n## [FEAT-20250115-001] export_to_csv\n\n**Logged**: 2025-01-15T16:45:00Z\n**Priority**: medium\n**Status**: pending\n**Area**: backend\n\n### Requested Capability\nExport analysis results to CSV format\n\n### User Context\nUser runs weekly reports and needs to share results with non-technical \nstakeholders in Excel. Currently copies output manually.\n\n### Complexity Estimate\nsimple\n\n### Suggested Implementation\nAdd `--output csv` flag to the analyze command. Use standard csv module.\nCould extend existing `--output json` pattern.\n\n### Metadata\n- Frequency: recurring\n- Related Features: analyze command, json output\n\n---\n```\n\n## Feature Request: Resolved\n\n```markdown\n## [FEAT-20250110-002] dark_mode\n\n**Logged**: 2025-01-10T14:00:00Z\n**Priority**: low\n**Status**: resolved\n**Area**: frontend\n\n### Requested Capability\nDark mode support for the dashboard\n\n### User Context\nUser works late hours and finds the bright interface straining.\nSeveral other users have mentioned this informally.\n\n### Complexity Estimate\nmedium\n\n### Suggested Implementation\nUse CSS variables for colors. Add toggle in user settings.\nConsider system preference detection.\n\n### Metadata\n- Frequency: recurring\n- Related Features: user settings, theme system\n\n### Resolution\n- **Resolved**: 2025-01-18T16:00:00Z\n- **Commit/PR**: #142\n- **Notes**: Implemented with system preference detection and manual toggle\n\n---\n```\n\n## Learning: Promoted to Skill\n\n```markdown\n## [LRN-20250118-001] best_practice\n\n**Logged**: 2025-01-18T11:00:00Z\n**Priority**: high\n**Status**: promoted_to_skill\n**Skill-Path**: skills/docker-m1-fixes\n**Area**: infra\n\n### Summary\nDocker build fails on Apple Silicon due to platform mismatch\n\n### Details\nWhen building Docker images on M1/M2 Macs, the build fails because\nthe base image doesn't have an ARM64 variant. This is a common issue\nthat affects many developers.\n\n### Suggested Action\nAdd `--platform linux/amd64` to docker build command, or use\n`FROM --platform=linux/amd64` in Dockerfile.\n\n### Metadata\n- Source: error\n- Related Files: Dockerfile\n- Tags: docker, arm64, m1, apple-silicon\n- See Also: ERR-20250115-A3F, ERR-20250117-B2D\n\n---\n```\n\n## Extracted Skill Example\n\nWhen the above learning is extracted as a skill, it becomes:\n\n**File**: `skills/docker-m1-fixes/SKILL.md`\n\n```markdown\n---\nname: docker-m1-fixes\ndescription: \"Fixes Docker build failures on Apple Silicon (M1/M2). Use when docker build fails with platform mismatch errors.\"\n---\n\n# Docker M1 Fixes\n\nSolutions for Docker build issues on Apple Silicon Macs.\n\n## Quick Reference\n\n| Error | Fix |\n|-------|-----|\n| `no match for platform linux/arm64` | Add `--platform linux/amd64` to build |\n| Image runs but crashes | Use emulation or find ARM-compatible base |\n\n## The Problem\n\nMany Docker base images don't have ARM64 variants. When building on\nApple Silicon (M1/M2/M3), Docker attempts to pull ARM64 images by\ndefault, causing platform mismatch errors.\n\n## Solutions\n\n### Option 1: Build Flag (Recommended)\n\nAdd platform flag to your build command:\n\n\\`\\`\\`bash\ndocker build --platform linux/amd64 -t myapp .\n\\`\\`\\`\n\n### Option 2: Dockerfile Modification\n\nSpecify platform in the FROM instruction:\n\n\\`\\`\\`dockerfile\nFROM --platform=linux/amd64 python:3.11-slim\n\\`\\`\\`\n\n### Option 3: Docker Compose\n\nAdd platform to your service:\n\n\\`\\`\\`yaml\nservices:\n  app:\n    platform: linux/amd64\n    build: .\n\\`\\`\\`\n\n## Trade-offs\n\n| Approach | Pros | Cons |\n|----------|------|------|\n| Build flag | No file changes | Must remember flag |\n| Dockerfile | Explicit, versioned | Affects all builds |\n| Compose | Convenient for dev | Requires compose |\n\n## Performance Note\n\nRunning AMD64 images on ARM64 uses Rosetta 2 emulation. This works\nfor development but may be slower. For production, find ARM-native\nalternatives when possible.\n\n## Source\n\n- Learning ID: LRN-20250118-001\n- Category: best_practice\n- Extraction Date: 2025-01-18\n```\n\nFile v3.0.18:references/hooks-setup.md\n\n# Hook Setup Guide\n\nConfigure automatic self-improvement triggers for AI coding agents.\n\n## Overview\n\nHooks enable proactive learning capture by injecting reminders at key moments:\n- **UserPromptSubmit**: Reminder after each prompt to evaluate learnings\n- **PostToolUse (Bash)**: Error detection when commands fail\n\n## Claude Code Setup\n\n### Option 1: Project-Level Configuration\n\nCreate `.claude/settings.json` in your project root:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/error-detector.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Option 2: User-Level Configuration\n\nAdd to `~/.claude/settings.json` for global activation:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"~/.claude/skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Minimal Setup (Activator Only)\n\nFor lower overhead, use only the UserPromptSubmit hook:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Codex CLI Setup\n\nCodex uses the same hook system as Claude Code. Create `.codex/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## GitHub Copilot Setup\n\nCopilot doesn't support hooks directly. Instead, add guidance to `.github/copilot-instructions.md`:\n\n```markdown\n## Self-Improvement\n\nAfter completing tasks that involved:\n- Debugging non-obvious issues\n- Discovering workarounds\n- Learning project-specific patterns\n- Resolving unexpected errors\n\nConsider logging the learning to `.learnings/` using the format from the self-improvement skill.\n\nFor high-value learnings that would benefit other sessions, consider skill extraction.\n```\n\n## Verification\n\n### Test Activator Hook\n\n1. Enable the hook configuration\n2. Start a new Claude Code session\n3. Send any prompt\n4. Verify you see `<self-improvement-reminder>` in the context\n\n### Test Error Detector Hook\n\n1. Enable PostToolUse hook for Bash\n2. Run a command that fails: `ls /nonexistent/path`\n3. Verify you see `<error-detected>` reminder\n\n### Dry Run Extract Script\n\n```bash\n./skills/self-improvement/scripts/extract-skill.sh test-skill --dry-run\n```\n\nExpected output shows the skill scaffold that would be created.\n\n## Troubleshooting\n\n### Hook Not Triggering\n\n1. **Check script permissions**: `chmod +x scripts/*.sh`\n2. **Verify path**: Use absolute paths or paths relative to project root\n3. **Check settings location**: Project vs user-level settings\n4. **Restart session**: Hooks are loaded at session start\n\n### Permission Denied\n\n```bash\nchmod +x ./skills/self-improvement/scripts/activator.sh\nchmod +x ./skills/self-improvement/scripts/error-detector.sh\nchmod +x ./skills/self-improvement/scripts/extract-skill.sh\n```\n\n### Script Not Found\n\nIf using relative paths, ensure you're in the correct directory or use absolute paths:\n\n```json\n{\n  \"command\": \"/absolute/path/to/skills/self-improvement/scripts/activator.sh\"\n}\n```\n\n### Too Much Overhead\n\nIf the activator feels intrusive:\n\n1. **Use minimal setup**: Only UserPromptSubmit, skip PostToolUse\n2. **Add matcher filter**: Only trigger for certain prompts:\n\n```json\n{\n  \"matcher\": \"fix|debug|error|issue\",\n  \"hooks\": [...]\n}\n```\n\n## Hook Output Budget\n\nThe activator is designed to be lightweight:\n- **Target**: ~50-100 tokens per activation\n- **Content**: Structured reminder, not verbose instructions\n- **Format**: XML tags for easy parsing\n\nIf you need to reduce overhead further, you can edit `activator.sh` to output less text.\n\n## Security Considerations\n\n- Hook scripts run with the same permissions as Claude Code\n- Scripts only output text; they don't modify files or run commands\n- Error detector reads `CLAUDE_TOOL_OUTPUT` environment variable\n- Treat `CLAUDE_TOOL_OUTPUT` as potentially sensitive; do not log or forward it verbatim unless the user explicitly wants that detail\n- All scripts are opt-in (you must configure them explicitly)\n- Recommended default: enable `UserPromptSubmit` only, and add `PostToolUse` only when you want error-pattern reminders from command output\n\n## Disabling Hooks\n\nTo temporarily disable without removing configuration:\n\n1. **Comment out in settings**:\n```json\n{\n  \"hooks\": {\n    // \"UserPromptSubmit\": [...]\n  }\n}\n```\n\n2. **Or delete the settings file**: Hooks won't run without configuration\n\nFile v3.0.18:references/openclaw-integration.md\n\n# OpenClaw Integration\n\nComplete setup and usage guide for integrating the self-improvement skill with OpenClaw.\n\n## Overview\n\nOpenClaw uses workspace-based prompt injection combined with event-driven hooks. Context is injected from workspace files at session start, and hooks can trigger on lifecycle events.\n\n## Workspace Structure\n\n```\n~/.openclaw/                      \n├── workspace/                   # Working directory\n│   ├── AGENTS.md               # Multi-agent coordination patterns\n│   ├── SOUL.md                 # Behavioral guidelines and personality\n│   ├── TOOLS.md                # Tool capabilities and gotchas\n│   ├── MEMORY.md               # Long-term memory (main session only)\n│   └── memory/                 # Daily memory files\n│       └── YYYY-MM-DD.md\n├── skills/                      # Installed skills\n│   └── <skill-name>/\n│       └── SKILL.md\n└── hooks/                       # Custom hooks\n    └── <hook-name>/\n        ├── HOOK.md\n        └── handler.ts\n```\n\n## Quick Setup\n\n### 1. Install the Skill\n\n```bash\nclawdhub install self-improving-agent\n```\n\nOr copy manually:\n\n```bash\ncp -r self-improving-agent ~/.openclaw/skills/\n```\n\n### 2. Install the Hook (Optional)\n\nCopy the hook to OpenClaw's hooks directory:\n\n```bash\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improvement\n```\n\nEnable the hook:\n\n```bash\nopenclaw hooks enable self-improvement\n```\n\n### 3. Create Learning Files\n\nCreate the `.learnings/` directory in your workspace:\n\n```bash\nmkdir -p ~/.openclaw/workspace/.learnings\n```\n\nOr in the skill directory:\n\n```bash\nmkdir -p ~/.openclaw/skills/self-improving-agent/.learnings\n```\n\n## Injected Prompt Files\n\n### AGENTS.md\n\nPurpose: Multi-agent workflows and delegation patterns.\n\n```markdown\n# Agent Coordination\n\n## Delegation Rules\n- Use explore agent for open-ended codebase questions\n- Spawn sub-agents for long-running tasks\n- Use sessions_send for cross-session communication\n\n## Session Handoff\nWhen delegating to another session:\n1. Provide full context in the handoff message\n2. Include relevant file paths\n3. Specify expected output format\n```\n\n### SOUL.md\n\nPurpose: Behavioral guidelines and communication style.\n\n```markdown\n# Behavioral Guidelines\n\n## Communication Style\n- Be direct and concise\n- Avoid unnecessary caveats and disclaimers\n- Use technical language appropriate to context\n\n## Error Handling\n- Admit mistakes promptly\n- Provide corrected information immediately\n- Log significant errors to learnings\n```\n\n### TOOLS.md\n\nPurpose: Tool capabilities, integration gotchas, local configuration.\n\n```markdown\n# Tool Knowledge\n\n## Self-Improvement Skill\nLog learnings to `.learnings/` for continuous improvement.\n\n## Local Tools\n- Document tool-specific gotchas here\n- Note authentication requirements\n- Track integration quirks\n```\n\n## Learning Workflow\n\n### Capturing Learnings\n\n1. **In-session**: Log to `.learnings/` as usual\n2. **Cross-session**: Promote to workspace files\n\n### Promotion Decision Tree\n\n```\nIs the learning project-specific?\n├── Yes → Keep in .learnings/\n└── No → Is it behavioral/style-related?\n    ├── Yes → Promote to SOUL.md\n    └── No → Is it tool-related?\n        ├── Yes → Promote to TOOLS.md\n        └── No → Promote to AGENTS.md (workflow)\n```\n\n### Promotion Format Examples\n\n**From learning:**\n> Git push to GitHub fails without auth configured - triggers desktop prompt\n\n**To TOOLS.md:**\n```markdown\n## Git\n- Don't push without confirming auth is configured\n- Use `gh auth status` to check GitHub CLI auth\n```\n\n## Inter-Agent Communication\n\nOpenClaw provides tools for cross-session communication:\n\nUse these only when cross-session sharing is explicitly needed and the environment is trusted. Prefer short sanitized summaries over raw transcripts, command output, or secret-bearing content.\n\n### sessions_list\n\nView active and recent sessions:\n```\nsessions_list(activeMinutes=30, messageLimit=3)\n```\n\n### sessions_history\n\nRead transcript from another session:\n```\nsessions_history(sessionKey=\"session-id\", limit=50)\n```\n\nOnly read another session's transcript when the user explicitly wants shared context or continuation across sessions.\n\n### sessions_send\n\nSend message to another session:\n```\nsessions_send(sessionKey=\"session-id\", message=\"Learning: API requires X-Custom-Header\")\n```\n\nPrefer sending a concise learning summary plus relevant paths rather than forwarding raw transcript content.\n\n### sessions_spawn\n\nSpawn a background sub-agent:\n```\nsessions_spawn(task=\"Research X and report back\", label=\"research\")\n```\n\n## Available Hook Events\n\n| Event | When It Fires |\n|-------|---------------|\n| `agent:bootstrap` | Before workspace files inject |\n| `command:new` | When `/new` command issued |\n| `command:reset` | When `/reset` command issued |\n| `command:stop` | When `/stop` command issued |\n| `gateway:startup` | When gateway starts |\n\n## Detection Triggers\n\n### Standard Triggers\n- User corrections (\"No, that's wrong...\")\n- Command failures (non-zero exit codes)\n- API errors\n- Knowledge gaps\n\n### OpenClaw-Specific Triggers\n\n| Trigger | Action |\n|---------|--------|\n| Tool call error | Log to TOOLS.md with tool name |\n| Session handoff confusion | Log to AGENTS.md with delegation pattern |\n| Model behavior surprise | Log to SOUL.md with expected vs actual |\n| Skill issue | Log to .learnings/ or report upstream |\n\n## Verification\n\nCheck hook is registered:\n\n```bash\nopenclaw hooks list\n```\n\nCheck skill is loaded:\n\n```bash\nopenclaw status\n```\n\n## Troubleshooting\n\n### Hook not firing\n\n1. Ensure hooks enabled in config\n2. Restart gateway after config changes\n3. Check gateway logs for errors\n\n### Learnings not persisting\n\n1. Verify `.learnings/` directory exists\n2. Check file permissions\n3. Ensure workspace path is configured correctly\n\n### Skill not loading\n\n1. Check skill is in skills directory\n2. Verify SKILL.md has correct frontmatter\n3. Run `openclaw status` to see loaded skills\n\nFile v3.0.18:assets/ERRORS.md\n\n# Errors Log\n\nCommand failures, exceptions, and unexpected behaviors.\n\n---\n\nFile v3.0.18:assets/FEATURE_REQUESTS.md\n\n# Feature Requests\n\nCapabilities requested by user that don't currently exist.\n\n---\n\nFile v3.0.18:assets/LEARNINGS.md\n\n# Learnings\n\nCorrections, insights, and knowledge gaps captured during development.\n\n**Categories**: correction | insight | knowledge_gap | best_practice\n**Areas**: frontend | backend | infra | tests | docs | config\n**Statuses**: pending | in_progress | resolved | wont_fix | promoted | promoted_to_skill\n\n## Status Definitions\n\n| Status | Meaning |\n|--------|---------|\n| `pending` | Not yet addressed |\n| `in_progress` | Actively being worked on |\n| `resolved` | Issue fixed or knowledge integrated |\n| `wont_fix` | Decided not to address (reason in Resolution) |\n| `promoted` | Elevated to CLAUDE.md, AGENTS.md, or copilot-instructions.md |\n| `promoted_to_skill` | Extracted as a reusable skill |\n\n## Skill Extraction Fields\n\nWhen a learning is promoted to a skill, add these fields:\n\n```markdown\n**Status**: promoted_to_skill\n**Skill-Path**: skills/skill-name\n```\n\nExample:\n```markdown\n## [LRN-20250115-001] best_practice\n\n**Logged**: 2025-01-15T10:00:00Z\n**Priority**: high\n**Status**: promoted_to_skill\n**Skill-Path**: skills/docker-m1-fixes\n**Area**: infra\n\n### Summary\nDocker build fails on Apple Silicon due to platform mismatch\n...\n```\n\n---\n\nFile v3.0.18:assets/SKILL-TEMPLATE.md\n\n# Skill Template\n\nTemplate for creating skills extracted from learnings. Copy and customize.\n\n---\n\n## SKILL.md Template\n\n```markdown\n---\nname: skill-name-here\ndescription: \"Concise description of when and why to use this skill. Include trigger conditions.\"\n---\n\n# Skill Name\n\nBrief introduction explaining the problem this skill solves and its origin.\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| [Trigger 1] | [Action 1] |\n| [Trigger 2] | [Action 2] |\n\n## Background\n\nWhy this knowledge matters. What problems it prevents. Context from the original learning.\n\n## Solution\n\n### Step-by-Step\n\n1. First step with code or command\n2. Second step\n3. Verification step\n\n### Code Example\n\n\\`\\`\\`language\n// Example code demonstrating the solution\n\\`\\`\\`\n\n## Common Variations\n\n- **Variation A**: Description and how to handle\n- **Variation B**: Description and how to handle\n\n## Gotchas\n\n- Warning or common mistake #1\n- Warning or common mistake #2\n\n## Related\n\n- Link to related documentation\n- Link to related skill\n\n## Source\n\nExtracted from learning entry.\n- **Learning ID**: LRN-YYYYMMDD-XXX\n- **Original Category**: correction | insight | knowledge_gap | best_practice\n- **Extraction Date**: YYYY-MM-DD\n```\n\n---\n\n## Minimal Template\n\nFor simple skills that don't need all sections:\n\n```markdown\n---\nname: skill-name-here\ndescription: \"What this skill does and when to use it.\"\n---\n\n# Skill Name\n\n[Problem statement in one sentence]\n\n## Solution\n\n[Direct solution with code/commands]\n\n## Source\n\n- Learning ID: LRN-YYYYMMDD-XXX\n```\n\n---\n\n## Template with Scripts\n\nFor skills that include executable helpers:\n\n```markdown\n---\nname: skill-name-here\ndescription: \"What this skill does and when to use it.\"\n---\n\n# Skill Name\n\n[Introduction]\n\n## Quick Reference\n\n| Command | Purpose |\n|---------|---------|\n| `./scripts/helper.sh` | [What it does] |\n| `./scripts/validate.sh` | [What it does] |\n\n## Usage\n\n### Automated (Recommended)\n\n\\`\\`\\`bash\n./skills/skill-name/scripts/helper.sh [args]\n\\`\\`\\`\n\n### Manual Steps\n\n1. Step one\n2. Step two\n\n## Scripts\n\n| Script | Description |\n|--------|-------------|\n| `scripts/helper.sh` | Main utility |\n| `scripts/validate.sh` | Validation checker |\n\n## Source\n\n- Learning ID: LRN-YYYYMMDD-XXX\n```\n\n---\n\n## Naming Conventions\n\n- **Skill name**: lowercase, hyphens for spaces\n  - Good: `docker-m1-fixes`, `api-timeout-patterns`\n  - Bad: `Docker_M1_Fixes`, `APITimeoutPatterns`\n\n- **Description**: Start with action verb, mention trigger\n  - Good: \"Handles Docker build failures on Apple Silicon. Use when builds fail with platform mismatch.\"\n  - Bad: \"Docker stuff\"\n\n- **Files**:\n  - `SKILL.md` - Required, main documentation\n  - `scripts/` - Optional, executable code\n  - `references/` - Optional, detailed docs\n  - `assets/` - Optional, templates\n\n---\n\n## Extraction Checklist\n\nBefore creating a skill from a learning:\n\n- [ ] Learning is verified (status: resolved)\n- [ ] Solution is broadly applicable (not one-off)\n- [ ] Content is complete (has all needed context)\n- [ ] Name follows conventions\n- [ ] Description is concise but informative\n- [ ] Quick Reference table is actionable\n- [ ] Code examples are tested\n- [ ] Source learning ID is recorded\n\nAfter creating:\n\n- [ ] Update original learning with `promoted_to_skill` status\n- [ ] Add `Skill-Path: skills/skill-name` to learning metadata\n- [ ] Test skill by reading it in a fresh session\n\nFile v3.0.18:hooks/openclaw/HOOK.md\n\n---\nname: self-improvement\ndescription: \"Injects self-improvement reminder during agent bootstrap\"\nmetadata: {\"openclaw\":{\"emoji\":\"🧠\",\"events\":[\"agent:bootstrap\"]}}\n---\n\n# Self-Improvement Hook\n\nInjects a reminder to evaluate learnings during agent bootstrap.\n\n## What It Does\n\n- Fires on `agent:bootstrap` (before workspace files are injected)\n- Adds a reminder block to check `.learnings/` for relevant entries\n- Prompts the agent to log corrections, errors, and discoveries\n\n## Configuration\n\nNo configuration needed. Enable with:\n\n```bash\nopenclaw hooks enable self-improvement\n```\n\nArchive v3.0.16: 16 files, 26210 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (3357b), hooks/openclaw/handler.ts (3438b), hooks/openclaw/HOOK.md (589b), README.md (378b), references/examples.md (8290b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (20674b), _meta.json (140b)\n\nFile v3.0.16:SKILL.md\n\n---\nname: self-improvement\ndescription: \"Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.\"\nmetadata:\n---\n\n# Self-Improvement Skill\n\nLog learnings and errors to markdown files for continuous improvement. Coding agents can later process these into fixes, and important learnings get promoted to project memory.\n\n## First-Use Initialisation\n\nBefore logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:\n\n```bash\nmkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Learnings\\n\\nCorrections, insights, and knowledge gaps captured during development.\\n\\n**Categories**: correction | insight | knowledge_gap | best_practice\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/ERRORS.md ] || printf \"# Errors\\n\\nCommand failures and integration errors.\\n\\n---\\n\" > .learnings/ERRORS.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Feature Requests\\n\\nCapabilities requested by the user.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md\n```\n\nNever overwrite existing files. This is a no-op if `.learnings/` is already initialised.\n\nDo not log secrets, tokens, private keys, environment variables, or full source/config files unless the user explicitly asks for that level of detail. Prefer short summaries or redacted excerpts over raw command output or full transcripts.\n\nIf you want automatic reminders or setup assistance, use the opt-in hook workflow described in [Hook Integration](#hook-integration).\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| Command/operation fails | Log to `.learnings/ERRORS.md` |\n| User corrects you | Log to `.learnings/LEARNINGS.md` with category `correction` |\n| User wants missing feature | Log to `.learnings/FEATURE_REQUESTS.md` |\n| API/external tool fails | Log to `.learnings/ERRORS.md` with integration details |\n| Knowledge was outdated | Log to `.learnings/LEARNINGS.md` with category `knowledge_gap` |\n| Found better approach | Log to `.learnings/LEARNINGS.md` with category `best_practice` |\n| Simplify/Harden recurring patterns | Log/update `.learnings/LEARNINGS.md` with `Source: simplify-and-harden` and a stable `Pattern-Key` |\n| Similar to existing entry | Link with `**See Also**`, consider priority bump |\n| Broadly applicable learning | Promote to `CLAUDE.md`, `AGENTS.md`, and/or `.github/copilot-instructions.md` |\n| Workflow improve\n\nArchive v3.0.15: 16 files, 26209 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (3357b), hooks/openclaw/handler.ts (3438b), hooks/openclaw/HOOK.md (589b), README.md (378b), references/examples.md (8291b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (20674b), _meta.json (140b)\n\nArchive v3.0.14: 16 files, 26209 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (3357b), hooks/openclaw/handler.ts (3438b), hooks/openclaw/HOOK.md (589b), README.md (378b), references/examples.md (8291b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (20674b), _meta.json (140b)\n\nArchive v3.0.13: 15 files, 25090 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (1620b), hooks/openclaw/handler.ts (1872b), hooks/openclaw/HOOK.md (589b), references/examples.md (8291b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (21606b), _meta.json (140b)\n\nArchive v3.0.12: 15 files, 25090 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (1620b), hooks/openclaw/handler.ts (1872b), hooks/openclaw/HOOK.md (589b), references/examples.md (8291b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (21606b), _meta.json (140b)\n\nArchive v3.0.11: 15 files, 25090 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (1620b), hooks/openclaw/handler.ts (1872b), hooks/openclaw/HOOK.md (589b), references/examples.md (8291b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (21606b), _meta.json (140b)\n\nArchive v3.0.10: 14 files, 22940 bytes\n\nFiles: assets/ERRORS.md (75b), assets/FEATURE_REQUESTS.md (84b), assets/LEARNINGS.md (1152b), assets/SKILL-TEMPLATE.md (3407b), hooks/openclaw/handler.js (0b), hooks/openclaw/HOOK.md (0b), references/examples.md (8291b), references/hooks-setup.md (5141b), references/openclaw-integration.md (6061b), scripts/activator.sh (680b), scripts/error-detector.sh (1317b), scripts/extract-skill.sh (5293b), SKILL.md (21606b), _meta.json (140b)","readmeExcerpt":"Skill: Self-Improving Agent Owner: pskoett Summary: Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau... Tags: latest:3.0.21 Version history: v3.0.21 | 2026-05-01T15:33:35.088Z | user re-upload v3.0.19 | 2026-05-01T06:00:13.738Z | user re-upload no changes v3.0.18 | 2026-04-25T13:59:22.039Z | user no changes ad","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"mkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Learnings\\n\\nCorrections, insights, and knowledge gaps captured during development.\\n\\n**Categories**: correction | insight | knowledge_gap | best_practice\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/ERRORS.md ] || printf \"# Errors\\n\\nCommand failures and integration errors.\\n\\n---\\n\" > .learnings/ERRORS.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Feature Requests\\n\\nCapabilities requested by the user.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md"},{"language":"bash","snippet":"clawdhub install self-improving-agent"},{"language":"bash","snippet":"git clone https://github.com/peterskoett/self-improving-agent.git ~/.openclaw/skills/self-improving-agent"},{"language":"text","snippet":"~/.openclaw/workspace/\n├── AGENTS.md          # Multi-agent workflows, delegation patterns\n├── SOUL.md            # Behavioral guidelines, personality, principles\n├── TOOLS.md           # Tool capabilities, integration gotchas\n├── MEMORY.md          # Long-term memory (main session only)\n├── memory/            # Daily memory files\n│   └── YYYY-MM-DD.md\n└── .learnings/        # This skill's log files\n    ├── LEARNINGS.md\n    ├── ERRORS.md\n    └── FEATURE_REQUESTS.md"},{"language":"bash","snippet":"mkdir -p ~/.openclaw/workspace/.learnings"},{"language":"bash","snippet":"# Copy hook to OpenClaw hooks directory\ncp -r hooks/openclaw ~/.openclaw/hooks/self-improvement\n\n# Enable it\nopenclaw hooks enable self-improvement"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: self-improvement\ndescription: \"Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.\"\nmetadata:\n---\n\n# Self-Improvement Skill\n\nLog learnings and errors to markdown files for continuous improvement. Coding agents can later process these into fixes, and important learnings get promoted to project memory.\n\n## First-Use Initialisation\n\nBefore logging anything, ensure the `.learnings/` directory and files exist in the project or workspace root. If any are missing, create them:\n\n```bash\nmkdir -p .learnings\n[ -f .learnings/LEARNINGS.md ] || printf \"# Learnings\\n\\nCorrections, insights, and knowledge gaps captured during development.\\n\\n**Categories**: correction | insight | knowledge_gap | best_practice\\n\\n---\\n\" > .learnings/LEARNINGS.md\n[ -f .learnings/ERRORS.md ] || printf \"# Errors\\n\\nCommand failures and integration errors.\\n\\n---\\n\" > .learnings/ERRORS.md\n[ -f .learnings/FEATURE_REQUESTS.md ] || printf \"# Feature Requests\\n\\nCapabilities requested by the user.\\n\\n---\\n\" > .learnings/FEATURE_REQUESTS.md\n```\n\nNever overwrite existing files. This is a no-op if `.learnings/` is already initialised.\n\nDo not log secrets, tokens, private keys, environment variables, or full source/config files unless the user explicitly asks for that level of detail. Prefer short summaries or redacted excerpts over raw command output or full transcripts.\n\nIf you want automatic reminders or setup assistance, use the opt-in hook workflow described in [Hook Integration](#hook-integration).\n\n## Quick Reference\n\n| Situation | Action |\n|-----------|--------|\n| Command/operation fails | Log to `.learnings/ERRORS.md` |\n| User corrects you | Log to `.learnings/LEARNINGS.md` with category `correction` |\n| User wants missing feature | Log to `.learnings/FEATURE_REQUESTS.md` |\n| API/external tool fails | Log to `.learnings/ERRORS.md` with integration details |\n| Knowledge was outdated | Log to `.learnings/LEARNINGS.md` with category `knowledge_gap` |\n| Found better approach | Log to `.learnings/LEARNINGS.md` with category `best_practice` |\n| Simplify/Harden recurring patterns | Log/update `.learnings/LEARNINGS.md` with `Source: simplify-and-harden` and a stable `Pattern-Key` |\n| Similar to existing entry | Link with `**See Also**`, consider priority bump |\n| Broadly applicable learning | Promote to `CLAUDE.md`, `AGENTS.md`, and/or `.github/copilot-instructions.md` |\n| Workflow improvements | Promote to `AGENTS.md` (OpenClaw workspace) |\n| Tool gotchas | Promote to `TOOLS.md` (OpenClaw workspace) |\n| Behavioral patterns | Promote to `SOUL.md` (OpenClaw workspace) |\n\n## OpenClaw Setup (Reco"},{"path":"README.md","content":"# self-improvement\n\nSelf-improvement skill for OpenClaw. It captures learnings, errors, and feature requests to support continuous improvement across sessions.\n\n## Attribution\n\nRemade for OpenClaw from the original repo:\n\n- https://github.com/pskoett/pskoett-ai-skills\n- https://github.com/pskoett/pskoett-ai-skills/tree/main/skills/self-improvement\n\n## Main File\n\n- `SKILL.md`"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn70cjr952qdec1nx70zs6wefn7ynq2t\",\n  \"slug\": \"self-improving-agent\",\n  \"version\": \"3.0.21\",\n  \"publishedAt\": 1777649615088\n}"},{"path":"references/examples.md","content":"# Entry Examples\n\nConcrete examples of well-formatted entries with all fields.\n\n## Learning: Correction\n\n```markdown\n## [LRN-20250115-001] correction\n\n**Logged**: 2025-01-15T10:30:00Z\n**Priority**: high\n**Status**: pending\n**Area**: tests\n\n### Summary\nIncorrectly assumed pytest fixtures are scoped to function by default\n\n### Details\nWhen writing test fixtures, I assumed all fixtures were function-scoped. \nUser corrected that while function scope is the default, the codebase \nconvention uses module-scoped fixtures for database connections to \nimprove test performance.\n\n### Suggested Action\nWhen creating fixtures that involve expensive setup (DB, network), \ncheck existing fixtures for scope patterns before defaulting to function scope.\n\n### Metadata\n- Source: user_feedback\n- Related Files: tests/conftest.py\n- Tags: pytest, testing, fixtures\n\n---\n```\n\n## Learning: Knowledge Gap (Resolved)\n\n```markdown\n## [LRN-20250115-002] knowledge_gap\n\n**Logged**: 2025-01-15T14:22:00Z\n**Priority**: medium\n**Status**: resolved\n**Area**: config\n\n### Summary\nProject uses pnpm not npm for package management\n\n### Details\nAttempted to run `npm install` but project uses pnpm workspaces.\nLock file is `pnpm-lock.yaml`, not `package-lock.json`.\n\n### Suggested Action\nCheck for `pnpm-lock.yaml` or `pnpm-workspace.yaml` before assuming npm.\nUse `pnpm install` for this project.\n\n### Metadata\n- Source: error\n- Related Files: pnpm-lock.yaml, pnpm-workspace.yaml\n- Tags: package-manager, pnpm, setup\n\n### Resolution\n- **Resolved**: 2025-01-15T14:30:00Z\n- **Commit/PR**: N/A - knowledge update\n- **Notes**: Added to CLAUDE.md for future reference\n\n---\n```\n\n## Learning: Promoted to CLAUDE.md\n\n```markdown\n## [LRN-20250115-003] best_practice\n\n**Logged**: 2025-01-15T16:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: CLAUDE.md\n**Area**: backend\n\n### Summary\nAPI responses must include correlation ID from request headers\n\n### Details\nAll API responses should echo back the X-Correlation-ID header from \nthe request. This is required for distributed tracing. Responses \nwithout this header break the observability pipeline.\n\n### Suggested Action\nAlways include correlation ID passthrough in API handlers.\n\n### Metadata\n- Source: user_feedback\n- Related Files: src/middleware/correlation.ts\n- Tags: api, observability, tracing\n\n---\n```\n\n## Learning: Promoted to AGENTS.md\n\n```markdown\n## [LRN-20250116-001] best_practice\n\n**Logged**: 2025-01-16T09:00:00Z\n**Priority**: high\n**Status**: promoted\n**Promoted**: AGENTS.md\n**Area**: backend\n\n### Summary\nMust regenerate API client after OpenAPI spec changes\n\n### Details\nWhen modifying API endpoints, the TypeScript client must be regenerated.\nForgetting this causes type mismatches that only appear at runtime.\nThe generate script also runs validation.\n\n### Suggested Action\nAdd to agent workflow: after any API changes, run `pnpm run generate:api`.\n\n### Metadata\n- Source: error\n- Related Files: openapi.yaml, src/client/api.ts\n- Tags: api, codegen, type"},{"path":"references/hooks-setup.md","content":"# Hook Setup Guide\n\nConfigure automatic self-improvement triggers for AI coding agents.\n\n## Overview\n\nHooks enable proactive learning capture by injecting reminders at key moments:\n- **UserPromptSubmit**: Reminder after each prompt to evaluate learnings\n- **PostToolUse (Bash)**: Error detection when commands fail\n\n## Claude Code Setup\n\n### Option 1: Project-Level Configuration\n\nCreate `.claude/settings.json` in your project root:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/error-detector.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Option 2: User-Level Configuration\n\nAdd to `~/.claude/settings.json` for global activation:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"~/.claude/skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### Minimal Setup (Activator Only)\n\nFor lower overhead, use only the UserPromptSubmit hook:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## Codex CLI Setup\n\nCodex uses the same hook system as Claude Code. Create `.codex/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"./skills/self-improvement/scripts/activator.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n## GitHub Copilot Setup\n\nCopilot doesn't support hooks directly. Instead, add guidance to `.github/copilot-instructions.md`:\n\n```markdown\n## Self-Improvement\n\nAfter completing tasks that involved:\n- Debugging non-obvious issues\n- Discovering workarounds\n- Learning project-specific patterns\n- Resolving unexpected errors\n\nConsider logging the learning to `.learnings/` using the format from the self-improvement skill.\n\nFor high-value learnings that would benefit other sessions, consider skill extraction.\n```\n\n## Verification\n\n### Test Activator Hook\n\n1. Enable the hook configuration\n2. Start a new Claude Code session\n3. Send any prompt\n4. Verify you see `<self-improvement-reminder>` in the context\n\n### Test Error Detector Hook\n\n1. Enable PostToolUse hook for Bash\n2. Run a command that fails: `ls /nonexistent/path`\n3. Verify you see `<error-detected>` reminder\n\n### Dry Run Extract Script\n\n```bash\n./skills/self-improvement/scripts/extract-skill.sh test-skill --dry-run\n```\n\nExpected"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau... Skill: Self-Improving Agent Owner: pskoett Summary: Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau... Tags: latest:3.0.21 Version history: v3.0.21 | 2026-05-01T15:33:35.088Z | user re-upload v3.0.19 | 2026-05-01T06:00:13.738Z | user re-upload no changes v3.0.18 | 2026-04-25T13:59:22.039Z | user no changes ad","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1193,"uniquenessScore":47,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-05-22T06:53:09.089Z","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:09.089Z","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-09T11:18:08.229Z","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"}]}}}