vercel-composition-patterns

Promotes scalable React component architecture by eliminating boolean prop proliferation through composition patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React teams often suffer from boolean prop proliferation and rigid component APIs that create maintenance headaches. This skill provides a structured approach to building scalable component libraries using composition, compound components, and context-driven APIs.

Core Features & Use Cases

  • Explicit component variants to avoid multi-boolean prop states.
  • Compound components with shared context for flexible composition.
  • State decoupling via provider-based patterns and generic context interfaces.
  • Guidance for React 19 API changes, including use() over useContext and ref handling.
  • Real-world scenarios: refactoring large component libraries, building reusable UI APIs, and upgrading existing codebases.

Quick Start

Review the rules and guidelines to implement and apply the composition patterns in your codebase.

Frequently Asked Questions about vercel-composition-patterns

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

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

To avoid boolean prop proliferation in React components, enforce explicit component variants and use compound components with shared context. This pattern replaces rigid multi-boolean states with flexible, composable APIs for scalable architecture.

What is the best way to build scalable React component libraries using composition?

The best way to build scalable React component libraries is applying composition patterns, provider-based state lifting, and generic context interfaces. This decouples state management and enforces child-based composition requirements to create flexible, reusable UI APIs.

How do I refactor a large React component library to use compound components?

Refactor large React component libraries by implementing compound components with shared context and explicit variants. This eliminates rigid component APIs and maintenance headaches by enforcing generic context interfaces and provider-based state decoupling.

Does React 19 change how context and composition patterns work?

React 19 changes context and composition patterns by introducing the use() API over useContext and updating ref handling. These API changes require migrating existing codebases and adjusting generic context interfaces for provider-based state decoupling.

When should I use provider-based state lifting over standard React props?

Use provider-based state lifting over standard React props when decoupling state and building reusable UI APIs for large component libraries. This pattern enforces generic context interfaces and child-based composition to eliminate rigid component APIs and maintenance headaches.