vercel-react-best-practices

Applies Vercel's performance optimization rules when writing or refactoring React and Next.js code.

1|Updated May 6, 2026
One-click install
npx skills add https://github.com/surfingalien/FinSurfing --skill vercel-react-best-practices-surfingalien
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/surfingalien/FinSurfing/tree/main/.claude/skills/vercel-react-best-practices
Command: npx skills add https://github.com/surfingalien/FinSurfing --skill vercel-react-best-practices-surfingalien

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React and Next.js codebases often suffer from slow load times, unnecessary re-renders, and bloated bundles because developers miss subtle performance pitfalls. This Skill provides a structured, prioritized rule set from Vercel Engineering so AI agents and developers consistently apply proven optimization patterns during code generation, review, and refactoring. ## Core Features & Use Cases - 70 Prioritized Rules Across 8 Categories: Covers eliminating async waterfalls, bundle size optimization, server-side performance, client-side data fetching, re-render optimization, rendering performance, JavaScript micro-optimizations, and advanced patterns, each tagged with an impact level from CRITICAL to LOW. - Incorrect vs. Correct Code Examples: Every rule includes concrete TypeScript/TSX examples showing the anti-pattern and the optimized implementation, plus impact metrics like 2-10x improvements from parallelizing fetches. - Use Case: When refactoring a Next.js dashboard that loads slowly, apply the waterfall rules to parallelize data fetching with Promise.all(), replace barrel imports from lucide-react with direct imports, and wrap heavy components in next/dynamic to cut Time to Interactive. ## Quick Start Review my React component and apply the Vercel performance best practices to eliminate waterfalls and reduce bundle size.

Frequently Asked Questions about vercel-react-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I eliminate async waterfalls in Next.js API routes?

Start independent operations immediately without awaiting them, then await the promises later. Use Promise.all() for independent fetches, or the better-all library for operations with partial dependencies, yielding 2-10x improvements.

How to reduce bundle size from barrel file imports in React?

Import directly from source files instead of barrel entry points like 'lucide-react' or '@mui/material', which can load thousands of unused modules. In Next.js 13.5+, use the optimizePackageImports config to transform imports automatically while keeping TypeScript support.

Does this guide apply to React apps without Next.js?

Yes, most rules apply to any React codebase, including re-render optimization, JavaScript performance, and client-side fetching patterns. Next.js-specific rules cover Server Actions, RSC serialization, and next/dynamic, while Vite and other bundlers are referenced for import analysis.

When should I not use Suspense boundaries for data fetching?

Avoid Suspense when data is critical for layout decisions, when content is SEO-critical above the fold, when queries are small and fast, or when you want to prevent layout shift. The trade-off is faster initial paint versus potential content jumping.

Why do Server Actions need authentication checks inside the function?

Server Actions are exposed as public endpoints just like API routes, so middleware or layout guards alone are insufficient. Always verify authentication and authorization inside each action, and validate inputs with a schema like zod before performing mutations.