Automatically document design decisions and patterns immediately when discovered in the readathon project
TRIGGER: When design decisions are made, patterns discovered, or rules defined.
From CLAUDE.md "Immediate Documentation (REFLEX ACTION)":
Context is lost during conversation compaction. Important decisions/rules are forgotten if not documented immediately.
Solution: Document important information immediately when discovered, not "later" or "at the end."
When: User asks or decision is made about which table/column to use
Examples:
Action: Immediately update md/RULES.md
Format:
## [Section: Data Source Rules / Calculation Rules]
**[Metric Name]:**
- Source: [table_name].[column_name]
- Reason: [why this source]
- Notes: [capped/uncapped, calculations, etc.]
Last Updated: [YYYY-MM-DD]
Report: "✅ Documented in md/RULES.md lines [X-Y]: [summary]"
When: A consistent pattern is noticed across pages
Examples:
Action: Immediately update md/UI_PATTERNS.md
Format:
## [Pattern Name]
**Description:** [what the pattern is]
**Used in:** [list of pages/files]
**Implementation:**
```html
[code example]
Colors/Styles:
Last Updated: [YYYY-MM-DD]
**Report:** "✅ Added [pattern] to md/UI_PATTERNS.md lines [X-Y]"
### Trigger 3: Feature Design Decision
**When:** Specific implementation choice is made for a feature
**Examples:**
- "Students page should use capped minutes"
- "Detail view shows daily breakdown with charts"
- "Banner metrics appear in this specific order"
**Action:** Update appropriate feature design doc: `docs/STUDENTS_PAGE_DESIGN.md`, `docs/features/feature-XX.md`
**Format:**
```markdown
## Design Decisions
**[Decision Topic]:**
- Decision: [what was decided]
- Rationale: [why this choice]
- Impact: [what this affects]
- Date: [YYYY-MM-DD]
Report: "✅ Documented in docs/[feature].md lines [X-Y]: [summary]"
When: Formula or calculation method is defined
Examples:
Action: Update md/RULES.md in appropriate section
Format:
## Calculation Rules
**[Metric Name]:**
- Formula: [mathematical formula or SQL logic]
- Special cases: [edge cases, caps, rounding]
- Example: [sample calculation]
Last Updated: [YYYY-MM-DD]
Report: "✅ Documented calculation in md/RULES.md lines [X-Y]: [summary]"
When: Uncertainty identified that needs user input later
Examples:
Action: Add to feature design doc with TBD marker
Format:
## Open Questions
- **[Question]:** [description of uncertainty]
- Options: [list alternatives]
- Status: TBD
- Added: [YYYY-MM-DD]
Report: "✅ Added TBD item to docs/[feature].md for later resolution"
NEVER say: "I'll document this later" or "We should add this to docs"
ALWAYS do: Edit the documentation file immediately, then report what was added
| Decision Type | File |
|---|---|
| Data source (which table/column) | md/RULES.md |
| Calculation formula | md/RULES.md |
| UI pattern / styling | md/UI_PATTERNS.md |
| Team colors, winner highlights | md/RULES.md or md/UI_PATTERNS.md |
| Feature design choice | docs/[FEATURE]_DESIGN.md |
| Report-specific logic | docs/features/feature-XX.md |
| New pattern across pages | md/UI_PATTERNS.md |
| Open question / TBD | Feature design doc |
Conversation compaction happens transparently - there's no warning, no pre-compaction hook.
By documenting immediately as reflex action, we minimize context loss and ensure decisions persist across sessions.
Best Practice: When uncertain whether to document, ask user then document immediately after confirmation.
This skill is part of the multi-layer context preservation system:
When this skill documents a decision:
docs/SESSION_MEMORY.mdWhen documenting patterns/decisions:
.claude/workflow_patterns.md as wellThis skill is Layer 1 in the multi-layer defense: