Communitygithub.com

Vercel React 성능 최적화 가이드

Vercel 엔지니어링 팀이 제공하는 React 및 Next.js 성능 최적화 가이드라인입니다. React/Next.js 코드 작성, 리뷰, 리팩토링 시 최적의 성능 패턴을 적용해야 할 때 사용합니다.

Vercel React 성능 최적화 가이드란 무엇인가요?

이 스킬은 Vercel 엔지니어링 팀이 유지 관리하는 React 및 Next.js 성능 최적화 가이드라인으로, 총 70개의 규칙을 8개 우선순위 카테고리로 정리한 체계적인 문서입니다. 워터폴 제거(비동기 처리), 번들 크기 최적화, 서버 및 클라이언트 성능, 리렌더링 방지, 렌더링 성능, JavaScript 성능, 고급 패턴을 다룹니다. 각 규칙은 영향도에 따라 CRITICAL(치명적), HIGH(높음), MEDIUM(중간), LOW(낮음)으로 구분되어 있어 자동 리팩토링과 코드 생성을 효율적으로 안내합니다. Claude Code, Cursor, Codex 등 다양한 AI 코딩 어시스턴트에서 React/Next.js 프로젝트의 성능 코드 리뷰, 자동 수정 제안, 모범 사례 적용 시 참조할 수 있습니다. 또한 각 규칙마다 별도 마크다운 파일로 상세한 설명과 잘못된/올바른 코드 예제를 제공하여 실무에 바로 적용 가능합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/xzedm/clipplic-landing/tree/HEAD/.agents/skills/vercel-react-best-practices

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Vercel React 모범 사례

Vercel이 유지 관리하는 React 및 Next.js 애플리케이션을 위한 종합적인 성능 최적화 가이드입니다. 8개 카테고리, 70개의 규칙을 포함하며 영향도에 따라 우선순위가 지정되어 자동 리팩토링 및 코드 생성을 안내합니다.

적용 시점

다음 상황에서 이 가이드라인을 참고하세요:

  • 새 React 컴포넌트나 Next.js 페이지를 작성할 때
  • 데이터 페칭(클라이언트 또는 서버 측)을 구현할 때
  • 성능 문제로 코드를 리뷰할 때
  • 기존 React/Next.js 코드를 리팩토링할 때
  • 번들 크기나 로드 시간을 최적화할 때

우선순위별 규칙 카테고리

우선순위카테고리영향도접두사
1워터폴 제거치명적async-
2번들 크기 최적화치명적bundle-
3서버 측 성능높음server-
4클라이언트 측 데이터 페칭중간-높음client-
5리렌더링 최적화중간rerender-
6렌더링 성능중간rendering-
7JavaScript 성능낮음-중간js-
8고급 패턴낮음advanced-

빠른 참조

1. 워터폴 제거 (치명적)

  • async-cheap-condition-before-await - 플래그나 원격 값을 기다리기 전에 저렴한 동기 조건을 먼저 확인
  • async-defer-await - await을 실제로 사용되는 분기 안으로 이동
  • async-parallel - 독립적인 작업에는 Promise.all() 사용
  • async-dependencies - 부분 의존성에는 better-all 사용
  • async-api-routes - API 라우트에서 Promise를 일찍 시작하고 늦게 await
  • async-suspense-boundaries - Suspense를 사용해 콘텐츠 스트리밍

2. 번들 크기 최적화 (치명적)

  • bundle-barrel-imports - 배럴 파일 대신 직접 가져오기
  • bundle-analyzable-paths - 정적으로 분석 가능한 가져오기 및 파일 시스템 경로 사용으로 넓은 번들 및 트레이스 방지
  • bundle-dynamic-imports - 무거운 컴포넌트에는 next/dynamic 사용
  • bundle-defer-third-party - 분석/로깅은 하이드레이션 이후에 로드
  • bundle-conditional - 기능이 활성화될 때만 모듈 로드
  • bundle-preload - 인지된 속도 향상을 위해 호버/포커스 시 사전 로드

3. 서버 측 성능 (높음)

  • server-auth-actions - 서버 액션을 API 라우트처럼 인증
  • server-cache-react - 요청별 중복 제거에 React.cache() 사용
  • server-cache-lru - 요청 간 캐싱에 LRU 캐시 사용
  • server-dedup-props - RSC props에서 중복 직렬화 방지
  • server-hoist-static-io - 정적 I/O(폰트, 로고)를 모듈 레벨로 호이스팅
  • server-no-shared-module-state - RSC/SSR에서 모듈 레벨 가변 요청 상태 피하기
  • server-serialization - 클라이언트 컴포넌트에 전달하는 데이터 최소화
  • server-parallel-fetching - 컴포넌트를 재구성하여 페치 병렬화
  • server-parallel-nested-fetching - Promise.all 내에서 항목별 중첩 페치 체인 구성
  • server-after-nonblocking - 비차단 작업에는 after() 사용

