$npx -y skills add bitjaru/styleseed --skill ss-componentGenerate a new UI component following the StyleSeed design conventions
| 1 | # UI Component Generator |
| 2 | |
| 3 | ## When NOT to use |
| 4 | |
| 5 | - For full-page scaffolding → use `/ss-page` |
| 6 | - For composed multi-component patterns → use `/ss-pattern` |
| 7 | - For tweaking an existing component — just edit the file directly |
| 8 | - For non-StyleSeed projects (no `components/ui/` directory or no Tailwind v4) |
| 9 | |
| 10 | Generate a new component: **$0** |
| 11 | Description: $ARGUMENTS |
| 12 | |
| 13 | ## Instructions |
| 14 | |
| 15 | 1. First, read the design system seed for context: |
| 16 | - Read `CLAUDE.md` for component conventions |
| 17 | - Read `css/theme.css` for available design tokens |
| 18 | - Read `components/ui/button.tsx` as a reference pattern |
| 19 | |
| 20 | 2. Follow these conventions strictly: |
| 21 | - Use `function` declaration (not `const`) |
| 22 | - Add `data-slot="component-name"` attribute |
| 23 | - Use `cn()` from `@/components/ui/utils` for all className merging |
| 24 | - Use `React.ComponentProps<>` for prop typing |
| 25 | - Always support `className` prop for overrides |
| 26 | - Use CVA (`class-variance-authority`) if the component has variants |
| 27 | - Use semantic color tokens (`bg-card`, `text-foreground`) — never inline hex |
| 28 | |
| 29 | 3. Design token usage: |
| 30 | - Colors: `text-foreground`, `bg-card`, `text-brand`, `text-muted-foreground`, `border-border` |
| 31 | - Shadows: `shadow-[var(--shadow-card)]`, `shadow-[var(--shadow-elevated)]` |
| 32 | - Radius: `rounded-md`, `rounded-lg`, `rounded-2xl` |
| 33 | - Spacing: multiples of 6px (`p-1.5`, `p-3`, `p-6`) |
| 34 | - Motion: `duration-[var(--duration-fast)]`, `ease-[var(--ease-default)]` |
| 35 | |
| 36 | 4. Typography rules: |
| 37 | - Display (36-48px): `leading-none tracking-[-0.02em]` |
| 38 | - Heading (18-24px): `leading-snug tracking-[-0.01em]` |
| 39 | - Body (14-17px): `leading-normal` (default tracking) |
| 40 | - Caption uppercase (10-13px): `tracking-[0.05em]` |
| 41 | - Use `size-*` shorthand instead of `w-* h-*` |
| 42 | - Use `ms-*/me-*` instead of `ml-*/mr-*` (logical properties) |
| 43 | |
| 44 | 5. Accessibility requirements: |
| 45 | - Minimum touch target: 44x44px (`min-h-11 min-w-11`) |
| 46 | - Support `aria-*` attributes passthrough |
| 47 | - Use `focus-visible:ring-2 focus-visible:ring-ring` for keyboard focus |
| 48 | - Respect `prefers-reduced-motion` for animations |
| 49 | |
| 50 | 6. Export the component as a named export (not default) |
| 51 | |
| 52 | 7. Place the file in the appropriate directory: |
| 53 | - Primitive/reusable → `src/components/ui/` |
| 54 | - Composed pattern → `src/components/patterns/` |