vercel-composition-patterns
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
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Component Architecture | HIGH | architecture- |
| 2 | State Management | MEDIUM | state- |
| 3 | Implementation Patterns | MEDIUM | patterns- |
Quick Reference
1. Component Architecture (HIGH)
architecture-avoid-boolean-props- Don't add boolean props to customize behavior; use compositionarchitecture-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 managedstate-context-interface- Define generic interface with state, actions, meta for dependency injectionstate-lift-state- Move state into provider components for sibling access
3. Implementation Patterns (MEDIUM)
patterns-explicit-variants- Create explicit variant components instead of boolean modespatterns-children-over-render-props- Use children for composition instead of renderX props
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
More from boostbrothers/agent-skills-fe
expo-crypto-dpop
RFC 9449 DPoP authentication crypto module for EC P-256 key generation, DPoP proof JWT creation, and secure token binding. Use when working with DPoP, dpop proof, RFC 9449, token binding, OAuth, or expo-crypto-dpop.
4jira-workflow
Jira 티켓(Epic/Task/Subtask) 생성 시 제목 규칙, 디스크립션 자동 생성, Subtask 일괄 생성을 안내하는 스킬. "티켓 만들어줘", "Task 생성", "Subtask 생성", "티켓 구조 검토" 등의 요청에 트리거.
4react-native-coucon-sdk
Coucon SAS authentication SDK using TurboModule for secure authentication with event-based async results. Use when working with coucon, SAS authentication, SAS 인증, coucon SDK, or TurboModule auth.
4react-native-live-activity
iOS Live Activity module for displaying hospital reception status on lock screen and Dynamic Island using ActivityKit. Use when working with live activity, hospital reception, 접수 상태, ActivityKit, Dynamic Island, or lock screen widget.
3