# Learnings & Promoted Rules
<!-- Promoted from ERROR_LOG.md when an error pattern is significant enough to become a standing rule -->
<!-- Trigger: count > mean + 2SD in ERROR_LOG, or manually via "summarize learnings" -->
<!-- After promoting: add to CLAUDE.md "Known Mistakes to Avoid" and reset/archive the ERROR_LOG entry -->

---

## When to Summarize

Run *"summarize learnings"* when:
- An error in ERROR_LOG has `Count` significantly above others (> mean + 2SD)
- A cluster of related errors points to a systemic pattern
- Before a major feature — review LEARNINGS as part of pre-task checklist
- Monthly cadence (suggested: end of each sprint or deploy cycle)

---

## Promoted Rules

<!-- Format:
### LEARN-001 | Rule title
- Promoted from: ERR-XXX
- Date: YYYY-MM-DD
- Pattern: What kept happening
- Golden rule: The exact rule to follow going forward
- Check: <grep_pattern> | <message shown on violation>   ← pre-commit-check.sh reads this automatically
- Added to: CLAUDE.md / docs/ (which file, which section)

Note: The "Check:" line is what makes the system self-advancing.
Once a learning has a Check: pattern, pre-commit-check.sh will
automatically grep staged files for it on every future commit.
Pattern is a basic grep string (not regex). Example:
  - Check: overflow-auto | Canvas used overflow-auto — use CSS transform instead
-->

### LEARN-001 | Never use solid hover colors in dark mode
- Promoted from: ERR-001
- Date: 2026-03-29
- Pattern: Repeated use of `dark:hover:bg-slate-750` (and similar solid slate-7xx variants) for hover states in dark mode — causes harsh, over-contrasted backgrounds that break the dark theme aesthetic
- Golden rule: All dark mode hover backgrounds must use opacity values only. Use `dark:hover:bg-white/[0.02]` for subtle hover, never solid Tailwind color classes for hover states
- Check: hover:bg-slate-7 | Dark hover used solid color — use opacity (dark:hover:bg-white/[0.02]) instead
- Added to: CLAUDE.md → UI / Dark Theme Conventions section

---

## Summary Stats
<!-- Updated each time a learning is promoted -->
- Total errors logged: 7 (seeded from Known Mistakes)
- Total learnings promoted: 1
- Last summarized: 2026-03-29
