vercel-composition-patterns

Refactors React components using compound patterns and state decoupling.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/alissonmds00/LostPets.v2 --skill vercel-composition-patterns-alissonmds00
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/alissonmds00/LostPets.v2/tree/main/.claude/skills/vercel-composition-patterns
Command: npx skills add https://github.com/alissonmds00/LostPets.v2 --skill vercel-composition-patterns-alissonmds00

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, complex conditional rendering, and tightly coupled state management.

Core Features & Use Cases

  • Compound Components: Structure complex UI elements as modular, context-aware subcomponents.
  • State Decoupling: Isolate state management logic into providers, allowing UI components to remain implementation-agnostic.
  • React 19 Best Practices: Modernize component architecture using the latest React APIs like use() instead of useContext().
  • Use Case: Refactor a monolithic, prop-heavy Composer component into a flexible, compound-based architecture that supports multiple variants like ThreadComposer and EditComposer without adding new boolean props.

Quick Start

Apply the vercel-composition-patterns skill to refactor the current component by identifying boolean props and replacing them with compound component structures.

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 boolean prop proliferation?

Refactor React components by replacing boolean props with compound component structures. This pattern isolates state management into providers, allowing UI components to remain implementation-agnostic and reducing complex conditional rendering.

What is the compound component pattern in React?

The compound component pattern structures complex UI elements as modular, context-aware subcomponents. It decouples state management from presentation logic by isolating state into providers, allowing UI components to remain implementation-agnostic.

Does this composition pattern support React 19 APIs?

Yes, the composition pattern supports React 19 APIs. It modernizes component architecture by utilizing the latest React APIs like use() instead of useContext() to adhere to modern React 19 standards.

How do I decouple state management from presentation logic in React?

Decouple state management by isolating state logic into context providers. This allows your UI components to remain implementation-agnostic and removes the need for complex conditional rendering tied to boolean props.

What's the best way to support multiple component variants without adding new boolean props?

The best way to support multiple component variants is using a compound-based architecture. Refactor monolithic, prop-heavy components into flexible structures to support variants like ThreadComposer without adding new boolean props.

When should I avoid compound components in my React architecture?

Avoid compound components when dealing with simple UI elements that do not suffer from unmaintainable code, boolean prop proliferation, or tightly coupled state management, as the architectural overhead outweighs the benefits.