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
npx skills add oakoss/agent-skills --skill react-performance -a claude-codeWhat 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
useMemoonce 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.lazyand<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-code2Manually: put the files in place
~/.claude/skills/react-performance/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/react-performance/
1Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill react-performance -a codex2Manually: put the files in place
.agents/skills/react-performance/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill react-performance -a cursor2Manually: put the files in place
.cursor/skills/react-performance/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install oakoss/agent-skills skills/react-performance2Manually: put the files in place
.github/skills/react-performance/SKILL.md1Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill react-performance -a gemini-cli2Platform CLI
gemini skills install https://github.com/oakoss/agent-skills --path skills/react-performanceManually: put the files in place
.devin/skills/react-performance/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add oakoss/agent-skills --skill react-performance -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.