Agentskillz Logo

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

pass

The 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

pass

No alerts

Audited: 3/18/2026, 4:50:55 PM

Snyk

pass

Risk: LOW · No issues

Audited: 2/17/2026, 10:15:25 PM

Runlayer

warn

1/14 files flagged

Audited: 2/25/2026, 5:21:26 PM

ZeroLeaks

pass

Score: 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

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

Все файлы скилла

Другие скиллы автора

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 или запасной вариант без авторизации для песочниц. Полезен для быстрой публикации приложения одной командой.