vercel-react-best-practices

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

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill vercel-react-best-practices-pikachu0310
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/pikachu0310/codex-agent-ops-public/tree/main/.agents/skills/react-best-practices
Command: npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill vercel-react-best-practices-pikachu0310

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React and Next.js codebases often suffer from slow load times, unnecessary re-renders, oversized bundles, and data-fetching waterfalls that are hard to spot during manual review. This Skill gives an AI agent a structured, prioritized rulebook so performance issues are caught and fixed during code generation and refactoring. ## Core Features & Use Cases - 70 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 tagged by impact 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 or 200-800ms import cost savings. - Modular Rule Files: Individual rules live in rules/ for targeted reading, with a compiled AGENTS.md containing the full guide. - Use Case: When asked to optimize a slow Next.js page, the agent applies rules like parallelizing fetches with Promise.all(), adding Suspense boundaries, replacing barrel imports, and memoizing expensive components. ## Quick Start Review my Next.js page component for performance issues and apply the relevant React best practices rules to fix 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 fix data fetching waterfalls in Next.js?

Start independent async operations immediately and await them together with Promise.all() instead of awaiting sequentially. For partial dependencies, use better-all or chain promises so dependent fetches start as early as possible.

How to reduce bundle size in a React or Next.js app?

Avoid barrel file imports from libraries like lucide-react or @mui/material, use next/dynamic for heavy components, and defer non-critical third-party scripts until after hydration. Next.js 13.5+ can optimize package imports automatically via optimizePackageImports.

Does this guide cover React Server Components performance?

Yes, it includes server-side rules such as minimizing serialization at RSC boundaries, per-request deduplication with React.cache(), avoiding shared module state for request data, and authenticating Server Actions like API routes.

When should I use Suspense boundaries in React?

Use Suspense when only part of a page needs async data, so the layout renders immediately while data streams in. Avoid it for SEO-critical above-the-fold content or when layout shift would hurt the user experience.

Why does my React component re-render too often?

Common causes include defining components inside components, missing memoization of expensive work, broad effect dependencies, and subscribing to raw state instead of derived values. The re-render rules cover functional setState, useDeferredValue, and transitions for non-urgent updates.