vercel-labs/agent-skills · skills/react-best-practices/SKILL.md
vercel-react-best-practices
“Vercel's 70-rule React speed cheat sheet: a sharp index, but the actual advice lives in other files”
What it does
A prioritized index of 70 React and Next.js performance rules from Vercel, grouped into 8 categories from waterfalls to micro-optimizations. Each rule gets one line here. Explanations and code examples are in rules/*.md and AGENTS.md.
- When the agent uses it
- When writing, reviewing or refactoring React or Next.js code, especially data fetching, bundle size, re-renders or general performance work.
- Who it is for
- Good for teams on modern React/Next.js who want perf-aware reviews. Skip it if you're on old React versions or want a guide that works without its rule files.
- What it costs
- 120 lines, about 2k tokens once the agent loads it.
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.
What it tells the agent to do
- Apply when writing, reviewing or refactoring React/Next.js code, data fetching, or bundle and load-time work
- Work through rule categories by impact: waterfalls and bundle size first, advanced patterns last
- Match the code to a rule by prefix in the quick reference (async-, bundle-, server-, rerender-, etc.)
- Open rules/<rule-name>.md for the explanation and the incorrect and correct code examples
- Read AGENTS.md when the full expanded guide is needed
Lines worth reading
Straight from the file, with why each one matters.
line 3Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
A clear trigger list, but 'React components' alone covers nearly any frontend task, so expect this to load often.
line 12Contains 70 rules across 8 categories
The count is honest. The quick reference lists exactly 70 rules across 8 categories.
line 58`server-auth-actions` - Authenticate server actions like API routes
A security rule hiding in a performance guide, and arguably the most important line here.
line 103`rendering-conditional-render` - Use ternary, not && for conditionals
A sharp, opinionated rule that catches the classic stray '0' rendered by `count && <List/>`.
line 43`async-dependencies` - Use better-all for partial dependencies
Recommends a specific third-party library by name with no context in this file. Check the rule file before adding the dependency.
Watch out for
Nothing risky that Kin could see in SKILL.md. Scripts beside it were not read.
The scorecard
- TriggerSays when to use it8/10
Says what and when with real keywords; 'React components' makes it fire on almost anything.
- FocusOne clear job7/10
One theme, performance, but 70 rules range from SSR waterfalls to RegExp hoisting.
- LeanLight to load9/10
About 150 lines, a pure index. Detail is pushed to rule files loaded on demand.
- ConcreteSteps you can follow5/10
One-liners only. No examples, procedure or done check here; those live in unseen files.
- SafeSafe to run10/10
Advice only. No shell, network, deletes, secrets or instruction overrides.
What it does well
- Rules are ranked by impact, so the agent fixes waterfalls and bundle bloat before memoizing a regex.
- Good progressive disclosure: a one-line index here, with full examples in per-rule files read only when needed.
- Rule IDs with category prefixes make it easy to cite a specific rule in a code review.
How it could be better
Add a short review procedure with a done check
The file lists rules but never tells the agent what order to work in or how to confirm a change helped.
Add## Procedure 1. Identify the code type: server component, client component, API route, or shared util. 2. Check CRITICAL rules (async-, bundle-) first, then HIGH, then lower. 3. For each match, open rules/<rule-id>.md and apply the 'Correct' pattern. 4. Report findings as: <rule-id> — <file:line> — <one-line fix>. 5. Done when <build passes / bundle size checked with <analyzer command> / no new waterfalls remain>.
Inline one example for the top two rules
If rules/ is missing or not read, the agent has nothing concrete. One before/after pair for the CRITICAL rules keeps the skill useful on its own.
Add### Example: async-parallel Incorrect: ```ts const a = await getA(); const b = await getB(); ``` Correct: ```ts const [a, b] = await Promise.all([getA(), getB()]); ```
State version requirements for newer APIs
Rules like Activity, useEffectEvent, after() and toSorted() need recent React, Next.js or runtimes. The agent should check before suggesting them.
Add## Version notes Some rules need recent versions: <rule-id> requires <React/Next.js version>. Check package.json before applying them and skip any rule the project's versions do not support.
Kin reviews against Anthropic’s Extend Claude with skills and agentskills.io’s the Agent Skills standard. It reads SKILL.md only, so a script beside it can still do things the file does not say.