react-best-practices
Skill1 starsChanged 17 days agoMITView on GitHub
Use for React or Next.js performance work: waterfalls, bundle size, server rendering, data fetching, or re-renders.
66 other projects use a version of this, 31 of them edited.
Adopted by
Most recently taken up by
- eea/eea.agent.skillsedited, first seen Nov 8, 2026
- amanuelmamo7/Skillsedited, first seen Nov 7, 2026
- drinkspiller/skillsedited, first seen Nov 6, 2026
- tylergibbs1/codewardentheir own version, first seen Nov 1, 2026
- sbrudz/agent-skillstheir own version, first seen Nov 1, 2026
- poizoncoded/skillsedited, first seen Nov 1, 2026
Used with
Projects with it also use composition-patterns, python-best-practices 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.
eeaSkillcomposition-patterns
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
Also in 4 projects that use this
jefflesterSkillpython-best-practices
Python development best practices including PEP 8 style guidelines, type hints, docstring conventions, and common patterns. Use when writing or modifying Python code.
Also in 3 projects that use this
MicrosoftSkillplanning-with-files
**USE THIS FOR COMPLEX TASKS.** Implements Manus-style file-based planning for multi-step tasks. Creates task_plan.md, findings.md, and progress.md in .agent_cache/<task-name>/. Use when: implementing multiple APIs, refactoring modules, research tasks, or ANY task requiring >5 tool calls.
Also in 5 projects that use this
VercelSkillvercel-deploy
Deploy applications and websites to Vercel with a claimable preview. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment". No authentication required - returns preview URL and claimable deployment link.
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 10 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
Other versions66 projects use a version of this.
Word for word · 0
None found.
Edited · 31
- openai/plugins★ 7.8k44% same
- ryokun6/ryos★ 1.3k41% same
- involvex/youtube-music-cli★ 47737% same
- vercel/vercel-plugin★ 32842% same
- typv/nest-turbo-starter★ 22438% same
- laguagu/claude-code-nextjs-skills★ 7241% same
- oxedom/haflow★ 3432% same
- georgekhananaev/claude-skills-vault★ 2848% same
- Fandry96/k3-agentic-skills★ 2737% same
- PracticalSwan/agent-skills★ 2233% same
21 more not listed
Wrote their own version · 35
- mastra-ai/mastra★ 29ksame name
- mikeOnBreeze/cc-crossbeam★ 297same name
- AvivK5498/Beads-Kanban-UI★ 102same name
- mxyhi/token_proxy★ 94same name
- ahonn/dotfiles★ 62same name
- baekenough/oh-my-customcode★ 42same name
- tdimino/claude-code-minoan★ 41same name
- ttmouse/skills★ 34same name
- sabahattink/antigravity-fullstack-hq★ 30same name
- diegovasquez-ai/skills-app★ 14same name
25 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 repository57 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-loginSkill
- animateSkill
- app-intentsSkill
- app-store-connectSkill
- architectSkill
- arenaSkill
- blast-radiusSkill
- codebase-designSkill
- code-qualitySkill
- correctSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- eli5Skill
- engineering-principlesSkill
- gauntlet-loopSkill
- gh-stackSkill
- goal-swarmSkill
- grillingSkill
- grill-with-docsSkill
- handoffSkill
- howSkill
- improve-codebase-architectureSkill
- ios-hapticsSkill
- koubouSkill
- mergeSkill
- orchestrationSkill
- prototypeSkill
- prSkill
- react-doctorSkill
- reframeSkill
- repo-cleanupSkill
- researchSkill
- retroSkill
- review-fix-loopSkill
- reviewSkill
- review-sweepSkill
- seoSkill
- setup-sreestackSkill
- show-dont-tellSkill
- showroomSkill
- snipsnap-do-choresSkill
- snip-snapSkill
- swift-testing-modernizationSkill
- swiftuiSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- ui-designSkill
- uikitSkill
- verifySkill
- wayfinderSkill
- web-component-inspirationSkill
- whySkill
- writing-for-agentsSkill
- xcode-security-auditSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 56 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
When this skill is a review reference, report findings from the opened files and leave edits to the parent.
“Common” is measured: kept by at least 6 in 10 of the 56 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
Performance patterns for React and Next.js applications. The 70 rules are candidates, not a checklist or a promise of impact. Before choosing an optimization or reporting a gain, use Explain the Number and its measurement-validity reference to locate the bottleneck and compare the same workload before and after. Check the project's React, Next.js, compiler, and data-layer choices before selecting rules.
When to Apply
Reference these guidelines when:
- Eliminating waterfalls in data fetching (client or server-side)
- Reviewing code for performance issues
- Refactoring React/Next.js for load time or re-renders
- Optimizing bundle size or load times
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
| 1 | Eliminating Waterfalls | CRITICAL | async- |
| 2 | Bundle Size Optimization | CRITICAL | bundle- |
| 3 | Server-Side Performance | HIGH | server- |
| 4 | Client-Side Data, Events, and Storage | MEDIUM-HIGH | client- |
| 5 | Re-render Optimization | MEDIUM | rerender- |
| 6 | Rendering Performance | MEDIUM | rendering- |
| 7 | JavaScript Performance | LOW-MEDIUM | js- |
| 8 | Advanced Patterns | LOW | advanced- |
How to Use
- From the category table, pick the prefixes that match the measured bottleneck or the current task; when this skill is a review reference, use the diff.
- Open only the Quick Reference links whose ids start with those prefixes and whose one-liners match the request, or the diff when this skill is a review reference.
- When this skill is a review reference, report findings from the opened files and leave edits to the parent. Otherwise apply only rules that fit the project's versions and existing architecture. The one-liners are only for choosing which files to open.
Quick Reference
1. Eliminating Waterfalls (CRITICAL)
async-cheap-condition-before-await- Check cheap sync conditions before awaiting flags or remote valuesasync-defer-await- Move await into branches where actually usedasync-parallel- Use Promise.all() for independent operationsasync-dependencies- Use better-all for partial dependenciesasync-api-routes- Start promises early, await late in API routesasync-suspense-boundaries- Use Suspense to stream content
2. Bundle Size Optimization (CRITICAL)
bundle-barrel-imports- Avoid barrel-file import costbundle-analyzable-paths- Prefer statically analyzable import and file-system paths to avoid broad bundles and tracesbundle-dynamic-imports- Use next/dynamic for heavy componentsbundle-defer-third-party- Load analytics/logging after hydrationbundle-conditional- Load modules only when feature is activatedbundle-preload- Preload on hover/focus for perceived speed
3. Server-Side Performance (HIGH)
server-auth-actions- Authenticate server actions like API routesserver-cache-react- Use React.cache() for per-request deduplicationserver-cache-lru- Scope and invalidate cross-request caches of shared dataserver-dedup-props- Avoid duplicate serialization in RSC propsserver-hoist-static-io- Hoist static I/O (fonts, logos) to module levelserver-no-shared-module-state- Avoid module-level mutable request state in RSC/SSRserver-serialization- Minimize data passed to client componentsserver-parallel-fetching- Restructure components to parallelize fetchesserver-parallel-nested-fetching- Chain nested fetches per item in Promise.allserver-after-nonblocking- Use after() for non-blocking operations
4. Client-Side Data, Events, and Storage (MEDIUM-HIGH)
client-swr-dedup- Use existing SWR caching for request deduplicationclient-event-listeners- Share repeated global listeners at an app-owned boundaryclient-passive-event-listeners- Use passive listeners for scrollclient-localstorage-schema- Version and minimize localStorage data
5. Re-render Optimization (MEDIUM)
rerender-defer-reads- Don't subscribe to state only used in callbacksrerender-memo- Extract expensive work into memoized componentsrerender-memo-with-default-value- Hoist default non-primitive propsrerender-dependencies- Use primitive dependencies in effectsrerender-derived-state- Subscribe to derived booleans, not raw valuesrerender-derived-state-no-effect- Derive state during render, not effectsrerender-functional-setstate- Use functional setState for stable callbacksrerender-lazy-state-init- Pass function to useState for expensive valuesrerender-simple-expression-in-memo- Avoid memo for simple primitivesrerender-split-combined-hooks- Split hooks with independent dependenciesrerender-move-effect-to-event- Put interaction logic in event handlersrerender-transitions- Use startTransition for non-urgent updatesrerender-use-deferred-value- Defer expensive renders to keep input responsivererender-use-ref-transient-values- Use refs for transient frequent valuesrerender-no-inline-components- Don't define components inside components
6. Rendering Performance (MEDIUM)
rendering-animate-svg-wrapper- Animate div wrapper, not SVG elementrendering-content-visibility- Use content-visibility for long listsrendering-hoist-jsx- Extract static JSX outside componentsrendering-svg-precision- Reduce SVG coordinate precisionrendering-hydration-no-flicker- Keep theme first paint and hydration consistentrendering-hydration-suppress-warning- Suppress expected mismatchesrendering-activity- Use Activity component for show/hiderendering-conditional-render- Use ternary, not && for conditionalsrendering-usetransition-loading- Prefer useTransition for loading staterendering-resource-hints- Use React DOM resource hints for preloadingrendering-script-defer-async- Use defer or async on script tags
7. JavaScript Performance (LOW-MEDIUM)
js-batch-dom-css- Group CSS changes via classes or cssTextjs-index-maps- Build Map for repeated lookupsjs-cache-property-access- Cache object properties in loopsjs-cache-function-results- Scope caches for repeated pure calculationsjs-cache-storage- Avoid repeated storage reads in measured hot pathsjs-combine-iterations- Combine multiple filter/map into one loopjs-length-check-first- Check array length before expensive comparisonjs-early-exit- Return early from functionsjs-hoist-regexp- Hoist RegExp creation outside loopsjs-min-max-loop- Use loop for min/max instead of sortjs-set-map-lookups- Use Set/Map for O(1) lookupsjs-tosorted-immutable- Use toSorted() for immutabilityjs-flatmap-filter- Use flatMap to map and filter in one passjs-request-idle-callback- Defer non-critical work to browser idle time
8. Advanced Patterns (LOW)
advanced-effect-event-deps- Don't putuseEffectEventresults in effect depsadvanced-event-handler-refs- Store event handlers in refsadvanced-init-once- Initialize app once per app loadadvanced-use-latest- useEffectEvent for stable callback refs
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.

