.cursor/skills/components-build/SKILL.md
Build modern, composable, and accessible React UI components following the components.build specification. Use when creating, reviewing, or refactoring component libraries, design systems, or any reusable UI components. Triggers on tasks involving component APIs, composition patterns, accessibility, styling systems, or TypeScript props.
npx skillsauth add asymmetric-al/core components-buildInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive guidelines for building modern, composable, and accessible UI components. Contains 16 rule categories covering everything from core principles to distribution, co-authored by Hayden Bleasel and shadcn.
Reference these guidelines when:
| Priority | Category | Focus | Prefix |
| -------- | --------------- | -------------------------------- | ----------------- |
| 1 | Overview | Specification scope and goals | overview |
| 2 | Principles | Core design philosophy | principles |
| 3 | Definitions | Common terminology | definitions |
| 4 | Composition | Breaking down complex components | composition |
| 5 | Accessibility | Keyboard, screen readers, ARIA | accessibility |
| 6 | State | Controlled/uncontrolled patterns | state |
| 7 | Types | TypeScript props and interfaces | types |
| 8 | Polymorphism | Element switching with as prop | polymorphism |
| 9 | As-Child | Radix Slot composition pattern | as-child |
| 10 | Data Attributes | data-state and data-slot | data-attributes |
| 11 | Styling | Tailwind CSS, cn utility, CVA | styling |
| 12 | Design Tokens | CSS variables and theming | design-tokens |
| 13 | Documentation | Component documentation | documentation |
| 14 | Registry | Component registries | registry |
| 15 | NPM | Publishing to npm | npm |
| 16 | Marketplaces | Component marketplaces | marketplaces |
overview - Specification scope, goals, and philosophyprinciples - Composability, accessibility, customization, transparencydefinitions - Common terminology (primitive, compound, headless, etc.)composition-root - Root component with Context for shared statecomposition-item - Item wrapper componentscomposition-trigger - Interactive trigger componentscomposition-content - Content display componentscomposition-export - Namespace export patternaccessibility-semantic-html - Use appropriate HTML elementsaccessibility-keyboard - Full keyboard navigation supportaccessibility-aria - Proper ARIA roles, states, and propertiesaccessibility-focus - Focus management and restorationaccessibility-live-regions - Screen reader announcementsaccessibility-contrast - Color contrast requirementsstate-uncontrolled - Internal state managementstate-controlled - External state delegationstate-controllable - Support both patterns with useControllableStatetypes-extend-html - Extend native HTML attributestypes-export - Export prop types for consumerstypes-single-element - One component wraps one elementpolymorphism-as-prop - Change rendered element typepolymorphism-typescript - Type-safe polymorphic componentspolymorphism-defaults - Semantic element defaultsas-child-slot - Radix Slot for prop mergingas-child-composition - Compose with child componentsdata-attributes-state - Use data-state for styling statesdata-attributes-slot - Use data-slot for targeting sub-componentsstyling-cn-utility - Combine clsx and tailwind-mergestyling-order - Base -> Variants -> Conditionals -> User overridesstyling-cva - Class Variance Authority for variantsstyling-css-variables - Dynamic values with CSS variablesdesign-tokens-css-variables - Define tokens as CSS variablesdesign-tokens-theming - Support light/dark modes and themesdocumentation-props - Document all props with JSDocdocumentation-examples - Provide usage examplesregistry-structure - Registry file structureregistry-schema - Component metadata schemanpm-package-json - Package configurationnpm-exports - Module exportsmarketplaces-distribution - Component distribution strategiesRead individual rule files for detailed explanations and code examples:
rules/composition/SKILL.md
rules/accessibility/SKILL.md
rules/styling/SKILL.md
Each rule file contains:
For the complete guide with all rules expanded: AGENTS.md
cn() utility with tailwind-mergeCo-authored by:
Adapted as an AI skill by:
Based on the components.build specification.
development
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
testing
Use when CI tests fail on main branch after PR merge, or when investigating flaky test failures in CI environments
tools
Use when new translation keys are added to packages to generate new translations strings
data-ai
Pointer to the canonical agent instruction and skill system for this monorepo