vercel-react-best-practices

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

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/stephschofield/beth --skill vercel-react-best-practices-stephschofield
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/stephschofield/beth/tree/main/.github/skills/vercel-react-best-practices
Command: npx skills add https://github.com/stephschofield/beth --skill vercel-react-best-practices-stephschofield

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, data-fetching waterfalls, bloated bundles, and unnecessary re-renders. This Skill gives AI agents a structured, prioritized rulebook from Vercel Engineering so generated and refactored code follows proven performance patterns instead of common anti-patterns. ## Core Features & Use Cases - 45 Prioritized Rules Across 8 Categories: Covers eliminating waterfalls, bundle size optimization, server-side performance, client-side data fetching, re-render optimization, rendering performance, JavaScript performance, and advanced patterns, each ranked by impact from CRITICAL to LOW. - Incorrect vs. Correct Code Examples: Every rule includes side-by-side TypeScript/TSX examples showing the anti-pattern and the optimized implementation, with impact metrics like 2-10x improvements from parallelization. - Modular Rule Files: Individual rule files under rules/ let agents load only the relevant guidance, while AGENTS.md provides the full compiled reference. - Use Case: When asked to optimize a slow Next.js page, the agent applies rules like Promise.all() parallelization, Suspense boundaries, direct imports instead of barrel files, and React.cache() deduplication to produce measurably faster code. ## Quick Start Review my Next.js page component and refactor it using the Vercel React best practices to eliminate data-fetching 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 data fetching waterfalls in Next.js?▼

Start independent async operations immediately and await them together with Promise.all(), or use better-all for partial dependency chains. Restructure Server Components with composition so sibling components fetch in parallel instead of sequentially.

How to reduce bundle size in a Next.js application?▼

Import directly from source files instead of barrel files like lucide-react or @mui/material entry points, which can load thousands of unused modules. Use next/dynamic for heavy components and Next.js 13.5+ optimizePackageImports to automate direct imports.

Does React.cache() work with Next.js fetch requests?▼

Next.js automatically memoizes fetch requests with the same URL and options within a single request, so React.cache() is unnecessary there. Use React.cache() for database queries, authentication checks, and other non-fetch async work.

When should I not use Suspense boundaries for data fetching?▼

Avoid Suspense when data drives layout decisions, when content is SEO-critical above the fold, or when queries are small and fast. The trade-off is faster initial paint versus potential layout shift when content loads.

Why do Server Actions need their own authentication checks?▼

Server Actions are exposed as public endpoints just like API routes and can be invoked directly, bypassing middleware or layout guards. Always verify authentication and authorization inside each action, and validate inputs with a schema like zod.