vercel-composition-patterns
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.
Install
npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-composition-patterns- title
- Decouple State Management from UI
- impact
- MEDIUM
- impactDescription
- enables swapping state implementations without changing UI
- tags
- composition, state, architecture
Decouple State Management from UI
The provider component should be the only place that knows how state is managed. UI components consume the context interface—they don't know if state comes from useState, Zustand, or a server sync.
Incorrect (UI coupled to state implementation):
Correct (state management isolated in provider):
Different providers, same UI:
The same Composer.Input component works with both providers because it only
depends on the context interface, not the implementation.