Skip to main content
skill CX Codex

react-performance · oakoss — Claude Code skill: what it does, how to install

react-performance is a Claude Code skill that applies React optimization patterns automatically when a task concerns app speed.

MIT 163 installs ★ 29 updated 2026-08-17

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add oakoss/agent-skills --skill react-performance -a claude-code
Open on GitHub

What react-performance does

The skill puts React optimization techniques in one place: memoization, code splitting, smaller bundles, profiling. A quick-reference table covers the categories (React.memo, useMemo, useCallback, React.lazy with <Suspense>, startTransition, content-visibility), and a second one pairs common mistakes with the pattern that replaces them.

Three reference files sit next to it: references/rendering-optimization.md, references/code-splitting.md, references/profiling-and-debugging.md. Profiling, code edits and ranking the work by impact get handed to the Explore, Task and Plan subagents.

You never invoke it yourself; the agent picks it up from your task description. Component architecture and React 19 API questions belong to the sibling react-patterns skill, installed with npx skills add oakoss/agent-skills --skill react-patterns. Profile a production build, because dev-mode warnings distort the numbers.

What it helps with

  • find slow components in a React DevTools flamegraph
  • stop a search box from re-rendering the whole list
  • split a heavy bundle into lazy chunks
  • render a long list without adding a virtualisation library
  • drop hand-written useMemo once React Compiler is on

Example prompts for the agent

  • Profile this app and tell me which components re-render too often
  • Split the bundle: load the chart and the editor lazily with React.lazy and <Suspense>
  • Why does this list lag while I type in the search box? Suggest fixes

How to install react-performance

1Skills CLI (Vercel)

npx skills add oakoss/agent-skills --skill react-performance -a claude-code

2Manually: put the files in place

~/.claude/skills/react-performance/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/react-performance/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about react-performance

How do I install react-performance in Claude Code?

Run npx skills add oakoss/agent-skills --skill react-performance -a claude-code. The skill lands at ~/.claude/skills/react-performance/SKILL.md.

What does react-performance do?

It covers how to make a React app faster: memoization, lazy imports, direct imports instead of barrel files, startTransition for non-urgent updates, content-visibility for long lists, and React DevTools profiling.

How is it different from react-patterns?

react-performance deals with speed only. General component architecture and React 19 API questions go to react-patterns, a separate skill from the same repository.

Source text

SKILL.md · MIT
---
name: react-performance
description: |
  React performance optimization patterns including memoization, code splitting, bundle size reduction, re-render elimination, and profiling. Covers React Compiler automatic optimization, manual memo/useMemo/useCallback targeting, React.lazy with Suspense, barrel file avoidance, content-visibility for large lists, startTransition for non-urgent updates, and React DevTools profiling.

  Use when optimizing React app performance, reducing bundle size, eliminating unnecessary re-renders, debugging slow components, code splitting, or profiling rendering bottlenecks. Use for performance audit, bundle analysis, re-render diagnosis, lazy loading, virtualization.
license: MIT
metadata:
  author: oakoss
  version: '1.0'
  source: 'https://react.dev/learn/react-compiler'
user-invocable: false
---

# React Performance

## Overview

Dedicated performance optimization skill for React applications. Covers the full spectrum from build-time optimizations (code splitting, barrel file avoidance) through runtime techniques (memoization, transitions, content-visibility) to diagnostic tooling (React DevTools Profiler, bundle analyzers).

**When to use:** Reducing Time to Interactive, shrinking bundle size, eliminating re-renders, profiling slow components, optimizing large lists, lazy loading heavy dependencies, auditing React app performance.

**When NOT to use:** General React component patterns (use `react-patterns` skill), framework-specific optimizations like Next.js caching (use framework skill), non-React performance (network, database, CDN).

## Quick Reference

| Category    | Technique                    | Key Points                                                                            |
| ----------- | ---------------------------- | ------------------------------------------------------------------------------------- |
| Compiler    | React Compiler               | Automatic memoization at build time; eliminates manual memo/useMemo/useCallback       |
| Memoization | `React.memo(Component)`      | Wrap components receiving stable primitive props from frequently re-rendering parents |
| Memoization | `useMemo(fn, deps)`          | Expensive computations only: sorting, filtering, Set/Map construction                 |
| Memoization | `useCallback(fn, deps)`      | Only when passed to memoized children; use functional setState for stable refs        |
| Splitting   | `React.lazy(() => import())` | Lazy-load heavy components with `<Suspense>` fallback                                 |
| Splitting   | Preload on intent            | Trigger `import()` on hover/focus for perceived speed                                 |
| Bundle      | Direct imports               | Avoid barrel files; import from specific paths to reduce module count                 |
| Bundle      | Defer third-party            | Load analytics, logging after hydration                                               |
| Re-renders  | `startTransition`            | Mark non-urgent updates (search, scroll tracking) as interruptible                    |
| Re-renders  | Functional setState          | `setState(prev => ...)` eliminates state dependencies from callbacks                  |
| Re-renders  | Derived state                | Subscribe to booleans, not continuous values; compute during render                   |
| Re-renders  | Defer state reads            | Read dynamic state (searchParams) inside callbacks, not at render                     |
| Rendering   | `content-visibility: auto`   | Skip layout/paint for off-screen items in long lists                                  |
| Rendering   | Hoist static JSX             | Extract constant elements outside component functions                                 |
| Profiling   | React DevTools Profiler      | Record renders, identify slow components, flamegraph analysis                         |
| Profiling   | Bundle analyzer              | Visualize chunk sizes, find oversized dependencies                                    |