4. 클라이언트 측 데이터 페칭 (중간-높음)

  • client-swr-dedup - 자동 요청 중복 제거에 SWR 사용
  • client-event-listeners - 전역 이벤트 리스너 중복 제거
  • client-passive-event-listeners - 스크롤에는 수동 리스너 사용
  • client-localstorage-schema - localStorage 데이터 버전 관리 및 최소화

5. 리렌더링 최적화 (중간)

  • rerender-defer-reads - 콜백에서만 사용되는 상태를 구독하지 않기
  • rerender-memo - 비용이 큰 작업을 메모이제이션된 컴포넌트로 추출
  • rerender-memo-with-default-value - 기본 비원시 타입 props 호이스팅
  • rerender-dependencies - 이펙트에서 원시 타입 의존성 사용
  • rerender-derived-state - 가공된 불리언 값 구독, 원시 값 구독 피하기
  • rerender-derived-state-no-effect - 이펙트가 아닌 렌더링 중에 상태 파생
  • rerender-functional-setstate - 안정적인 콜백을 위해 함수형 setState 사용
  • rerender-lazy-state-init - 비용이 큰 값은 useState에 함수 전달
  • rerender-simple-expression-in-memo - 간단한 원시 타입에는 memo 피하기
  • rerender-split-combined-hooks - 독립적인 의존성을 가진 훅 분리
  • rerender-move-effect-to-event - 상호작용 로직을 이벤트 핸들러로 이동
  • rerender-transitions - 긴급하지 않은 업데이트에는 startTransition 사용
  • rerender-use-deferred-value - 비용이 큰 렌더링을 지연하여 입력 반응성 유지
  • rerender-use-ref-transient-values - 일시적인 빈번한 값에는 ref 사용
  • rerender-no-inline-components - 컴포넌트 내부에 컴포넌트 정의 금지

6. 렌더링 성능 (중간)

  • rendering-animate-svg-wrapper - SVG 요소가 아닌 div 래퍼에 애니메이션 적용
  • rendering-content-visibility - 긴 목록에는 content-visibility 사용
  • rendering-hoist-jsx - 정적 JSX를 컴포넌트 외부로 추출
  • rendering-svg-precision - SVG 좌표 정밀도 줄이기
  • rendering-hydration-no-flicker - 클라이언트 전용 데이터에는 인라인 스크립트 사용
  • rendering-hydration-suppress-warning - 예상되는 불일치 경고 억제
  • rendering-activity - 표시/숨기기에 Activity 컴포넌트 사용
  • rendering-conditional-render - 조건부 렌더링에 && 대신 삼항 연산자 사용
  • rendering-usetransition-loading - 로딩 상태에는 useTransition 선호
  • rendering-resource-hints - 사전 로딩에 React DOM 리소스 힌트 사용
  • rendering-script-defer-async - script 태그에 defer 또는 async 사용

7. JavaScript 성능 (낮음-중간)

  • js-batch-dom-css - 클래스나 cssText로 CSS 변경 그룹화
  • js-index-maps - 반복 조회에는 Map 구축
  • js-cache-property-access - 루프 내 객체 속성 캐싱
  • js-cache-function-results - 모듈 레벨 Map에 함수 결과 캐싱
  • js-cache-storage - localStorage/sessionStorage 읽기 캐싱
  • js-combine-iterations - 여러 filter/map을 하나의 루프로 결합
  • js-length-check-first - 비용이 큰 비교 전에 배열 길이 확인
  • js-early-exit - 함수에서 조기 반환
  • js-hoist-regexp - 루프 밖으로 RegExp 생성 호이스팅
  • js-min-max-loop - 정렬 대신 루프로 최소/최대값 찾기
  • js-set-map-lookups - O(1) 조회를 위해 Set/Map 사용
  • js-tosorted-immutable - 불변성을 위해 toSorted() 사용
  • js-flatmap-filter - flatMap으로 매핑과 필터링을 한 번에 처리
  • js-request-idle-callback - 중요하지 않은 작업을 브라우저 유휴 시간으로 지연

8. 고급 패턴 (낮음)

  • advanced-effect-event-deps - useEffectEvent 결과를 이펙트 의존성에 넣지 않기
  • advanced-event-handler-refs - 이벤트 핸들러를 ref에 저장
  • advanced-init-once - 앱 로드당 한 번 초기화
  • advanced-use-latest - 안정적인 콜백 ref를 위해 useLatest 사용

사용 방법

자세한 설명과 코드 예제는 각 규칙 파일을 읽어보세요:

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

각 규칙 파일에는 다음이 포함됩니다:

  • 규칙이 중요한 이유에 대한 간략한 설명
  • 잘못된 코드 예제와 설명
  • 올바른 코드 예제와 설명
  • 추가 컨텍스트 및 참고 자료

전체 문서

모든 규칙이 확장된 전체 가이드는 AGENTS.md를 참조하세요.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

xzedm/clipplic-landing

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

xzedm/clipplic-landing

