Self Improving Agent

alirezarezvani/claude-skills/engineering-team/self-improving-agent/skills/self-improving-agent

作者 alirezarezvani19392f7a0826無授權條款27K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫5 週前更新

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.

僅含說明AI & Agents
AI 產生的概覽

將 Claude Code 自動記憶整理為長期專案規則與可重複使用的技能。

功能
分析 MEMORY.md 與主題檔案,找出反覆出現的模式、過時項目與可合併的內容。把經過驗證的經驗提升到 CLAUDE.md 或 .claude/rules/,並將反覆出現的解決方案萃取為包含 SKILL.md、參考文件與範例的獨立技能。也會回報記憶體健康狀態與容量,並可明確將知識存入自動記憶。
適用情境
適用於檢視代理已瞭解的專案資訊、把反覆出現的模式從筆記升級為強制規則、將除錯解法轉為可重複使用的技能,或檢查記憶體健康狀態與容量。
執行需求
需要啟用自動記憶的 Claude Code(v2.1.32+),或 OpenClaw、Codex CLI 等相容平台;僅為說明文件,未附帶指令碼。

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

CommandWhat it does
/si:memory-reviewAnalyze MEMORY.md — find promotion candidates, stale entries, consolidation opportunities
/si:promoteGraduate a pattern from MEMORY.md → CLAUDE.md or .claude/rules/
/si:extractTurn a proven pattern into a standalone skill
/si:memory-statusMemory health dashboard — line counts, topic files, recommendations
/si:rememberExplicitly 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:memory-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

FileWho writesScopeLoaded
./CLAUDE.mdYou (+ /si:promote)Project rulesFull file, every session
~/.claude/CLAUDE.mdYouGlobal preferencesFull file, every session
~/.claude/projects/<path>/memory/MEMORY.mdClaude (auto)Project learningsFirst 200 lines
~/.claude/projects/<path>/memory/*.mdClaude (overflow)Topic-specific notesOn demand
.claude/rules/*.mdYou (+ /si:promote)Scoped rulesWhen matching files open

The promotion lifecycle

1. Claude discovers pattern → auto-memory (MEMORY.md)2. Pattern recurs 2-3x → /si:memory-review flags it as promotion candidate3. You approve → /si:promote graduates it to CLAUDE.md or rules/4. Pattern becomes an enforced rule, not just a note5. 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

PlatformMemory SystemPlugin Works?
Claude CodeAuto-memory (MEMORY.md)✅ Full support
OpenClawworkspace/MEMORY.md✅ Adapted (reads workspace memory)
Codex CLIAGENTS.md✅ Adapted (reads AGENTS.md patterns)
GitHub Copilot.github/copilot-instructions.md⚠️ Manual promotion only

Related

來源與署名

來源:alirezarezvani/claude-skills位於engineering-team/self-improving-agent/skills/self-improving-agent提交19392f7

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架