Dev.to AI 🤖 Ai 👁 0 📖 5 min read

vercel-react-best-practices in Claude Code: the waterfall and bundle rules that change the code it writes

Disclosure: we run Skillselion, an independent directory of Claude Code, Codex and Cursor extensions ranked by real installs. We have no tie to Vercel. Quotes come from the skill's files at commit 5a37a63, the head of ma

Disclosure: we run Skillselion, an independent directory of Claude Code, Codex and Cursor extensions ranked by real installs. We have no tie to Vercel. Quotes come from the skill's files at commit 5a37a63, the head of main on 22 November 2026.

Short answer: vercel-react-best-practices gives Claude Code 70 React and Next.js performance rules in 8 categories, ranked by impact. The ones to apply first are the 12 rules in the two CRITICAL categories: 6 on request waterfalls (parallel awaits, deferred awaits) and 6 on bundle size (barrel imports, dynamic imports). Install it with npx skills add, then let React tasks trigger it.

On 22 November 2026 Skillselion's catalog API recorded 921,910 installs for the vercel-react-best-practices skill listing (skills.sh registry data). The vercel-labs/agent-skills repo had 34,682 GitHub stars the same day, and the SKILL.md frontmatter declares an MIT license.

What does vercel-react-best-practices do?

It is a rulebook your agent reads while it writes React. The SKILL.md describes itself this way:

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.

Source: vercel-labs/agent-skills, skills/react-best-practices/SKILL.md

We counted the files to check that number. The rules/ folder holds 70 rule files plus two helper files (_sections.md and _template.md), and the SKILL.md quick reference lists the same 70 IDs. Three other files in the repo still say "40+ rules": the root README, the skill's metadata.json and the compiled AGENTS.md. Trust the folder.

Each rule is one Markdown file with an impact level, an incorrect example and a correct example. The SKILL.md is only an index. The agent opens a rule file when it needs the detail, so the part loaded on trigger stays short.

Which rule categories matter most?

The SKILL.md ranks the 8 categories. Here is the ranking with the rule count per category, from our count of the quick reference:

Priority Category Impact Rules
1 Eliminating Waterfalls (async-) CRITICAL 6
2 Bundle Size Optimization (bundle-) CRITICAL 6
3 Server-Side Performance (server-) HIGH 10
4 Client-Side Data Fetching (client-) MEDIUM-HIGH 4
5 Re-render Optimization (rerender-) MEDIUM 15
6 Rendering Performance (rendering-) MEDIUM 11
7 JavaScript Performance (js-) LOW-MEDIUM 14
8 Advanced Patterns (advanced-) LOW 4

Re-render optimization has the most rules and sits at priority 5. That ordering is the useful opinion in this skill. Most React performance advice starts with useMemo and React.memo. Vercel's file starts with requests that wait on each other and JavaScript you did not need to ship. The section file explains why waterfalls come first:

Waterfalls are the #1 performance killer. Each sequential await adds full network latency. Eliminating them yields the largest gains.

Source: vercel-labs/agent-skills, skills/react-best-practices/rules/_sections.md

How does it change the async code Claude Code writes?

This is where you see the difference in a diff. Left alone, an agent writing a server component or route handler tends to fetch one thing per line. The async-parallel rule is marked impact: CRITICAL with impactDescription: 2-10× improvement, and its before/after is short:

Incorrect (sequential execution, 3 round trips):

const user = await fetchUser()
const posts = await fetchPosts()
const comments = await fetchComments()

Correct (parallel execution, 1 round trip):

const [user, posts, comments] = await Promise.all([
  fetchUser(),
  fetchPosts(),
  fetchComments()
])

Source: vercel-labs/agent-skills, skills/react-best-practices/rules/async-parallel.md

The companion rule, async-defer-await, moves an await into the branch that uses the result. Its example updateResource function checks that the resource exists before it fetches permissions, so a "Not found" response never waits on a permissions call. One detail we noticed: that file's own frontmatter says impact: HIGH, even though it sits in a CRITICAL category. It is not alone: only 5 of the 12 rules in the two CRITICAL categories grade themselves CRITICAL, 5 say HIGH and 2 say MEDIUM. The category rank and the per-rule impact are separate fields, and the rule files carry the finer grade.

How does it change imports and bundle size?

The second CRITICAL category targets what ships to the browser. The bundle-barrel-imports rule is the one you will notice first in a Next.js repo, because agents import icons and components from package roots by default. The rule's incorrect example:

import { Check, X, Menu } from 'lucide-react'
// Loads 1,583 modules, takes ~2.8s extra in dev
// Runtime cost: 200-800ms on every cold start

For Next.js 13.5 and later, the recommended fix keeps that import line and adds config instead:

// next.config.js - automatically optimizes barrel imports at build time
module.exports = {
  experimental: {
    optimizePackageImports: ['lucide-react', '@mui/material']
  }
}

Source: vercel-labs/agent-skills, skills/react-best-practices/rules/bundle-barrel-imports.md

The rule also warns that lucide-react deep import paths do not ship .d.ts files, so a direct import can become an implicit any under strict. That warning is the kind of thing an agent gets wrong without it. Other bundle rules include next/dynamic for heavy components, loading analytics after hydration, and preloading on hover or focus.

How do you install and invoke it in Claude Code?

The skill lives in the vercel-labs/agent-skills collection, next to other Vercel skills. The repo README installs the whole collection:

npx skills add vercel-labs/agent-skills

To install only this skill for Claude Code, the skills CLI README documents --skill and -a:

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

You do not call it with a special command. The README says skills "are automatically available once installed", and the SKILL.md description triggers it on "React components, Next.js pages, data fetching, bundle optimization, or performance improvements". For a review pass on existing code, name it in the prompt, for example "review app/dashboard/page.tsx against vercel-react-best-practices and name the rule IDs you apply". The IDs make the output checkable: async-parallel in a commit message points to one file you can read.

A practical order for an existing app: ask for a pass with only the async- and bundle- rules first, ship that, then look at server-. Leave the js- micro-optimizations for hot paths you have profiled.

Which copy should you install?

The vercel-labs original. Our catalog also lists repos that carry a skill with the same name. On 22 November the largest same-name copy, inside OpenMontageInc/OpenMontage, had 1,257 installs against the original's 921,910. Vercel also ships a differently named react-best-practices skill inside vercel/vercel-plugin (2,027 installs that day). If you want to see the other skills in the collection, our Vercel Labs author page lists them.

When you run an agent on a React codebase, which category does it get wrong most often for you: waterfalls, bundle size, or re-renders?

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.