What problem does it solve?
This Skill solves the common React hook problems of unnecessary re-renders, stale closures, infinite loops, and noisy biome exhaustive-deps warnings by standardizing how custom hooks and Context providers should be structured in this project.
Core Features & Use Cases
- Custom hook design rules: Extract hooks only when there is real duplication, follow naming/return-value conventions, and favor stable references with useCallback/useMemo.
- Context splitting guidance: Use separate State and Actions contexts so action-only consumers don’t re-render when state changes.
- Effect and dependency correctness: Use effects only for external synchronization (WebSocket, timers, subscriptions) and derive render-time data during render or with memoization; align with biome useExhaustiveDependencies and safe ref/callback patterns.
- Testing conventions for hooks: Test custom hooks with @testing-library/react using renderHook and act, without calling hooks directly.
Quick Start
Apply the react-hooks guidelines to refactor a Context provider by splitting state vs actions, then fix any biome exhaustive-deps warnings in its effects using the documented dependency and ref patterns.