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 universal self-improvement system that learns from ALL skill experiences and continuously updates the codebase.45## Overview67This agent learns from **every skill interaction** to achieve true lifelong learning. It implements a complete feedback loop with multi-memory architecture, self-correction, and evolution markers.89## Key Features1011- **Multi-Memory Architecture**: Semantic + Episodic + Working memory12- **Universal Learning**: Learns from ALL skills, not just PRDs13- **Pattern Extraction**: Converts experiences into reusable patterns14- **Self-Correction**: Fixes skill guidance when errors occur15- **Self-Validation**: Periodically verifies skill accuracy16- **Automatic Updates**: Updates related skills based on learned patterns17- **Confidence Tracking**: Measures pattern reliability over time18- **Human-in-the-Loop**: Collects feedback to validate improvements1920## Memory System2122```23~/.claude/memory/24├── semantic/ # Patterns, rules, best practices25├── episodic/ # Specific experiences and episodes26└── working/ # Current session context27```2829## How It Works3031```32Any Skill Completes33↓34Extract Experience → Identify Patterns → Update Skills → Consolidate Memory35↓ ↓ ↓ ↓36What happened? What can we reuse? Which skills? Track metrics37```3839## Installation4041```bash42ln -s ~/path/to/agent-playbook/skills/self-improving-agent ~/.claude/skills/self-improving-agent43```4445## Hooks (Optional)4647Wire hooks to capture errors and session-end signals:4849```json50{51"hooks": {52"PreToolUse": [53{54"matcher": "Bash|Write|Edit",55"hooks": [56{ "type": "command", "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/pre-tool.sh \"$TOOL_NAME\" \"$TOOL_INPUT\"" }57]58}59],60"PostToolUse": [61{62"matcher": "Bash",63"hooks": [64{ "type": "command", "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/post-bash.sh \"$TOOL_OUTPUT\" \"$EXIT_CODE\"" }65]66}67],68"Stop": [69{70"matcher": "",71"hooks": [72{ "type": "command", "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/session-end.sh" }73]74}75]76}77}78```7980## Triggering8182### Automatic83After ANY skill completes:84- prd-planner85- code-reviewer86- debugger87- refactoring-specialist88- etc.8990### Manual91```92"自我进化"93"self-improve"94"分析今天的经验"95"总结这次教训"96```9798## Example Learning99100### Episode101```yaml102Skill: debugger103Situation: Form submission doesn't refresh data104Root Cause: Empty callback function105Pattern: Always verify callbacks have implementations106Confidence: 0.95 → Updates: debugger, prd-implementation-precheck107```108109### Skill Update110```markdown111## Auto-Update (2025-01-11)112113### Pattern Added114**Callback Verification**: Always verify that callback functions115passed as props are not empty and actually execute logic.116117**Source**: Episode ep-2025-01-11-003 (3 occurrences)118**Action**: Added to debugger checklist119```120121## Research Basis122123- [SimpleMem: Efficient Lifelong Memory](https://arxiv.org/html/2601.02553v1)124- [ACM Memory Mechanisms Survey](https://dl.acm.org/doi/10.1145/3748302)125- [Lifelong Learning of LLM Agents](https://arxiv.org/html/2501.07278v1)126127## Templates128129Reusable templates live in `skills/self-improving-agent/templates`:130- `pattern-template.md`131- `correction-template.md`132- `validation-template.md`133134## License135136MIT137