component-refactoring
Installation
SKILL.md
Component Refactoring Skill
When to use
- Large components (>300 lines) or complex nested conditionals.
- Mixed UI + data fetching + state logic in one file.
- Re-renders are hard to reason about.
Refactoring patterns
- Extract hooks for state/effects/data logic.
- Split UI sections into subcomponents.
- Simplify conditionals with lookup tables/early returns.
- Move API/data logic into query hooks.
- Extract modal/dialog state into a dedicated hook.
- Extract form logic into TanStack Form hooks.