vercel-labs/agent-skills / vercel-composition-patterns
vercel-composition-patterns
- Установки
- 313,439
- Автор
- vercel-labs/agent-skills
Помогает проектировать гибкие React-компоненты, избавляясь от множества булевых пропсов через композицию: compound components, контекст и подъём состояния. Полезен при рефакторинге, создании компонентных библиотек и проектировании переиспользуемых API, включая особенности React 19.
Установить скилл
npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-composition-patterns
Аудит безопасности
Gen Agent Trust Hub
passThe skill provides a set of architectural guidelines and code examples for React development. No security risks or malicious behaviors were identified during the analysis.
Audited: 2/17/2026, 6:48:58 PM
Socket
passNo alerts
Audited: 3/18/2026, 4:50:55 PM
Snyk
passRisk: LOW · No issues
Audited: 2/17/2026, 10:15:25 PM
Runlayer
warn1/14 files flagged
Audited: 2/25/2026, 5:21:26 PM
ZeroLeaks
passScore: 93/100 · 2 sections analyzed
Audited: 4/16/2026, 8:31:55 AM
Промпт скилла
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- |
| 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 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
4. React 19 APIs (MEDIUM)
⚠️ React 19+ only. Skip this section if using React 18 or earlier.
react19-no-forwardref- Don't useforwardRef; useuse()instead ofuseContext()
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
Все файлы скилла
- AGENTS.md
- metadata.json
- README.md
- rules/_sections.md
- rules/_template.md
- rules/architecture-avoid-boolean-props.md
- rules/architecture-compound-components.md
- rules/patterns-children-over-render-props.md
- rules/patterns-explicit-variants.md
- rules/react19-no-forwardref.md
- rules/state-context-interface.md
- rules/state-decouple-implementation.md
- rules/state-lift-state.md
- SKILL.md
Другие скиллы автора
vercel-react-best-practices
676,936 установокvercel-labs/agent-skills
Набор практических правил по оптимизации производительности React и Next.js от Vercel. Охватывает устранение водопадов, оптимизацию размера бандла, серверную и клиентскую загрузку данных, предотвращение лишних ререндеров и улучшение рендеринга. Помогает писать быстрые и эффективные приложения.
web-design-guidelines
592,933 установокvercel-labs/agent-skills
Этот навык проверяет интерфейсы на соответствие рекомендациям по веб-дизайну. Он загружает актуальные правила, анализирует указанные файлы и выдаёт замечания в компактном формате. Полезен для быстрого аудита UI и доступности.
deploy-to-vercel
117,353 установокvercel-labs/agent-skills
Разворачивает проекты на Vercel и возвращает ссылку на готовое превью. Автоматически определяет состояние проекта, связывает его с Vercel при необходимости и выбирает оптимальный способ деплоя: git push, CLI или запасной вариант без авторизации для песочниц. Полезен для быстрой публикации приложения одной командой.