vercel-composition-patterns

Refactor React components to replace boolean props with composition patterns.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/ZawHlaingPhyoTsuki/food-order-app --skill vercel-composition-patterns-zawhlaingphyotsuki
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/ZawHlaingPhyoTsuki/food-order-app/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/ZawHlaingPhyoTsuki/food-order-app --skill vercel-composition-patterns-zawhlaingphyotsuki

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React projects often suffer from boolean prop proliferation and brittle APIs as they scale. This Skill provides composition-focused patterns to build flexible, reusable UI libraries and maintainable codebases.

Core Features & Use Cases

  • Compound components with shared context to avoid prop drilling.
  • Explicit variants and provider-based state management to decouple UI from data flow.
  • Guidelines for implementing patterns across real-world codebases, including React 19 API changes.

Quick Start

Refactor an existing component to replace boolean props with explicit variants and lift shared state into a provider.

Frequently Asked Questions about vercel-composition-patterns

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

FAQPage Schema
How do I eliminate boolean prop proliferation in React components?

To eliminate boolean prop proliferation in React components, refactor your APIs to use explicit variants and compound component patterns. This approach decouples UI structure from data flow, preventing brittle and unmaintainable code as your project scales.

What is the best way to manage shared state across compound components in React?

The best way to manage shared state across compound components is by using context providers. This pattern allows you to lift shared state into a provider, avoiding prop drilling and ensuring generic context interfaces handle state, actions, and meta cleanly.

How do I refactor React components to use explicit variants instead of boolean props?

Refactor React components to use explicit variants by replacing conditional boolean props with distinct component variants. Lift shared state into a context provider and implement compound components to build flexible, reusable UI libraries.

Do I need React 19 APIs to implement composition patterns and context providers?

Implementing these composition patterns requires understanding React 19 APIs, specifically using `use` instead of `useContext` and passing `ref` as a regular prop. This knowledge is necessary to correctly apply context providers and generic interfaces.

Why does my React component architecture become brittle as the codebase scales?

React component architecture becomes brittle as it scales due to boolean prop proliferation and tightly coupled data flow. Adopting composition-focused patterns with explicit variants and provider-based state management solves this by decoupling UI from data.