Material Design 3 and Android platform guidelines. Use when building Android apps with Jetpack Compose or XML layouts, implementing Material You, navigation, or accessibility. Triggers on tasks involving Android UI, Compose components, dynamic color, or Material Design compliance.

xzedm/clipplic-landing

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

xzedm/clipplic-landing

Design iOS apps following Apple's Human Interface Guidelines. Generate native components, validate designs, and ensure accessibility compliance for iPhone, iPad, and Apple Watch.

xzedm/clipplic-landing

Redesign mobile app UI to feel unmistakably Apple-like, iOS-forward, and native. Use this skill when building iOS apps, applying Apple Human Interface Guidelines, or creating native-feeling mobile interfaces with SF Pro typography, translucency, and system-like components.

xzedm/clipplic-landing

Accessibility engineering for product interfaces, from focus states and keyboard support to ARIA, forms, and screen readers. Use when building or reviewing UI components, modals, menus, forms, custom widgets, or when the user says "make this accessible" or reports keyboard or screen-reader issues. Triggers on accessibility, a11y, WCAG, aria, focus ring, focus-visible, focus trap, keyboard navigation, tab order, tabindex, screen reader, sr-only, aria-live, alt text, hit area, touch target, prefers-reduced-motion, autoplay, toast duration, skip link, semantic HTML, aria-label, form errors, disabled buttons, "not keyboard accessible".

xzedm/clipplic-landing

OKLCH color space and color usage for web projects. Convert hex/rgb/hsl to oklch, generate palettes, check contrast, handle gamut boundaries, theme with Tailwind v4, and apply color with meaning. Triggers on oklch, color conversion, palette generation, contrast ratio, gamut, display p3, design tokens, semantic color tokens, hue drift, chroma, dark mode colors, accent color, color meaning, light and dark appearance, increased contrast.

xzedm/clipplic-landing

Layout structure for web interfaces, from grouping and alignment to reading order, progressive disclosure, and adaptive breakpoints. Use when structuring a page or component, spacing or aligning controls, deciding what collapses at small sizes, handling RTL layout direction, or reviewing frontend code for layout. Triggers on layout, spacing, alignment, grouping, negative space, whitespace, visual hierarchy, reading order, progressive disclosure, breakpoints, responsive layout, container queries, safe area, full-bleed, edge-to-edge, layout margins, RTL layout, logical properties.

xzedm/clipplic-landing

Web typography from choosing fonts to spacing, wrapping and accessibility. Use when picking or pairing typefaces, configuring variable fonts or OpenType features, setting up a type scale, checking heading hierarchy, styling text in components, truncating text, styling underlines, selection, placeholders or carets, or reviewing frontend code for typography. Triggers on typography, fonts, font formats, woff2, variable fonts, font-weight, opentype, font-feature-settings, letter-spacing, line-height, type scale, heading hierarchy, heading levels, tabular numbers, text-wrap, truncation, line clamp, underlines, text-decoration, text selection, iOS input zoom, scaled input text, font smoothing, text contrast, measure, line length, text-box, smart punctuation, drop cap.

xzedm/clipplic-landing

Design engineering principles for making interfaces feel polished. Use when building UI components, reviewing frontend code, implementing animations, hover states, shadows, borders, micro-interactions, enter/exit animations, choosing or reviewing icons, or any visual detail work. Triggers on UI polish, design details, "make it feel better", "feels off", stagger animations, border radius, optical alignment, image outlines, box shadows, icons, icon stroke weight, icon states, motion restraint.

xzedm/clipplic-landing

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

xzedm/clipplic-landing

Generate developer handoff specs from a design. Use when a design is ready for engineering and needs a spec sheet covering layout, design tokens, component props, interaction states, responsive breakpoints, edge cases, and animation details.

xzedm/clipplic-landing

This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.

xzedm/clipplic-landing

Extract design primitives from a public website and generate starter token files for your project.

xzedm/clipplic-landing

Use this skill alongside figma-use when the task involves translating an application page, view, or multi-section layout into Figma. Triggers: 'write to Figma', 'create in Figma from code', 'push page to Figma', 'take this app/page and build it in Figma', 'create a screen', 'build a landing page in Figma', 'update the Figma screen to match code', 'convert this modal/dialog/drawer/panel to Figma'. This is the preferred workflow skill whenever the user wants to build or update a full page, modal, dialog, drawer, sidebar, panel, or any composed multi-section view in Figma from code or a description. Discovers design system components, variables, and styles from Code Connect files, existing screens, and library search, then imports them and assembles views incrementally section-by-section using design system tokens instead of hardcoded values.

xzedm/clipplic-landing

**MANDATORY prerequisite**: you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in the Figma file context, e.g. create/edit/delete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically.

xzedm/clipplic-landing

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

xzedm/clipplic-landing

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications.

xzedm/clipplic-landing

Elite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typography (bans 6-line wraps), gapless bento grids, strict GSAP ScrollTriggers (pinning, stacking, scrubbing), inline micro-images, and massive section spacing.

xzedm/clipplic-landing

Fast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)

관련 스킬