| name | component-authoring |
| description | Conventions for creating and refactoring UI components in this repo, including state styling via data attributes, variant ownership, and composition-first APIs. |
| user-invocable | true |
Component authoring
Use this skill whenever creating or refactoring UI components in this repository.
Rules
- Use data attributes for UI state (
data-selected, data-open, data-active, data-disabled, data-state) on the interactive element.
- Style state with Tailwind selectors (
data-[selected=true]:..., data-[state=open]:...) instead of relying on !important.
- Treat
!important as fallback-only; if needed, document why structural alternatives were not viable.
- Put shared visual behavior in base primitives and their variant systems (
buttonVariants, etc.), not in wrapper-only overrides.
- Keep wrappers thin: behavior defaults, composition, and slots only.
- Prefer composition-first APIs for icons (
children with icon nodes) over dedicated icon props unless strict ergonomics demand otherwise.
- Always named-import React APIs (
useState, useEffect, type ReactNode, etc.). Do not call them off a React namespace (React.useState). Prefer import type for type-only symbols.
PR checklist