Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Universal self-improvement system that learns from every skill interaction using multi-memory architecture.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
README.md
1# Self-Improving Agent23A self-improvement system that captures learning artifacts from skill experiences and proposes validated updates.45## Overview67This agent captures reusable evidence from skill interactions. It implements a feedback loop with memory artifacts, self-correction proposals, and evolution markers. Durable skill or code changes still require validation or explicit approval.89## Key Features1011- **Multi-Memory Architecture**: Semantic + Episodic + Working memory12- **Evidence-Gated Learning**: Captures reusable lessons from skill workflows13- **Pattern Extraction**: Converts experiences into reusable patterns14- **Self-Correction**: Fixes skill guidance when errors occur15- **Self-Validation**: Periodically verifies skill accuracy16- **Proposal Artifacts**: Writes proposed updates before durable skill changes17- **Confidence Tracking**: Measures pattern reliability over time18- **Human-in-the-Loop**: Collects feedback to validate improvements1920## Memory System2122Current Claude Code hook integration writes to:2324```25~/.claude/memory/26├── semantic/ # Patterns, rules, best practices27├── episodic/ # Specific experiences and episodes28└── working/ # Current session context29```3031## How It Works3233```34Any Skill Completes35↓36Extract Experience → Identify Patterns → Write Proposals → Consolidate Memory37↓ ↓ ↓ ↓38What happened? What can we reuse? Which proposals? Track metrics39```4041## Installation4243```bash44apb skills add ./skills/self-improving-agent --scope global --target all --link45```4647## Hooks (Optional)4849Wire hooks to capture errors and session-end signals:5051```json52{53"hooks": {54"PreToolUse": [55{56"matcher": "Bash|Write|Edit",57"hooks": [58{ "type": "command", "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/pre-tool.sh \"$TOOL_NAME\" \"$TOOL_INPUT\"" }59]60}61],62"PostToolUse": [63{64"matcher": "Bash",65"hooks": [66{ "type": "command", "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/post-bash.sh \"$TOOL_OUTPUT\" \"$EXIT_CODE\"" }67]68}69],70"Stop": [71{72"matcher": "",73"hooks": [74{ "type": "command", "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/session-end.sh" }75]76}77]78}79}80```8182## Triggering8384### Host-Supported Follow-up85When the host runtime supports hook follow-ups, this skill can be recorded or run after high-signal workflows such as:86- prd-planner87- code-reviewer88- debugger89- refactoring-specialist90- etc.9192### Manual93```94"自我进化"95"self-improve"96"分析今天的经验"97"总结这次教训"98```99100## Example Learning101102### Episode103```yaml104Skill: debugger105Situation: Form submission doesn't refresh data106Root Cause: Empty callback function107Pattern: Always verify callbacks have implementations108Confidence: 0.95 → Proposals: debugger, prd-implementation-precheck109```110111### Skill Update112```markdown113## Proposed Update (2025-01-11)114115### Pattern Added116**Callback Verification**: Always verify that callback functions117passed as props are not empty and actually execute logic.118119**Source**: Episode ep-2025-01-11-003 (3 occurrences)120**Action**: Propose adding to debugger checklist121```122123## Research Basis124125- [SimpleMem: Efficient Lifelong Memory](https://arxiv.org/html/2601.02553v1)126- [ACM Memory Mechanisms Survey](https://dl.acm.org/doi/10.1145/3748302)127- [Lifelong Learning of LLM Agents](https://arxiv.org/html/2501.07278v1)128129## Templates130131Reusable templates live in `skills/self-improving-agent/templates`:132- `pattern-template.md`133- `correction-template.md`134- `validation-template.md`135136## License137138MIT139