Agent skill

React Best Practices

by ryokun6 in ryokun6/ryos

React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills).

MITAuto-check passedFrontend & Design

Install React Best Practices

skills CLI
$ npx skills add ryokun6/ryos --skill react-best-practices -a claude-code

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

GitHub CLI
$ gh skill install ryokun6/ryos 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/ryokun6/ryos.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/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.3k
Token cost
~2k tokens
SKILL.md length
753 words
Files
76
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills).

  • Works in 8 steps: Eliminating Waterfalls (CRITICAL) → Bundle Size Optimization (CRITICAL) → Server-Side Performance (HIGH) → …
  • Refactoring React components
  • SKILL.md covers ryOS notes, When to Apply, Rule Categories by Priority and Quick Reference, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

React Best Practices is an agent skill from ryokun6/ryos. React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills). Use when writing, reviewing, or refactoring React components, data fetching, bundle size, re-renders, or performance. Prefer Vite-compatible patterns in ryOS (React.lazy + Suspense instead of next/dynamic; skip Next.js RSC/server-action rules unless touching Next-specific code).

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 76 other files (for example `AGENTS.md`, `README.md` and `metadata.json`).

It sits in Frontend & Design, covering React components, Web performance and Performance optimization. It works with Vercel, React, Vite and Next.js. The repository describes itself as: ryOS, made with Cursor. The licence is MIT.

When your agent uses it

  • Refactoring React components
  • Tasks that involve React components
  • Tasks that involve Web performance

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 4a6e61e. 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

    Links to these hosts (documentation or services it may open):

    • github.com

    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 2k tokens when it runs. Until then it costs about 99 tokens; SKILL.md has 753 words of instructions outside code blocks.

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

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 ryokun6/ryos at commit 4a6e61e, republished under its MIT licence (© ryokun6). 753 words, ~2,012 tokens.

Download SKILL.mdSave it as .claude/skills/react-best-practices/SKILL.md (or your agent's skills folder). This skill also uses 75 other files; get the full folder from GitHub.
name
react-best-practices
description
React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills). Use when writing, reviewing, or refactoring React components, data fetching, bundle size, re-renders, or performance. Prefer Vite-compatible patterns in ryOS (React.lazy + Suspense instead of next/dynamic; skip Next.js RSC/server-action rules unless touching Next-specific code).
license
MIT
metadata.author
vercel
metadata.version
1.0.0
metadata.source
https://github.com/vercel-labs/agent-skills/tree/main/skills/react-best-practices

Vercel React Best Practices

Comprehensive performance optimization guide for React applications, maintained by Vercel. Contains 70 rules across 8 categories, prioritized by impact. Sourced from vercel-labs/agent-skills.

ryOS notes

