/claude-mods:shadcn-opsfrom claude-mods
Manages shadcn/ui projects: init, add, view, search, docs, info, presets, migrate, eject, registry authoring, and admin dashboards. Runs a pinned CLI version for supply-chain safety.
Ships in claude-mods. 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; scripts run unread.
Why: shadcn/ui copies component source into your project through a CLI that ships
several releases a month. Its docs and official agent skill run that CLI as @latest,
unpinned and pre-approved. This skill runs a pinned CLI, treats every registry as code you
are about to install, and goes deep on the admin dashboards most projects build with it.
Versions verified 2026-11-10 against shadcn 4.23.0 (published 2026-10-27, no install scripts, Socket supply-chain score 97), ui.shadcn.com/docs and its llms.txt index. The pin and the other moving facts live in
assets/shadcn-facts.json;scripts/check-shadcn-facts.py --offlinekeeps this text in step with it, and--live(weekly) fails when npm or the CLI moves.
Never run shadcn@latest, a dist-tag (@canary, @beta), a range (@4), or an
unversioned pnpm dlx shadcn / yarn dlx shadcn. Resolve the runner once per project:
bash "<skill-dir>/scripts/shadcn-cmd.sh" # {"prefix":"pnpm exec shadcn","source":"project",...}
Then type that literal prefix in every command (pnpm exec shadcn info --json). This
skill writes it as $SHADCN; don't store it in a shell variable, which neither survives
between tool calls nor matches the pre-approved forms in allowed-tools. Order: the
project's own devDependency, then a global shadcn of the pin's major, then
<pm> dlx shadcn@<pin>. Exit 10 means run the frozen install first; exit 5 means nothing
pinned is available. Only info, docs, view, search and add --dry-run (flag
first) are pre-approved on a local or global runner: every write and every one-off
download asks first, by design.
Read the project before writing code: $SHADCN info --json nests its answers:
config.base, config.style, config.iconLibrary, config.aliases,
config.resolvedPaths, project.tailwindVersion, project.tailwindCss, project.rsc,
and components (installed). At a monorepo root it exits 1 with
"error": "monorepo_root" and the workspaces in targets: rerun with -c <workspace>.
Never assume the base, the icon library or the import alias.
Third-party registries are untrusted code. For anything not from @shadcn: view,
then add --dry-run <item>, then add --dry-run <item> --diff <file> (or --view <file>) per file, and read the dependencies, target paths and network calls before the
real add. Never pick a registry for the user.
add installs npm packages. New ones follow the supply-chain rule: a 7-day cooldown
and a behavioural scan (supply-chain-defense owns how), with the lockfile change committed
beside the component.
Installed components are the user's code. Update with add --dry-run <item> and
add --dry-run <item> --diff <file>, merge by hand, and use --overwrite only with the
user's OK, after a commit.
Ask, and commit first, before project-wide rewrites: apply (overwrites
components), init --force, migrate, add --all --overwrite, and eject, which is
irreversible.
Write for the project's base. Radix uses asChild; Base UI uses render (plus
nativeButton={false} for non-buttons); React Aria keeps its own API. Select,
ToggleGroup, Slider, Accordion and toasts differ too.
Compose, don't restyle. Existing components before markup, variants before classes,
semantic tokens (bg-primary, text-muted-foreground) never raw colours, gap-* not
space-y-*, items inside their groups, and a title on every Dialog, Sheet and Drawer.
Don't add the shadcn MCP server to Claude Code. It duplicates the CLI, runs in every
session, and its documented config is unpinned. If a user insists, use the pinned
project-scoped form in assets/mcp.json.example.
Verify every change: typecheck and build after an add, read the files it wrote
(imports, icon library, composition), and check keyboard and screen-reader basics;
a11y-ops runs full audits.
Resolve the CLI (rule 1).
Audit the project. It only reads files; it never runs the CLI, a package manager or git:
bash "<skill-dir>/scripts/run-python.sh" "<skill-dir>/scripts/shadcn-audit.py" .
bash "<skill-dir>/scripts/run-python.sh" "<skill-dir>/scripts/shadcn-audit.py" apps/web --json | jq '.data[]'
Exit 10 means findings (severity, id, file:line, message, fix; high first), 0 clean,
3 no components.json or not shadcn's (at a monorepo root it names the workspaces), 4
invalid JSON or a facts file missing a key.
$SHADCN info --json, then $SHADCN docs <component> and fetch the URLs it prints
before using a component whose API you haven't read in this session.
Find before you build: $SHADCN search @shadcn -q "<need>", and blocks before pages.
Add, read what was written, fix imports and icons, typecheck.
| Task | Read |
|---|---|
| CLI commands and flags, the runner, updating installed components, bumping the pin | cli-and-pinning.md |
What add changes, trust by source, reviewing an item, private registries and tokens | supply-chain-and-registries.md |
| components.json fields, styles, aliases, Tailwind v3 vs v4 | components-json.md |
Base UI vs Radix vs React Aria: asChild/render, Select, toasts, changing base | bases.md |
| Styling and composition rules, icons, which component for which need, chat UIs | composition-rules.md |
| Forms: Field, React Hook Form, TanStack Form, validation, server errors | forms.md |
| Data tables: TanStack Table v9, row actions, server-side paging, states | data-tables.md |
| Dashboard shell: blocks, sidebar, dialogs and sheets, toasts, page states, auth pages, dark mode | admin-layouts.md |
| Charts and KPI cards (Recharts v3) | charts.md |
Theme tokens, custom colours, radius, presets, apply | theming.md |
| A design system from a DESIGN.md or brand spec | design-systems.md |
migrate, Tailwind v3 to v4, React 19, eject | migrations-and-eject.md |
Monorepos (init --monorepo, two components.json files) | monorepo.md |
Publishing your own registry (registry.json, build, GitHub registries) | registry-authoring.md |
| The shadcn MCP server | mcp.md |
| Testing components: Vitest, Testing Library, jsdom gaps, real-browser runs | testing.md |
| Need | Use | Notes |
|---|---|---|
| The whole shell | $SHADCN add --dry-run dashboard-01, then adapt | or a sidebar-01..sidebar-16 block |
| Navigation | Sidebar (collapsible="icon", tooltips on items), Breadcrumb | Cmd/Ctrl+B toggles |
| Lists | the data-table guide (TanStack Table v9) on Table | server-side paging when data is large |
| Create and edit | Dialog + Field forms; Sheet for side panels | validate on client and server |
| Delete and other irreversible actions | AlertDialog naming the action | never straight from a menu item |
| Feedback | Base UI toast; Radix and React Aria Sonner | one <Toaster /> in the root layout |
| KPIs and trends | Card + Badge; Chart with min-h-* | colours from --chart-1..5 |
| Loading, empty, failed | Skeleton, Empty, Alert variant="destructive" | distinguish "none yet" from "no matches" |
| Login and sign-up | login-*, signup-* blocks | layout only; wire your auth |
| Theme | next-themes (Next.js) or the Vite ThemeProvider; .dark tokens | check contrast in both |
New projects start on Tailwind CSS v4 and React 19 with --base base (the default) unless
told otherwise; check an existing project's lines with the audit before writing code for it.
| Resource | Use |
|---|---|
scripts/shadcn-cmd.sh [--cwd DIR] [--prefix | --json] [--pm PM] [--no-dlx] | the pinned runner; default output is JSON {prefix, source, version, pm, pin, installed, workspace}; workspace is null, or the monorepo workspace that declares shadcn ("packages/ui"): run the CLI from there |
scripts/shadcn-audit.py [DIR] [--json] [--ignore ID] [--checks] | read-only audit; --checks lists the 20 check ids |
scripts/check-shadcn-facts.py --offline | after editing the facts, SKILL.md or a reference: pin, read-only allowed-tools, code blocks and prose agree |
scripts/check-shadcn-facts.py --live | weekly: npm (pin age, majors, install scripts, ecosystem majors) and the pinned CLI's --help; exit 7 is advisory |
scripts/run-python.sh | launches the .py scripts with the first real Python 3.8+ |
assets/shadcn-facts.json | the pin, cooldown and age policy, commands, migrations, bases, styles, ecosystem majors |
assets/mcp.json.example | a pinned, project-scoped .mcp.json for those who use the MCP server anyway |
The audit's checks: components.json shape (config-missing-field, style-unknown,
style-deprecated), files (css-missing, tailwind-config-missing, tailwind-mismatch;
v4 CSS with @config is fine), aliases resolved as the CLI does (alias-unresolved,
alias-missing), the CLI pin (shadcn-css-orphan, cli-range-open, cli-unlocked,
cli-old-major, and cli-not-installed: runs use a global or downloaded copy; low when a
sibling workspace declares shadcn), unpinned runs in package.json scripts, README,
AGENTS.md, CLAUDE.md and MCP configs read as JSONC (unpinned-cli, unpinned-mcp),
registries (third-party-registry, registry-insecure-url, registry-literal-secret in
headers, params, URL queries or URL passwords; values never printed), react-pre-19 and
monorepo-mismatch. --ignore <id> records a deliberate exception.
| Topic | Owner |
|---|---|
Tailwind itself: utilities, @theme, the v4 engine, plugins | tailwind-ops |
| React patterns, hooks, state, error boundaries | react-ops |
Next.js App Router: server/client boundary, Server Actions, caching, loading.tsx/error.tsx | nextjs-ops |
| Vetting a package: cooldown, Socket, IOCs, install scripts | supply-chain-defense |
| Lockfiles, package managers, workspaces, npx discipline | package-manager-ops |
| Accessibility audits and WCAG | a11y-ops |
| Figma designs to shadcn code (Figma MCP, Code Connect) | figma-ops |
| Test strategy: what deserves a test, mocking, flaky and slow suites | test-engineering |
| End-to-end and real-browser suites | playwright-ops |
shadcn --help for every command of 4.23.0, and the CLI source at the [email protected] tag
(info --json shape, init preset handling); npm registry metadata; Socket's score.init installs, including the shadcn devDependency) and the eject command.skills/shadcn/, MIT licence, last changed
2026-10-14), ported and adapted; each reference that draws on it says so.assets/mcp.json.example (opens in a new tab)assets/shadcn-facts.json (opens in a new tab)references/admin-layouts.md (opens in a new tab)references/bases.md (opens in a new tab)references/charts.md (opens in a new tab)references/cli-and-pinning.md (opens in a new tab)references/components-json.md (opens in a new tab)references/composition-rules.md (opens in a new tab)references/data-tables.md (opens in a new tab)references/design-systems.md (opens in a new tab)references/forms.md (opens in a new tab)references/mcp.md (opens in a new tab)references/migrations-and-eject.md (opens in a new tab)references/monorepo.md (opens in a new tab)references/registry-authoring.md (opens in a new tab)references/supply-chain-and-registries.md (opens in a new tab)references/testing.md (opens in a new tab)references/theming.md (opens in a new tab)scripts/check-shadcn-facts.py (opens in a new tab)scripts/run-python.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub 0xdarkmatter/claude-mods --plugin claude-mods116 skills in this plugin
/a11y-opsWeb accessibility end to end: WCAG 2.2 AA, EAA and ADA Title II obligations, audits (axe, pa11y, keyboard, screen reader), the common failures, accessibility statements, and server-rendered Craft CMS/Twig sites (Formie, CKEditor, multi-site lang). Use when asked about a11y, WCAG, EAA, EN 301 549, Section 508, VPAT, NVDA/VoiceOver, focus, skip links, ARIA, landmarks, alt text, form labels or errors, contrast, target size, or 'is my site accessible'./adr-opsAuthor, index, and lint Architecture Decision Records — append-only memory that recovers the WHY behind a system's shape. Triggers on: adr, architecture decision record, decision log, record this decision, supersede an adr, why was this decided, adr template, next adr number./api-design-opsOther plugins' skills for the same job