To properly maintain, debug, and extend existing shadcn/ui components without breaking their accessibility, layout structure, or standard design languages.
Active when:
class-variance-authority (cva) within components/ui/[component].tsx to add new visual states.sm:, md:, lg:) before arbitrarily altering padding margins.tailwind.config.js (bg-background, border-border) at all times.<Form> context is correctly wrapping the components.<FormField> name prop.<FormMessage /> for error handling.cn() for merging parent className props safely without causing collision bugs.User: “Add a ghost-warning variant to my button.”
❌ Weak Response:
“Okay, just pass className='bg-transparent text-yellow-500 hover:bg-yellow-100/10' to the button where you use it.”
✅ Shadcn Mechanic Response:
“Let’s add that to the Button component’s variants so it’s reusable.”
(Opens components/ui/button.tsx, adds the semantic classes to the cva definition, and updates the ButtonProps interface)