Agent skill
self-improve
Captures learnings, errors, and corrections to enable continuous improvement. Activates when a command fails, the user corrects Claude, a knowledge gap is discovered, or a better approach is found.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/self-improve
SKILL.md
Self-Improvement Engine
You are a continuously learning agent. After every meaningful interaction, evaluate whether something was learned and log it.
When to Log
Errors (ERR) — Log when:
- A command returns a non-zero exit code
- An exception or stack trace appears
- Unexpected output or behavior occurs
- A timeout or connection failure happens
- A tool call is denied or fails
Learnings (LRN) — Log when:
- The user corrects you ("No, that's wrong...", "Actually...", "Not like that...")
- You discover your knowledge is outdated or incorrect
- Documentation you referenced is wrong or has changed
- An API behaves differently than expected
- A better approach is discovered for something you've done before
- The user provides information you didn't know
Feature Requests (FEAT) — Log when:
- The user asks for a capability that doesn't exist
- You realize a skill would make a recurring task easier
- The user says "I wish you could..." or "Can you..."
How to Log
Each entry is an individual markdown file in vault/learnings/ with YAML frontmatter.
File Naming
vault/learnings/LRN-YYYYMMDD-XXX.mdfor learningsvault/learnings/ERR-YYYYMMDD-XXX.mdfor errorsvault/learnings/FEAT-YYYYMMDD-XXX.mdfor feature requests
To determine the next sequence number (XXX), list existing files in vault/learnings/ matching today's date and the entry type prefix, then increment.
Templates
See template files for the full frontmatter and body format:
- templates/learning.md — LRN template
- templates/error.md — ERR template
- templates/feature.md — FEAT template
Recurring Pattern Detection
Before creating a new entry:
- List files in
vault/learnings/and scan their frontmatter for matchingpattern-keyor overlappingtags - If a match is found:
- Add a
[[wikilink]]to therelatedlist in both the existing and new file's frontmatter - Increment
recurrence-counton the original file - Update
last-seendate on the original file - Do NOT create a duplicate entry — only update the original
- Add a
- If no match, create a new entry file
Promotion Rules
When a learning meets ALL of these criteria, flag it for promotion:
recurrence-count>= 3- Occurred across 2+ distinct tasks
- Within a 30-day window (
last-seen-first-seen<= 30 days)
Promotion process:
- Change
statustopromotedin the file's frontmatter - Append the learning to the
## Promoted Learningssection ofCLAUDE.md - Format:
- **[Area]**: Learning description (promoted YYYY-MM-DD, from LRN-XXXXXXXX-XXX)
Important: Always ask the user for approval before promoting. Say:
"I've noticed a recurring pattern: [description]. This has come up [N] times. Should I promote this to CLAUDE.md so I always remember it?"
Skill Extraction
When a learning is valuable enough to become a reusable skill, it qualifies if:
- It has 2+
[[wikilinks]]in itsrelatedlist - Status is
resolvedwith a verified working fix - It required non-obvious debugging to discover
- It's broadly applicable across projects
To extract, create a new SKILL.md in .claude/skills/<skill-name>/ with:
disable-model-invocation: true(user must opt-in to new auto-generated skills)- Clear description of what the skill does
- The learned workflow as step-by-step instructions
Always ask the user before creating a new skill.
Daily Digest
When invoked with /self-improve digest or at the end of a long session, summarize:
- New entries added today (count by type) — check
vault/learnings/for files with today's date - Any patterns approaching promotion threshold (recurrence-count >= 2)
- Any feature requests that could be built quickly
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?