[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71J7PB8B7ZDG9VN5FMXTQZ7":3,"skill-same:01M71J7PB8B7ZDG9VN5FMXTQZ7":123},{"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":14,"repositoryHtmlUrl":65,"repositoryHomepageUrl":66,"ownerHtmlUrl":67,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":68,"install":69,"resources":82},"01M71J7PB8B7ZDG9VN5FMXTQZ7","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.","bobvarkey\u002Fdiabetes-buddy","bobvarkey","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F72114170?v=4","01M6KP64KQA4GNH11CSV7FXKNB","Bob Varkey","01M71J703CY616M3Q53B0VQPY7",0,"MIT","https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\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 improving","self improving agent","self","evolve","edit","write","repository","read","create","architecture","websearch","Bash","ask","auto","self-improving","hooks","cycle","submit","memory","error","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":32,"context":48,"trigger":49},"Error captured in {skill_name}","session-logger",[51],{"mode":32,"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":32,"context":60,"trigger":49},"Self-improvement cycle complete","Read, Write, Edit, Bash, Grep, Glob, WebSearch","main","96c323ae8e97220e2713e00f6b4a548258ea364b",".agents\u002Fskills\u002Fself-improving-agent","https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy","https:\u002F\u002Fdiabetes-buddy.vercel.app","https:\u002F\u002Fgithub.com\u002Fbobvarkey","2026-09-28 10:30:17",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add bobvarkey\u002Fdiabetes-buddy --skill self-improving-agent",{"tool":75,"command":76},"bunx","bunx skills add bobvarkey\u002Fdiabetes-buddy --skill self-improving-agent",{"tool":78,"command":79},"pnpm","pnpm dlx skills add bobvarkey\u002Fdiabetes-buddy --skill self-improving-agent","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002FSKILL.md",true,[83,89,93,97,103,107,111,115,119],{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"hooks\u002Fpost-bash.sh","SCRIPT","脚本",243,"https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002Fhooks\u002Fpost-bash.sh",{"path":90,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":91,"sourceHtmlUrl":92},"hooks\u002Fpre-tool.sh",239,"https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002Fhooks\u002Fpre-tool.sh",{"path":94,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":95,"sourceHtmlUrl":96},"hooks\u002Fsession-end.sh",87,"https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002Fhooks\u002Fsession-end.sh",{"path":98,"resourceType":99,"resourceTypeDesc":100,"sizeBytes":101,"sourceHtmlUrl":102},"memory\u002Fsemantic-patterns.json","REFERENCE","参考文档",13589,"https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002Fmemory\u002Fsemantic-patterns.json",{"path":104,"resourceType":99,"resourceTypeDesc":100,"sizeBytes":105,"sourceHtmlUrl":106},"README.md",3535,"https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002FREADME.md",{"path":108,"resourceType":99,"resourceTypeDesc":100,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002Fappendix.md",3193,"https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002Freferences\u002Fappendix.md",{"path":112,"resourceType":99,"resourceTypeDesc":100,"sizeBytes":113,"sourceHtmlUrl":114},"templates\u002Fcorrection-template.md",122,"https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002Ftemplates\u002Fcorrection-template.md",{"path":116,"resourceType":99,"resourceTypeDesc":100,"sizeBytes":117,"sourceHtmlUrl":118},"templates\u002Fpattern-template.md",160,"https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002Ftemplates\u002Fpattern-template.md",{"path":120,"resourceType":99,"resourceTypeDesc":100,"sizeBytes":121,"sourceHtmlUrl":122},"templates\u002Fvalidation-template.md",193,"https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fself-improving-agent\u002Ftemplates\u002Fvalidation-template.md",[124,151,176,200,211,238],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":128,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":39},"01M71JB0ESZJDBPJCQHG5CTZZ2","youtube","YouTube Data API integration with managed OAuth. Search videos, manage playlists, access channel data, and interact with comments. Use this skill when users want to interact with YouTube. For other third party apps, use the api-gateway skill (https:\u002F\u002Fclawhub.ai\u002Fbyungkyu\u002Fapi-gateway).","https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-api-skill\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-api-skill\u002FSKILL.md",[],[126,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150],"api","OAuth","use","gateway skill","clawhub","api integration","manage","for","api-gateway","gateway","data","network","valid","when","apps","access","maton","managed","search",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":39},"01M71JAW9XM1K0FKXHR30ZWC5Y","xcellent","Free, open-source X (Twitter) growth tool. Analytics dashboard, niche discovery, AI tweet writer, best posting times, and credit usage monitoring — all running locally on your machine. BYOK (Bring Your Own Key) model means users only pay X directly for API usage (~$5-15\u002Fmo). A free alternative to SuperX ($39\u002Fmo), Typefully, and Tweet Hunter.","https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002Fskills\u002Fxcellent\u002FSKILL.md",[],[153,139,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175],"hunter","bring","model","machine","discovery","tool","twitter","typefully","tweet writer","posting","usage","running","writer","open","analytics dashboard","free","pay","only",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":182,"publishedAt":39},"01M71JAR498425CSRJKPPTJ6F4","work-application","CV generation, job scraping, offer analysis, and application tracking. Use when: (1) generating or adapting a CV\u002Fresume for a job offer, (2) scraping job offers from French platforms, (3) analyzing and ranking job offers, (4) generating a full analysis report for a single offer (skills, company, location, salary), (5) tracking candidatures and their status, (6) validating CV content against formatting guardrails. NOT for: cover letter generation (planned), LinkedIn direct messaging, job application submission, salary negotiation coaching.","https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002Fskills\u002Fwork-application\u002FSKILL.md",[],[183,184,185,186,187,142,188,143,145,189,190,191,192,193,194,195,196,197,198,199],"work","work application","application","master","cover","status","config","reports","analysis","files","ranking","Guardrails","company","messaging","french","scraping","analyzing",{"skillNo":201,"name":202,"nameZh":6,"description":203,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":204,"categories":205,"keywords":206,"publishedAt":39},"01M71JAPH8A5CH6G5T8K24YQ85","weather","Get current weather and forecasts (no API key required).","https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002Fskills\u002Fweather\u002FSKILL.md",[],[202,132,207,208,209,210],"https","help","get","curl",{"skillNo":212,"name":213,"nameZh":6,"description":214,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":215,"categories":216,"keywords":217,"publishedAt":39},"01M71JAMMTE4K1HZW7D8JQWKDQ","to-do","Give your AI the power to act in the future. Schedule delayed prompts and one-off reminders that automatically wake the agent up at an exact moment to execute workflows, check systems, or send notifications.","https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002Fskills\u002Fto-do\u002FSKILL.md",[],[218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237],"to do","do","reminders","wake","notifications","check","schedule","one","workflows","up","send","power","at","openclaw","prompts","execute","tz","act","systems","node",{"skillNo":239,"name":240,"nameZh":6,"description":241,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":242,"categories":243,"keywords":244,"publishedAt":39},"01M71JAKBCTYE3D7V8B72VKSJE","summarize","Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube).","https:\u002F\u002Fgithub.com\u002Fbobvarkey\u002Fdiabetes-buddy\u002Fblob\u002Fmain\u002Fskills\u002Fsummarize\u002FSKILL.md",[],[240,245,192,246,247,207,248,249,250,126,251,252,253],"tap","pdfs","install","web","Audio","cli","with","brew","images"]