Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
vercel-labs avatar

Vercel Composition Patterns

  • 265k installs
  • 29.5k repo stars
  • Updated July 24, 2026
  • vercel-labs/agent-skills

vercel-composition-patterns is a Vercel agent skill with React rules for compound components, lifted state, and avoiding boolean prop proliferation including React 19 notes.

About

Vercel Composition Patterns is a React architecture skill for flexible, maintainable components that scale for humans and AI agents. It targets boolean prop proliferation, rigid component libraries, and unclear provider boundaries with prioritized rule categories: component architecture, state management, implementation patterns, and React 19 APIs. High-impact rules include architecture-avoid-boolean-props, architecture-compound-components, state-decouple-implementation, state-context-interface, state-lift-state, patterns-explicit-variants, and patterns-children-over-render-props. React 19 guidance covers react19-no-forwardref and preferring use() over useContext(), noted as React 19+ only. Each rule file in rules/ provides incorrect and correct code examples with explanations, and AGENTS.md compiles the full guide. Apply when refactoring components with many boolean flags, designing reusable library APIs, reviewing component architecture, or working with compound components and context providers. The skill helps teams replace mode-switching props with explicit variant components, provider-owned state interfaces, and clearer extension points for future features.

  • Prioritized rules across architecture, state, patterns, and React 19 APIs with impact labels.
  • architecture-avoid-boolean-props: replace mode booleans with composition and explicit variants.
  • Compound component and provider patterns with decoupled state implementation interfaces.
  • React 19 section: skip forwardRef, use use() instead of useContext when on React 19+.
  • Per-rule files with incorrect/correct examples plus full AGENTS.md compiled reference.

Vercel Composition Patterns by the numbers

  • 265,193 all-time installs (skills.sh)
  • +9,987 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #2 of 2,277 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

vercel-composition-patterns capabilities & compatibility

Capabilities
boolean prop anti pattern detection and composit · compound component structuring with shared conte · provider state decoupling and generic context in · explicit variant components instead of mode flag · children over render props implementation guidan · react 19 api migration notes for refs and contex
Use cases
frontend · refactoring · ui design
From the docs

What vercel-composition-patterns says it does

Avoid boolean prop proliferation by using compound components, lifting state, and composing internals.
SKILL.md
npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-composition-patterns

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs265k
repo stars29.5k
Security audit3 / 3 scanners passed
Last updatedJuly 24, 2026
Repositoryvercel-labs/agent-skills

How do I refactor React components with too many boolean props into a flexible, composable API that scales?

Refactor boolean-heavy React components using compound components, lifted state, and React 19 composition APIs.

Who is it for?

Frontend developers refactoring component libraries or reviewing React architecture for long-term maintainability.

Skip if: Skip when the project uses React 18 or earlier and you need React 19-only APIs without adaptation.

When should I use this skill?

User mentions boolean prop proliferation, compound components, render props, context providers, or React 19 component APIs.

What you get

Architecture aligned to Vercel composition rules with explicit variants, provider-owned state, and documented anti-patterns fixed.

  • Refactored component architecture guidance
  • Rule-aligned code examples
  • AGENTS.md rule references

By the numbers

  • Boolean prop anti-pattern detection and composition alternatives
  • Compound component structuring with shared context
  • Provider state decoupling and generic context interfaces

Files

SKILL.mdMarkdownGitHub ↗

React Composition Patterns

Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.

When to Apply

Reference these guidelines when:

  • Refactoring components with many boolean props
  • Building reusable component libraries
  • Designing flexible component APIs
  • Reviewing component architecture
  • Working with compound components or context providers

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Component ArchitectureHIGHarchitecture-
2State ManagementMEDIUMstate-
3Implementation PatternsMEDIUMpatterns-
4React 19 APIsMEDIUMreact19-

Quick Reference

1. Component Architecture (HIGH)

  • architecture-avoid-boolean-props - Don't add boolean props to customize

behavior; use composition

  • architecture-compound-components - Structure complex components with shared

context

2. State Management (MEDIUM)

  • state-decouple-implementation - Provider is the only place that knows how

state is managed

  • state-context-interface - Define generic interface with state, actions, meta

for dependency injection

  • state-lift-state - Move state into provider components for sibling access

3. Implementation Patterns (MEDIUM)

  • patterns-explicit-variants - Create explicit variant components instead of

boolean modes

  • patterns-children-over-render-props - Use children for composition instead

of renderX props

4. React 19 APIs (MEDIUM)

⚠️ React 19+ only. Skip this section if using React 18 or earlier.
  • react19-no-forwardref - Don't use forwardRef; use use() instead of useContext()

How to Use

Read individual rule files for detailed explanations and code examples:

rules/architecture-avoid-boolean-props.md
rules/state-context-interface.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Related skills

Forks & variants (19)

Vercel Composition Patterns has 19 known copies in the catalog totaling 2.5k installs. They canonicalize to this original listing.

How it compares

vercel-composition-patterns is a Vercel agent skill with React rules for compound components, lifted state, and avoiding boolean prop proliferation including React 19 notes, not a generic alternative.

FAQ

Who is vercel-composition-patterns for?

React developers and reviewers building or refactoring component libraries with composition-first architecture.

When should I use vercel-composition-patterns?

When designing flexible component APIs, refactoring boolean modes, or applying Vercel compound component rules.

Is vercel-composition-patterns safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.