
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
·
A structured repository for creating and maintaining React Best Practices optimized for agents and LLMs.
rules/ - Individual rule files (one per rule)
_sections.md - Section metadata (titles, impacts, descriptions)_template.md - Template for creating new rulesarea-description.md - Individual rule filessrc/ - Build scripts and utilitiesmetadata.json - Document metadata (version, organization, abstract)AGENTS.md - Compiled output (generated)test-cases.json - Test cases for LLM evaluation (generated)Install dependencies:
pnpm installBuild AGENTS.md from rules:
pnpm buildValidate rule files:
pnpm validateExtract test cases:
pnpm extract-testsrules/_template.md to rules/area-description.mdasync- for Eliminating Waterfalls (Section 1)bundle- for Bundle Size Optimization (Section 2)server- for Server-Side Performance (Section 3)client- for Client-Side Data Fetching (Section 4)rerender- for Re-render Optimization (Section 5)rendering- for Rendering Performance (Section 6)js- for JavaScript Performance (Section 7)advanced- for Advanced Patterns (Section 8)pnpm build to regenerate AGENTS.md and test-cases.jsonEach rule file should follow this structure:
---
title: Rule Title Here
impact: MEDIUM
impactDescription: Optional description
tags: tag1, tag2, tag3
---
## Rule Title Here
Brief explanation of the rule and why it matters.
**Incorrect (description of what's wrong):**
```typescript
// Bad code exampleCorrect (description of what's right):
// Good code exampleOptional explanatory text after examples.
Reference: Link
_ are special (excluded from build)area-description.md (e.g., async-parallel.md)CRITICAL - Highest priority, major performance gainsHIGH - Significant performance improvementsMEDIUM-HIGH - Moderate-high gainsMEDIUM - Moderate performance improvementsLOW-MEDIUM - Low-medium gainsLOW - Incremental improvementspnpm build - Compile rules into AGENTS.mdpnpm validate - Validate all rule filespnpm extract-tests - Extract test cases for LLM evaluationpnpm dev - Build and validateWhen adding or modifying rules:
_template.md structurepnpm build to regenerate AGENTS.md and test-cases.jsonPaste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/skill/react-best-practices-vercel to learn what the "React Best Practices (Vercel)" skill does and how to install it. Install it for my coding agent as documented on that page, then confirm the skill is available and summarize what it can do.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
git clone --depth 1 https://github.com/vercel-labs/agent-skills.git /tmp/react-best-practices-vercel
mkdir -p ~/.claude/skills
cp -r /tmp/react-best-practices-vercel/skills/react-best-practices ~/.claude/skills/react-best-practices-vercel
rm -rf /tmp/react-best-practices-vercel~/.claude/skills/react-best-practices-vercel
├── SKILL.md
├── AGENTS.md
├── metadata.json
└── rulesFor a single project, put the folder in .claude/skills inside the repo instead.
git clone --depth 1 https://github.com/vercel-labs/agent-skills.gitComprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 70 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| 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 Fetching | 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- |
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 contentbundle-barrel-imports - Import directly, avoid barrel filesbundle-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 speedserver-auth-actions - Authenticate server actions like API routesserver-cache-react - Use React.cache() for per-request deduplicationserver-cache-lru - Use LRU cache for cross-request cachingserver-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 operationsclient-swr-dedup - Use SWR for automatic request deduplicationclient-event-listeners - Deduplicate global event listenersclient-passive-event-listeners - Use passive listeners for scrollclient-localstorage-schema - Version and minimize localStorage datarerender-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 componentsrendering-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 - Use inline script for client-only datarendering-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 tagsjs-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 - Cache function results in module-level Mapjs-cache-storage - Cache localStorage/sessionStorage readsjs-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 timeadvanced-effect-event-deps - Don't put useEffectEvent results in effect depsadvanced-event-handler-refs - Store event handlers in refsadvanced-init-once - Initialize app once per app loadadvanced-use-latest - useLatest for stable callback refsRead individual rule files for detailed explanations and code examples:
rules/async-parallel.md
rules/bundle-barrel-imports.mdEach rule file contains:
For the complete guide with all rules expanded: AGENTS.md
380 Claude Code skills & agent skills & plugins (30+ Agents, 70+ custom commands, 380+ skills, custo
An IOS Simulator Skill for ClaudeCode. Use it to optimise Claude's ability to build, run and interac
agent-skills-063bee94c3f4df8453406c830b0a7df0f2860278Agent Skills 063bee94c3f4df8453406c830b0a7df0f2860278Release notesagent-skills-20e89cc4bb256eb7b1fcbdc68f7175284709a847Agent Skills 20e89cc4bb256eb7b1fcbdc68f7175284709a847Release notesagent-skills-dd089a8c752c966dee8bf0f27cb625ba193ffd9eAgent Skills dd089a8c752c966dee8bf0f27cb625ba193ffd9eRelease notesConnect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "react-best-practices-vercel" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
380 Claude Code skills & agent skills & plugins (30+ Agents, 70+ custom commands, 380+ skills, custo
Coding & Review
An IOS Simulator Skill for ClaudeCode. Use it to optimise Claude's ability to build, run and interac
Coding & Review
One email a week. New agents, MCP servers and skills, and what is actually getting traction.