VE

vercel-composition-patterns

Provides architectural patterns like compound components and state lifting to build flexible, scalable React UIs.

Install

mkdir -p .claude/skills/vercel-composition-patterns && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/997" && unzip -o skill.zip -d .claude/skills/vercel-composition-patterns && rm skill.zip

Installs to .claude/skills/vercel-composition-patterns

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

React composition patterns that scale. Use when refactoring components with
75 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Implement compound component patterns
  • Structure shared context providers
  • Replace boolean props with component composition
  • Apply explicit variants for UI components
  • Organize architecture for React 19 APIs

How it works

Applies a set of structural refactoring rules to decouple state from implementation via provider components and explicit variant patterns.

Inputs & outputs

You give it
Code component file with excessive boolean props
You get back
Refactored, composed component structure

When to use vercel-composition-patterns

  • Refactor components with too many props
  • Build a reusable component library
  • Design flexible component APIs
  • Implement compound components

About this skill

React Composition Patterns

Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.

When to Apply

Reference these guidelines when:

  • Refactoring components with many boolean props
  • Building reusable component libraries
  • Designing flexible component APIs
  • Reviewing component architecture
  • Working with compound components or context providers

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Component ArchitectureHIGHarchitecture-
2State ManagementMEDIUMstate-
3Implementation PatternsMEDIUMpatterns-
4React 19 APIsMEDIUMreact19-

Quick Reference

1. Component Architecture (HIGH)

  • architecture-avoid-boolean-props - Don't add boolean props to customize behavior; use composition
  • architecture-compound-components - Structure complex components with shared context

2. State Management (MEDIUM)

  • state-decouple-implementation - Provider is the only place that knows how state is managed
  • state-context-interface - Define generic interface with state, actions, meta for dependency injection
  • state-lift-state - Move state into provider components for sibling access

3. Implementation Patterns (MEDIUM)

  • patterns-explicit-variants - Create explicit variant components instead of boolean modes
  • patterns-children-over-render-props - Use children for composition instead of renderX props

4. React 19 APIs (MEDIUM)

⚠️ React 19+ only. Skip this section if using React 18 or earlier.

  • react19-no-forwardref - Don't use forwardRef; use use() instead of useContext()

How to Use

Read individual rule files for detailed explanations and code examples:

rules/architecture-avoid-boolean-props.md
rules/state-context-interface.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

When not to use it

  • Building simple, single-use utility components
  • Small codebases where architectural overhead is unnecessary
  • Projects not using React

Prerequisites

React 18+

Limitations

  • Increases component file count
  • Requires team familiarity with composition patterns

How it compares

It moves from 'prop-driven' design to 'composition-driven' design, standardizing how complex UI components are built.

Compared to similar skills

vercel-composition-patterns side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
vercel-composition-patterns (this skill)36moNo flagsAdvanced
accessibility-compliance452moNo flagsIntermediate
senior-fullstack357moReviewIntermediate
nextjs-best-practices316moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by vercel-labs

View all by vercel-labs

agent-browser

vercel-labs

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.

3075

vercel-react-native-skills

vercel-labs

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.

2156

json-render-core

vercel-labs

Core package for defining schemas, catalogs, and AI prompt generation for json-render. Use when working with @json-render/core, defining schemas, creating catalogs, or building JSON specs for UI/video generation.

323

json-render-react-native

vercel-labs

React Native renderer for json-render that turns JSON specs into native mobile UIs. Use when working with @json-render/react-native, building React Native UIs from JSON, creating mobile component catalogs, or rendering AI-generated specs on mobile.

13

json-render-remotion

vercel-labs

Remotion renderer for json-render that turns JSON timeline specs into videos. Use when working with @json-render/remotion, building video compositions from JSON, creating video catalogs, or rendering AI-generated video timelines.

12

Search skills

Search the agent skills registry