vercel-composition-patterns

Enforce React composition patterns over boolean props for component architecture.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/elcokiin/peluqueria --skill vercel-composition-patterns-elcokiin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/elcokiin/peluqueria/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/elcokiin/peluqueria --skill vercel-composition-patterns-elcokiin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the common issue of unmaintainable React codebases caused by boolean prop proliferation and monolithic component structures, providing a standardized approach to building flexible, scalable UI.

Core Features & Use Cases

  • Compound Components: Structure complex UI pieces that share state via context, eliminating prop drilling.
  • State Decoupling: Isolate state management logic from UI components, allowing for easier testing and swapping of state implementations.
  • Explicit Variants: Replace complex boolean-driven components with clear, self-documenting variant components.
  • Use Case: When refactoring a complex Composer component that has become difficult to manage due to numerous boolean flags, use these patterns to break it down into a clean, compound component architecture.

Quick Start

Apply the vercel-composition-patterns to refactor the current component by implementing a provider-based compound component structure.

Frequently Asked Questions about vercel-composition-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor React components to stop using boolean props for configuration?

Refactor React components by replacing boolean prop configurations with explicit variant components and a modular compound component architecture. This approach standardizes UI development, eliminating monolithic structures and making complex component libraries easier to maintain and scale.

What is the best way to manage shared state in a React component library without prop drilling?

Manage shared state in a React component library by implementing compound components structured around a provider-based context. This pattern decouples state management logic from UI components, allows generic dependency injection, and eliminates prop drilling entirely.

Can I use these React composition patterns with React 19 and TypeScript?

Yes, these React composition patterns are built to satisfy React 19 compatibility requirements and use TypeScript for implementation. They apply generic context interfaces for dependency injection, ensuring type-safe state decoupling and modular component design within your architecture.

When should I use compound components over monolithic structures in React?

Use compound components when a monolithic React structure becomes difficult to manage due to numerous boolean flags. This pattern isolates state management from UI components, allowing for easier testing, explicit self-documenting variants, and simpler swapping of state implementations.