react-best-practices
Skill2 starsChanged 4 months agoMITView on GitHub
Build React UIs with clear composition, correct state placement, disciplined effects, and basic accessibility. Use when writing React components, hooks, fixing re-renders or effect bugs, or when the user mentions React, JSX, or client UI state.
38 other projects use a version of this.
Adopted by
Most recently taken up by
- baekenough/oh-my-customcodetheir own version, first seen Oct 3, 2026
- BytePioneer-AI/codex-hosttheir own version, first seen Oct 2, 2026
- laguagu/claude-code-nextjs-skillstheir own version, first seen Sep 30, 2026
- Isabella-a/Skillstheir own version, first seen Sep 27, 2026
- sabahattink/antigravity-fullstack-hqtheir own version, first seen Sep 20, 2026
- drinkspiller/skillstheir own version, first seen Sep 16, 2026
Used with
Projects with it also use parallel-agents, web-design-guidelines and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
parcadeiSkillparallel-agents
Parallel Agent Orchestration
Also in 3 projects that use this
VercelSkillweb-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
Also in 7 projects that use this
JetBrainsSkillwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Also in 7 projects that use this
xfstudioSkillclean-code
Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
Also in 3 projects that use this
ttmouseSkillnotebooklm
Automate Google NotebookLM - create notebooks, add sources, generate podcasts/videos/quizzes, download artifacts. Supports browser-based content extraction for anti-crawler platforms (Twitter/X, LinkedIn, etc.). Activates on explicit /notebooklm or intent like "create a podcast about X
Also in 3 projects that use this
MicrosoftSkillmcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Also in 6 projects that use this
Other versions38 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 38
- openai/plugins★ 7.3ksame name
- BytePioneer-AI/codex-host★ 2.7ksame name
- vercel/vercel-plugin★ 297same name
- mxyhi/token_proxy★ 94same name
- laguagu/claude-code-nextjs-skills★ 67same name
- baekenough/oh-my-customcode★ 43same name
- tdimino/claude-code-minoan★ 40same name
- itallstartedwithaidea/agent-skills★ 39same name
- ttmouse/skills★ 34same name
- sabahattink/antigravity-fullstack-hq★ 30same name
28 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- code-reviewSkill
- debuggingSkill
- javascript-best-practicesSkill
- nextjs-app-routerSkill
- nextjs-data-fetchingSkill
- python-best-practicesSkill
- python-testingSkill
- tagged-code-commentsSkill
- typescript-best-practicesSkill
- create-skillSkill
- revise-skillSkill
- academic-paperSkill
- latex-scientific-writingSkill
- paper-abstractSkill
- paper-conclusionSkill
- paper-discussionSkill
- paper-introductionSkill
- paper-literature-reviewSkill
- paper-methodsSkill
- paper-peer-reviewSkill
- paper-related-workSkill
- paper-resultsSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 33 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Prefer deriving state over syncing with effects
- Distinctive: line 27
State placement: Keep state as local as possible.
- Very specific: line 28
Effects are escape hatches: Use useEffect for synchronizing with external systems (DOM, network subscriptions), not for computing …
- Distinctive: line 29
Lists need stable keys: Use stable IDs, not array indexes, when order can change.
- Very specific: line 31
Performance: Do not add useMemo/useCallback by default.
- Very specific: line 32
Accessibility baseline: Use button/link correctly.
- Very specific: line 33
Tag unfinished or risky work: Use the global tagged-code-comments convention (🔴 FIXME(P0):, 🟠 TODO(P1):, {/* 🟡 UX(P2): … */}).
“Common” is measured: kept by at least 6 in 10 of the 33 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Best Practices
Defaults
- Function components + hooks
- Colocate state with the nearest common consumer
- Prefer deriving state over syncing with effects
- Accessibility: semantic HTML first; labels for inputs; keyboard reachability
Instructions
- Composition over configuration. Split UI into small components with clear props. Prefer children/slots over boolean prop sprawl (
isHeader && …). - State placement. Keep state as local as possible. Lift only when siblings must share. Prefer URL/search params for shareable UI state when the app already does.
- Effects are escape hatches. Use
useEffectfor synchronizing with external systems (DOM, network subscriptions), not for computing renderable values. Prefer event handlers for user-driven updates. - Lists need stable keys. Use stable IDs, not array indexes, when order can change.
- Controlled vs uncontrolled. Pick one per input; do not flip-flop. For forms, follow the project's form library if present.
- Performance. Do not add
useMemo/useCallbackby default. Add them when profiling or when referential stability is required by a child/effect dep. Follow React Compiler guidance if the project uses it. - Accessibility baseline. Use button/link correctly; associate
<label htmlFor>; manage focus for dialogs; do not rely on color alone. - Tag unfinished or risky work. Use the global
tagged-code-commentsconvention (🔴 FIXME(P0):,🟠 TODO(P1):,{/* 🟡 UX(P2): … */}). Never leave silent stubs. End with an Open follow-ups table so the developer must check P0/P1 before ship.
Effect anti-pattern
// Bad: syncing derived state
const [fullName, setFullName] = useState("");
useEffect(() => {
setFullName(first + " " + last);
}, [first, last]);
// Good: derive during render
const fullName = `${first} ${last}`;Component sketch
type UserCardProps = {
name: string;
onSelect: (id: string) => void;
id: string;
};
export function UserCard({ id, name, onSelect }: UserCardProps) {
return (
<button type="button" onClick={() => onSelect(id)}>
{name}
</button>
);
}Anti-patterns
- Prop drilling deep trees when context or composition would clarify
- Effects that set state solely to mirror props
key={index}on reorderable lists- Div soup for interactive elements (
div onClickinstead ofbutton)
Additional resources
- references/checklist.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

