vercel-labs avatar

Vercel Composition Patterns

Tackles the classic React problem of components drowning in boolean props by teaching composition patterns that actually scale. Covers compound components, context providers, state lifting, and render prop alternatives with specific rules like avoiding boolean customization props and using explicit variant components instead. Includes React 19 API updates like dropping forwardRef for the new use() hook. The skill provides both quick reference rules and detailed examples for refactoring messy component APIs. Honestly, these patterns should be standard practice but most teams discover them the hard way after their component props become unmanageable.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
10
skills.sh installs
446.4K
GitHub stars
33.8K
last updated
Jul 14, 2026

Install

$ npx -y skills add vercel-labs/agent-skills --skill vercel-composition-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

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)

Sponsors

Details

Repository
github.com/vercel-labs/agent-skills
Categories
Frontend Development, AI & Agent Building, Cloud & Infrastructure

More from vercel-labs/agent-skills

All 14
1leonxlnx avatargpt-tasteleonxlnx/taste-skillElite UX/UI & Advanced GSAP Motion Engineer. Enforces Python-driven true randomization for layout variance, strict AIDA page structure, wide editorial typograph399.5Kskills.sh installs
2tt-a1i avatararchifytt-a1i/archifyCreate polished, validated architecture, workflow, sequence, data-flow, and lifecycle/state diagrams as explorable standalone HTML with inline SVG, dark/light t190.4Kskills.sh installs
3cloudflare avatarturnstile-spincloudflare/skillsSet up Cloudflare Turnstile end-to-end in a project. Scan the codebase, create the widget via the Cloudflare API, embed it where user requests need bot verifica105.1Kskills.sh installs
4vercel-labs avatarnext-best-practicesvercel-labs/next-skillsComprehensive Next.js development guidelines covering file structure, RSC patterns, data fetching, optimization, and error handling.98.5Kskills.sh installs
5addyosmani avatarperformance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regres75.2Kskills.sh installs
6addyosmani avatarapi-and-interface-designaddyosmani/agent-skillsGuides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defini72.4Kskills.sh installs