Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

react-performance

БесплатноБез исполняемых скриптовНе проверен

Make React and Next.js performance changes that are measured, evidence-backed, and behaviorally safe. Routes to the right rule catalogue…

citypaulот citypaul★ 764 звезды на GitHub

Об этом скилле

React Performance

Performance work fails in two predictable ways: optimizing something that was never the bottleneck, and buying speed with a mutation, a cast, or a deleted test. This skill exists to prevent both. It owns the method; the rule catalogues own the rules.

The catalogue is not the plan. Vercel's rules are ordered by typical impact, not by what is slow in this application. A rule earns its way into a diff by a measurement, not by appearing high in the list.

Where the Rules Live

Read the catalogue that matches the question before proposing a change:

Source Owns Reach for it when
vercel-react-best-practices (external, pinned) 72 rules across 8 impact-ordered categories: async- waterfalls, bundle- size, server- RSC/serialization, client- fetching, rerender-, rendering-, js-, advanced- You have a measured bottleneck and need the specific, worked fix — read the individual rules/<id>.md, not just the index
vercel-composition-patterns (external, pinned) Compound components, boolean-prop proliferation, context providers, React 19 API changes (ref as prop, no forwardRef) The re-render or prop-drilling problem is really a component-API problem
next-best-practices (external, pinned) App Router structure, RSC boundaries, async request APIs, metadata The question is Next.js semantics rather than React cost
next-cache-components (external, pinned) Cache Components, use cache, revalidation Caching and revalidation are the lever
core-web-vitals, performance (external, pinned) LCP/INP/CLS in the field, non-React budgets, images, fonts, third parties The complaint is a user-facing metric, not a React-internal cost
react-testing, front-end-testing Proving browser-observable behavior survived Any time a performance change touches rendered output
xstate Flow logic that re-renders on every keystroke because it lives in scattered useState and useEffect The re-render storm is a modelling problem, not a memoization problem

If two catalogues disagree, the more specific one wins: Next-specific semantics over general React, field-metric guidance over component-level micro-cost.

The Method

1. Establish the baseline

Name the symptom in user-observable terms — a slow route, an unresponsive input, a heavy first load — and capture a number before touching code: a profile, a bundle report, a trace, a field metric. Record how it was measured so the same measurement can be repeated.

Complete when: the symptom, the measurement method, and the starting number are all written down, and the number is reproducible.

2. Locate the cost

Find where the time actually goes before choosing a category. The prioritized order in the catalogue is a good search order — waterfalls and bundle size first, js- micro-optimizations last — but it is a hypothesis generator, not a diagnosis. React Profiler, next build output, a bundle analyzer, and a network waterfall are evidence; a plausible story about re-renders is not.

Complete when: the dominant cost is attributed to a specific boundary — a request waterfall, a bundle entry, a serialization payload, a re-render path, a layout or hydration step — with the evidence that attributes it.

3. Apply one rule at a time

Read the specific rule file, then change one thing. Batched "performance passes" make the re-measurement uninterpretable and turn a review into a guess.

Before the change lands, check it against the house rules below.

Complete when: exactly one hypothesis is in the diff, and the rule it implements is named.

4. Re-measure and keep the evidence

Repeat the step-1 measurement. A change that does not move the number is reverted, not kept "because it is better practice" — an unmeasured optimization is mechanism without benefit, and reduce-system-complexity treats added mechanism as a cost.

Record the before/after pair in the PR. Performance is a non-functional guarantee, so this measurement is the evidence for the change; it does not substitute for the behavior tests, which must be unchanged and green.

Complete when: the same measurement is reported before and after, and every behavior test still passes without modification.

Where House Rules Win

Performance advice written for the general case sometimes trades away something this repository does not trade. When they collide, these hold:

  1. Behavior tests do not change to accommodate a performance change. A perf refactor that requires editing assertions is a behavior change wearing a disguise — route it through tdd. Deleting or weakening a test to make a benchmark look better is never in scope.
  2. Immutability holds until a measurement says otherwise. js- rules that cache property lookups, mutate accumulators, or reuse arrays in hot loops are legitimate inside a proven hot path, and only there. The mutat
Полный SKILL.md на GitHub

Установить react-performance в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

agents/openai.yaml

FAQ

Что делает скилл react-performance?

Make React and Next.js performance changes that are measured, evidence-backed, and behaviorally safe. Routes to the right rule catalogue — vercel-react-best-practices for the 72 prioritized React/Next rules, vercel-composition-patterns for component API shape, next-best-practices for App Router semantics, core-web-vitals and performance for field metrics and non-React budgets — then governs how a rule is applied here: baseline first, one hypothesis at a time, behavior tests unchanged and green, and the house functional and typing rules winning where a micro-optimization would trade them away. Use when React or Next.js feels slow — a search box or list that stutters or lags while typing, a page that burns CPU while it sits open, a sluggish dashboard, jank on scroll, a screen that takes too long to appear — when a bundle, waterfall, re-render, or hydration problem is suspected, when reviewing a diff for performance, or when a performance rule appears to conflict with immutability, TDD, or type-safety guidance. For rendering-tier decisions and browser-observable proof see front-end-testing and react-testing; for flow logic driving the re-renders see xstate.

Как установить скилл react-performance?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл react-performance запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить react-performance с