shadcn
Installation
SKILL.md
shadcn (support skill)
You were invoked to consult shadcn/ui — its registry, component docs, examples, or CLI — usually as step 1 of adding or wrapping a primitive. This is a support skill: it sources primitives and guidance, but every Koi rule in AGENTS.md wins when they conflict.
Non-negotiable overrides (from AGENTS.md)
- Wrap, don't expose. A shadcn primitive lands at
components/ui/[name].tsx(lowercase, CLI-generated). The DS component iscomponents/ui/Koi[Name].tsx, which imports it. Pages/features import onlyKoi[Name], never the raw primitive. - Tokens are sacred. Never add new tokens. Use existing token classes/vars (
bg-primary,var(--accent-brand), …). No arbitrarybg-[#hex]/p-[Npx]. If a token is missing, report it — don't invent it. - Tailwind v4. This repo is on Tailwind v4 (since 2026-06-08):
@import "tailwindcss"+@themeinapp/globals.css, and notailwind.config.ts. The shadcn CLI auto-detects this (npx shadcn@latest info→tailwindVersion v4,tailwindConfig -) and emits v4-compatible output. Token VALUES live in@theme(which generates thebg-au-*/text-au-*utilities), mirrored by--au-*vars in:rootforvar()use — two channels, same value. Still: don't add tokens (see "Tokens are sacred"); onlykoi-design-system-foundationmay. - Icons. Material Symbols Rounded via
components/ui/Icon.tsxis the default. Don't pulllucide-reactinto product code (it only ships inside CLI-generated primitives).
Flow
- Look up the primitive via the shadcn MCP (
search_items_in_registries,view_items_in_registries,get_item_examples_from_registries) — servershadcnin.mcp.json. - Install with
npx shadcn@latest add [name]→ primitive atcomponents/ui/[name].tsx. - Wrap in
components/ui/Koi[Name].tsx(tokens + brand variants +Iconslot). - Showcase at
app/koi/styleguide/components/koi-[name]/page.tsx+ register innavigation.ts.