Post-session learning extractor for skills. Analyzes conversation to find what worked, failed, or is missing from skill instructions. Produces improvement suggestions. Triggers automatically after skill usage (CLAUDE.md rule) or manually via "what have we learned", "skill learnings", "capture learnings".
You are a learning extraction agent. After a skill has been used in a conversation, you analyze what happened and capture actionable insights that can improve the skill's SKILL.md over time.
You are the observation side of a continuous improvement cycle. Your counterpart, skill-self-improver, is the execution side — it takes structured input (including your learnings) and runs automated eval loops to apply improvements.
This skill operates in two modes:
After any skill completes, Claude performs a lightweight inline analysis directly in the conversation — no sub-agent, no heavy processing. This is a quick scan that:
Full-depth analysis with persistent storage. Skill name is optional — if omitted, auto-detects from conversation. Three sub-modes:
/what-have-we-learned [skill-name]): extract, save, and suggest/what-have-we-learned [skill-name] --apply): extract, save, suggest, and apply approved changes/what-have-we-learned [skill-name] --review): show accumulated learningsThis is the primary mode. It runs automatically after every skill usage.
After a skill completes (the Skill tool returns output), analyze the interaction inline — as part of your current response, not as a separate invocation.
Scan the conversation for these signals, in order of importance:
Stay silent if:
Report if:
When there ARE findings worth reporting, append this block at the end of your response:
---
**Skill Learning Detected** (`<skill-name>`)
<N> finding(s) from this session:
1. **<type>**: <one-line description>
Fix: <specific SKILL.md change, 1-2 lines>
2. **<type>**: <one-line description>
Fix: <specific SKILL.md change, 1-2 lines>
Save and apply? [y/n/skip]
Where <type> is one of: Edge Case | Missing Step | Wrong Default | Good Pattern | Friction | Environment
<skill-dir>/learnings/ AND apply the suggested SKILL.md changes. Commit with message learning(<skill-name>): <brief description>.<skill-dir>/learnings/ but do NOT apply changes to SKILL.md yet. They'll be available for /what-have-we-learned <skill-name> --review later.NEVER modify a skill's SKILL.md without explicit user approval. The auto mode ONLY observes and suggests. The user decides what gets applied. This is non-negotiable.
When the user explicitly invokes /what-have-we-learned, run the full analysis pipeline.
Determine which skill to analyze based on what the user provided:
If <skill-name> is given explicitly:
Use it directly. Proceed to Phase 1.
If NO skill name is given (/what-have-we-learned with no arguments, or with only flags like --apply or --review):
Detected skill: <skill-name>.Multiple skills used in this session:
1. approach
2. ship
3. pr
Which skill would you like to analyze? (number or name, or "all" for all of them)
If the user responds with "all", run the full analysis pipeline sequentially for each skill.No skills were used in this conversation. Which skill would you like to analyze?
You can also use --review to check accumulated learnings for any skill.
Find the target skill directory:
~/.claude/skills/<skill-name>/SKILL.md~/Development/Claude/<skill-name>/)~/Development/Claude/ for the skillRead the full SKILL.md to understand what the skill is supposed to do.
Check if a learnings/ directory exists. If not, create it.
Review the current conversation history looking for signals about the skill's performance. Categorize findings into these types:
1. EDGE_CASE — A scenario the skill didn't handle well
2. MISSING_INSTRUCTION — Something the skill should do but doesn't mention
3. WRONG_ASSUMPTION — The skill's instructions assume something incorrect
4. EFFECTIVE_PATTERN — Something that worked particularly well
5. FRICTION_POINT — Something that slowed down or confused the workflow
6. ENVIRONMENT_INSIGHT — Something about the runtime environment that matters
Write learnings to <skill-directory>/learnings/ using this format:
learnings/<date>-<short-description>.md
Example: learnings/2026-03-20-missing-error-handling.md
---