vercel-composition-patterns

Implement React composition patterns with explicit variants, compound components, and context providers.

240|75|Updated Dec 3, 2020
One-click install
npx skills add https://github.com/mburumaxwell/paklo --skill vercel-composition-patterns-mburumaxwell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-composition-patterns
Source: https://github.com/mburumaxwell/paklo/tree/main/.agents/skills/vercel-composition-patterns
Command: npx skills add https://github.com/mburumaxwell/paklo --skill vercel-composition-patterns-mburumaxwell

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps frontend teams tame React codebases by replacing sprawling boolean props with explicit, composable patterns. It guides the design of scalable component libraries through compound components, context providers, and provider-based state management.

Core Features & Use Cases

  • Explicit Variant Components: replace boolean-mode components with dedicated variant components to document intent and reduce branching.
  • Compound Components with Shared Context: structure complex UIs as a set of parts that share state via context.
  • Provider-based State Management: lift state into providers to enable cross-cut UI usage and easier testing.
  • Guidance for Patterns: outlines when to apply explicit variants, compound components, and context-based architectures.

Quick Start

Apply the pattern guidance to refactor a monolithic component with many boolean props into explicit variants (e.g., ThreadComposer, EditMessageComposer, ForwardMessageComposer), and compose them with a shared Composer frame and 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 reduce boolean prop proliferation in React components?

Reduce boolean prop proliferation in React by replacing mode-driven components with explicit variant components, such as separate ThreadComposer and EditMessageComposer, to document intent and eliminate complex branching logic.

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

Share state across compound components in React by using shared context providers, lifting the state up to enable cross-cutting UI usage, easier testing, and decoupled state management.

When should I use explicit variant components instead of boolean props?

Use explicit variant components instead of boolean props when refactoring monolithic components or designing scalable UI libraries, ensuring dedicated variants document clear intent and reduce branching.

How do I refactor a monolithic React component with many boolean props?

Refactor a monolithic React component by breaking it into explicit variant components, composing them with a shared frame, and lifting state into a provider to decouple architecture.

Does provider-based state management work for React library design?

Provider-based state management works effectively for React library design by enabling flexible composition, generic context interfaces, and decoupled state management across complex frontend architectures.