/engineering-advanced-skills:self-improving-agentfrom engineering-advanced-skills
Curates agent memory, extracts repeated lessons, and promotes them into reviewed rules. Includes memory health checks, feedback loops, regression detection, and meta-learning for self-improving agents.
Ships in engineering-advanced-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The agent captures what went wrong or right in a session, curates it in memory, and proposes promoting a lesson into a permanent rule only when it has recurred and a person has approved it. Rules compound: a wrong rule repeats its mistake in every later session, so promotion is a reviewed change, never an automatic one.
Before capturing or promoting learnings, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
MEMORY.md, and rules dir to operate on (the subject the tools read and write).--min-occurrences; decides what is kept vs discarded).Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
Compound sub-skill architecture — each file in skills/ handles one step of the improvement loop:
| Sub-Skill | File | Purpose |
|---|---|---|
| Remember | skills/remember.md | Capture errors and learnings from current session |
| Extract | skills/extract.md | Extract reusable patterns from completed work |
| Promote | skills/promote.md | Graduate proven patterns to permanent rules |
| Review | skills/review.md | Audit memory health, prune stale entries |
| Status | skills/status.md | Dashboard showing memory state and learning progress |
Flow: Remember → Extract → Promote → Review, with Status providing visibility back into the cycle.
memory_health_checker.py --memory <MEMORY.md>. It reads both layouts: ## section entries, and index files whose lines point at topic files (Claude Code auto-memory), where it reads each topic file's frontmatter and age and flags pointers to missing files.pattern_extractor.py and feedback_analyzer.py patterns.rule_promoter.py --entry-title ... --dry-run prints the rule text and whether it meets the bar (recurrence, confidence)..claude/rules/), and apply with --apply only after an explicit yes.regression_detector.py compare; roll the rule back if first-attempt success or corrections get worse.# from engineering/self-improving-agent/
python3 scripts/memory_health_checker.py --memory assets/memory_index/MEMORY.md # flags one broken pointer
python3 scripts/feedback_analyzer.py analyze --input assets/sample_feedback.jsonl
python3 scripts/regression_detector.py compare --input assets/sample_metrics.json # REGRESSION DETECTED after a rule change
| Tool | Purpose | Example |
|---|---|---|
pattern_extractor.py | Recurring patterns in session logs (JSONL) | python3 scripts/pattern_extractor.py --input sessions.jsonl --min-occurrences 3 |
memory_health_checker.py | Line limits, stale and duplicate entries, broken topic pointers, promotion candidates | python3 scripts/memory_health_checker.py --memory ./MEMORY.md --rules ./.claude/rules/ |
rule_promoter.py | Validate and (after approval) apply a promotion from ## section memory to rules | python3 scripts/rule_promoter.py --memory ./MEMORY.md --list-candidates |
feedback_analyzer.py | Success rates, corrections, tool errors and opportunities from a feedback log | python3 scripts/feedback_analyzer.py analyze --input feedback.jsonl |
regression_detector.py | Baseline vs current session metrics around a rule or memory change | python3 scripts/regression_detector.py compare --input metrics.json |
rule_manager.py | CRUD over a JSON rules knowledge base | python3 scripts/rule_manager.py --db rules_kb.json list |
Exit codes: 0 report produced; 2 unusable input (missing or unreadable file, no entries, no subcommand). A memory path that does not exist is an error, not a "stateless" result. rule_promoter.py handles section-style memory only; for an index-style MEMORY.md it says so and the promotion is done by hand.
Mistake: Promoting a lesson into CLAUDE.md or rules without asking. Why it matters: Rules apply to every later session; a rule learned from one bad day keeps steering the agent wrong long after. Instead: Show the dry-run rule text and target, and apply only after the user says yes.
Mistake: Promoting after a single occurrence. Why it matters: One-off fixes are often context-specific; as rules they misfire elsewhere. Instead: Wait for the recurrence threshold (3 by default) or an explicit user instruction.
Mistake: Letting memory grow without curation. Why it matters: Over-limit or duplicate memory crowds the context window and buries the lessons that matter. Instead: Run the health check on a schedule, consolidate duplicates, and delete pointers to topics that no longer hold.
Load the reference that matches the task — keep this file lean and pull detail on demand:
This skill covers:
This skill does NOT cover:
engineering/agent-workflow-designer.engineering/prompt-engineer-toolkit.engineering/observability-designer.engineering/agent-designer.| File | Purpose |
|---|---|
skills/*.md | Sub-skills: remember, extract, promote, review, status |
scripts/*.py | Six stdlib CLIs (see Tools Overview) |
assets/memory_index/ | Index-style MEMORY.md with two topic files and one broken pointer |
assets/sample_feedback.jsonl | Twelve feedback entries with a recurring npm/pnpm correction |
assets/sample_metrics.json | Baseline and current sessions around a rule change (regression) |
assets/memory_index/MEMORY.md (opens in a new tab)assets/memory_index/feedback_migrations.md (opens in a new tab)assets/memory_index/feedback_pnpm.md (opens in a new tab)assets/sample_feedback.jsonl (opens in a new tab)assets/sample_metrics.json (opens in a new tab)references/feedback-loop-patterns.md (opens in a new tab)references/memory-curation-guide.md (opens in a new tab)references/meta-learning-architectures.md (opens in a new tab)references/self-improvement-methodology.md (opens in a new tab)scripts/feedback_analyzer.py (opens in a new tab)scripts/memory_health_checker.py (opens in a new tab)scripts/pattern_extractor.py (opens in a new tab)scripts/regression_detector.py (opens in a new tab)scripts/rule_manager.py (opens in a new tab)scripts/rule_promoter.py (opens in a new tab)skills/extract.md (opens in a new tab)skills/promote.md (opens in a new tab)skills/remember.md (opens in a new tab)skills/review.md (opens in a new tab)skills/status.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
100 skills in this plugin
/a11y-auditStatic WCAG scan of HTML files (alt text, headings, labels, ARIA, lang, landmarks) and colour contrast checks for colour pairs or CSS. Use when auditing templates for accessibility, checking contrast, or adding an a11y gate to CI.
/agent-designerDesigns multi-agent system architectures with orchestration patterns, tool schemas, and performance evaluation. Use when building AI agent systems, designing agent workflows, creating tool schemas, or evaluating agent performance.
/agent-harnessTest and evaluation harness for AI agents — scenario suites, deterministic replay, regression diffing, cost and latency budgets. Use when agent quality is vibe-checked, before shipping a prompt or model change, or when evals drift.
npx claudepluginhub borghei/claude-skills --plugin engineering-advanced-skillsOther plugins' skills for the same job