Frontend skillCommunity

React Best Practices Skill

Vercel's React and Next.js skill gives your AI agent 70 performance rules, from request waterfalls to bundle size, to follow as it writes code.

Works in
  • Claude Code
  • Codex
  • Cursor
  • VS Code
  • Gemini CLI

By Vercel · vercel-labs/agent-skills · MIT

Last updated

Install

Run

npx skills add vercel-labs/agent-skills --skill vercel-react-best-practices

This installs the repo's latest version. We reviewed commit 063bee9; use the Manual tab to install exactly that.

What it can touch

Runs scripts
No. Instructions only.
Needs network
No.
allowed-tools
Not set. It asks for no extra tool permissions; your tool's usual prompts apply.
Licence
MIT
Last reviewed
How we check a skill is safe
Check it yourself

Agent skills checklist

0 of 10 checked

Who made it

Before reading a line of it, know whose code you are about to run.

What's inside

The part people skip. Read what your agent will read.

What it can reach

Give it the least access that still does the job.

Keeping it that way

What you checked today is only what runs tomorrow if you pin it.

Your ticks are saved in this browser only.

This is Vercel's performance guide for React and Next.js, written for an AI agent to follow. It holds 70 rules, each with a wrong and a right code example, sorted by how much they matter: request waterfalls and bundle size first, micro-optimisations last. Once it's installed, your agent checks its React code against the rules as it writes and reviews.

What it does

The rules sit in eight groups, in priority order:

PriorityGroupExample rule
CriticalWaterfallsStart independent requests together with Promise.all()
CriticalBundle sizeImport from the file, not the barrel index.ts
HighServerDeduplicate per-request work with React.cache()
Medium-highClient dataShare one request across components with SWR
MediumRe-rendersDerive values during render instead of syncing them in an effect
MediumRenderingUse a ternary, not &&, when the condition can be 0
Low-mediumJavaScriptBuild a Map instead of calling .find() in a loop
LowAdvancedKeep useEffectEvent results out of dependency arrays

SKILL.md is the index. Each rule is a short file under rules/ that the agent opens when a rule applies, so most of the guide stays out of its context until it's needed.

The skill describes its own purpose like this:

Comprehensive 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.

From SKILL.md by Vercel, MIT.

An example

A page component awaits the user, then the user's posts, then the site config, one after another. Ask the agent to "make this page load faster" and, with the skill loaded, it names the rule it's applying (async-parallel), starts the three requests together, and wraps the slow part in a Suspense boundary (async-suspense-boundaries) so the rest of the page can render first. The rule names make it easy to look up why a change was made.

When to use it, and when not to

Use it on any React or Next.js project, and especially when you ask your agent to review a component or speed up a slow page. It's also a good way to learn: read the rule file behind each change your agent makes.

It's less useful outside React. It's a performance guide first: a few rules touch security, like authenticating server actions, but it won't catch accessibility problems or plain bugs, and it doesn't replace a security review.

What we checked

We read every file in the folder at the commit linked above: SKILL.md, README.md, metadata.json, the 72 files under rules/ (70 rules, a template and a section list) and AGENTS.md, which the repo generates from those rules. There are no scripts and no allowed-tools, and nothing tells the agent to fetch anything. The links in the rules point at React, Next.js, MDN and library docs, for you to read. The repo licence is MIT, and the skill says so in its frontmatter.

One thing to know: this skill's name (vercel-react-best-practices) differs from its folder name, which is why the install commands above use the longer name. Our full checklist is in the guide to checking a skill before you install it.

For the look of the page rather than its speed, see Anthropic's frontend design skill.

FAQ

Why is the skill called vercel-react-best-practices when the folder is react-best-practices?

The folder in Vercel's repo is react-best-practices, but the name inside SKILL.md is vercel-react-best-practices. Tools go by that name, so it is what the install commands on this page use and what the folder should be called if you copy it by hand.

Do I need Next.js or Vercel to use it?

No. Most of the rules are plain React or plain JavaScript: parallel requests, memoisation, conditional rendering, array lookups. A section on server components and API routes is written for Next.js, and a few rules mention Vercel features, but nothing requires hosting there.

Will it make my agent slower or use more tokens?

Only when it loads. The SKILL.md is a short index of 70 rules; each rule is its own file the agent opens when it needs the details, and there is a compiled AGENTS.md of the whole guide if it wants everything at once.

Does it replace the React Compiler?

No, and several rules say so: where the React Compiler already memoises for you, the manual version of the rule is not needed. The skill is most useful for the things a compiler cannot fix, like request waterfalls and oversized bundles.

See all skills