self-improving-agent
$
npx mdskill add alirezarezvani/claude-skills/self-improving-agent> Auto-memory captures. This plugin curates.
SKILL.md
.github/skills/self-improving-agentView on GitHub ↗
--- name: "self-improving-agent" description: "Curate Claude Code's auto-memory into durable project knowledge. Analyze MEMORY.md for patterns, promote proven learnings to CLAUDE.md and .claude/rules/, extract recurring solutions into reusable skills. Use when: (1) reviewing what Claude has learned about your project, (2) graduating a pattern from notes to enforced rules, (3) turning a debugging solution into a skill, (4) checking memory health and capacity." --- # Self-Improving Agent > Auto-memory captures. This plugin curates. Claude Code's auto-memory (v2.1.32+) automatically records project patterns, debugging insights, and your preferences in `MEMORY.md`. This plugin adds the intelligence layer: it analyzes what Claude has learned, promotes proven patterns into project rules, and extracts recurring solutions into reusable skills. ## Quick Reference | Command | What it does | |---------|-------------| | `/si:review` | Analyze MEMORY.md — find promotion candidates, stale entries, consolidation opportunities | | `/si:promote` | Graduate a pattern from MEMORY.md → CLAUDE.md or `.claude/rules/` | | `/si:extract` | Turn a proven pattern into a standalone skill | | `/si:status` | Memory health dashboard — line counts, topic files, recommendations | | `/si:remember` | Explicitly save important knowledge to auto-memory | ## How It Fits Together ``` ┌─────────────────────────────────────────────────────────┐ │ Claude Code Memory Stack │ ├─────────────┬──────────────────┬────────────────────────┤ │ CLAUDE.md │ Auto Memory │ Session Memory │ │ (you write)│ (Claude writes)│ (Claude writes) │ │ Rules & │ MEMORY.md │ Conversation logs │ │ standards │ + topic files │ + continuity │ │ Full load │ First 200 lines│ Contextual load │ ├─────────────┴──────────────────┴────────────────────────┤ │ ↑ /si:promote ↑ /si:review │ │ Self-Improving Agent (this plugin) │ │ ↓ /si:extract ↓ /si:remember │ ├─────────────────────────────────────────────────────────┤ │ .claude/rules/ │ New Skills │ Error Logs │ │ (scoped rules) │ (extracted) │ (auto-captured)│ └─────────────────────────────────────────────────────────┘ ``` ## Installation ### Claude Code (Plugin) ``` /plugin marketplace add alirezarezvani/claude-skills /plugin install self-improving-agent@claude-code-skills ``` ### OpenClaw ```bash clawhub install self-improving-agent ``` ### Codex CLI ```bash ./scripts/codex-install.sh --skill self-improving-agent ``` ## Memory Architecture ### Where things live | File | Who writes | Scope | Loaded | |------|-----------|-------|--------| | `./CLAUDE.md` | You (+ `/si:promote`) | Project rules | Full file, every session | | `~/.claude/CLAUDE.md` | You | Global preferences | Full file, every session | | `~/.claude/projects/<path>/memory/MEMORY.md` | Claude (auto) | Project learnings | First 200 lines | | `~/.claude/projects/<path>/memory/*.md` | Claude (overflow) | Topic-specific notes | On demand | | `.claude/rules/*.md` | You (+ `/si:promote`) | Scoped rules | When matching files open | ### The promotion lifecycle ``` 1. Claude discovers pattern → auto-memory (MEMORY.md) 2. Pattern recurs 2-3x → /si:review flags it as promotion candidate 3. You approve → /si:promote graduates it to CLAUDE.md or rules/ 4. Pattern becomes an enforced rule, not just a note 5. MEMORY.md entry removed → frees space for new learnings ``` ## Core Concepts ### Auto-memory is capture, not curation Auto-memory is excellent at recording what Claude learns. But it has no judgment about: - Which learnings are temporary vs. permanent - Which patterns should become enforced rules - When the 200-line limit is wasting space on stale entries - Which solutions are good enough to become reusable skills That's what this plugin does. ### Promotion = graduation When you promote a learning, it moves from Claude's scratchpad (MEMORY.md) to your project's rule system (CLAUDE.md or `.claude/rules/`). The difference matters: - **MEMORY.md**: "I noticed this project uses pnpm" (background context) - **CLAUDE.md**: "Use pnpm, not npm" (enforced instruction) Promoted rules have higher priority and load in full (not truncated at 200 lines). ### Rules directory for scoped knowledge Not everything belongs in CLAUDE.md. Use `.claude/rules/` for patterns that only apply to specific file types: ```yaml # .claude/rules/api-testing.md --- paths: - "src/api/**/*.test.ts" - "tests/api/**/*" --- - Use supertest for API endpoint testing - Mock external services with msw - Always test error responses, not just happy paths ``` This loads only when Claude works with API test files — zero overhead otherwise. ## Agents ### memory-analyst Analyzes MEMORY.md and topic files to identify: - Entries that recur across sessions (promotion candidates) - Stale entries referencing deleted files or old patterns - Related entries that should be consolidated - Gaps between what MEMORY.md knows and what CLAUDE.md enforces ### skill-extractor Takes a proven pattern and generates a complete skill: - SKILL.md with proper frontmatter - Reference documentation - Examples and edge cases - Ready for `/plugin install` or `clawhub publish` ## Hooks ### error-capture (PostToolUse → Bash) Monitors command output for errors. When detected, appends a structured entry to auto-memory with: - The command that failed - Error output (truncated) - Timestamp and context - Suggested category **Token overhead:** Zero on success. ~30 tokens only when an error is detected. ## Platform Support | Platform | Memory System | Plugin Works? | |----------|--------------|---------------| | Claude Code | Auto-memory (MEMORY.md) | ✅ Full support | | OpenClaw | workspace/MEMORY.md | ✅ Adapted (reads workspace memory) | | Codex CLI | AGENTS.md | ✅ Adapted (reads AGENTS.md patterns) | | GitHub Copilot | `.github/copilot-instructions.md` | ⚠️ Manual promotion only | ## Related - [Claude Code Memory Docs](https://code.claude.com/docs/en/memory) - [pskoett/self-improving-agent](https://clawhub.ai/pskoett/self-improving-agent) — inspiration - [playwright-pro](engineering-team/playwright-pro/) — sister plugin in this repo
More from alirezarezvani/claude-skills
- a11y-auditAccessibility audit skill for scanning, fixing, and verifying WCAG 2.2 Level A and AA compliance across React, Next.js, Vue, Angular, Svelte, and plain HTML codebases. Use when auditing accessibility, fixing a11y violations, checking color contrast, generating compliance reports, or integrating accessibility checks into CI/CD pipelines.
- ab-test-setupWhen the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.
- ad-creativeWhen the user needs to generate, iterate, or scale ad creative for paid advertising. Use when they say 'write ad copy,' 'generate headlines,' 'create ad variations,' 'bulk creative,' 'iterate on ads,' 'ad copy validation,' 'RSA headlines,' 'Meta ad copy,' 'LinkedIn ad,' or 'creative testing.' This is pure creative production — distinct from paid-ads (campaign strategy). Use ad-creative when you need the copy, not the campaign plan.
- adversarial-reviewerAdversarial code review that breaks the self-review monoculture. Use when you want a genuinely critical review of recent changes, before merging a PR, or when you suspect Claude is being too agreeable about code quality. Forces perspective shifts through hostile reviewer personas that catch blind spots the author's mental model shares with the reviewer.
- aeoAnswer Engine Optimization (AEO) skill — optimize content to be cited by AI language models (ChatGPT, Perplexity, Claude, Gemini, Mistral) as authoritative sources. Distinct from SEO — AEO optimizes for citation in LLM-generated responses, not search rankings. Use when planning content for AI-first search audiences, auditing existing content for E-E-A-T signals, tracking which pages get cited by which LLMs, or building a citation-friendly content strategy. Triggers — 'AEO audit', 'optimize for ChatGPT', 'get cited by Perplexity', 'LLM citation strategy', 'answer engine optimization', 'content for AI search', 'E-E-A-T audit'. Output is a markdown audit report (default) or JSON for pipeline integration. Stdlib-only Python tools.
- agent-designerUse when the user asks to design a multi-agent system, pick an orchestration pattern (supervisor/swarm/pipeline), generate tool schemas for agents, or evaluate agent execution logs for cost, latency, and failure bottlenecks. Examples: 'design an agent architecture for research automation', 'generate Anthropic tool schemas from these tool descriptions', 'analyze these agent run logs for bottlenecks'. NOT for Claude Code workflow files (use workflow-builder) or single-agent prompt design (use agent-workflow-designer).
- agent-protocolInter-agent communication protocol for C-suite agent teams. Defines invocation syntax, loop prevention, isolation rules, and response formats. Use when C-suite agents need to query each other, coordinate cross-functional analysis, or run board meetings with multiple agent roles.
- agent-workflow-designerDesign production-grade multi-agent workflows with clear pattern choice (sequential, parallel, hierarchical), handoff contracts, failure handling, and cost/context controls. Use when architecting a multi-step agent pipeline, choosing between single-agent vs multi-agent approaches, or refactoring an LLM workflow that suffers from context bloat or unreliable handoffs.
- agenthubMulti-agent collaboration plugin that spawns N parallel subagents competing on the same task via git worktree isolation. Agents work independently, results are evaluated by metric or LLM judge, and the best branch is merged. Use when: user wants multiple approaches tried in parallel — code optimization, content variation, research exploration, or any task that benefits from parallel competition. Requires: a git repo.
- agile-product-ownerAgile product ownership for backlog management and sprint execution. Covers user story writing, acceptance criteria, sprint planning, and velocity tracking. Use when writing user stories, creating acceptance criteria, planning sprints, estimating story points, breaking down epics, or prioritizing the backlog.