vercel-composition-patterns

Refactors React components using compound components, context providers, and composition patterns.

2|Updated May 30, 2026
One-click install
npx skills add https://github.com/virahitvin8/crafty-gis --skill vercel-composition-patterns-virahitvin8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/virahitvin8/crafty-gis/tree/main/GIT_STAR/assignment-generator/antigravity-skills-main/antigravity-skills-main/skills/composition-patterns
Command: npx skills add https://github.com/virahitvin8/crafty-gis --skill vercel-composition-patterns-virahitvin8

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React components accumulate boolean props like isThread or isEditing that create exponential state combinations and unmaintainable conditional logic. This Skill provides structured rules for replacing prop proliferation with composition, making component libraries easier to maintain and extend. ## Core Features & Use Cases - Boolean Prop Elimination: Replace conditional props with explicit variant components such as ThreadComposer or EditComposer that compose shared internals. - Compound Component Architecture: Structure components with shared context so subcomponents access state without prop drilling. - Dependency-Injectable State: Define generic context interfaces with state, actions, and meta so the same UI works with local useState, Zustand, or server-synced state. - Use Case: When refactoring a messaging composer that has grown to six boolean props, apply these rules to split it into explicit variants backed by provider components, eliminating impossible states. ## Quick Start Ask the AI to refactor a React component with many boolean props into compound components using these composition patterns.

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 with too many boolean props?

Replace boolean props with explicit variant components that compose shared internals. Instead of one Composer with isThread and isEditing flags, create ThreadComposer and EditComposer components that each compose the pieces they need from a shared compound component.

What are compound components in React?

Compound components are structured as a parent provider with subcomponents that share state through context rather than props. Consumers compose exactly the pieces they need, such as Composer.Frame, Composer.Input, and Composer.Submit, without hidden conditionals.

Should I use children or render props for React composition?

Use children for composing static structure because they are more readable and compose naturally. Reserve render props for cases where the parent must pass data back to the child, such as rendering list items with per-item data.

Does React 19 still require forwardRef?

No, React 19 makes ref a regular prop, so forwardRef wrappers are unnecessary. The use() hook also replaces useContext() and can be called conditionally, unlike useContext.

How do I share React state with components outside the main UI?

Lift state into a provider component that wraps the entire subtree. Any component inside the provider boundary can access state and actions through context, even if it is not visually nested inside the main component.