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.
Add this skill
npx mdskills install vercel-labs/react-best-practicesComprehensive React/Next.js performance guide with 45 prioritized, categorized rules and clear trigger conditions
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 install
Build AGENTS.md from rules:
pnpm build
Validate rule files:
pnpm validate
Extract test cases:
pnpm extract-tests
rules/_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 example
Correct (description of what's right):
// Good code example
Optional 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.jsonInstall via CLI
npx mdskills install vercel-labs/react-best-practicesVercel React Best Practices is a free, open-source AI agent skill. 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.
Install Vercel React Best Practices with a single command:
npx mdskills install vercel-labs/react-best-practicesThis downloads the skill files into your project and your AI agent picks them up automatically.
Vercel React Best Practices works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.