state-colocation
Installation
SKILL.md
State Colocation
Phase 1 — Diagnose the Colocation Problem
Three distinct problems, three different fixes. Misidentifying them causes the wrong refactor.
| Symptom | Problem | Fix |
|---|---|---|
| Parent holds state, only one child reads/sets it | Over-lifted state | Push down |
| Two siblings need the same value | State too low | Lift up to nearest common ancestor |
| Prop passes through 2+ components that don't use it | Drill or wrong level | Push down OR context — see §2.3 |
| Context/store slice used by exactly one component | Over-globalized | Push down to local state |
| Re-renders cascade to unrelated subtrees on every state change | State too high | Push down or split context |