원클릭으로
vercel-react-best-practices
React and Next.js performance optimization guide with 64 prioritized rules across 8 categories.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
React and Next.js performance optimization guide with 64 prioritized rules across 8 categories.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Distinctive, production-grade frontend interfaces that reject generic AI aesthetics.
Complete shadcn/ui component management for adding, searching, fixing, styling, and composing UI.
CSS-first design system framework for Tailwind v4 with tokens, components, and responsive patterns.
React composition patterns for scaling components and avoiding boolean prop proliferation.
Audit UI code against Vercel's Web Interface Guidelines for design and accessibility compliance.
| name | vercel-react-best-practices |
| description | React and Next.js performance optimization guide with 64 prioritized rules across 8 categories. |
| license | MIT |
| metadata | {"source":"vercel-labs/agent-skills"} |
Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 70 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Eliminating Waterfalls | CRITICAL | async- |
| 2 | Bundle Size Optimization | CRITICAL | bundle- |
| 3 | Server-Side Performance | HIGH | server- |
| 4 | Client-Side Data Fetching | MEDIUM-HIGH | client- |
| 5 | Re-render Optimization | MEDIUM | rerender- |
| 6 | Rendering Performance | MEDIUM | rendering- |
| 7 | JavaScript Performance | LOW-MEDIUM | js- |
| 8 | Advanced Patterns | LOW | advanced- |
async-cheap-condition-before-await - Check cheap sync conditions before awaiting flags or remote valuesasync-defer-await - Move await into branches where actually usedasync-parallel - Use Promise.all() for independent operationsasync-dependencies - Use better-all for partial dependenciesasync-api-routes - Start promises early, await late in API routesasync-suspense-boundaries - Use Suspense to stream contentbundle-barrel-imports - Import directly, avoid barrel filesbundle-analyzable-paths - Prefer statically analyzable import and file-system paths to avoid broad bundles and tracesbundle-dynamic-imports - Use next/dynamic for heavy componentsbundle-defer-third-party - Load analytics/logging after hydrationbundle-conditional - Load modules only when feature is activatedbundle-preload - Preload on hover/focus for perceived speedserver-auth-actions - Authenticate server actions like API routesserver-cache-react - Use React.cache() for per-request deduplicationserver-cache-lru - Use LRU cache for cross-request cachingserver-dedup-props - Avoid duplicate serialization in RSC propsserver-hoist-static-io - Hoist static I/O (fonts, logos) to module levelserver-no-shared-module-state - Avoid module-level mutable request state in RSC/SSRserver-serialization - Minimize data passed to client componentsserver-parallel-fetching - Restructure components to parallelize fetchesserver-parallel-nested-fetching - Chain nested fetches per item in Promise.allserver-after-nonblocking - Use after() for non-blocking operationsclient-swr-dedup - Use SWR for automatic request deduplicationclient-event-listeners - Deduplicate global event listenersclient-passive-event-listeners - Use passive listeners for scrollclient-localstorage-schema - Version and minimize localStorage datarerender-defer-reads - Don't subscribe to state only used in callbacksrerender-memo - Extract expensive work into memoized componentsrerender-memo-with-default-value - Hoist default non-primitive propsrerender-dependencies - Use primitive dependencies in effectsrerender-derived-state - Subscribe to derived booleans, not raw valuesrerender-derived-state-no-effect - Derive state during render, not effectsrerender-functional-setstate - Use functional setState for stable callbacksrerender-lazy-state-init - Pass function to useState for expensive valuesrerender-simple-expression-in-memo - Avoid memo for simple primitivesrerender-split-combined-hooks - Split hooks with independent dependenciesrerender-move-effect-to-event - Put interaction logic in event handlersrerender-transitions - Use startTransition for non-urgent updatesrerender-use-deferred-value - Defer expensive renders to keep input responsivererender-use-ref-transient-values - Use refs for transient frequent valuesrerender-no-inline-components - Don't define components inside componentsrendering-animate-svg-wrapper - Animate div wrapper, not SVG elementrendering-content-visibility - Use content-visibility for long listsrendering-hoist-jsx - Extract static JSX outside componentsrendering-svg-precision - Reduce SVG coordinate precisionrendering-hydration-no-flicker - Use inline script for client-only datarendering-hydration-suppress-warning - Suppress expected mismatchesrendering-activity - Use Activity component for show/hiderendering-conditional-render - Use ternary, not && for conditionalsrendering-usetransition-loading - Prefer useTransition for loading staterendering-resource-hints - Use React DOM resource hints for preloadingrendering-script-defer-async - Use defer or async on script tagsjs-batch-dom-css - Group CSS changes via classes or cssTextjs-index-maps - Build Map for repeated lookupsjs-cache-property-access - Cache object properties in loopsjs-cache-function-results - Cache function results in module-level Mapjs-cache-storage - Cache localStorage/sessionStorage readsjs-combine-iterations - Combine multiple filter/map into one loopjs-length-check-first - Check array length before expensive comparisonjs-early-exit - Return early from functionsjs-hoist-regexp - Hoist RegExp creation outside loopsjs-min-max-loop - Use loop for min/max instead of sortjs-set-map-lookups - Use Set/Map for O(1) lookupsjs-tosorted-immutable - Use toSorted() for immutabilityjs-flatmap-filter - Use flatMap to map and filter in one passjs-request-idle-callback - Defer non-critical work to browser idle timeadvanced-effect-event-deps - Don't put useEffectEvent results in effect depsadvanced-event-handler-refs - Store event handlers in refsadvanced-init-once - Initialize app once per app loadadvanced-use-latest - useLatest for stable callback refsUse Promise.all() for independent async operations to avoid sequential waterfalls.
Incorrect:
const user = await getUser(id)
const posts = await getPosts(id)
const notifications = await getNotifications(id)
Correct:
const [user, posts, notifications] = await Promise.all([
getUser(id),
getPosts(id),
getNotifications(id),
])
Import directly from the module file, not through barrel index.ts files that pull in the entire package.
Incorrect:
import { Button } from '@/components'
Correct:
import { Button } from '@/components/ui/button'
Don't define components inside other components. They get recreated on every render, losing all state.
Incorrect:
function Parent() {
const InlineChild = () => <div>content</div>
return <InlineChild />
}
Correct:
function Child() {
return <div>content</div>
}
function Parent() {
return <Child />
}
Derive state during render instead of using effects that cause extra render cycles.
Incorrect:
const [items, setItems] = useState([])
const [filteredItems, setFilteredItems] = useState([])
useEffect(() => {
setFilteredItems(items.filter(item => item.active))
}, [items])
Correct:
const [items, setItems] = useState([])
const filteredItems = items.filter(item => item.active)
Use functional setState to create stable callbacks that don't need the current state in their closure.
Incorrect:
const [count, setCount] = useState(0)
const increment = useCallback(() => setCount(count + 1), [count])
Correct:
const [count, setCount] = useState(0)
const increment = useCallback(() => setCount(c => c + 1), [])
Use ternary operators instead of && for conditional rendering to avoid rendering 0 or empty strings.
Incorrect:
{items.length && <List items={items} />}
Correct:
{items.length > 0 ? <List items={items} /> : null}
Return early from functions to reduce nesting and improve readability.
Incorrect:
function processOrder(order: Order) {
if (order) {
if (order.items.length > 0) {
if (order.status === 'pending') {
// ... deep nesting
}
}
}
}
Correct:
function processOrder(order: Order) {
if (!order) return
if (order.items.length === 0) return
if (order.status !== 'pending') return
// ... flat logic
}