--- description: Scaffold shadcn/ui components with distinctive design, accessibility, and animation best practices built-in. Prevents generic aesthetics from the start. --- # Component Generator Command Generate shadcn/ui components with distinctive design patterns, deep customization, accessibility features, and engaging animations built-in. Prevents generic "AI aesthetic" by providing branded templates from the start. ## Introduction Senior Component Architect with expertise in shadcn/ui, React 19 with hooks, Tailwind CSS, accessibility, and distinctive design patterns **Design Philosophy**: Start with distinctive, accessible, engaging components rather than fixing generic patterns later. ## Prerequisites - Tanstack Start project with Vue 3 - shadcn/ui component library installed - Tailwind 4 CSS configured with custom theme (or will be created) - (Optional) shadcn/ui MCP server for component API validation - (Optional) Existing `composables/useDesignSystem.ts` for consistent patterns ## Command Usage ```bash /es-component [options] ``` ### Arguments: - ``: Component type (button, card, form, modal, hero, navigation, etc.) - ``: Component name in PascalCase (e.g., `PrimaryButton`, `FeatureCard`) - `[options]`: Optional flags: - `--theme `: Theme variant - `--animations `: Animation complexity - `--accessible`: Include enhanced accessibility features (default: true) - `--output `: Custom output path (default: `components/`) ### Examples: ```bash # Generate primary button component /es-component button PrimaryButton # Generate feature card with rich animations /es-component card FeatureCard --animations rich # Generate hero section with custom theme /es-component hero LandingHero --theme custom # Generate modal with custom output path /es-component modal ConfirmDialog --output components/dialogs/ ``` ## Main Tasks ### 1. Project Context Analysis First, I need to understand existing design system, theme configuration, and component patterns. This ensures generated components match existing project aesthetics. #### Immediate Actions: - [ ] Check for `tailwind.config.ts` and extract custom theme (fonts, colors, animations) - [ ] Check for `composables/useDesignSystem.ts` and extract existing variants - [ ] Check for `app.config.ts` and extract shadcn/ui global customization - [ ] Scan existing components for naming conventions and structure patterns - [ ] Determine if design system is established or needs creation #### Output Summary: 📦 **Project Context**: - Custom fonts: Found/Not Found (Inter ❌ or Custom ✅) - Brand colors: Found/Not Found (Purple ❌ or Custom ✅) - Design system composable: Exists/Missing - Component count: X components found - Naming convention: Detected pattern ### 2. Validate Component Type with MCP (if available) If shadcn/ui MCP is available, validate that the requested component type exists and get accurate props/slots before generating. #### MCP Validation: If shadcn/ui MCP available: 1. Query `shadcn-ui.list_components()` to get available components 2. Map component type to shadcn/ui component: - `button` → `Button` - `card` → `Card` - `modal` → `Dialog` - `form` → `UForm` + `Input`/`UTextarea`/etc. - `hero` → Custom layout with `Button`, `Card` - `navigation` → `UTabs` or custom 3. Query `shadcn-ui.get_component("Button")` for accurate props 4. Use real props in generated component (prevent hallucination) If MCP not available: - Use documented shadcn/ui API - Include comment: "// TODO: Verify props with shadcn/ui docs" ### 3. Generate Component with Design Best Practices Generate React component with: 1. Distinctive typography (custom fonts, not Inter) 2. Brand colors (custom palette, not purple) 3. Rich animations (transitions, micro-interactions) 4. Deep shadcn/ui customization (ui prop + utilities) 5. Accessibility features (ARIA, keyboard, focus states) 6. Responsive design #### Component Templates by Type: #### Button Component ```tsx