
Vercel React Best Practices
SkillVercel 工程团队整理的 React 与 Next.js 性能规范,70 条规则按影响排序,涵盖消除请求瀑布、包体积、服务端性能与重复渲染,供编写、评审与重构时对照。Vercel 官方维护。
React Best Practices
A structured repository for creating and maintaining React Best Practices optimized for agents and LLMs.
Structure
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 files
src/- Build scripts and utilitiesmetadata.json- Document metadata (version, organization, abstract)AGENTS.md- Compiled output (generated)test-cases.json- Test cases for LLM evaluation (generated)
Getting Started
-
Install dependencies:
pnpm install -
Build AGENTS.md from rules:
pnpm build -
Validate rule files:
pnpm validate -
Extract test cases:
pnpm extract-tests
Creating a New Rule
- Copy
rules/_template.mdtorules/area-description.md - Choose the appropriate area prefix:
async-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)
- Fill in the frontmatter and content
- Ensure you have clear examples with explanations
- Run
pnpm buildto regenerate AGENTS.md and test-cases.json
Rule File Structure
Each 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
File Naming Convention
- Files starting with
_are special (excluded from build) - Rule files:
area-description.md(e.g.,async-parallel.md) - Section is automatically inferred from filename prefix
- Rules are sorted alphabetically by title within each section
- IDs (e.g., 1.1, 1.2) are auto-generated during build
Impact Levels
CRITICAL- Highest priority, major performance gainsHIGH- Significant performance improvementsMEDIUM-HIGH- Moderate-high gainsMEDIUM- Moderate performance improvementsLOW-MEDIUM- Low-medium gainsLOW- Incremental improvements
Scripts
pnpm build- Compile rules into AGENTS.mdpnpm validate- Validate all rule filespnpm extract-tests- Extract test cases for LLM evaluationpnpm dev- Build and validate
Contributing
When adding or modifying rules:
- Use the correct filename prefix for your section
- Follow the
_template.mdstructure - Include clear bad/good examples with explanations
- Add appropriate tags
- Run
pnpm buildto regenerate AGENTS.md and test-cases.json - Rules are automatically sorted by title - no need to manage numbers!
Acknowledgments
相關資源

Next.js Skills
PluginNext.js 官方插件,随 vercel/next.js 仓库发布:引导启用和优化 Cache Components 与 Partial Prefetching,并结合 Next.js MCP 与 agent-browser 在运行中的 dev server 上验证改动。
vercel/next.js143k
React Composition Patterns
SkillVercel 出品的 React 组合模式指南:用复合组件、状态提升和清晰的 Context 接口取代布尔 props 泛滥,含 React 19 API 变化,适合重构组件库与评审组件架构。
vercel-labs/agent-skills32.5k
next-dev-loop
Skill改完代码后让 agent 结合 /_next/mcp 与 agent-browser 在运行中的 Next.js 应用里核对路由、报错与页面表现,确认改动真正生效。Next.js 官方维护,需要 Next.js 16.3+(Turbopack)与 agent-browser。
vercel/next.js143k
Next.js Cache Components Optimizer
Skill让 agent 在 Cache Components 下把 Next.js 路由优化成即时导航:先用 @next/playwright 的 instant() 写一个失败的端到端测试,再把 Suspense 边界下推到它保护的数据处、扩大静态外壳,直到测试通过并保留为回归防护;首次加载与客户端导航都覆盖。需要 Next.js 16.3+ 并开启 cacheComponents。
vercel/next.js143k
Vercel Optimize
SkillVercel 官方成本与性能优化技能:先采集线上指标、用量与项目配置,只排查指标指向的路由和文件,输出带文档依据的优化建议排序;支持 Next.js、SvelteKit 与 Nuxt。需要 Vercel CLI v53+ 登录并关联项目。
vercel-labs/agent-skills32.5k
Improve React
Skill以资深 React 工程师的视角审查整个代码库:先只读运行 React Doctor 扫描作为证据,按缺陷、性能、无障碍、安全、可维护性五类筛选并排序问题,再为选定的问题写出可交给其他 agent 执行的独立实施计划,不改源码。
millionco/react-doctor15k