react
Skill2 starsChanged 51 days agoMITView on GitHub
Use when auditing and optimizing React/Next.js application performance, component waterfalls, bundle sizes, Server Actions, or re-render dependencies. Don't use for CSS design (use frontend-design), UX usability critiques (use ui-ux-review), UI prototyping (use prototype), CSS/spring animations (use ui-motion), or multi-task execution plans (use agent-planning).
48 other projects use a version of this.
Adopted by
Most recently taken up by
- atinder-harika/reel-reactortheir own version, first seen Nov 8, 2026
- LuisSambrano/antigravity-configtheir own version, first seen Nov 8, 2026
- compozy/compozytheir own version, first seen Nov 7, 2026
- lobehub/lobehubtheir own version, first seen Nov 5, 2026
- hmj1026/dhpktheir own version, first seen Nov 1, 2026
- gingerminds/claude-skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use app-renderer-systems, refactoring-analysis and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
pedronauckSkillapp-renderer-systems
Create, extend, or debug frontend domain modules organized under systems/. Covers adapters, Query hooks, local state, and public exports; excludes generic components and backend implementation.
Also in 3 projects that use this
pedronauckSkillrefactoring-analysis
Audit code quality and architectural health or plan refactoring using Fowler code smells and techniques; write prioritized findings to docs/_refacs/. Excludes formatting, performance, and security audits.
Also in 3 projects that use this
andyridsSkillexpress
Run the ICM express-change pipeline - a small change no spec has to move for, with the plan record left intact
Also in 4 projects that use this
tondevrelSkillpytorch
Leading deep learning framework. Provides Tensors and Dynamic Computational Graphs with strong GPU acceleration. Widely used for research, neural networks, and differentiable programming.
Also in 3 projects that use this
azlekovSkilltailwindcss
This skill should be used when the user asks to "style with Tailwind", "add CSS", "configure theme", "use @theme", "add custom colors", "implement dark mode", "use container queries", "add responsive design", "use OKLCH colors", or discusses styling, theming, or visual design. Always use the latest Tailwind CSS version and modern patterns.
Also in 5 projects that use this
jander99Skilltypescript-advanced
Design, implement, refactor, and debug advanced TypeScript patterns including generics, utility types, mapped types, conditional types, type guards, discriminated unions, and strict mode configuration. Use when writing type-safe code, fixing type errors, or improving type inference.
Also in 3 projects that use this
Other versions48 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 48
- lobehub/lobe-chat★ 84ksame name
- lobehub/lobehub★ 84ksame name
- vercel-labs/json-render★ 19ksame name
- compozy/compozy★ 2.9ksame name
- BetterTyped/react-zoom-pan-pinch★ 1.9ksame name
- openops-cloud/openops★ 1.1ksame name
- pedronauck/skills★ 649same name
- Mindrally/skills★ 275same name
- kid-sid/claude-spellbook★ 190same name
- magnus919/agent-skills★ 172same name
38 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository35 other files it gives its agents.
- agent-planningSkill
- brainstormingSkill
- codebase-designSkill
- code-reviewSkill
- conventional-commitSkill
- copy-web-designSkill
- executing-plansSkill
- frontend-designSkill
- i18nSkill
- laravelSkill
- prototypeSkill
- pull-requestSkill
- recursive-researchSkill
- reflect-to-skillSkill
- review-a-skillSkill
- s13nSkill
- schema-migrationSkill
- security-auditSkill
- skill-testingSkill
- summarizeSkill
- systematic-debuggingSkill
- t3-operational-guardrailSkill
- technical-writingSkill
- testing-patternsSkill
- ui-motionSkill
- ui-ux-reviewSkill
- unslopSkill
- upsert-codebase-docsSkill
- verification-before-completionSkill
- vibe-wiseSkill
- web-advisor-promptSkill
- wizardSkill
- workspace-onboardingSkill
- writing-for-agentsSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 3 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 38 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Follow these five steps in sequence.
- Very specific: line 34
Check React version, Next.js version, and compiler configuration across package.json and Next.js config:
- Very specific: line 38
Run TypeScript compiler diagnostics with Next.js route typegen:
- Very specific: line 60
Read the specific rule file in references/rules/<prefix>-<name>.md for concrete code implementations, anti-patterns, and mechanical fixes.
- Very specific: line 68
Place Server Actions in dedicated files with 'use server' at the top (never inside 'use client' files).
- Very specific: line 69
When compiler: true, do not add manual useMemo, useCallback, or React.memo.
- Very specific: line 71
Use .reduce() instead of Math.max(...array) for numeric aggregations over dynamic datasets to prevent call stack size limits.
- Distinctive: line 77
Run build commands, test suites, and type checks to verify that the bottleneck is eliminated:
- Distinctive: line 88
Never modify component visual aesthetics, design tokens, or typography in the name of performance.
- Very specific: line 91
Ensure 'use client' is explicitly declared at the top of client component files.
“Common” is measured: kept by at least 6 in 10 of the 38 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React
Performance optimization and architectural patterns for React and Next.js applications. Profile and optimize React and Next.js applications by eliminating network waterfalls, managing bundle size, and reducing unnecessary re-renders.
<HARD-GATE>
Write-Target Boundary. In Audit mode, do not modify any source file outside `.agents/state/react/`. In Optimize mode, modify only component files, dynamic import boundaries, Server Action files, and RSC or client boundary declarations. Never modify backend API route contracts, database schemas, business validation, or accessibility attributes. Emit audit reports to `.agents/state/react/audit-report.md` before changing code.
</HARD-GATE>Modes
Select an execution mode before Step 1:
- Audit mode (default). Profile bundles, waterfalls, and re-renders, and report findings without editing source code.
- Optimize mode. Restructure Server and Client boundaries, stream Suspense trees, split chunks, upgrade action hooks, and apply compiler-safe optimizations.
Reference quick routing
| Optimization domain | Reference module | Scope |
| Render & network optimization | references/render-optimization.md | React 19 mutations, Core Web Vitals, & waterfalls |
Workflow
Follow these five steps in sequence.
Step 1. Toolchain probe and bottleneck identification
Probe the project runtime, compiler configuration, and performance symptoms before modifying code:
- Check React version, Next.js version, and compiler configuration across
package.jsonand Next.js config:node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8')),d={...p.dependencies,...p.devDependencies},c=['next.config.ts','next.config.mjs','next.config.js'].find(f=>fs.existsSync(f));console.log({react:d.react,next:d.next,compiler:Boolean(d['babel-plugin-react-compiler']||(c&&/reactCompiler\s*:\s*true/.test(fs.readFileSync(c,'utf8'))))})" - Run TypeScript compiler diagnostics with Next.js route typegen:
npx next typegen && npx tsc --noEmit - Profile component rendering or network waterfalls to isolate the exact bottleneck.
Completion criterion. .agents/state/react/baseline.json exists on disk with fields react_version, next_version, compiler, tsc_errors (0), perf_metric_name, perf_metric_baseline, perf_metric_threshold, and perf_metric_source. perf_metric_source is one of lighthouse-json, web-vitals-lib, next-bundle-analyzer, or manual-profiler.
Attach the raw measurement artifact path to perf_metric_source_path. A baseline without a source artifact is rejected.
Step 2. Rule selection and priority triage
Filter rules by the React version detected in Step 1:
- React 19 or later. All categories apply, including
server-and modern action hooks. - React 18. Skip
useActionStateanduseOptimisticupgrades. UseuseTransitionfor pending states. RetainforwardRefrather than passingrefas standard prop. Skip compiler optimizations whencompiler: false. - React 17 or earlier. Skip all Server Component and Server Action rules. Confine optimizations to
bundle-,client-, andrerender-categories.
Record category selection in .agents/state/react/rule-selection.json. Enforce joint security and serialization invariants: every RSC or Server Action change must verify server authorization and Client boundary DTO safety.
Completion criterion. .agents/state/react/rule-selection.json exists on disk with fields react_version and applied_categories matching the project runtime.
Step 3. Reference consultation
Read the specific rule file in references/rules/<prefix>-<name>.md for concrete code implementations, anti-patterns, and mechanical fixes.
Completion criterion. The rule file is inspected and the canonical fix pattern is established before mutating source files.
Step 4. Surgical implementation
Apply minimal code changes to eliminate the bottleneck:
- Upgrade legacy
useState/useEffectmutation flows to React 19useActionState,useOptimistic, and uncontrolledFormDatawhen on React 19. Before replacing a controlled form, verify that input state survives network failure perui-ux-reviewINV-7. If uncontrolled migration would drop draft persistence, retain the controlled form and useuseActionStatesolely for submit-state tracking. - Place Server Actions in dedicated files with
'use server'at the top (never inside'use client'files). Validate session credentials and tenant access inside the action. Return serializable discriminated unions (ActionState { ok: boolean, error: string | null }) instead of throwing raw errors that Next.js censors in production. - When
compiler: true, do not add manualuseMemo,useCallback, orReact.memo. Use immutable derivations (.toSorted()) and acceptrefas a standard React 19 prop. - For high-frequency interactive controls like range sliders, separate local thumb position state from transitioned data filtering to preserve responsive input tracking.
- Use
.reduce()instead ofMath.max(...array)for numeric aggregations over dynamic datasets to prevent call stack size limits.
Completion criterion: Targeted components implement the rule pattern with zero orphan imports, verified security boundaries, and clean compiler derivation paths.
Step 5. Verification pass
Run build commands, test suites, and type checks to verify that the bottleneck is eliminated:
npx next typegen && npx tsc --noEmit && npm testCompletion criterion: Clean build exit code, passing test assertions, and verified elimination of the target performance defect.
Boundary isolation
Confine optimization strictly to component rendering patterns, bundle splitting, and data fetching:
- Preserve backend API route contracts, database schemas, and business validation logic.
- Never modify component visual aesthetics, design tokens, or typography in the name of performance.
- Preserve existing accessibility attributes and semantic markup; never remove aria attributes or keyboard handlers to simplify rendering.
- Preserve public exported signatures, but narrow internal
'use client'props to minimal serializable DTOs. Block raw database model leakage across the Client boundary usingexperimental_taintObjectReference. - Ensure
'use client'is explicitly declared at the top of client component files. - Type Next.js 15
paramsandsearchParamsas Promises (Promise<{ slug: string }>) and await them concurrently withcookies(). - Guard concurrent RSC reads with
Promise.allSettledand anAbortControllertimeout signal to prevent whole-page crashes and detached orphaned queries.
Rule categories by priority
| Priority | Category | Impact | Prefix | Focus |
| 1 | Eliminating Waterfalls | CRITICAL | async- | Parallelize requests, defer await, use streaming |
| 2 | Server Actions and Security | CRITICAL | server- | Server Actions auth, RSC caching, minimize client serialization |
| 3 | Bundle Size Optimization | HIGH | bundle- | Tree-shaking, dynamic imports, avoid barrel files |
| 4 | Client-Side Data Fetching | MEDIUM-HIGH | client- | SWR deduplication, passive listeners, compact client storage |
| 5 | Re-render Optimization | MEDIUM | rerender- | Primitive dependencies, state colocation, deferred values |
| 6 | Rendering Performance | MEDIUM | rendering- | Content visibility, ternary conditionals, SVG animation wrappers |
| 7 | JavaScript Performance | LOW-MEDIUM | js- | Map and Set lookups, early exits, loop hoisting |
| 8 | Advanced Patterns | LOW | advanced- | Stable callback refs, single initialization, event handler refs |
Detailed rule specifications, code examples, and bad versus good patterns are stored individually in references/rules/<prefix>-<name>.md.
Quick audit checklist
Review this table before completing React optimization tasks:
| Check | Passing condition |
| Next.js 15 dynamic APIs | params, searchParams, and cookies() awaited properly as Promises |
| Waterfalls | Data dependencies run concurrently via Promise.allSettled with AbortController timeout |
| Suspense streaming | Heavy or slow queries deferred and streamed via <Suspense> boundaries |
| Boundary serialization | Internal 'use client' props narrowed to safe DTOs; raw ORM records tainted |
| Server Actions | Actions declared in 'use server' files, verify session auth, and return serializable union results |
| Modern actions | Forms use useActionState, useOptimistic, and uncontrolled inputs with rollback |
| Compiler compatibility | Zero redundant useMemo/useCallback when compiler active; immutable derivations used |
| Native props | Components accept ref as standard prop without legacy forwardRef |
| Input responsiveness | High-frequency sliders decouple immediate thumb state from heavy transitioned filtering |
| Array aggregation | Aggregations use .reduce() instead of spreading unbounded arrays |
| Bundle size | Heavy client modules split dynamically with tree-shaking preserved |
| Accessibility | Semantic elements, ARIA attributes, and focus order preserved intact |
| Verification | Automated tests pass and TypeScript emits zero diagnostic errors |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

