react-dev
Skill1 starsChanged 9 months agoMITView on GitHub
React 18+ development: components, hooks, state, effects, TypeScript, Tailwind CSS, performance, accessibility, testing, and security. Use when building or modifying React UI, state management, hooks/effects, forms, styling, or frontend tests.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- taeeho/ClaudeSkillstheir own version, first seen May 20, 2026
- nbirkner/digital-braintheir own version, first seen Apr 12, 2026
- chidekina/aria-superpowerstheir own version, first seen Feb 22, 2026
- softaworks/agent-toolkittheir own version, first seen Jan 20, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- softaworks/agent-toolkit★ 2.5ksame name
- chidekina/aria-superpowers★ 2same name
- nbirkner/digital-brain★ 0same name
- taeeho/ClaudeSkills★ 0same name
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 repository16 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- .cursor/rules/ask-first.mdcCursor rule
- .cursor/rules/git-mv-rename.mdcCursor rule
- .cursor/rules/include-specs.mdcCursor rule
- .cursor/rules/update-specs.mdcCursor rule
- code-review-codexSkill
- commitSkill
- python-devSkill
- react-devSkill
- spec-review-codexSkill
- summarizerSkill
- ui-designSkill
- yt-transcriptSkill
- codex-reviewSkill
- python-devSkill
- ui-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
44 rules. 0 are common, 32 are distinctive, and 12 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
32
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use this whenever you are asked to:
- Distinctive: line 21
Add/repair accessibility (semantic HTML, keyboard support, ARIA)
- Distinctive: line 22
Write or update frontend tests (React Testing Library)
- Distinctive: line 28
Correctness: no hook rule violations, no state mutation, no effect loops, no controlled/uncontrolled switching
- Distinctive: line 33
Safety: avoid XSS footguns; never inject untrusted HTML
- Distinctive: line 65
Do not perform side effects during render (no subscriptions, no direct DOM mutation, no network calls).
- Distinctive: line 66
Keep event handlers as the primary place where user actions trigger state updates.
- Distinctive: line 70
Call Hooks only at the top level of React components or custom hooks.
- Distinctive: line 71
Never call Hooks inside loops, conditions, or nested functions.
- Very specific: line 72
Prefer enabling and respecting eslint-plugin-react-hooks (rules-of-hooks + exhaustive-deps).
- Distinctive: line 76
Prefer the smallest state that can drive the UI:
- Distinctive: line 77
Avoid redundant/derived state (compute during render or memoize if expensive).
- Distinctive: line 78
Avoid deeply nested state.
- Distinctive: line 79
Keep a single source of truth.
- Distinctive: line 80
When multiple components must stay in sync:
- Very specific: line 82
Consider useReducer for complex update logic.
- Distinctive: line 86
Treat props/state as immutable snapshots.
- Distinctive: line 87
Update objects/arrays by creating new ones (spread, map/filter, or Immer if already used).
- Distinctive: line 88
Do not mutate values read from state and then call setState with the same reference.
- Very specific: line 92
Use useEffect when synchronizing with an external system, e.g.:
- Distinctive: line 96
Don't use effects to orchestrate your app's internal data flow.
- Distinctive: line 97
Always declare the full dependency list.
- Distinctive: line 107
Avoid using refs to replace state for UI rendering.
- Very specific: line 111
Use stable IDs from data for key.
- Very specific: line 112
Avoid array indices as keys when items can reorder/insert/delete (it breaks state preservation and causes UI glitches).
- Very specific: line 113
Never generate keys during render (e.g., Math.random()).
- Distinctive: line 119
Never switch an input between controlled and uncontrolled across renders.
- Very specific: line 126
Use React.ComponentProps<"button"> / ComponentPropsWithoutRef for wrapper components.
- Very specific: line 127
Avoid any; prefer explicit unions and narrowing.
- Distinctive: line 128
Keep prop types readable; don't over-genericize until needed.
- Distinctive: line 135
Prefer structural fixes over micro-optimizations:
- Distinctive: line 137
Avoid passing "new" object/function props to memoized children unless needed.
- Distinctive: line 138
Use memoization tools intentionally:
- Distinctive: line 149
Prefer semantic HTML ("right element for the right job") before ARIA.
- Very specific: line 150
Ensure every interactive control has an accessible name (visible label, aria-label, or aria-labelledby).
- Distinctive: line 154
When building custom widgets, follow the WAI-ARIA Authoring Practices patterns.
- Distinctive: line 160
Use Testing Library's principles:
- Distinctive: line 161
Test the app like a user uses it.
- Very specific: line 162
Prefer queries by role + accessible name (getByRole, findByRole).
- Distinctive: line 163
Avoid testing implementation details (DOM structure, internal state, private methods).
- Very specific: line 164
Prefer @testing-library/user-event over low-level fireEvent for realistic interactions.
- Very specific: line 170
Avoid dangerouslySetInnerHTML.
- Distinctive: line 171
Only render trusted content or sanitize it with a well-reviewed sanitizer.
- Distinctive: line 174
Follow OWASP XSS prevention guidance.
“Common” is measured: kept by at least 6 in 10 of the 4 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 Development
When to use this skill
Use this whenever you are asked to:
- Build or refactor React components, hooks, or UI flows
- Fix bugs involving state, effects, rendering, or controlled inputs
- Improve performance (unnecessary re-renders, slow lists, heavy computations)
- Work with Tailwind CSS styling or responsive design
- Add/repair accessibility (semantic HTML, keyboard support, ARIA)
- Write or update frontend tests (React Testing Library)
For UI/styling work that requires high design quality, also read the UI Design skill at .cursor/skills/ui-design/SKILL.md.
Outcome targets
- Correctness: no hook rule violations, no state mutation, no effect loops, no controlled/uncontrolled switching
- Maintainability: clear component boundaries, minimal state, readable data flow
- Type safety: strict TypeScript at all boundaries — no
any - UX + A11y: semantic HTML first; predictable focus and keyboard behavior
- Performance: measure before optimizing; optimize the right bottleneck
- Safety: avoid XSS footguns; never inject untrusted HTML
Stack and tooling
- React 18+ — functional components, hooks, concurrent features
- TypeScript — strict typing, generics, discriminated unions
- Tailwind CSS — utility-first styling, responsive design, design tokens
- Vite — fast dev server, build config, env handling
- State management — Zustand, React context, local state (pick the right level)
- Testing — React Testing Library, user-event, vitest/jest
Coding standards
- TypeScript strict — type all props, callbacks, state. Avoid
any. - Functional components only — no class components.
- Tailwind for styling — no CSS modules or inline style objects unless absolutely necessary.
- Small, composable components — one responsibility per component. Extract early.
- Minimal state — derive in render what you can. Don't duplicate data across state slices.
- Accessible by default — semantic HTML, keyboard nav, visible focus, ARIA when needed.
- No side effects in render — effects are for external synchronization only.
Best-practice rules
A) Components and Hooks must be pure
- Render functions must be pure and idempotent: same inputs (props/state/context) -> same JSX.
- Do not perform side effects during render (no subscriptions, no direct DOM mutation, no network calls).
- Keep event handlers as the primary place where user actions trigger state updates.
B) Follow the Rules of Hooks
- Call Hooks only at the top level of React components or custom hooks.
- Never call Hooks inside loops, conditions, or nested functions.
- Prefer enabling and respecting
eslint-plugin-react-hooks(rules-of-hooks + exhaustive-deps).
C) State modeling: keep it minimal and coherent
- Prefer the smallest state that can drive the UI:
- Avoid redundant/derived state (compute during render or memoize if expensive).
- Avoid deeply nested state; normalize when it grows.
- Keep a single source of truth.
- When multiple components must stay in sync:
- Lift state up to the closest common parent.
- Consider
useReducerfor complex update logic; combine withContextwhen passing deeply.
D) Never mutate props/state
- Treat props/state as immutable snapshots.
- Update objects/arrays by creating new ones (spread, map/filter, or Immer if already used).
- Do not mutate values read from state and then call setState with the same reference.
E) Effects are for external synchronization only
Use useEffect when synchronizing with an external system, e.g.:
- Browser APIs (timers, observers), subscriptions, manual DOM work, network (when not handled by a framework/data layer)
Rules:
- Don't use effects to orchestrate your app's internal data flow.
- Always declare the full dependency list; avoid "lying" dependency arrays.
- Implement cleanup for subscriptions/timers/listeners.
- Expect Strict Mode to run an extra setup/cleanup cycle in development; your effect should be resilient.
F) Refs are for "escape hatches"
Use useRef for:
- Holding mutable values that shouldn't trigger renders (timeouts, previous values, instance handles)
- Accessing DOM nodes (focus, measurement) sparingly
Avoid using refs to replace state for UI rendering.
G) Lists: keys must be stable
- Use stable IDs from data for
key. - Avoid array indices as keys when items can reorder/insert/delete (it breaks state preservation and causes UI glitches).
- Never generate keys during render (e.g.,
Math.random()).
H) Forms: pick controlled vs uncontrolled and stick to it
- Controlled inputs (
value+onChange) when you need validation, conditional UI, or instant feedback. - Uncontrolled inputs (
defaultValue/ refs /FormData) for simpler forms. - Never switch an input between controlled and uncontrolled across renders.
TypeScript
- Type props, callbacks, and event handlers at component boundaries.
- Use
React.ComponentProps<"button">/ComponentPropsWithoutReffor wrapper components. - Avoid
any; prefer explicit unions and narrowing. - Keep prop types readable; don't over-genericize until needed.
Performance guidance
- Measure first (React DevTools Profiler) before optimizing.
- Prefer structural fixes over micro-optimizations:
- Split large components; colocate state near where it's used.
- Avoid passing "new" object/function props to memoized children unless needed.
- Use memoization tools intentionally:
memoto skip re-renders when props are stableuseMemofor expensive calculationsuseCallbackwhen function identity stability matters (prop to memoized children / hook deps)
- Be mindful with Context:
- Context updates re-render consumers; keep provider values stable and consider splitting contexts by concern.
Accessibility
- Prefer semantic HTML ("right element for the right job") before ARIA.
- Ensure every interactive control has an accessible name (visible label,
aria-label, oraria-labelledby). - Ensure keyboard accessibility:
- Tab order makes sense
- Focus is visible and managed for dialogs/menus
- When building custom widgets, follow the WAI-ARIA Authoring Practices patterns.
Testing
- Use Testing Library's principles:
- Test the app like a user uses it.
- Prefer queries by role + accessible name (
getByRole,findByRole). - Avoid testing implementation details (DOM structure, internal state, private methods).
- Prefer
@testing-library/user-eventover low-levelfireEventfor realistic interactions.
Security
- Avoid
dangerouslySetInnerHTML. If you must render HTML:- Only render trusted content or sanitize it with a well-reviewed sanitizer.
- Use defense-in-depth:
- Configure CSP where possible.
- Follow OWASP XSS prevention guidance.
Common failure modes (fast triage)
| Symptom | Likely cause | Fix |
| Infinite render/effect loop | Effect sets state + deps cause re-run | Move logic to render derivation or fix deps |
| Stale closures | Effect/handler reads old state | Ensure deps are correct or use functional updates |
| "Rendered fewer hooks" | Hooks inside condition/loop | Refactor so hooks are unconditional |
| Controlled/uncontrolled warning | value flips between undefined and defined | Initialize state and keep consistent |
| List UI glitches | Unstable keys | Fix keys to stable IDs |
Sources
React (official)
- Keeping Components Pure — https://react.dev/learn/keeping-components-pure
- Components and Hooks must be pure — https://react.dev/reference/rules/components-and-hooks-must-be-pure
- You Might Not Need an Effect — https://react.dev/learn/you-might-not-need-an-effect
- useEffect — https://react.dev/reference/react/useEffect
- useState (immutability notes) — https://react.dev/reference/react/useState
- Choosing the State Structure — https://react.dev/learn/choosing-the-state-structure
- Sharing State Between Components — https://react.dev/learn/sharing-state-between-components
- useContext — https://react.dev/reference/react/useContext
- memo / useMemo / useCallback — https://react.dev/reference/react/memo ; https://react.dev/reference/react/useMemo ; https://react.dev/reference/react/useCallback
- eslint-plugin-react-hooks — https://react.dev/reference/eslint-plugin-react-hooks
- Using TypeScript — https://react.dev/learn/typescript
- Profiler — https://react.dev/reference/react/Profiler
Accessibility
- MDN: HTML accessibility — https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Accessibility/HTML
- W3C: ARIA Authoring Practices — https://www.w3.org/WAI/ARIA/apg/
- W3C: WCAG 2.2 — https://www.w3.org/TR/WCAG22/
Testing
- Testing Library Guiding Principles — https://testing-library.com/docs/guiding-principles/
- React Testing Library — https://testing-library.com/docs/react-testing-library/intro/
- user-event — https://testing-library.com/docs/user-event/intro
Security
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.

