
react-best-practices
Reading or writing React components (.tsx, .jsx files with React imports)
by alleneubankFree
Description
react-best-practices is an agent skill that guides how an AI assistant reads and writes React components in .tsx and .jsx files. Its central rule is that Effects are escape hatches. They let a component step outside React to synchronize with an external system, so most component logic should not use one. Before writing an Effect, the agent is asked whether the same thing can be done without one. The skill includes a decision tree that maps each need to the right tool. A user interaction gets an event handler. A value computed from props or state is calculated during render. An expensive calculation that needs caching uses useMemo. Resetting state when a prop changes uses a key prop. Synchronizing with an external system uses an Effect with cleanup. Code that must read the latest values without re-running an Effect uses useEffectEvent, and a mutable value that should not trigger a render uses a ref. The skill says to load it together with typescript-best-practices when working with React, since TypeScript patterns such as type-first development, discriminated unions and Zod validation apply to React code too. It is aimed at developers who use an AI assistant to write React and want fewer unnecessary effects in the code it produces. Install it with npx skills add https://github.com/alleneubank/claude-code --skill react-best-practices.…
Highlights
- Core rule: avoid Effects unless syncing with an external system
- Decision tree from each need to the right React tool
- Guidance for useMemo, key props, refs and useEffectEvent
- Pairs with typescript-best-practices
- Applies to .tsx and .jsx React files
Ratings & Reviews
No ratings yet
Be the first to rate react-best-practices.
People also visit
react-best-practices FAQ
When does this skill load?
When an agent reads or writes React components, in .tsx or .jsx files with React imports.
What is the main rule?
Effects are escape hatches for syncing with external systems. Most component logic should not use one.
What should I use instead of an Effect for a user action?
An event handler. The skill's decision tree maps each kind of need to the right tool.
Should I load it with TypeScript guidance?
Yes. The skill says to load typescript-best-practices alongside it when working with React.
How do I install it?
Run npx skills add https://github.com/alleneubank/claude-code --skill react-best-practices.
What were the security audit results?
Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.
What are the best react-best-practices alternatives?
Popular alternatives to react-best-practices include react-expert, react-expert and react-code-review. See all react-best-practices alternatives



















