Agent Skills: React Optimise Best Practices

Application-level React performance optimization covering React Compiler mastery, bundle optimization, rendering performance, data fetching, Core Web Vitals, state subscriptions, profiling, and memory management. Use when optimizing React app performance, analyzing bundle size, improving Core Web Vitals, or profiling render bottlenecks. Complements the react skill (API-level patterns) with holistic performance strategies. Does NOT cover React 19 API usage (see react skill) or Next.js-specific features (see nextjs-16-app-router skill).

UncategorizedID: pproenca/dot-skills/react-optimise

Install this agent skill to your local

pnpm dlx add-skill https://github.com/pproenca/dot-skills/tree/HEAD/skills/.experimental/react-optimise

Skill Files

Browse the full folder contents for react-optimise.

Download Skill

Loading file tree…

skills/.experimental/react-optimise/SKILL.md

Skill Metadata

Name
react-optimise
Description
Application-level React performance optimization covering React Compiler mastery, bundle optimization, rendering performance, data fetching, Core Web Vitals, state subscriptions, profiling, and memory management. Use when optimizing React app performance, analyzing bundle size, improving Core Web Vitals, or profiling render bottlenecks. Complements the react skill (API-level patterns) with holistic performance strategies. Does NOT cover React 19 API usage (see react skill) or Next.js-specific features (see nextjs-16-app-router skill).

React Optimise Best Practices

Application-level performance optimization guide for React applications. Contains 43 rules across 8 categories, prioritized by impact from critical (React Compiler, bundle optimization) to incremental (memory management).

When to Apply

  • Optimizing React application performance or bundle size
  • Adopting or troubleshooting React Compiler v1.0
  • Splitting bundles and configuring code splitting
  • Improving Core Web Vitals (INP, LCP, CLS)
  • Profiling render performance and identifying bottlenecks
  • Fixing memory leaks in long-lived single-page applications
  • Optimizing data fetching patterns and eliminating waterfalls

Rule Categories

| Category | Impact | Rules | Key Topics | |----------|--------|-------|------------| | React Compiler Mastery | CRITICAL | 6 | Compiler-friendly code, bailout detection, incremental adoption | | Bundle & Loading | CRITICAL | 6 | Route splitting, barrel elimination, dynamic imports, prefetching | | Rendering Optimization | HIGH | 6 | Virtualization, children pattern, debouncing, CSS containment | | Data Fetching Performance | HIGH | 5 | Waterfall elimination, route preloading, SWR, deduplication | | Core Web Vitals | MEDIUM-HIGH | 5 | INP yielding, LCP priority, CLS prevention, image optimization | | State & Subscription Performance | MEDIUM-HIGH | 5 | Context splitting, selectors, atomic state, derived state | | Profiling & Measurement | MEDIUM | 5 | DevTools profiling, flame charts, CI budgets, production builds | | Memory Management | LOW-MEDIUM | 5 | Effect cleanup, async cancellation, closure leaks, heap analysis |

Quick Reference

Critical patterns — get these right first:

  • Write compiler-friendly components to unlock automatic 2-10x optimization
  • Split code at route boundaries to reduce initial bundle by 40-70%
  • Eliminate barrel files to enable tree shaking
  • Detect and fix silent compiler bailouts

Common mistakes — avoid these anti-patterns:

  • Reading refs during render (breaks compiler optimization)
  • Importing entire libraries when only using one function
  • Not profiling before optimizing (targeting the wrong bottleneck)
  • Missing effect cleanup (subscription memory leaks)

Table of Contents

  1. React Compiler MasteryCRITICAL
  2. Bundle & LoadingCRITICAL
  3. Rendering OptimizationHIGH
  4. Data Fetching PerformanceHIGH
  5. Core Web VitalsMEDIUM-HIGH
  6. State & Subscription PerformanceMEDIUM-HIGH
  7. Profiling & MeasurementMEDIUM
  8. Memory ManagementLOW-MEDIUM

References

  1. https://react.dev
  2. https://react.dev/blog/2025/10/07/react-compiler-1
  3. https://web.dev/articles/vitals
  4. https://tanstack.com/virtual
  5. https://developer.chrome.com/docs/devtools/performance

Related Skills

  • For React 19 API best practices, see react skill
  • For Next.js App Router optimization, see nextjs-16-app-router skill
  • For client-side form handling, see react-hook-form skill