Official코딩 & 개발github.com

vercel-composition-patterns

확장 가능한 React 컴포지션 패턴입니다. 컴포넌트 리팩토링 시 사용하세요.

vercel-composition-patterns란 무엇인가요?

이 스킬은 Vercel의 React 컴포지션 패턴을 기반으로 하여, 복잡한 컴포넌트를 더 유지보수하기 쉽고 확장 가능하게 만드는 방법을 설명합니다. 주로 boolean prop이 남용된 컴포넌트를 리팩토링하거나, 재사용 가능한 컴포넌트 라이브러리를 설계할 때 유용합니다. Claude Code, Cursor 등 AI 에이전트와 함께 사용할 수 있도록 설계되었으며, 규칙 파일을 통해 구체적인 코드 예제와 설명을 제공합니다. 이 스킬은 '컴포넌트 아키텍처', '상태 관리', '구현 패턴', 'React 19 API'의 네 가지 우선순위 범주로 나뉘어 있으며, 각 범주는 HIGH 또는 MEDIUM의 영향도를 가집니다. 사용자는 각 규칙 파일을 읽고 잘못된 예제와 올바른 예제를 비교하며 학습할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
Part ofReact
npx skills add https://github.com/vercel-labs/agent-skills/tree/main/skills/composition-patterns

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

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

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

문서

React 컴포지션 패턴

유연하고 유지보수 가능한 React 컴포넌트를 구축하기 위한 컴포지션 패턴입니다. boolean prop의 확산을 피하기 위해 복합 컴포넌트(compound components), 상태 끌어올리기(lifting state), 내부 구성(composing internals)을 사용합니다. 이러한 패턴은 코드베이스가 확장됨에 따라 사람과 AI 에이전트 모두가 작업하기 쉽게 만듭니다.

적용 시점

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

  • 많은 boolean prop을 가진 컴포넌트를 리팩토링할 때
  • 재사용 가능한 컴포넌트 라이브러리를 구축할 때
  • 유연한 컴포넌트 API를 설계할 때
  • 컴포넌트 아키텍처를 검토할 때
  • 복합 컴포넌트나 컨텍스트 프로바이더로 작업할 때

우선순위별 규칙 범주

우선순위범주영향도접두사
1컴포넌트 아키텍처HIGHarchitecture-
2상태 관리MEDIUMstate-
3구현 패턴MEDIUMpatterns-
4React 19 APIMEDIUMreact19-

빠른 참조

1. 컴포넌트 아키텍처 (HIGH)

  • architecture-avoid-boolean-props - 동작을 커스터마이즈하기 위해 boolean prop을 추가하지 말고 컴포지션을 사용하세요.
  • architecture-compound-components - 공유 컨텍스트로 복잡한 컴포넌트를 구조화하세요.

2. 상태 관리 (MEDIUM)

  • state-decouple-implementation - 프로바이더만이 상태가 어떻게 관리되는지 알고 있습니다.
  • state-context-interface - 의존성 주입을 위해 상태, 액션, 메타를 포함한 제네릭 인터페이스를 정의하세요.
  • state-lift-state - 형제 접근을 위해 상태를 프로바이더 컴포넌트로 이동하세요.

3. 구현 패턴 (MEDIUM)

  • patterns-explicit-variants - boolean 모드 대신 명시적 변형 컴포넌트를 만드세요.
  • patterns-children-over-render-props - renderX prop 대신 컴포지션을 위해 children을 사용하세요.

4. React 19 API (MEDIUM)

⚠️ React 19+ 전용. React 18 이하를 사용하는 경우 이 섹션을 건너뛰세요.

  • react19-no-forwardref - forwardRef를 사용하지 말고, useContext() 대신 use()를 사용하세요.

사용 방법

자세한 설명과 코드 예제를 보려면 개별 규칙 파일을 읽으세요:

rules/architecture-avoid-boolean-props.md
rules/state-context-interface.md

각 규칙 파일에는 다음이 포함되어 있습니다:

  • 왜 중요한지에 대한 간략한 설명
  • 설명이 포함된 잘못된 코드 예제
  • 설명이 포함된 올바른 코드 예제
  • 추가 컨텍스트 및 참조

전체 컴파일 문서

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

Individual skills in this repo

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

deploy-to-vercel

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".

vercel-cli-with-tokens

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g.

vercel-labs/vercel-composition-patterns

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

vercel-labs/vercel-react-best-practices

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.

vercel-labs/vercel-react-native-skills

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

vercel-labs/vercel-react-view-transitions

Guide for implementing smooth, native-feeling animations using React's View Transition API (`<ViewTransition>` component, `addTransitionType`, and CSS view transition pseudo-elements). Use this skill whenever the user wants to add page transitions, animate route changes, create shared element animations, animate enter/exit of components, animate list reorder, implement directional (forward/back) navigation animations, or integrate view transitions in Next.js. Also use when the user mentions view transitions, `startViewTransition`, `ViewTransition`, transition types, or asks about animating between UI states in React without third-party animation libraries.

vercel-optimize

Use for Vercel cost and performance optimization on deployed projects, especially Next.js, SvelteKit, Nuxt, and limited Astro apps. Collect Vercel metrics, usage, project config, and code scan results first; investigate only metric-backed candidates; produce ranked recommendations grounded in verified files and version-aware Vercel/framework docs. Trigger for Vercel bill reduction, slow or expensive routes, caching opportunities, Function Invocations, Build Minutes, Fast Data Transfer, Core Web Vitals, Bot Management, Fluid compute, or cost breakdown requests.

vercel-react-best-practices

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.

vercel-react-native-skills

React Native and Expo best practices for building performant mobile apps. Use

web-design-guidelines

Review UI code for Web Interface Guidelines compliance. Use when asked to

writing-guidelines

Review docs/prose for Writing Guidelines compliance. Use when asked to

관련 스킬