Skip to content
cccskills
FreePublished on GitHubEnglish overview

vercel-react-best-practices

Improve React and Next.js performance when writing, reviewing, or refactoring code. Apply prioritized rules to reduce sequential data requests, shrink downloaded code, and improve server processing and component rendering.

OriginalShow the original description

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

Works withVercel

Run score Not tested

See how to install

Good for

  • Reviewing React code for performance issues
  • Reducing sequential data requests
  • Shrinking downloaded JavaScript
  • Reducing unnecessary component rendering

Overview

What it does

This skill provides guidelines for writing, reviewing, and refactoring React and Next.js code with performance in mind. It organizes 45 rules into eight areas and prioritizes improvements by their impact. The main focus is eliminating unnecessary waits between sequential data requests and reducing the amount of code delivered to browsers. It also covers server processing, unnecessary component re-renders, and JavaScript processing patterns.

When it helps

Use it when building new components or pages, or when revisiting existing screens that load slowly. Individual rule files explain the reasoning behind each rule and include both good and bad code examples. These examples let you compare a proposed change with concrete code when deciding how to improve the application.

Example requests

  • “Find data-fetching operations on this Next.js page that can run in parallel.”
  • “Review how heavy components load and identify unnecessary re-renders.”

Notes

These guidelines target React and Next.js applications. Some examples use SWR or next/dynamic, so choose methods that fit the code being reviewed. The license is MIT.

This overview was written by AI (OpenAI Codex) from the public SKILL.md. Check the original below for the exact behavior.

Document check

AI checked the SKILL.md for operations that need care and for setup requirements. The score comes only from actually running the skill (hands-on test).

SafetyAre sending data, deleting files, and running commands disclosed?
AGoodThe material provides code improvement guidance without procedures for external transmission or deletion.
Easy setupDoes it need few tools or API keys, and are they documented?
AGoodIt is reference material for React and Next.js, with no specified API keys or paid services.

Not counted in the score. Rated by AI (OpenAI Codex) as of Oct 23, 2026. Treat it as a guide and read the original before installing.

Disagree? Request a re-evaluation

Tell us which point is wrong and why. No login needed. We will check it against the SKILL.md, redo the evaluation, and show the result here.

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

Files included (47)

  • SKILL.md5.2 KB
  • AGENTS.md59.1 KB
  • rules/advanced-event-handler-refs.md1.4 KB
  • rules/advanced-use-latest.md1.2 KB
  • rules/async-api-routes.md1.1 KB
  • rules/async-defer-await.md2.0 KB
  • rules/async-dependencies.md942 B
  • rules/async-parallel.md654 B
  • rules/async-suspense-boundaries.md2.5 KB
  • rules/bundle-barrel-imports.md2.3 KB
  • rules/bundle-conditional.md866 B
  • rules/bundle-defer-third-party.md920 B
  • rules/bundle-dynamic-imports.md791 B
  • rules/bundle-preload.md1.1 KB
  • rules/client-event-listeners.md1.9 KB
  • rules/client-swr-dedup.md1.1 KB
  • rules/js-batch-dom-css.md1.9 KB
  • rules/js-cache-function-results.md1.9 KB
  • rules/js-cache-property-access.md532 B
  • rules/js-cache-storage.md1.6 KB
  • rules/js-combine-iterations.md753 B
  • rules/js-early-exit.md1.1 KB
  • rules/js-hoist-regexp.md1.0 KB
  • rules/js-index-maps.md837 B
  • rules/js-length-check-first.md1.7 KB
  • rules/js-min-max-loop.md2.1 KB
  • rules/js-set-map-lookups.md532 B
  • rules/js-tosorted-immutable.md1.7 KB
  • rules/rendering-activity.md564 B
  • rules/rendering-animate-svg-wrapper.md1.2 KB
  • rules/rendering-conditional-render.md980 B
  • rules/rendering-content-visibility.md815 B
  • rules/rendering-hoist-jsx.md1.0 KB
  • rules/rendering-hydration-no-flicker.md2.3 KB
  • rules/rendering-svg-precision.md588 B
  • rules/rerender-defer-reads.md973 B
  • rules/rerender-dependencies.md824 B
  • rules/rerender-derived-state.md724 B
  • rules/rerender-functional-setstate.md2.9 KB
  • rules/rerender-lazy-state-init.md2.0 KB
  • rules/rerender-memo.md1.1 KB
  • rules/rerender-transitions.md1.0 KB
  • rules/server-after-nonblocking.md2.0 KB
  • rules/server-cache-lru.md1.3 KB
  • rules/server-cache-react.md681 B
  • rules/server-parallel-fetching.md1.5 KB
  • rules/server-serialization.md996 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

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:

  • Writing new React components or Next.js pages
  • Implementing data fetching (client or server-side)
  • Reviewing code for performance issues
  • Refactoring existing React/Next.js code
  • Optimizing bundle size or load times

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

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

Full Compiled Document

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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

open-pr

FreeSummary

Create a pull request that follows the project's template and title conventions. Check existing behavior and test coverage, document testing limits, and coordinate self-review or bot review with follow-up on reported issues.

  • Create a PR using the project's required template
  • Check regression tests and coverage for new behavior
  • Request bot review when local testing is limited
Significant-Gravitas/AutoGPT187.7KUpdated Oct 23, 2026

orchestrate

FreeSummary

Coordinate multiple Claude Code agents in separate Git worktrees and tmux windows. Assign tasks, inspect progress, help stalled agents resume, and verify PR checks and review feedback before treating work as complete.

  • Assign separate development tasks to multiple agents
  • Check agent progress and available worktrees
  • Help stalled or crashed agent sessions resume
Significant-Gravitas/AutoGPT187.7KUpdated Oct 23, 2026

perf-compare

FreeSummary

Compare performance across releases, environments, or time windows using Sentry data. Report request counts, latency percentiles, and failure rates, with statistical checks that distinguish faster or slower behavior from noise and flag insufficient data.

  • Compare performance before and after a release
  • Compare a preview deployment with a control
  • Check other operations for performance regressions
Significant-Gravitas/AutoGPT187.7KUpdated Oct 23, 2026

pr-address

FreeSummary

Work through PR review feedback by fixing code, pushing commits, replying to reviewers, and resolving addressed threads. Monitor automated checks, merge conflicts, and new comments until checks pass and the review work is complete.

  • Fix code based on PR review feedback
  • Reply to human and bot reviewers
  • Investigate failed CI checks after a push
Significant-Gravitas/AutoGPT187.7KUpdated Oct 23, 2026

pr-polish

FreeSummary

Prepare a pull request for merging by repeatedly reviewing changes and addressing feedback. Verify resolved discussions, passing automated checks, and mergeability, then check twice for late comments after the checks finish.

  • Preparing a pull request for merging
  • Repeating review and fixes until no new issues remain
  • Following up on delayed review bot feedback
Significant-Gravitas/AutoGPT187.7KUpdated Oct 23, 2026

pr-review

FreeSummary

Review a pull request, a proposed code change, for correctness, security, design, and test coverage. Check its explanation and existing feedback, then post findings on relevant code lines with severity labels.

  • Checking a pull request before merging
  • Reviewing security risks in code changes
  • Finding missing edge-case tests
Significant-Gravitas/AutoGPT187.7KUpdated Oct 23, 2026

See all skills by Significant-Gravitas

Report a problem with this skill