Skip to content
Skillpedia
Websites & UI (frontend)75k · #2695

vercel-composition-patterns

What it does

This skill shares React component design patterns that keep code easy to change as it grows. It is for developers who want interface parts to be reusable and clear.

When to use it

  • ✓When a React component has many on-or-off settings and is hard to read.
  • ✓When you are building a shared component library for several pages.
  • ✓When you are reviewing how component state and context are arranged in an app.

Skill link

https://github.com/calesthio/OpenMontage/blob/main/.agents/skills/vercel-composition-patterns/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/calesthio/OpenMontage/blob/main/.agents/skills/vercel-composition-patterns/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Refactor this React button so it stops using a long list of true-or-false settings.”

5 new skills a week. 1 minute to read.

How it works

It gives rules for splitting a component into parts that work together, lifting shared state up, and using React 19 features where they fit.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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.

Extended reference: AGENTS.md in this directory is the long-form upstream guide (vendored from Vercel). It is supplementary reference material scoped to this skill only — SKILL.md is the loadable entry point and the authority. It does not override or extend the repository-root AGENTS.md / AGENT_GUIDE.md.

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

Priority Category Impact Prefix
1 Component Architecture HIGH architecture-
2 State Management MEDIUM state-
3 Implementation Patterns MEDIUM patterns-
4 React 19 APIs MEDIUM react19-

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

FAQ

Is this only for React?

Yes. The patterns are for React components, including the React 19 API changes the skill covers.

What is a compound component?

It is a set of parts that work together, such as a menu with its own items and trigger, rather than one component with many settings.

Where is the full guide?

The skill points to an extended reference file in the same folder for more detail.

Details

Original description by the author

React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.

repo: calesthio/OpenMontage

Popularity

GitHub stars
75k
Ranking position
#2695
License
AGPL-3.0
Updated
10/28/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills