[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ENV6PBATDR2GHQ5S8VZBX7":3,"skill-same:01M6ENV6PBATDR2GHQ5S8VZBX7":129},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":65,"repositoryHtmlUrl":66,"repositoryHomepageUrl":67,"ownerHtmlUrl":68,"ownerBlogUrl":6,"ownerDescription":69,"updatedAt":70,"install":71,"resources":84},"01M6ENV6PBATDR2GHQ5S8VZBX7","self-improving-agent",null,"A universal self-improving agent that learns from ALL skill experiences. Uses multi-memory architecture (semantic + episodic + working) to continuously evolve the codebase. Auto-triggers on skill completion\u002Ferror with hooks-based self-correction.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"self","self improving agent","write","error","submit","complete","cycle","hooks","auto","edit","memory","read","evolve","ask","Bash","start","repository","create","pr","architecture","2026-11-10 10:12:30",false,"---\nname: self-improving-agent\ndescription: A universal self-improving agent that learns from ALL skill experiences. Uses multi-memory architecture (semantic + episodic + working) to continuously evolve the codebase. Auto-triggers on skill completion\u002Ferror with hooks-based self-correction.\nallowed-tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch\nmetadata:\n  hooks:\n    before_start:\n      - trigger: session-logger\n        mode: auto\n        context: \"Start {skill_name}\"\n    after_complete:\n      - trigger: create-pr\n        mode: ask_first\n        condition: skills_modified\n        reason: \"Submit improvements to repository\"\n      - trigger: session-logger\n        mode: auto\n        context: \"Self-improvement cycle complete\"\n    # Note: on_error intentionally only logs to session to avoid infinite recursion\n    # Self-correction is triggered by other skills (debugger, code-reviewer) completing their work\n    on_error:\n      - trigger: session-logger\n        mode: auto\n        context: \"Error captured in {skill_name}\"\n---\n\n# Self-Improving Agent\n\n> \"An AI agent that learns from every interaction, accumulating patterns and insights to continuously improve its own capabilities.\" — Based on 2025 lifelong learning research\n\n## Overview\n\nThis is a **universal self-improvement system** that learns from ALL skill experiences, not just PRDs. It implements a complete feedback loop with:\n\n- **Multi-Memory Architecture**: Semantic + Episodic + Working memory\n- **Self-Correction**: Detects and fixes skill guidance errors\n- **Self-Validation**: Periodically verifies skill accuracy\n- **Hooks Integration**: Auto-triggers on skill events (before_start, after_complete, on_error)\n- **Evolution Markers**: Traceable changes with source attribution\n\n## Research-Based Design\n\nBased on 2025 research:\n\n| Research | Key Insight | Application |\n|----------|-------------|-------------|\n| [SimpleMem](https:\u002F\u002Farxiv.org\u002Fhtml\u002F2601.02553v1) | Efficient lifelong memory | Pattern accumulation system |\n| [Multi-Memory Survey](https:\u002F\u002Fdl.acm.org\u002Fdoi\u002F10.1145\u002F3748302) | Semantic + Episodic memory | World knowledge + experiences |\n| [Lifelong Learning](https:\u002F\u002Farxiv.org\u002Fhtml\u002F2501.07278v1) | Continuous task stream learning | Learn from every skill use |\n| [Evo-Memory](https:\u002F\u002Fshothota.medium.com\u002Fevo-memory-deepminds-new-benchmark) | Test-time lifelong learning | Real-time adaptation |\n\n## The Self-Improvement Loop\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                    UNIVERSAL SELF-IMPROVEMENT                    │\n├─────────────────────────────────────────────────────────────────┤\n│                                                                 │\n│   Skill Event → Extract Experience → Abstract Pattern → Update  │\n│        │                  │                │         │          │\n│        ▼                  ▼                ▼         ▼          │\n│   ┌─────────────────────────────────────────────────────┐       │\n│   │              MULTI-MEMORY SYSTEM                      │       │\n│   ├─────────────────────────────────────────────────────┤       │\n│   │  Semantic Memory   │  Episodic Memory  │ Working Memory │  │\n│   │  (Patterns\u002FRules)  │  (Experiences)    │  (Current)     │  │\n│   │  memory\u002Fsemantic\u002F  │  memory\u002Fepisodic\u002F │  memory\u002Fworking\u002F│  │\n│   └─────────────────────────────────────────────────────┘       │\n│                                                                 │\n│   ┌─────────────────────────────────────────────────────┐       │\n│   │              FEEDBACK LOOP                            │       │\n│   │  User Feedback → Confidence Update → Pattern Adapt   │       │\n│   └─────────────────────────────────────────────────────┘       │\n│                                                                 │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## When This Activates\n\n### Automatic Triggers (via hooks)\n\n| Event | Trigger | Action |\n|-------|---------|--------|\n| **before_start** | Any skill starts | Log session start |\n| **after_complete** | Any skill completes | Extract patterns, update skills |\n| **on_error** | Bash returns non-zero exit | Capture error context, trigger self-correction |\n\n### Manual Triggers\n\n- User says \"自我进化\", \"self-improve\", \"从经验中学习\"\n- User says \"分析今天的经验\", \"总结教训\"\n- User asks to improve a specific skill\n\n## Evolution Priority Matrix\n\nTrigger evolution when new reusable knowledge appears:\n\n| Trigger | Target Skill | Priority | Action |\n|---------|--------------|----------|--------|\n| New PRD pattern discovered | prd-planner | High | Add to quality checklist |\n| Architecture tradeoff clarified | architecting-solutions | High | Add to decision patterns |\n| API design rule learned | api-designer | High | Update template |\n| Debugging fix discovered | debugger | High | Add to anti-patterns |\n| Review checklist gap | code-reviewer | High | Add checklist item |\n| Perf\u002Fsecurity insight | performance-engineer, security-auditor | High | Add to patterns |\n| UI\u002FUX spec issue | prd-planner, architecting-solutions | High | Add visual spec requirements |\n| React\u002Fstate pattern | debugger, refactoring-specialist | Medium | Add to patterns |\n| Test strategy improvement | test-automator, qa-expert | Medium | Update approach |\n| CI\u002Fdeploy fix | deployment-engineer | Medium | Add to troubleshooting |\n\n## Multi-Memory Architecture\n\n### 1. Semantic Memory (`memory\u002Fsemantic-patterns.json`)\n\nStores **abstract patterns and rules** reusable across contexts:\n\n```json\n{\n  \"patterns\": {\n    \"pattern_id\": {\n      \"id\": \"pat-2025-01-11-001\",\n      \"name\": \"Pattern Name\",\n      \"source\": \"user_feedback|implementation_review|retrospective\",\n      \"confidence\": 0.95,\n      \"applications\": 5,\n      \"created\": \"2025-01-11\",\n      \"category\": \"prd_structure|react_patterns|async_patterns|...\",\n      \"pattern\": \"One-line summary\",\n      \"problem\": \"What problem does this solve?\",\n      \"solution\": { ... },\n      \"quality_rules\": [ ... ],\n      \"target_skills\": [ ... ]\n    }\n  }\n}\n```\n\n### 2. Episodic Memory (`memory\u002Fepisodic\u002F`)\n\nStores **specific experiences and what happened**:\n\n```\nmemory\u002Fepisodic\u002F\n├── 2025\u002F\n│   ├── 2025-01-11-prd-creation.json\n│   ├── 2025-01-11-debug-session.json\n│   └── 2025-01-12-refactoring.json\n```\n\n```json\n{\n  \"id\": \"ep-2025-01-11-001\",\n  \"timestamp\": \"2025-01-11T10:30:00Z\",\n  \"skill\": \"debugger\",\n  \"situation\": \"User reported data not refreshing after form submission\",\n  \"root_cause\": \"Empty callback in onRefresh prop\",\n  \"solution\": \"Implement actual refresh logic in callback\",\n  \"lesson\": \"Always verify callbacks are not empty functions\",\n  \"related_pattern\": \"callback_verification\",\n  \"user_feedback\": {\n    \"rating\": 8,\n    \"comments\": \"This was exactly the issue\"\n  }\n}\n```\n\n### 3. Working Memory (`memory\u002Fworking\u002F`)\n\nStores **current session context**:\n\n```\nmemory\u002Fworking\u002F\n├── current_session.json   # Active session data\n├── last_error.json        # Error context for self-correction\n└── session_end.json       # Session end marker\n```\n\n## Self-Improvement Process\n\n### Phase 1: Experience Extraction\n\nAfter any skill completes, extract:\n\n```yaml\nWhat happened:\n  skill_used: {which skill}\n  task: {what was being done}\n  outcome: {success|partial|failure}\n\nKey Insights:\n  what_went_well: [what worked]\n  what_went_wrong: [what didn't work]\n  root_cause: {underlying issue if applicable}\n\nUser Feedback:\n  rating: {1-10 if provided}\n  comments: {specific feedback}\n```\n\n### Phase 2: Pattern Abstraction\n\nConvert experiences to reusable patterns:\n\n| Concrete Experience | Abstract Pattern | Target Skill |\n|--------------------|------------------|--------------|\n| \"User forgot to save PRD notes\" | \"Always persist thinking to files\" | prd-planner |\n| \"Code review missed SQL injection\" | \"Add security checklist item\" | code-reviewer |\n| \"Callback was empty, didn't work\" | \"Verify callback implementations\" | debugger |\n| \"Net APY position ambiguous\" | \"UI specs need exact relative positions\" | prd-planner |\n\n**Abstraction Rules:**\n\n```yaml\nIf experience_repeats 3+ times:\n  pattern_level: critical\n  action: Add to skill's \"Critical Mistakes\" section\n\nIf solution_was_effective:\n  pattern_level: best_practice\n  action: Add to skill's \"Best Practices\" section\n\nIf user_rating >= 7:\n  pattern_level: strength\n  action: Reinforce this approach\n\nIf user_rating \u003C= 4:\n  pattern_level: weakness\n  action: Add to \"What to Avoid\" section\n```\n\n### Phase 3: Skill Updates\n\nUpdate the appropriate skill files with **evolution markers**:\n\n```markdown\n\u003C!-- Evolution: 2025-01-12 | source: ep-2025-01-12-001 | skill: debugger -->\n\n## Pattern Added (2025-01-12)\n\n**Pattern**: Always verify callbacks are not empty functions\n\n**Source**: Episode ep-2025-01-12-001\n\n**Confidence**: 0.95\n\n### Updated Checklist\n- [ ] Verify all callbacks have implementations\n- [ ] Test callback execution paths\n```\n\n**Correction Markers** (when fixing wrong guidance):\n\n```markdown\n\u003C!-- Correction: 2025-01-12 | was: \"Use callback chain\" | reason: caused stale refresh -->\n\n## Corrected Guidance\n\nUse direct state monitoring instead of callback chains:\n```typescript\n\u002F\u002F ✅ Do: Direct state monitoring\nconst prevPendingCount = usePrevious(pendingCount);\n```\n```\n\n### Phase 4: Memory Consolidation\n\n1. **Update semantic memory** (`memory\u002Fsemantic-patterns.json`)\n2. **Store episodic memory** (`memory\u002Fepisodic\u002FYYYY-MM-DD-{skill}.json`)\n3. **Update pattern confidence** based on applications\u002Ffeedback\n4. **Prune outdated patterns** (low confidence, no recent applications)\n\n## Self-Correction (on_error hook)\n\nTriggered when:\n- Bash command returns non-zero exit code\n- Tests fail after following skill guidance\n- User reports the guidance produced incorrect results\n\n**Process:**\n\n```markdown\n## Self-Correction Workflow\n\n1. Detect Error\n   - Capture error context from working\u002Flast_error.json\n   - Identify which skill guidance was followed\n\n2. Verify Root Cause\n   - Was the skill guidance incorrect?\n   - Was the guidance misinterpreted?\n   - Was the guidance incomplete?\n\n3. Apply Correction\n   - Update skill file with corrected guidance\n   - Add correction marker with reason\n   - Update related patterns in semantic memory\n\n4. Validate Fix\n   - Test the corrected guidance\n   - Ask user to verify\n```\n\n**Example:**\n\n```markdown\n\u003C!-- Correction: 2025-01-12 | was: \"useMemo for claimable ids\" | reason: stale data at click time -->\n\n## Self-Correction: Click-Time Computation\n\n**Issue**: Using useMemo for claimable IDs caused stale data\n**Fix**: Compute at click time for always-fresh data\n**Pattern**: click_time_vs_open_time_computation\n```\n\n## Self-Validation\n\nUse the validation template in `references\u002Fappendix.md` when reviewing updates.\n\n## Hooks Integration\n\n### Wiring Hooks in Claude Code Settings\n\nAdd to Claude Code settings (`~\u002F.claude\u002Fsettings.json`):\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash|Write|Edit\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash ${SKILLS_DIR}\u002Fself-improving-agent\u002Fhooks\u002Fpre-tool.sh \\\"$TOOL_NAME\\\" \\\"$TOOL_INPUT\\\"\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash ${SKILLS_DIR}\u002Fself-improving-agent\u002Fhooks\u002Fpost-bash.sh \\\"$TOOL_OUTPUT\\\" \\\"$EXIT_CODE\\\"\"\n          }\n        ]\n      }\n    ],\n    \"Stop\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash ${SKILLS_DIR}\u002Fself-improving-agent\u002Fhooks\u002Fsession-end.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nReplace `${SKILLS_DIR}` with your actual skills path.\n\n## Additional References\n\nSee `references\u002Fappendix.md` for memory structure, workflow diagrams, metrics, feedback templates, and research links.\n\n## Best Practices\n\n### DO\n\n- ✅ Learn from EVERY skill interaction\n- ✅ Extract patterns at the right abstraction level\n- ✅ Update multiple related skills\n- ✅ Track confidence and apply counts\n- ✅ Ask for user feedback on improvements\n- ✅ Use evolution\u002Fcorrection markers for traceability\n- ✅ Validate guidance before applying broadly\n\n### DON'T\n\n- ❌ Over-generalize from single experiences\n- ❌ Update skills without confidence tracking\n- ❌ Ignore negative feedback\n- ❌ Make changes that break existing functionality\n- ❌ Create contradictory patterns\n- ❌ Update skills without understanding context\n\n## Quick Start\n\nAfter any skill completes, this agent automatically:\n\n1. **Analyzes** what happened\n2. **Extracts** patterns and insights\n3. **Updates** relevant skill files\n4. **Logs** to memory for future reference\n5. **Reports** summary to user\n\n## References\n\n- [SimpleMem: Efficient Lifelong Memory for LLM Agents](https:\u002F\u002Farxiv.org\u002Fhtml\u002F2601.02553v1)\n- [A Survey on the Memory Mechanism of Large Language Model Agents](https:\u002F\u002Fdl.acm.org\u002Fdoi\u002F10.1145\u002F3748302)\n- [Lifelong Learning of LLM based Agents](https:\u002F\u002Farxiv.org\u002Fhtml\u002F2501.07278v1)\n- [Evo-Memory: DeepMind's Benchmark](https:\u002F\u002Fshothota.medium.com\u002Fevo-memory-deepminds-new-benchmark)\n- [Let's Build a Self-Improving AI Agent](https:\u002F\u002Fmedium.com\u002F@nomannayeem\u002Flets-build-a-self-improving-ai-agent-that-learns-from-your-feedback-722d2ce9c2d9)\n","# Self-Improving Agent\n\n> \"An AI agent that learns from every interaction, accumulating patterns and insights to continuously improve its own capabilities.\" — Based on 2025 lifelong learning research\n\n## Overview\n\nThis is a **universal self-improvement system** that learns from ALL skill experiences, not just PRDs. It implements a complete feedback loop with:\n\n- **Multi-Memory Architecture**: Semantic + Episodic + Working memory\n- **Self-Correction**: Detects and fixes skill guidance errors\n- **Self-Validation**: Periodically verifies skill accuracy\n- **Hooks Integration**: Auto-triggers on skill events (before_start, after_complete, on_error)\n- **Evolution Markers**: Traceable changes with source attribution\n\n## Research-Based Design\n\nBased on 2025 research:\n\n| Research | Key Insight | Application |\n|----------|-------------|-------------|\n| [SimpleMem](https:\u002F\u002Farxiv.org\u002Fhtml\u002F2601.02553v1) | Efficient lifelong memory | Pattern accumulation system |\n| [Multi-Memory Survey](https:\u002F\u002Fdl.acm.org\u002Fdoi\u002F10.1145\u002F3748302) | Semantic + Episodic memory | World knowledge + experiences |\n| [Lifelong Learning](https:\u002F\u002Farxiv.org\u002Fhtml\u002F2501.07278v1) | Continuous task stream learning | Learn from every skill use |\n| [Evo-Memory](https:\u002F\u002Fshothota.medium.com\u002Fevo-memory-deepminds-new-benchmark) | Test-time lifelong learning | Real-time adaptation |\n\n## The Self-Improvement Loop\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                    UNIVERSAL SELF-IMPROVEMENT                    │\n├─────────────────────────────────────────────────────────────────┤\n│                                                                 │\n│   Skill Event → Extract Experience → Abstract Pattern → Update  │\n│        │                  │                │         │          │\n│        ▼                  ▼                ▼         ▼          │\n│   ┌─────────────────────────────────────────────────────┐       │\n│   │              MULTI-MEMORY SYSTEM                      │       │\n│   ├─────────────────────────────────────────────────────┤       │\n│   │  Semantic Memory   │  Episodic Memory  │ Working Memory │  │\n│   │  (Patterns\u002FRules)  │  (Experiences)    │  (Current)     │  │\n│   │  memory\u002Fsemantic\u002F  │  memory\u002Fepisodic\u002F │  memory\u002Fworking\u002F│  │\n│   └─────────────────────────────────────────────────────┘       │\n│                                                                 │\n│   ┌─────────────────────────────────────────────────────┐       │\n│   │              FEEDBACK LOOP                            │       │\n│   │  User Feedback → Confidence Update → Pattern Adapt   │       │\n│   └─────────────────────────────────────────────────────┘       │\n│                                                                 │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## When This Activates\n\n### Automatic Triggers (via hooks)\n\n| Event | Trigger | Action |\n|-------|---------|--------|\n| **before_start** | Any skill starts | Log session start |\n| **after_complete** | Any skill completes | Extract patterns, update skills |\n| **on_error** | Bash returns non-zero exit | Capture error context, trigger self-correction |\n\n### Manual Triggers\n\n- User says \"自我进化\", \"self-improve\", \"从经验中学习\"\n- User says \"分析今天的经验\", \"总结教训\"\n- User asks to improve a specific skill\n\n## Evolution Priority Matrix\n\nTrigger evolution when new reusable knowledge appears:\n\n| Trigger | Target Skill | Priority | Action |\n|---------|--------------|----------|--------|\n| New PRD pattern discovered | prd-planner | High | Add to quality checklist |\n| Architecture tradeoff clarified | architecting-solutions | High | Add to decision patterns |\n| API design rule learned | api-designer | High | Update template |\n| Debugging fix discovered | debugger | High | Add to anti-patterns |\n| Review checklist gap | code-reviewer | High | Add checklist item |\n| Perf\u002Fsecurity insight | performance-engineer, security-auditor | High | Add to patterns |\n| UI\u002FUX spec issue | prd-planner, architecting-solutions | High | Add visual spec requirements |\n| React\u002Fstate pattern | debugger, refactoring-specialist | Medium | Add to patterns |\n| Test strategy improvement | test-automator, qa-expert | Medium | Update approach |\n| CI\u002Fdeploy fix | deployment-engineer | Medium | Add to troubleshooting |\n\n## Multi-Memory Architecture\n\n### 1. Semantic Memory (`memory\u002Fsemantic-patterns.json`)\n\nStores **abstract patterns and rules** reusable across contexts:\n\n```json\n{\n  \"patterns\": {\n    \"pattern_id\": {\n      \"id\": \"pat-2025-01-11-001\",\n      \"name\": \"Pattern Name\",\n      \"source\": \"user_feedback|implementation_review|retrospective\",\n      \"confidence\": 0.95,\n      \"applications\": 5,\n      \"created\": \"2025-01-11\",\n      \"category\": \"prd_structure|react_patterns|async_patterns|...\",\n      \"pattern\": \"One-line summary\",\n      \"problem\": \"What problem does this solve?\",\n      \"solution\": { ... },\n      \"quality_rules\": [ ... ],\n      \"target_skills\": [ ... ]\n    }\n  }\n}\n```\n\n### 2. Episodic Memory (`memory\u002Fepisodic\u002F`)\n\nStores **specific experiences and what happened**:\n\n```\nmemory\u002Fepisodic\u002F\n├── 2025\u002F\n│   ├── 2025-01-11-prd-creation.json\n│   ├── 2025-01-11-debug-session.json\n│   └── 2025-01-12-refactoring.json\n```\n\n```json\n{\n  \"id\": \"ep-2025-01-11-001\",\n  \"timestamp\": \"2025-01-11T10:30:00Z\",\n  \"skill\": \"debugger\",\n  \"situation\": \"User reported data not refreshing after form submission\",\n  \"root_cause\": \"Empty callback in onRefresh prop\",\n  \"solution\": \"Implement actual refresh logic in callback\",\n  \"lesson\": \"Always verify callbacks are not empty functions\",\n  \"related_pattern\": \"callback_verification\",\n  \"user_feedback\": {\n    \"rating\": 8,\n    \"comments\": \"This was exactly the issue\"\n  }\n}\n```\n\n### 3. Working Memory (`memory\u002Fworking\u002F`)\n\nStores **current session context**:\n\n```\nmemory\u002Fworking\u002F\n├── current_session.json   # Active session data\n├── last_error.json        # Error context for self-correction\n└── session_end.json       # Session end marker\n```\n\n## Self-Improvement Process\n\n### Phase 1: Experience Extraction\n\nAfter any skill completes, extract:\n\n```yaml\nWhat happened:\n  skill_used: {which skill}\n  task: {what was being done}\n  outcome: {success|partial|failure}\n\nKey Insights:\n  what_went_well: [what worked]\n  what_went_wrong: [what didn't work]\n  root_cause: {underlying issue if applicable}\n\nUser Feedback:\n  rating: {1-10 if provided}\n  comments: {specific feedback}\n```\n\n### Phase 2: Pattern Abstraction\n\nConvert experiences to reusable patterns:\n\n| Concrete Experience | Abstract Pattern | Target Skill |\n|--------------------|------------------|--------------|\n| \"User forgot to save PRD notes\" | \"Always persist thinking to files\" | prd-planner |\n| \"Code review missed SQL injection\" | \"Add security checklist item\" | code-reviewer |\n| \"Callback was empty, didn't work\" | \"Verify callback implementations\" | debugger |\n| \"Net APY position ambiguous\" | \"UI specs need exact relative positions\" | prd-planner |\n\n**Abstraction Rules:**\n\n```yaml\nIf experience_repeats 3+ times:\n  pattern_level: critical\n  action: Add to skill's \"Critical Mistakes\" section\n\nIf solution_was_effective:\n  pattern_level: best_practice\n  action: Add to skill's \"Best Practices\" section\n\nIf user_rating >= 7:\n  pattern_level: strength\n  action: Reinforce this approach\n\nIf user_rating \u003C= 4:\n  pattern_level: weakness\n  action: Add to \"What to Avoid\" section\n```\n\n### Phase 3: Skill Updates\n\nUpdate the appropriate skill files with **evolution markers**:\n\n```markdown\n\u003C!-- Evolution: 2025-01-12 | source: ep-2025-01-12-001 | skill: debugger -->\n\n## Pattern Added (2025-01-12)\n\n**Pattern**: Always verify callbacks are not empty functions\n\n**Source**: Episode ep-2025-01-12-001\n\n**Confidence**: 0.95\n\n### Updated Checklist\n- [ ] Verify all callbacks have implementations\n- [ ] Test callback execution paths\n```\n\n**Correction Markers** (when fixing wrong guidance):\n\n```markdown\n\u003C!-- Correction: 2025-01-12 | was: \"Use callback chain\" | reason: caused stale refresh -->\n\n## Corrected Guidance\n\nUse direct state monitoring instead of callback chains:\n```typescript\n\u002F\u002F ✅ Do: Direct state monitoring\nconst prevPendingCount = usePrevious(pendingCount);\n```\n```\n\n### Phase 4: Memory Consolidation\n\n1. **Update semantic memory** (`memory\u002Fsemantic-patterns.json`)\n2. **Store episodic memory** (`memory\u002Fepisodic\u002FYYYY-MM-DD-{skill}.json`)\n3. **Update pattern confidence** based on applications\u002Ffeedback\n4. **Prune outdated patterns** (low confidence, no recent applications)\n\n## Self-Correction (on_error hook)\n\nTriggered when:\n- Bash command returns non-zero exit code\n- Tests fail after following skill guidance\n- User reports the guidance produced incorrect results\n\n**Process:**\n\n```markdown\n## Self-Correction Workflow\n\n1. Detect Error\n   - Capture error context from working\u002Flast_error.json\n   - Identify which skill guidance was followed\n\n2. Verify Root Cause\n   - Was the skill guidance incorrect?\n   - Was the guidance misinterpreted?\n   - Was the guidance incomplete?\n\n3. Apply Correction\n   - Update skill file with corrected guidance\n   - Add correction marker with reason\n   - Update related patterns in semantic memory\n\n4. Validate Fix\n   - Test the corrected guidance\n   - Ask user to verify\n```\n\n**Example:**\n\n```markdown\n\u003C!-- Correction: 2025-01-12 | was: \"useMemo for claimable ids\" | reason: stale data at click time -->\n\n## Self-Correction: Click-Time Computation\n\n**Issue**: Using useMemo for claimable IDs caused stale data\n**Fix**: Compute at click time for always-fresh data\n**Pattern**: click_time_vs_open_time_computation\n```\n\n## Self-Validation\n\nUse the validation template in `references\u002Fappendix.md` when reviewing updates.\n\n## Hooks Integration\n\n### Wiring Hooks in Claude Code Settings\n\nAdd to Claude Code settings (`~\u002F.claude\u002Fsettings.json`):\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Bash|Write|Edit\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash ${SKILLS_DIR}\u002Fself-improving-agent\u002Fhooks\u002Fpre-tool.sh \\\"$TOOL_NAME\\\" \\\"$TOOL_INPUT\\\"\"\n          }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash ${SKILLS_DIR}\u002Fself-improving-agent\u002Fhooks\u002Fpost-bash.sh \\\"$TOOL_OUTPUT\\\" \\\"$EXIT_CODE\\\"\"\n          }\n        ]\n      }\n    ],\n    \"Stop\": [\n      {\n        \"matcher\": \"\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"bash ${SKILLS_DIR}\u002Fself-improving-agent\u002Fhooks\u002Fsession-end.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nReplace `${SKILLS_DIR}` with your actual skills path.\n\n## Additional References\n\nSee `references\u002Fappendix.md` for memory structure, workflow diagrams, metrics, feedback templates, and research links.\n\n## Best Practices\n\n### DO\n\n- ✅ Learn from EVERY skill interaction\n- ✅ Extract patterns at the right abstraction level\n- ✅ Update multiple related skills\n- ✅ Track confidence and apply counts\n- ✅ Ask for user feedback on improvements\n- ✅ Use evolution\u002Fcorrection markers for traceability\n- ✅ Validate guidance before applying broadly\n\n### DON'T\n\n- ❌ Over-generalize from single experiences\n- ❌ Update skills without confidence tracking\n- ❌ Ignore negative feedback\n- ❌ Make changes that break existing functionality\n- ❌ Create contradictory patterns\n- ❌ Update skills without understanding context\n\n## Quick Start\n\nAfter any skill completes, this agent automatically:\n\n1. **Analyzes** what happened\n2. **Extracts** patterns and insights\n3. **Updates** relevant skill files\n4. **Logs** to memory for future reference\n5. **Reports** summary to user\n\n## References\n\n- [SimpleMem: Efficient Lifelong Memory for LLM Agents](https:\u002F\u002Farxiv.org\u002Fhtml\u002F2601.02553v1)\n- [A Survey on the Memory Mechanism of Large Language Model Agents](https:\u002F\u002Fdl.acm.org\u002Fdoi\u002F10.1145\u002F3748302)\n- [Lifelong Learning of LLM based Agents](https:\u002F\u002Farxiv.org\u002Fhtml\u002F2501.07278v1)\n- [Evo-Memory: DeepMind's Benchmark](https:\u002F\u002Fshothota.medium.com\u002Fevo-memory-deepminds-new-benchmark)\n- [Let's Build a Self-Improving AI Agent](https:\u002F\u002Fmedium.com\u002F@nomannayeem\u002Flets-build-a-self-improving-ai-agent-that-learns-from-your-feedback-722d2ce9c2d9)\n",{"name":5,"metadata":44,"description":7,"allowed-tools":61},{"hooks":45},{"on_error":46,"before_start":50,"after_complete":53},[47],{"mode":27,"context":48,"trigger":49},"Error captured in {skill_name}","session-logger",[51],{"mode":27,"context":52,"trigger":49},"Start {skill_name}",[54,59],{"mode":55,"reason":56,"trigger":57,"condition":58},"ask_first","Submit improvements to repository","create-pr","skills_modified",{"mode":27,"context":60,"trigger":49},"Self-improvement cycle complete","Read, Write, Edit, Bash, Grep, Glob, WebSearch","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":72,"prompt":82,"zipAvailable":83},[73,76,79],{"tool":74,"command":75},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill self-improving-agent",{"tool":77,"command":78},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill self-improving-agent",{"tool":80,"command":81},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill self-improving-agent","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002FSKILL.md",true,[85,91,95,99,105,109,113,117,121,125],{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"hooks\u002Fpost-bash.sh","SCRIPT","脚本",243,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002Fhooks\u002Fpost-bash.sh",{"path":92,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":93,"sourceHtmlUrl":94},"hooks\u002Fpre-tool.sh",239,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002Fhooks\u002Fpre-tool.sh",{"path":96,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":97,"sourceHtmlUrl":98},"hooks\u002Fsession-end.sh",87,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002Fhooks\u002Fsession-end.sh",{"path":100,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":103,"sourceHtmlUrl":104},"memory\u002Fsemantic-patterns.json","REFERENCE","参考文档",13582,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002Fmemory\u002Fsemantic-patterns.json",{"path":106,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":107,"sourceHtmlUrl":108},"README.md",3535,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002FREADME.md",{"path":110,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":111,"sourceHtmlUrl":112},"references\u002Fappendix.md",3193,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002Freferences\u002Fappendix.md",{"path":114,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":115,"sourceHtmlUrl":116},"skill-report.json",10487,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002Fskill-report.json",{"path":118,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":119,"sourceHtmlUrl":120},"templates\u002Fcorrection-template.md",122,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002Ftemplates\u002Fcorrection-template.md",{"path":122,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":123,"sourceHtmlUrl":124},"templates\u002Fpattern-template.md",160,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002Ftemplates\u002Fpattern-template.md",{"path":126,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":127,"sourceHtmlUrl":128},"templates\u002Fvalidation-template.md",193,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002Fcharon-fan\u002Fself-improving-agent\u002Ftemplates\u002Fvalidation-template.md",[130,139,148,157,163,169],{"skillNo":131,"name":132,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":39},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[136,137,138],"model","model hierarchy","model hierarchy skill",{"skillNo":140,"name":141,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":39},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[145,146,147],"MCP","zoom","zoom mcp",{"skillNo":149,"name":150,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":39},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[154,155,156,146],"sdk","zoom apps sdk","apps",{"skillNo":158,"name":159,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":39},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[159],{"skillNo":164,"name":165,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":39},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[165],{"skillNo":170,"name":171,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":39},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[171]]