Agent skill

React Best Practices

by benchflow-ai in benchflow-ai/skillsbench

IMPORTANT: Any change to React or Next.js code must read through this skill first.

MITAuto-check passedFrontend & Design

Install React Best Practices

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill react-best-practices -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install benchflow-ai/skillsbench react-best-practices --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks/fix-visual-stability/environment/skills/react-best-practices .claude/skills/react-best-practices && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
react-best-practices
GitHub stars
1.8k
Token cost
~1.3k tokens
SKILL.md length
500 words
Files
50
Skills in repo
178
Repo updated
First seen
Licence
MIT

At a glance

IMPORTANT: Any change to React or Next.js code must read through this skill first.

  • Works in 8 steps: Eliminating Waterfalls (CRITICAL) → Bundle Size Optimization (CRITICAL) → Server-Side Performance (HIGH) → …
  • Tasks that involve React components
  • SKILL.md covers When to Apply, Rule Categories by Priority, Quick Reference and How to Use
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

React Best Practices is an agent skill from benchflow-ai/skillsbench. IMPORTANT: Any change to React or Next.js code must read through this skill first. React and Next.js guidelines from Vercel Engineering covering visual instability, layout shifts, CLS, flickering, hydration issues, and font loading.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 50 other files (for example `rules/_sections.md`, `rules/_template.md` and `rules/advanced-event-handler-refs.md`).

It sits in Frontend & Design, covering React components. It works with React, Next.js and Vercel. The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is MIT.

When your agent uses it

  • Tasks that involve React components

Example prompts

  • “/react-best-practices”

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Eliminating Waterfalls (CRITICAL)
  2. Bundle Size Optimization (CRITICAL)
  3. Server-Side Performance (HIGH)
  4. Client-Side Data Fetching (MEDIUM-HIGH)
  5. Re-render Optimization (MEDIUM)
  6. Rendering Performance (MEDIUM)
  7. JavaScript Performance (LOW-MEDIUM)
  8. Advanced Patterns (LOW)

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

React Best Practices loads about 1.3k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 500 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from benchflow-ai/skillsbench at commit 9a1f4dd, republished under its MIT licence (© benchflow-ai). 500 words, ~1,321 tokens.

Download SKILL.mdSave it as .claude/skills/react-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 49 other files; get the full folder from GitHub.
name
react-best-practices
description
**IMPORTANT**: Any change to React or Next.js code must read through this skill first. React and Next.js guidelines from Vercel Engineering covering visual instability, layout shifts, CLS, flickering, hydration issues, and font loading.
license
MIT
metadata.author
vercel
metadata.version
1.0.0

Vercel React Best Practices

Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Refactoring existing React/Next.js code
  • Writing new React components or Next.js pages
  • Fixing visual instability or layout shift (CLS) issues
  • Preventing flickering when reading from localStorage or cookies
  • Handling hydration mismatches with client-only data
  • Optimizing font loading (FOIT/FOUT prevention)
  • Adding proper dimensions to images and dynamic content

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Eliminating WaterfallsCRITICALasync-
2Bundle Size OptimizationCRITICALbundle-
3Server-Side PerformanceHIGHserver-
4Client-Side Data FetchingMEDIUM-HIGHclient-
5Re-render OptimizationMEDIUMrerender-
6Rendering PerformanceMEDIUMrendering-
7JavaScript PerformanceLOW-MEDIUMjs-
8Advanced PatternsLOWadvanced-

Quick Reference

1. Eliminating Waterfalls (CRITICAL)
  • async-defer-await - Move await into branches where actually used
  • async-parallel - Use Promise.all() for independent operations
  • async-dependencies - Use better-all for partial dependencies
  • async-api-routes - Start promises early, await late in API routes
  • async-suspense-boundaries - Use Suspense to stream content
