React Refactor Rules
A drop-in Cursor rule pack that makes Cursor edit React the way you'd want a senior engineer to. No agent to run — just rules loaded into Cursor's context.
What the rules enforce
- Function components with hooks (never new class components)
- Extract custom hooks from tangled
useEffectlogic - Avoid re-renders: stable callbacks, memoization where it pays off, context splitting
- React 19 patterns (
use, Actions,useOptimistic) - Strict prop types — no
any
Install
bash
npx nuclexa install react-refactor-rules --target cursorInstalls to .cursor/rules/react-refactor-rules.mdc. Open any React file and Cursor follows the rules automatically.