Ensure all UI components strictly adhere to the project’s shadcn/ui configuration, preventing custom style bloat and ensuring consistency.
Active when:
components/ui directory or a components.json file.@/components/ui (or the configured alias) first.Button, Card) already exists, import it: import { Button } from "@/components/ui/button".<button className="..."> if the shadcn Button component exists.Accordion, Dialog, Sheet) is missing, DO NOT write it from scratch.npx shadcn@latest add [component-name] OR run it yourself if you have shell access.cn() utility (usually in @/lib/utils) when accepting a className prop.className={bg-red-500 ${className}}className={cn("bg-red-500", className)}lucide-react for icons, as it is the default standard for shadcn/ui.tailwind.config.js (e.g., bg-primary, text-muted-foreground) rather than hardcoded hex or arbitrary Tailwind colors (e.g., bg-blue-600).User: “Make me a red delete button.”
❌ Weak Response:
Creates a <button className="bg-red-500 text-white p-2 rounded">Delete</button>
✅ Shadcn Architect Response:
import { Button } from "@/components/ui/button"
export function DeleteButton() {
return (
<Button variant="destructive">
Delete
</Button>
)
}
(Note: Uses the existing ‘destructive’ variant instead of hardcoded red classes)