2. Bundle Size Optimization (CRITICAL)
  • bundle-barrel-imports - Import directly, avoid barrel files
  • bundle-dynamic-imports - Use next/dynamic for heavy components
  • bundle-defer-third-party - Load analytics/logging after hydration
  • bundle-conditional - Load modules only when feature is activated
  • bundle-preload - Preload on hover/focus for perceived speed
3. Server-Side Performance (HIGH)
  • server-cache-react - Use React.cache() for per-request deduplication
  • server-cache-lru - Use LRU cache for cross-request caching
  • server-serialization - Minimize data passed to client components
  • server-parallel-fetching - Restructure components to parallelize fetches
  • server-after-nonblocking - Use after() for non-blocking operations
4. Client-Side Data Fetching (MEDIUM-HIGH)
  • client-swr-dedup - Use SWR for automatic request deduplication
  • client-event-listeners - Deduplicate global event listeners
5. Re-render Optimization (MEDIUM)
  • rerender-defer-reads - Don't subscribe to state only used in callbacks
  • rerender-memo - Extract expensive work into memoized components
  • rerender-dependencies - Use primitive dependencies in effects
  • rerender-derived-state - Subscribe to derived booleans, not raw values
  • rerender-functional-setstate - Use functional setState for stable callbacks
  • rerender-lazy-state-init - Pass function to useState for expensive values
  • rerender-transitions - Use startTransition for non-urgent updates
Show full SKILL.md (179 more words)Show less
6. Rendering Performance (MEDIUM)
  • rendering-animate-svg-wrapper - Animate div wrapper, not SVG element
  • rendering-content-visibility - Use content-visibility for long lists
  • rendering-hoist-jsx - Extract static JSX outside components
  • rendering-svg-precision - Reduce SVG coordinate precision
  • rendering-hydration-no-flicker - Use inline script for client-only data
  • rendering-activity - Use Activity component for show/hide
  • rendering-conditional-render - Use ternary, not && for conditionals
7. JavaScript Performance (LOW-MEDIUM)
  • js-batch-dom-css - Group CSS changes via classes or cssText
  • js-index-maps - Build Map for repeated lookups
  • js-cache-property-access - Cache object properties in loops
  • js-cache-function-results - Cache function results in module-level Map
  • js-cache-storage - Cache localStorage/sessionStorage reads
  • js-combine-iterations - Combine multiple filter/map into one loop
  • js-length-check-first - Check array length before expensive comparison
  • js-early-exit - Return early from functions
  • js-hoist-regexp - Hoist RegExp creation outside loops
  • js-min-max-loop - Use loop for min/max instead of sort
  • js-set-map-lookups - Use Set/Map for O(1) lookups
  • js-tosorted-immutable - Use toSorted() for immutability
8. Advanced Patterns (LOW)
  • advanced-event-handler-refs - Store event handlers in refs
  • advanced-use-latest - useLatest for stable callback refs

How to Use

Read individual rule files for detailed explanations and code examples:

rules/async-parallel.md
rules/bundle-barrel-imports.md
rules/_sections.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

© benchflow-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 49 other files in tasks/fix-visual-stability/environment/skills/react-best-practices of benchflow-ai/skillsbench.

  • SKILL.md
  • rules/_sections.md
  • rules/_template.md
  • rules/advanced-event-handler-refs.md
  • rules/advanced-use-latest.md
  • rules/async-api-routes.md
  • rules/async-defer-await.md
  • rules/async-dependencies.md
  • rules/async-parallel.md
  • rules/async-suspense-boundaries.md
  • rules/bundle-barrel-imports.md
  • rules/bundle-conditional.md
  • rules/bundle-defer-third-party.md
  • rules/bundle-dynamic-imports.md
  • rules/bundle-preload.md
  • rules/client-event-listeners.md
  • rules/client-localstorage-schema.md
  • rules/client-passive-event-listeners.md
  • rules/client-swr-dedup.md
  • rules/js-batch-dom-css.md
  • … and 30 more

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

React Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

React Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
React Best Practices this skillbenchflow-ai/skillsbench1.8k—~1.3kAutomated safety check: PassMIT
Vercel React Best Practicessanity-io/sanity6.4k130 repos~1.6kAutomated safety check: PassMIT
React Best Practicesryokun6/ryos1.3k—~2kAutomated safety check: PassMIT
Vercel React Best Practicesgambitph/Stackable350—~2kAutomated safety check: PassMIT
React Best Practicesmajiayu000/spellbook286—~1.1kAutomated safety check: PassMIT
React Best Practices V2diegosouzapw/awesome-omni-skills159—~3.5kAutomated safety check: PassMIT

Similar skills

  • Official

    React and Next.js performance optimization guidelines from Vercel Engineering.

    6.4k GitHub starsUsed in 130 repos~1.6k tokens
    Frontend & DesignAuto-check passed
  • React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills).

    1.3k GitHub stars~2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Vercel React Best Practices

    gambitph/Stackable

    React performance optimization guidelines from Vercel Engineering.

    350 GitHub stars~2k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • React Best Practices

    majiayu000/spellbook

    React and Next.js performance playbook distilled from Vercel Engineering guidance.

    286 GitHub stars~1.1k tokensUpdated today
    Frontend & DesignAuto-check passed
  • React Best Practices V2

    diegosouzapw/awesome-omni-skills

    Vercel React Best Practices workflow skill. An agent skill from diegosouzapw/awesome-omni-skills.

    159 GitHub stars~3.5k tokensUpdated 3 mo ago
    Frontend & DesignAuto-check passed
  • Pinak Frontend Guru

    sundial-org/awesome-openclaw-skills

    Expert UI/UX and React performance auditor (PinakBot persona).

    663 GitHub stars~651 tokensUpdated 7 mo ago
    Frontend & DesignAuto-check passed

More from benchflow-ai/skillsbench

All 178 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Ac Branch Pi Model

    benchflow-ai/skillsbench

    AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

    1.8k GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed

Questions about React Best Practices

What does React Best Practices do?

IMPORTANT: Any change to React or Next.js code must read through this skill first. React Best Practices is an agent skill from benchflow-ai/skillsbench.js code must read through this skill first.

When should I use React Best Practices?

React Best Practices fits situations like: tasks that involve React components.

How do I install React Best Practices in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill react-best-practices -a claude-code`. Or copy the skill folder (tasks/fix-visual-stability/environment/skills/react-best-practices in benchflow-ai/skillsbench) into .claude/skills/react-best-practices in your project. Claude Code loads it when a task matches its description.

How do I install React Best Practices in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill react-best-practices -a codex`. Or copy the skill folder (tasks/fix-visual-stability/environment/skills/react-best-practices in benchflow-ai/skillsbench) into .agents/skills/react-best-practices in your project. Codex loads it when a task matches its description.

Can I use React Best Practices in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add benchflow-ai/skillsbench --skill react-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/react-best-practices, .gemini/skills/react-best-practices, .github/skills/react-best-practices and .opencode/skills/react-best-practices in your project.

What does React Best Practices need to run?

SKILL.md names no scripts, command-line tools or credentials: React Best Practices is instructions for the agent only.

Does React Best Practices access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is React Best Practices safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does React Best Practices use?

React Best Practices is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does React Best Practices use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to React Best Practices?

Skills that share tags, products or a category with React Best Practices: Vercel React Best Practices (sanity-io/sanity, 6.4k stars), React Best Practices (ryokun6/ryos, 1.3k stars), Vercel React Best Practices (gambitph/Stackable, 350 stars) and React Best Practices (majiayu000/spellbook, 286 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains React Best Practices?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,832 GitHub stars. The repository holds 178 skills in this directory. The repository was last updated on July 23, 2026.

Source: benchflow-ai/skillsbench on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.