ryOS is a Vite + React SPA with a standalone Bun API (not Next.js App Router). When applying this skill:

  • Prefer React.lazy + Suspense over next/dynamic (bundle-dynamic-imports)
  • Most server-* rules (RSC, React.cache, after(), server actions) do not apply to the SPA; still apply waterfall/Promise.all ideas in api/ handlers (async-api-routes, async-parallel)
  • The repo uses React Compiler–oriented eslint rules — avoid adding useMemo/useCallback by default unless an existing pattern requires it
  • Full rule text: AGENTS.md and rules/*.md in this skill directory

When to Apply

Reference these guidelines when:

  • Writing or reviewing React components in src/
  • Implementing client data fetching or API route handlers
  • Reviewing code for performance issues
  • Refactoring for bundle size, re-renders, or load time

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-cheap-condition-before-await - Check cheap sync conditions before awaiting flags or remote values
  • 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-analyzable-paths - Prefer statically analyzable import and file-system paths to avoid broad bundles and traces
  • 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-auth-actions - Authenticate server actions like API routes
  • server-cache-react - Use React.cache() for per-request deduplication
  • server-cache-lru - Use LRU cache for cross-request caching
  • server-dedup-props - Avoid duplicate serialization in RSC props
  • server-hoist-static-io - Hoist static I/O (fonts, logos) to module level
  • server-no-shared-module-state - Avoid module-level mutable request state in RSC/SSR
  • server-serialization - Minimize data passed to client components
  • server-parallel-fetching - Restructure components to parallelize fetches
  • server-parallel-nested-fetching - Chain nested fetches per item in Promise.all
  • 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
  • client-passive-event-listeners - Use passive listeners for scroll
  • client-localstorage-schema - Version and minimize localStorage data
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-memo-with-default-value - Hoist default non-primitive props
  • rerender-dependencies - Use primitive dependencies in effects
  • rerender-derived-state - Subscribe to derived booleans, not raw values
  • rerender-derived-state-no-effect - Derive state during render, not effects
  • rerender-functional-setstate - Use functional setState for stable callbacks
  • rerender-lazy-state-init - Pass function to useState for expensive values
  • rerender-simple-expression-in-memo - Avoid memo for simple primitives
  • rerender-split-combined-hooks - Split hooks with independent dependencies
  • rerender-move-effect-to-event - Put interaction logic in event handlers
  • rerender-transitions - Use startTransition for non-urgent updates
  • rerender-use-deferred-value - Defer expensive renders to keep input responsive
  • rerender-use-ref-transient-values - Use refs for transient frequent values
  • rerender-no-inline-components - Don't define components inside components
Show full SKILL.md (250 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-hydration-suppress-warning - Suppress expected mismatches
  • rendering-activity - Use Activity component for show/hide
  • rendering-conditional-render - Use ternary, not && for conditionals
  • rendering-usetransition-loading - Prefer useTransition for loading state
  • rendering-resource-hints - Use React DOM resource hints for preloading
  • rendering-script-defer-async - Use defer or async on script tags
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
  • js-flatmap-filter - Use flatMap to map and filter in one pass
  • js-request-idle-callback - Defer non-critical work to browser idle time
8. Advanced Patterns (LOW)
  • advanced-effect-event-deps - Don't put useEffectEvent results in effect deps
  • advanced-event-handler-refs - Store event handlers in refs
  • advanced-init-once - Initialize app once per app load
  • 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

Each rule file contains:

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

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

© ryokun6, 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 75 other files in .cursor/skills/react-best-practices of ryokun6/ryos.

  • SKILL.md
  • AGENTS.md
  • README.md
  • metadata.json
  • rules/_sections.md
  • rules/_template.md
  • rules/advanced-effect-event-deps.md
  • rules/advanced-event-handler-refs.md
  • rules/advanced-init-once.md
  • rules/advanced-use-latest.md
  • rules/async-api-routes.md
  • rules/async-cheap-condition-before-await.md
  • rules/async-defer-await.md
  • rules/async-dependencies.md
  • rules/async-parallel.md
  • rules/async-suspense-boundaries.md
  • rules/bundle-analyzable-paths.md
  • rules/bundle-barrel-imports.md
  • rules/bundle-conditional.md
  • rules/bundle-defer-third-party.md
  • … and 56 more

Open the folder on GitHubat commit 4a6e61e

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 skillryokun6/ryos1.3k—~2kAutomated safety check: PassMIT
Vercel React Best Practicesgambitph/Stackable350—~2kAutomated safety check: PassMIT
React Performanceaffaan-m/ECC275k1 repos~4.5kAutomated safety check: PassMIT
Vercel React Best Practicessanity-io/sanity6.4k130 repos~1.6kAutomated safety check: PassMIT
React Best Practicesmajiayu000/spellbook286—~1.1kAutomated safety check: PassMIT
React Best Practicespoteto/noodle437—~1.4kAutomated safety check: PassMIT

Similar skills

  • Vercel React Best Practices

    gambitph/Stackable

    React performance optimization guidelines from Vercel Engineering.

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

    affaan-m/ECC

    React and Next.js performance optimization patterns adapted from Vercel Engineering's React Best Practices (https://github.com/vercel-labs/agent-skills).

    275k GitHub starsUsed in 1 repo~4.5k tokens
    DevelopmentAuto-check passed
  • 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 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 performance optimization guidelines. An agent skill from poteto/noodle.

    437 GitHub stars~1.4k tokensUpdated 6 mo ago
    Frontend & DesignAuto-check passed
  • React Best Practices

    shapeshift/web

    Comprehensive React and Next.js performance optimization guide with 40+ rules for eliminating waterfalls, optimizing bundles, and improving rendering.

    206 GitHub starsUsed in 1 repo~2k tokens
    DevelopmentAuto-check passed

More from ryokun6/ryos

All 10 skills in this repo
  • Add AI Chat Tool

    ryokun6/ryos

    Add or modify an AI chat tool ("Ask Ryo" capability) in ryOS.

    1.3k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Create Ryos App

    ryokun6/ryos

    Create new applications for ryOS following established patterns and conventions.

    1.3k GitHub stars~3.7k tokensUpdated today
    Auto-check passed
  • Create Store

    ryokun6/ryos

    Create or modify ryOS Zustand stores following repo conventions — persist middleware, partialize, versioned migrations, the debounced write-behind storage adapter for large slices, and cloud-sync…

    1.3k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Desktop Release

    ryokun6/ryos

    Cut and publish ryOS Electron desktop releases on GitHub. An agent skill from ryokun6/ryos.

    1.3k GitHub stars~1k tokensUpdated today
    Auto-check: notes
  • Localize

    ryokun6/ryos

    Localize ryOS apps and components by extracting hardcoded strings, replacing with translation keys, and syncing across languages.

    1.3k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • UI Design Styling

    ryokun6/ryos

    Design and style ryOS UI using the current OS theme token system, Tailwind variants, shared primitives, Aqua Glass, dark mode, and accent conventions.

    1.3k GitHub stars~3.1k tokensUpdated today
    Auto-check passed

Questions about React Best Practices

What does React Best Practices do?

React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills). React Best Practices is an agent skill from ryokun6/ryos. React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills).

When should I use React Best Practices?

React Best Practices fits situations like: refactoring React components; tasks that involve React components; tasks that involve Web performance.

How do I install React Best Practices in Claude Code?

Run `npx skills add ryokun6/ryos --skill react-best-practices -a claude-code`. Or copy the skill folder (.cursor/skills/react-best-practices in ryokun6/ryos) 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 ryokun6/ryos --skill react-best-practices -a codex`. Or copy the skill folder (.cursor/skills/react-best-practices in ryokun6/ryos) 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 ryokun6/ryos --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 names 1 domain. As links in the text: github.com. 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 2k tokens (SKILL.md is roughly 8k 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 (gambitph/Stackable, 350 stars), React Performance (affaan-m/ECC, 275k stars), Vercel React Best Practices (sanity-io/sanity, 6.4k 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?

ryokun6 (a GitHub user) maintains it in ryokun6/ryos, which has 1,264 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 7, 2026.

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