/shadcn:shadcn-uifrom shadcn
MUST load BEFORE adding, composing, theming, or installing shadcn/ui components, and BEFORE any mcp__plugin_shadcn_shadcn__* tool call. Trigger on ANY of: "shadcn", "shadcn/ui", "components.json", "@shadcn", "@acme", "@tailark", "registry", "namespaced registry", "private registry", "add a button/dialog/card/form/sheet/sidebar", "build a login form", "build a dashboard", "build a settings page", "landing page with shadcn", "switch preset", "--preset", "OKLCH", "CSS variables theming", "dark mode tokens", "shadcn init/add/search/view/docs/diff/info/build", "registry.json", "publish a registry", "FieldGroup", "ToggleGroup", "radix base". Without this skill, output uses wrong base APIs, invents component names, skips registry resolution, ignores the project's aliases and icon library, and misuses theming tokens.
Ships in shadcn. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill to install, compose, theme, and customize shadcn/ui components in a real project, and to author or consume custom registries through the shadcn MCP server.
Parse the user's intent from: $ARGUMENTS
Typical intents:
button, dialog, form, sidebar, …)@acme/hero, @tailark/...)registry.json, shadcn build)Detect the project. Confirm a components.json exists at the project root. If missing, the project is not shadcn-initialized — offer to run npx shadcn@latest init (do not run without confirmation; it edits Tailwind config and global CSS).
Load project context first, every time. Before generating component code, read project state:
npx shadcn@latest info --json (or call mcp__plugin_shadcn_shadcn__get_project_registries for the registry slice).radix vs base), icon library, installed components, configured registries.Discover before writing code. Never invent component names or APIs.
mcp__plugin_shadcn_shadcn__list_items_in_registries or search_items_in_registries.view_items_in_registries.get_item_examples_from_registries.npx shadcn@latest docs <component>.Install the right way. Resolve the install command via get_add_command_for_items (it respects the project's package manager and registries), then run it. Examples:
npx shadcn@latest add button dialog cardnpx shadcn@latest add @acme/hero @acme/features--yes only when the user has confirmed overwrites.--dry-run first when overwriting existing files.Compose using shadcn rules.
Field primitives — Field, FieldGroup, FieldLabel, FieldDescription, FieldError — and integrate with react-hook-form + zod when the project already uses them.ToggleGroup over rolled-your-own button groups.bg-background, text-foreground, border, muted, accent, destructive, ring) — never raw Tailwind palette colors for UI chrome.radix vs base change the underlying primitives and prop surface — do not mix.lucide-react, @radix-ui/react-icons, etc.) discovered via info.components.json (@/components/ui/..., @/lib/utils, etc.) — never hardcode src/....Theming.
@theme block; v3 projects use tailwind.config.{ts,js}. Detect from info..dark { ... }); add overrides only inside the dark block.--preset), use npx shadcn@latest add --preset <code> and let it rewrite tokens.--radius) cascaded by rounded-lg/md/sm utilities — change once, not per-component.Registry authoring (when the user wants to publish/share components).
registry.json declares name, homepage, and an items[] array. Each item: name, type (registry:ui | registry:block | registry:hook | registry:lib | registry:theme | registry:style), files[] (each with path, type, optional target), dependencies[], devDependencies[], registryDependencies[], optional cssVars and tailwind.npx shadcn@latest build → emits public/r/<item>.json.components.json under registries as "@ns": "https://host/r/{name}.json" (or an object with headers for private registries)..env.local via ${VAR} substitution in headers.MCP setup help. If the user asks to wire shadcn MCP into a client:
npx shadcn@latest mcp init --client claude writes .mcp.json. (This plugin already provides the same .mcp.json config — do not duplicate if installed via this plugin.)npx shadcn@latest mcp init --client cursor writes .cursor/mcp.json; user then enables it in settings.npx shadcn@latest mcp init --client vscode writes .vscode/mcp.json; user clicks Start.npx shadcn@latest mcp init --client codex, then manually append to ~/.codex/config.toml:
[mcp_servers.shadcn]
command = "npx"
args = ["shadcn@latest", "mcp"]
npx shadcn@latest mcp init --client opencode then restart.Verify. After installation:
aliases.ui path.npx shadcn@latest diff if updating existing components.mcp__plugin_shadcn_shadcn__get_audit_checklist to surface follow-ups (deps to install, tokens to wire, providers to mount).Always include:
@/components/ui/...).bg-blue-500 style raw colors in UI chrome — use semantic tokens.radix; check info first.components/ui/* lightly — they are owned by shadcn and will be overwritten on update unless the user accepts the divergence (use diff to track).components.json.components.json as ground truth; if a value seems off, ask the user before mutating it.Do:
info before generating code.Field* and ToggleGroup patterns.Don't:
init silently — it rewrites globals and Tailwind config.radix and base APIs..env.local or registry tokens.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub lespaceman/athena-workflow-marketplace --plugin shadcn