From reflect-skills
Analyze Claude Code sessions and update specified skills with learnings from user corrections and successful patterns. Supports manual /reflect command and automatic mode via stop hook. Corrections are signals for new memories. Approvals are confirmations of existing patterns.
How this skill is triggered — by the user, by Claude, or both
Slash command
/reflect-skills:reflectThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are running the reflect skill. Your job is to analyze the current conversation, extract learnings from user corrections and successful patterns, and update a specified skill file so the same mistakes don't repeat across sessions.
You are running the reflect skill. Your job is to analyze the current conversation, extract learnings from user corrections and successful patterns, and update a specified skill file so the same mistakes don't repeat across sessions.
Handle these based on the argument passed:
/reflect <skill-name> -- Run the full reflect workflow (see below)/reflect on -- Enable automatic mode: read the state file, set enabled: true, write it back. Confirm to user./reflect off -- Disable automatic mode: read the state file, set enabled: false, write it back. Confirm to user./reflect status -- Read and display the state file: whether auto-mode is on/off, last run timestamp, recent history.The state file is located at state/reflect-state.json relative to this skill's directory.
When the user calls /reflect <skill-name>:
Find the SKILL.md file for the named skill. Search in order:
~/.claude/skills/<skill-name>/SKILL.md~/.claude/skills/<skill-name>.md~/.claude/plugins/If not found, tell the user and ask them to provide the path.
Read the target skill file so you understand its current content.
Scan the full conversation history for two types of signals:
Corrections -- The user corrected your behavior:
Approvals/Confirmations -- The user confirmed something worked:
For each signal, assign a confidence level:
HIGH -- Direct, unambiguous user directives:
MEDIUM -- Patterns that worked well:
LOW -- Observations worth noting:
Based on the signals, determine how the target skill should be updated.
Critical: Integrate, don't append. Do not just add a "Learnings" changelog section at the bottom. Instead, work the learnings into the skill's existing instructions so Claude follows them naturally. For example:
For each proposed change, note:
Show the user a clear review with three sections:
Signals Detected: List each signal with its confidence level and a brief quote from the conversation showing where it came from.
HIGH: "Never generate button styles inline -- always reference the design system"
(from: user corrected inline style generation at turn 12)
MEDIUM: Using optional chaining for null checks worked well
(from: user approved the fix at turn 8)
Proposed Changes: Show the specific edits to the skill file. Use before/after format or describe the insertion clearly.
In section "## Component Patterns", add:
+ - Always reference design system components (PrimaryButton, SecondaryButton)
+ instead of generating inline button styles. Never invent component names.
Commit Message: A concise summary for git, e.g.:
reflect(frontend-patterns): add design system component rule from session corrections
Examples of natural language edits:
lastRun to current ISO timestamp, append to history array with skill name, signal count, and approved: true.After updating the skill file:
Check if the skill's parent directory is a git repo:
git -C <skill-directory> rev-parse --git-dir
If it IS a git repo:
git -C <dir> add <file>git -C <dir> commit -m "<message>"git -C <dir> pushIf it is NOT a git repo:
When triggered by the stop hook (the hook prints a message to stderr that you'll see), follow the same workflow as manual mode. The hook message will look like:
[Reflect] Session has N messages -- running automatic reflection
When you see this:
Never update skills without user approval in automatic mode.
fetchUser() from @/lib/api for user data" beats "Use the proper API functions."npx claudepluginhub vladdu/reflect-skills --plugin reflect-skillsAnalyzes coding sessions to detect corrections and preferences, proposing targeted updates to active Skills or CLAUDE.md. Triggered by 'learn from this session' or 'update skills'.
Captures high/medium/low confidence learnings from conversations via triggers like corrections, praise, edge cases. Improves skills by preventing mistakes and preserving successes. Invoke proactively after 'no/wrong', 'perfect', or session ends.
Captures high/medium/low confidence patterns from conversations to prevent repeating mistakes and preserve successes. Invoke proactively after corrections, praise, edge cases, or skill-heavy sessions.