react-best-practices

Identify and eliminate performance anti-patterns in React and Next.js applications.

24|8|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/vadimcomanescu/codex-skills --skill react-best-practices-vadimcomanescu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-best-practices
Source: https://github.com/vadimcomanescu/codex-skills/tree/main/skills/.curated/platform/react-best-practices
Command: npx skills add https://github.com/vadimcomanescu/codex-skills --skill react-best-practices-vadimcomanescu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a prioritized, actionable checklist to identify and eliminate common performance anti-patterns in React and Next.js applications, enabling faster initial paint, lower bundle size, and more efficient server/client data fetching. It is written for automated agents and engineers to guide code generation, automated refactors, and code reviews so that performance improvements are consistent and measurable. The guidance covers both high-impact systemic issues and incremental micro-optimizations.

Core Features & Use Cases

  • Prioritized Rule Set: 40+ rules grouped by impact (eliminating waterfalls, bundle size, server-side, client fetching, re-renders, rendering, JS micro-optimizations, advanced patterns) to guide automated changes.
  • Agent-Optimized Guidance: Concrete incorrect vs correct examples, trade-offs, and references designed for LLM-driven refactoring and review workflows.
  • Use Cases: Audit a Next.js page to remove waterfall fetches, refactor imports to reduce bundle size, add Suspense boundaries for streaming, or apply server-side caching patterns.

Quick Start

Use the react-best-practices skill to audit the provided Next.js page and refactor it to eliminate waterfalls, reduce bundle size, and apply server/client data fetching optimizations.

Frequently Asked Questions about react-best-practices

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

FAQPage Schema
How do I identify and fix data fetching waterfalls in Next.js applications?

To eliminate data fetching waterfalls in Next.js applications, audit server-side data fetching and apply a prioritized rule set to parallelize sequential requests. This removes anti-patterns, enabling faster initial paint and more efficient server-side data retrieval.

What causes large bundle size in React components and how can I reduce it?

Large React bundle size is caused by unoptimized imports and heavy client-side dependencies. Reduce bundle size by refactoring imports and enforcing prioritized rules that shift logic to the server, resulting in lower bundle size and faster initial paint.

How do I minimize serialization overhead at React Server and Client boundaries?

Minimize serialization at React Server and Client boundaries by enforcing specific performance rules that optimize data passing between server and client components, reducing unnecessary data transfer and improving rendering efficiency.

What is the best way to audit a Next.js page for performance anti-patterns?

The best way to audit a Next.js page for performance anti-patterns is to apply a prioritized checklist of 40+ rules covering waterfalls, bundle size, and data fetching. This provides concrete incorrect versus correct examples for automated refactoring.

Can I apply Suspense boundaries for streaming data in React and Next.js?

Yes, you can apply Suspense boundaries for streaming data in React and Next.js. This technique is included in performance optimization patterns to improve server-side data fetching and reduce blocking renders for faster initial paint.

Why does my Next.js application have slow initial paint despite using server-side rendering?

Slow initial paint in server-side rendered Next.js applications is often caused by sequential data fetching waterfalls and large bundle sizes. Refactoring server-side caching patterns and eliminating waterfalls directly addresses these bottlenecks.