plugins/frontend/skills/shadcn-ui/SKILL.md
Expert guidance for building with shadcn/ui -- component composition, registry system, form patterns, data tables, sidebar navigation, theming, and Tailwind v4 migration. Trigger when working with shadcn/ui components, adding shadcn to a project, composing complex UI from shadcn primitives, or customizing shadcn themes. Also trigger on mentions of "shadcn", "shadcn/ui", "shadcn components", "shadcn registry", or "shadcn blocks". TRIGGER WHEN: working with shadcn/ui components, adding shadcn to a project, composing complex UI from shadcn primitives, or customizing shadcn themes DO NOT TRIGGER WHEN: the task is outside the specific scope of this component.
npx skillsauth add acaprino/alfio-claude-plugins shadcn-uiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guidance for building production UIs with shadcn/ui. Covers component composition, advanced patterns, registry authoring, theming, and integration with the broader frontend ecosystem.
Docs: https://ui.shadcn.com/docs
shadcn/ui is NOT a component library -- it is a collection of beautifully designed, accessible components you copy into your project and own. Five pillars:
data-slot attributes and structured props for LLM toolingnpx shadcn@latest init)npx shadcn@latest add)This skill works alongside the other frontend skills. Route to them when appropriate:
| Need | Route to | |------|----------| | CSS architecture, modern CSS features, responsive patterns | frontend-design | | Page layout composition, grid systems, breakpoint strategy | frontend-layout agent | | Animations, micro-interactions, visual polish | frontend-design agent | | UX flows, design tokens, component hierarchy | frontend-design agent | | Distinctive visual identity, avoiding generic AI aesthetics | frontend-css skill | | React 19 patterns, Server Components, performance | react-performance-optimizer agent |
This skill handles shadcn-specific concerns: which components to use, how to compose them, registry patterns, form/table/sidebar architecture, and shadcn theming.
This skill contains reference patterns for the most complex components (Data Table, Form, Sidebar, Dialog). For any other component's API, props, or usage -- spawn a quick-searcher agent to fetch the docs in real time.
All component docs follow a predictable URL scheme:
| Resource | URL pattern |
|----------|-------------|
| Component docs | https://ui.shadcn.com/docs/components/{name} |
| Form integrations | https://ui.shadcn.com/docs/forms/{library} |
| Blocks | https://ui.shadcn.com/blocks |
| Registry | https://ui.shadcn.com/docs/registry |
| Themes | https://ui.shadcn.com/themes |
| CLI reference | https://ui.shadcn.com/docs/cli |
| Tailwind v4 | https://ui.shadcn.com/docs/tailwind-v4 |
| Changelog | https://ui.shadcn.com/docs/changelog |
When you need API details for a specific component (e.g., Combobox, Toast, Sheet):
Spawn a research:quick-searcher agent with this prompt template:
Fetch https://ui.shadcn.com/docs/components/{component-name} and extract:
- Sub-components and their props
- Required accessibility attributes
- Install command
- Key usage patterns and code examples
Return structured findings.
For Radix primitive API details (inherited by shadcn), fetch:
https://www.radix-ui.com/primitives/docs/components/{component-name}
For TanStack Table API (used by Data Table), fetch:
https://tanstack.com/table/latest/docs/introduction
For quick reference when choosing components:
| Category | Components | |----------|------------| | Layout | Sidebar, Resizable, Collapsible, Separator, Aspect Ratio | | Overlay | Dialog, Sheet, Drawer, Alert Dialog, Popover, Tooltip, Hover Card | | Form | Input, Textarea, Select, Checkbox, Radio Group, Switch, Slider, Toggle, Toggle Group, Date Picker, Combobox | | Data Display | Table, Data Table, Card, Badge, Avatar, Calendar | | Feedback | Alert, Toast (Sonner), Progress, Skeleton | | Navigation | Navigation Menu, Breadcrumb, Pagination, Tabs, Command, Menubar, Dropdown Menu, Context Menu | | Typography | Label, Separator |
npx shadcn@latest init
# Choose: New York style (default, "default" style is deprecated)
# Choose: Tailwind v4 + React 19 (current default)
npx shadcn@latest add button dialog form sidebar data-table
# Or add a block:
npx shadcn@latest add dashboard-01
shadcn add --dry-run dialog # preview changes without writing
shadcn add --diff dialog # show diff of what would change
shadcn info # show installed components, framework, CSS vars
shadcn docs dialog # fetch component docs from CLI
shadcn init --template next # scaffold with framework template
shadcn components are composable primitives. Build complex UI by nesting them.
<Dialog>
<DialogTrigger asChild>
<Button variant="outline">Edit Profile</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>Update your information.</DialogDescription>
</DialogHeader>
{/* your content */}
</DialogContent>
</Dialog>
Use asChild to delegate rendering to a child element -- avoids extra DOM nodes and lets you use router Links, custom buttons, etc.
<DialogTrigger asChild>
<Link href="/settings">Open Settings</Link>
</DialogTrigger>
import { cn } from "@/lib/utils"
<div className={cn(
"rounded-lg border p-4",
isActive && "border-primary bg-primary/5",
className
)} />
import { cva, type VariantProps } from "class-variance-authority"
const badgeVariants = cva("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs", {
variants: {
variant: {
default: "bg-primary text-primary-foreground",
destructive: "bg-destructive text-destructive-foreground",
outline: "border text-foreground",
},
},
defaultVariants: { variant: "default" },
})
3-file architecture with TanStack Table. See references/advanced-patterns.md for full column definition, sorting, filtering, pagination, and row selection patterns.
columns.tsx - column definitions (ColumnDef<TData>[])data-table.tsx - table wrapper with useReactTablepage.tsx - server component for data fetchingReact Hook Form + Zod resolver. See references/advanced-patterns.md for field patterns, dynamic arrays, and validation modes.
const form = useForm<z.infer<typeof schema>>({
resolver: zodResolver(schema),
defaultValues: { title: "" }
})
Provider-based with SidebarProvider. Supports collapsible="icon" and collapsible="offcanvas". See references/advanced-patterns.md for nested navigation, mobile responsive, and useSidebar() hook.
New projects use OKLCH for perceptual color uniformity. Colors defined as CSS variables in globals.css:
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
/* ... */
}
Toggle via class on <html>. All shadcn components respect dark: variants automatically.
globals.css for global theme changescn() for per-instance overridesdata-slot attributes for targeted CSS overrides without class specificity fightsSee references/migration-guide.md for the step-by-step migration from Tailwind v3 to v4, including:
npx @tailwindcss/upgrade@next codemodtailwindcss-animate to tw-animate-css)@theme inlineforwardRef removal for React 19data-slot adoptionBuild and distribute your own component sets. See references/registry-guide.md for:
registry.json schema and item typesregistry:base for full design systemsSee references/pitfalls.md for detailed problems and fixes:
shadcn add to refresh componentsforwardRef breakage in React 19"use client""use client" (they reference React components)"use client" boundary as low in the tree as possibledevelopment
Quality gates for multi-reviewer code review pipelines: adversarial verification panel, completeness critic, reviewer pipeline conventions, and the context sharing pattern for parallel reviewers. TRIGGER WHEN: running /senior-review:team-review quality gates; running /senior-review:code-review Steps 4b/4c (adversarial verification and completeness check); consolidating or deduplicating findings from multiple parallel reviewers. DO NOT TRIGGER WHEN: single-reviewer style review without a consolidation phase, or generic team coordination (the upstream agent-teams skills cover that).
development
Knowledge base for pure-architecture decisions on when to unify duplicated logic into a shared abstraction versus leave it duplicated. Covers the canonical theory (Rule of Three, DRY/WET/AHA, Wrong Abstraction, Locality of Behaviour, Bounded Contexts, Tidy First options framing, CUPID vs SOLID), 12 essential-duplication patterns that justify unification, 12 wrong-abstraction patterns that justify inlining or decomposition, an operational decision frame, and a verified reading list. TRIGGER WHEN: the user is making an architectural decision about whether to centralize, extract, or remove a layer; reviewing an abstraction for premature generality; auditing scattered cross-cutting concerns; spawned by the abstraction-architect agent during /abstraction-architect:audit or as the Abstraction dimension of /senior-review:team-review or /senior-review:code-review; the user asks "should I extract this into a service" / "is this DRY enough" / "is this wrong abstraction". DO NOT TRIGGER WHEN: the task is code formatting and readability cleanup (use clean-code:clean-code), Python-specific refactoring with metrics (use python-development:python-refactor), generic dead-code removal (use senior-review:cleanup-dead-code), security review (use senior-review:security-auditor), or pure pattern-consistency review without an architecture lens (use senior-review:code-auditor).
development
Unified web frontend knowledge base covering CSS architecture, UX psychology, UI components, distinctive aesthetics, and interface design generation. TRIGGER WHEN: working on web styling, design systems, component decisions, responsive strategy, distinctive frontend aesthetics, or exploring multiple interface designs. DO NOT TRIGGER WHEN: the task is purely backend or unrelated to web frontend.
development
Stripe payments knowledge base - API patterns, checkout optimization, subscription lifecycle, pricing strategies, webhook reliability, Firebase integration, cost analysis, and revenue modeling. Loaded by stripe-integrator and revenue-optimizer agents; also consumable directly when the user asks for Stripe-specific patterns without needing an agent. TRIGGER WHEN: working with Stripe API (Payment Intents, Customers, Subscriptions, Checkout Sessions, Connect, webhooks, tax, usage-based billing), pricing strategy, or revenue modeling. DO NOT TRIGGER WHEN: payment work is non-Stripe (PayPal, Square, crypto) or the task is generic e-commerce unrelated to payments.