reflection
Skill4 starsChanged 3 months agoMITView on GitHub
Analyze session patterns, capture mistakes, curate rules. Unified learning loop. Triggered by "analyze session", "what did I learn", "improve CLAUDE.md", or /reflection
We split this skill into the rules it gives an agent
13 rules. 0 are common, 6 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Run scripts/analyze-sessions.sh to aggregate recent activity
- Distinctive: line 27
When user says "I keep making this mistake" or describes a recurring error:
- Very specific: line 30
Check rules/learned-anti-patterns.md for duplicates
- Very specific: line 33
Check audit/.anti-patterns.lock before writing
- Distinctive: line 40
Check rules/ for staleness (specific versions, untriggered in 90 days)
- Very specific: line 41
Update audit/.last-reflection with today's date when complete
- Very specific: line 44
Run scripts/promotion-candidates.sh to list entries with Count >= 3 not yet marked | Promoted:.
- Very specific: line 69
Before writing to rules/learned-anti-patterns.md:
- Very specific: line 70
If audit/.anti-patterns.lock exists → blocked (team-execute QA is writing)
- Distinctive: line 75
Don't remove rules that haven't been tested
- Distinctive: line 76
Don't add rules already covered by hooks
- Distinctive: line 77
Don't treat one-off errors as patterns (require Count >= 2)
- Distinctive: line 78
Don't propose rules that are generic software engineering
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Reflection — Unified Learning Loop
Three modes based on context:
Mode 1: Session Analysis
Reads audit/bash-commands-*.log for patterns and recent git log.
- Run
scripts/analyze-sessions.shto aggregate recent activity - Identify: repeated errors, permission blocks, hook violations, time sinks
- Summarize: files touched, patterns observed, recurring issues
- Propose: specific improvements to CLAUDE.md or rules/
Mode 2: Mistake Capture
When user says "I keep making this mistake" or describes a recurring error:
- Prompt for: context, mistake, correction, severity (critical/warning/info), tags
- Check
rules/learned-anti-patterns.mdfor duplicates - Duplicate → increment Count, update Since date
- New → append:
- **Pattern**: <desc> | **Fix**: <fix> | **Severity**: <level> | **Tags**: <tags> | **Count**: 1 | **Since**: YYYY-MM-DD - Check
audit/.anti-patterns.lockbefore writing
Mode 3: Rules Curation
- Prune learned-anti-patterns.md per severity rules:
critical: never auto-prunedwarning: prune when Count < 2 AND Since > 90 daysinfo: prune by lowest count when over 50-line cap
- Check rules/ for staleness (specific versions, untriggered in 90 days)
- Update
audit/.last-reflectionwith today's date when complete
Pattern Promotion
Run scripts/promotion-candidates.sh to list entries with Count >= 3 not yet
marked | **Promoted**:. For each candidate:
Mechanical branch — pattern is expressible as regex / AST grep / exit-code (no model reasoning needed):
- Propose a regex in
hooks/test-quality-lint.sh(test patterns), or - A check in an existing hook (code patterns), or
- A new line in
rules/(convention patterns).
Behavioral branch — pattern needs judgment (not mechanically detectable). Propose promotion using this taxonomy:
- Repeatable, user-invoked sequence → command (
commands/<name>.md) - Auto-triggered behavior / style enforcement → skill (
skills/<name>/SKILL.md) - Complex, multi-step process needing isolation → agent (
agents/<name>.md)
Propose only. After user approval, create the artifact and append
| **Promoted**: <artifact> to the anti-pattern entry.
Scoping
- Project-specific pattern → repo
.claude/rules/learned-anti-patterns.md. - Universal pattern → global
~/.claude/rules/learned-anti-patterns.md. - On duplicate pattern text, project overrides global (dedup is by pattern text,
not ID). Global edits reach
~/.claudeviascripts/deploy.sh(repo root).
Write Safety
Before writing to rules/learned-anti-patterns.md:
- If
audit/.anti-patterns.lockexists → blocked (team-execute QA is writing)
All changes require user approval before writing.
Gotchas
- Don't remove rules that haven't been tested
- Don't add rules already covered by hooks
- Don't treat one-off errors as patterns (require Count >= 2)
- Don't propose rules that are generic software engineering
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- idanbeck/claude-skills★ 14same name
- davidkiss/smart-ai-skills★ 4same name
- hajekim/agentic-design-patterns-skills★ 4same name
- mfang0126/openclaw-skills★ 4same name
- DavoDC/claude-playbook★ 1same name
- hajekim/agentic-design-patterns-extension★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository48 other files it gives its agents.
- .claude/templates/AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- .cursor/rules/core.mdcCursor rule
- .cursor/rules/go.mdcCursor rule
- .cursor/rules/k8s.mdcCursor rule
- .cursor/rules/node.mdcCursor rule
- .cursor/rules/python.mdcCursor rule
- .cursor/rules/rust.mdcCursor rule
- .cursor/rules/tdd.mdcCursor rule
- .cursor/rules/workbench.mdcCursor rule
- llms-full.txtllms.txt
- llms.txtllms.txt
- cmux-sprint-orchestratorSkill
- config-auditSkill
- doneSkill
- eurekaSkill
- goalSkill
- go-reviewSkill
- handoffSkill
- js-reviewSkill
- k8s-debugSkill
- k8s-reviewSkill
- kickoffSkill
- pr-review-ingestSkill
- pr-reviewSkill
- python-reviewSkill
- skill-evalSkill
- tdd-protocolSkill
- team-executeSkill
- team-planSkill
- team-shutdownSkill
- test-reviewSkill
- validate-recommendationSkill
- worktree-guideSkill
- babysitSkill
- canvasSkill
- create-hookSkill
- create-ruleSkill
- create-skillSkill
- create-subagentSkill
- migrate-to-skillsSkill
- sdkSkill
- shellSkill
- split-to-prsSkill
- statuslineSkill
- update-cli-configSkill
- update-cursor-settingsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

