Shadcn

From tdimino/claude-code-minoan · View interactive version

Shadcn is an AI agent skill from the GitHub repository tdimino/claude-code-minoan. Install, customize, and compose shadcn/ui components with design-system awareness. Covers CLI v4, custom registries, Tailwind v4 OKLCH theming, components.json, presets, and monorepo setup. Pairs with minoan-frontend-design for creative direction. Triggers on shadcn, install component, shadcn theme,

How to use this skill

Skill file

Install, customize, and compose shadcn/ui components with design-system awareness.

shadcn is a code distribution system — components are source files you own, not packages.

Workflow

Every shadcn interaction follows four steps: Orient, Install, Refine, Verify.

1. Orient

Read project state before any CLI operation. Run npx shadcn@latest info to get framework, installed components, aliases, icon library, and base library. Read components.json directly for theme config. Never guess configuration.

2. Install

Add components via CLI, never by copying from docs manually.

npx shadcn@latest add button card dialog    # Multiple at once
npx shadcn@latest add @namespace/component  # From custom registry
npx shadcn@latest add --dry-run button      # Preview before writing

Before re-adding an existing component, run npx shadcn@latest diff <name> to see upstream changes. Commit local customizations first — add overwrites files.

3. Refine

This is where craft lives. After every add, audit the component against the project's design system:

When minoan-frontend-design is active, translate its creative direction into shadcn theme variables and component customizations.

4. Verify

Build the project to catch type errors. Visually inspect the component in context. Check dark mode. Check mobile.

Tailwind v4 Contract

shadcn v4 uses OKLCH color space with @theme inline — not HSL, not tailwind.config.ts.

:root {
  --primary: oklch(0.205 0.03 264.05);
  --primary-foreground: oklch(0.985 0 0);
}
@theme inline {
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
}

Leave tailwind.config blank in components.json for v4 projects. Use data-slot attributes for targeted styling. Use React.ComponentProps<> — forwardRef is removed.

Theming

Colors follow background + foreground pairs. The background suffix is omitted for the primary role:

--primary (background), --primary-foreground (text on that background).

Extend with custom semantic tokens by adding both the CSS variable and the @theme inline mapping:

:root { --warning: oklch(0.84 0.16 84); --warning-foreground: oklch(0.14 0.04 84); }
@theme inline { --color-warning: var(--warning); --color-warning-foreground: var(--warning-foreground); }

Use cn() (clsx + tailwind-merge) for all class name composition.

References

Consult references/ on demand:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.