vercel-composition-patterns

Enforce explicit composition patterns in React components to replace boolean props.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React projects often suffer from boolean prop proliferation that leads to bloated, hard-to-maintain components. This Skill offers a structured approach that uses explicit variants, compound components, and provider-based state to enable scalable, reusable UI across teams.

Core Features & Use Cases

  • Explicit variant components (ThreadComposer, EditMessageComposer, ForwardMessageComposer) to replace boolean flags.
  • Compound components with a shared context to avoid prop drilling and enable flexible composition.
  • State lifting into providers so UI can be reused across different state implementations.
  • Guidance for React 19 APIs (use() instead of useContext and no need for forwardRef in many cases).

Quick Start

Implement a starter that demonstrates explicit variants (ThreadComposer, EditMessageComposer, ForwardMessageComposer) sharing state via a provider to showcase scalable React composition.

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?

Avoid boolean prop proliferation in React by enforcing explicit composition patterns. You replace conditional flags with explicit variant components, such as ThreadComposer or EditMessageComposer, ensuring a clean and maintainable component API.

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

The best way to share state across compound components in React is by lifting it into context providers. This approach avoids prop drilling and enables flexible composition while maintaining reusable UI across different state implementations.

How do I refactor a monolithic React component into explicit variants?

Refactor a monolithic React component by extracting explicit variant components from boolean flags and sharing their state via context providers. This creates distinct elements like ForwardMessageComposer to ensure scalable composition.

Do I need forwardRef when building reusable React component libraries?

You do not need forwardRef when building reusable React component libraries in many cases. Following React 19 API guidance, you can leverage the use() hook over useContext to design flexible APIs without relying on forwardRef.

When should I not use boolean flags for React component variants?

You should not use boolean flags for React component variants when building reusable component libraries or flexible APIs. Boolean flags cause bloated components, so explicit composition patterns are preferred for scalable UI.