## Common Mistakes

| Mistake                                                            | Correct Pattern                                                                             |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- |
| Wrapping everything in useMemo/useCallback                         | Trust React Compiler first; only memoize expensive computations or memoized-child callbacks |
| Memoizing cheap operations like `value * 2`                        | Skip memo for simple primitives; overhead exceeds recomputation cost                        |
| Importing from barrel files (`lucide-react`, `@mui/material`)      | Import directly from specific paths or use `optimizePackageImports`                         |
| Loading analytics/tracking in the initial bundle                   | Defer with lazy + mounted state to load after hydration                                     |
| Subscribing to continuous values (window width) for boolean checks | Use `useMediaQuery` or derived boolean to re-render only on threshold change                |
| Referencing state in useCallback dependency array                  | Use functional setState `setState(prev => ...)` for stable callbacks                        |
| Using `useEffect` to derive state from props                       | Compute derived values during render; effects add an extra render cycle                     |
| Creating new object literals as props on every render              | Hoist static objects outside component; use useMemo for dynamic objects                     |
| Profiling in development mode                                      | Always profile production builds; dev mode includes extra warnings that skew results        |

## Delegation

- **Profile and diagnose performance bottlenecks**: Use `Explore` agent to run React DevTools Profiler, analyze bundle composition, and trace re-render cascades
- **Apply performance optimizations to existing code**: Use `Task` agent to implement code splitting, add memoization boundaries, and optimize rendering
- **Plan performance improvement strategy**: Use `Plan` agent to prioritize optimizations by impact (waterfalls > bundle > re-renders) and create an optimization roadmap

> If the `react-patterns` skill is available, delegate general component architecture and React 19 API questions to it.
> Otherwise, recommend: `npx skills add oakoss/agent-skills --skill react-patterns`

## References

- [Rendering optimization: memo, useMemo, useCallback, compiler, re-render elimination](references/rendering-optimization.md)
- [Code splitting: React.lazy, Suspense, dynamic imports, bundle optimization](references/code-splitting.md)
- [Profiling and debugging: DevTools, performance measurement, common bottlenecks](references/profiling-and-debugging.md)

© oakoss · MIT · oakoss/agent-skills

Similar skills

All skills for Frontend and UI →

react-performance by other authors comes first.

react-performance affaan-m react-performance — a performance optimization skill for React 18/19 and Next.js. It helps coding agents spot network waterfalls, trim client bundle sizes, and tune Server Components during code review. CX Codex +1 6,700installs react-performance-optimizer curiositech react-performance-optimizer diagnoses React render bottlenecks to hit 60fps. It tackles sluggish lists, unnecessary component updates, and oversized bundles. CX Codex +1 215installs react-component-performance Dimillian react-component-performance identifies React render hotspots, isolates fast-changing state, and eliminates re-render churn. Useful when lists lag or components re-render too often. CX Codex +1 1,100installs react-render-optimization patterns.dev A Claude Code skill, also available for five other agents, that teaches React render optimization patterns. Use it when refactoring components that lag on typing, scrolling or any interaction. CX Codex +1 1,200installs react-coding-style LegendApp react-coding-style — a skill that steers your coding agent through React implementation and review: narrow subscriptions, stable identities, honest hook dependencies. CX Codex +1 482installs react-vite-best-practices agent-skills react-vite-best-practices — a skill with 23 rules for optimizing React apps built with Vite: build config, code splitting, HMR, assets, env variables and bundle analysis. Useful when an agent writes or reviews components. CX Codex +1 3,000installs react-performance-optimization davila7 react-performance-optimization is a Claude Code subagent that finds and addresses performance issues in React apps. It handles rendering, bundle size, and memory leak investigations. CX Codex 3,935installs

From the same set106

The whole set →

Project sponsors

Companies that keep this analytics open