vercel-composition-patterns

Replace boolean props with explicit composition patterns in React components.

Updated Dec 8, 2025
One-click install
npx skills add https://github.com/Yahia89/meditrans --skill vercel-composition-patterns-yahia89
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/Yahia89/meditrans/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/Yahia89/meditrans --skill vercel-composition-patterns-yahia89

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Boolean props proliferation in React can lead to hard-to-maintain, error-prone UI code. This skill promotes explicit composition patterns, compound components, and provider-based state to keep components scalable and predictable.

Core Features & Use Cases

  • Explicit variants (ThreadComposer, EditMessageComposer, ForwardMessageComposer) that replace boolean flags with self-contained usage.
  • Compound components with shared context to avoid prop drilling and enable cross-boundary state access.
  • State lifting and dependency injection via providers so UI remains UI-focused while state comes from interchangeable backends.
  • Guidance for React 19 API changes (use() for context consumers and avoiding forwardRef in new patterns).

Quick Start

Implement explicit variant components with a provider-driven Composer to replace boolean props 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 fix boolean prop proliferation in React components?

To fix boolean prop proliferation in React, replace boolean flags with explicit composition patterns like self-contained variant components. This prevents unpredictable state combinations and keeps components scalable and maintainable.

What is the best way to structure reusable React component libraries?

The best way to structure reusable React component libraries is using explicit composition patterns, compound components, and provider-based state. This architecture avoids prop drilling and keeps components scalable and predictable.

How do I use compound components with context providers in React?

To use compound components with context providers in React, orchestrate shared state via providers to enable cross-boundary state access. This avoids prop drilling and allows UI components to remain focused on rendering.

Do I need React 19 to implement explicit variant components?

You do not need React 19 to implement explicit variant components, but guidance includes React 19 API changes like using use() for context consumers and avoiding forwardRef in new patterns for optimal architecture.

Why does replacing boolean flags with explicit variants help React architecture?

Replacing boolean flags with explicit variants helps React architecture by creating self-contained usage scenarios like ThreadComposer or ForwardMessageComposer, eliminating unpredictable state combinations and ensuring scalable UI design.