paste this link into your ai. it will know what to do.
Build, extend or audit a product-first, white-label design system on shadcn/ui + Tailwind v4 - foundations (color, type, spacing, layout, breakpoints, grid strokes, radius, borders, shadows, motion, icons, imagery & logo), product components (app shell, sidebar, modals, data tables, dashboards) and the rules that keep it consistent. Use when the user says "design system", "design system builder", "foundations", "tokens", "theme", "white-label", "rebrand", "app shell", "dashboard layout", or starts a new product UI and wants it built on a system rather than one-off styles.
Design System Builder
A master template for a product-first, white-label design system. Generic: no brand is baked in. Every project starts from the same structure, then gets painted with its own brand through tokens only.
Stack: shadcn/ui (open code, copied into the repo) on Tailwind CSS v4, with @shadcn/lint enforcing the rules. Primitives come from Radix, Base UI or React Aria via shadcn init --base.
When to read what
| You are doing | Read |
|---|---|
| Starting a project, or adopting the system in an existing one | Section 1 below, then references/foundations.md |
| Defining or changing tokens, brand, dark mode | references/theming.md + templates/theme.css |
| Building any screen or component | references/components.md |
| Building the app shell, sidebar, dashboard, settings, list/detail | references/layouts.md |
| Reviewing or auditing UI | Section 3 (rules) + references/checklist.md |
| Writing the system's own docs/gallery | references/documentation.md |
1. Setup (required, in this order)
Do not skip these. They are what make the system enforceable instead of a style guide nobody follows.
# 1. shadcn/ui. Template: next | vite | start | react-router | laravel | astro
pnpm dlx shadcn@latest init -t <framework>
# optional: --base radix|base|aria (primitive library) --rtl --monorepo
# 2. The shadcn agent skill (reads components.json, runs `shadcn info --json`,
# steers agents to shadcn docs/search before generating code)
pnpm dlx skills add shadcn/ui
# 3. The design-system linter: https://github.com/shadcn-ui/lint
pnpm add -D @shadcn/lint eslint @typescript-eslint/parser # ESLint 9.30+, Node 20.19+
# or: pnpm add -D @shadcn/lint oxlint # Oxlint 1.80+Then:
- Copy
templates/eslint.config.mjs(ortemplates/.oxlintrc.json) into the project root and add"lint": "eslint ."topackage.json. - Replace the generated theme block in the global CSS with
templates/theme.css, then set the brand (seereferences/theming.md). - Append
templates/AGENTS.mdto the project'sAGENTS.md/CLAUDE.mdso every agent runs the linter after changes. - Install the base product kit in one go: ``
bash pnpm dlx shadcn@latest add sidebar breadcrumb button button-group input textarea select \ checkbox radio-group switch slider label field form dialog sheet drawer popover tooltip \ dropdown-menu context-menu command tabs table card badge avatar skeleton progress \ sonner alert alert-dialog separator scroll-area collapsible accordion toggle toggle-group \ calendar date-picker chart empty kbd spinner pagination hover-card resizable`(Runpnpm dlx shadcn@latest searchorviewto check names; some, likedate-picker`, are compositions documented on the site rather than a single add.) - Verify:
pnpm lintpasses,pnpm dlx shadcn@latest infoshows the expected base, icon library and aliases.
2. Build order
Always foundations → primitives → composites → layouts → pages. A layer may only use the layers before it.
- Foundations (tokens only, no components): color, typography, spacing, layout, breakpoints, grid strokes, radius, borders, shadows/elevation, z-index, motion, iconography, imagery & logo, focus. See
references/foundations.md. - Primitives: the shadcn components, restyled only through tokens and
cvavariants insidecomponents/ui/*. - Composites (product components built from primitives): page header, stat tile, filter bar, data table, empty state, command palette, settings row, etc. Live in
components/(notui/). - Layouts: app shell, dashboard, list/detail, settings, auth, onboarding, error. See
references/layouts.md. - Pages: assemble layouts + composites. Pages contain no styling decisions, only composition.
Out of scope for this skill (add per project if needed): marketing heroes, landing sections, pricing pages, decorative/interactive backgrounds, video/media players.
3. Rules
Hard rules. @shadcn/lint enforces the ones marked ⚙; the rest are review rules.
Tokens
- ⚙ No raw palette colors in product code (
bg-zinc-900,text-red-500, hex, rgb). Use semantic tokens:bg-background,text-muted-foreground,border-border,bg-destructive. - ⚙ No arbitrary values (
p-[13px],w-[372px],text-[15px]). Missing a value? Add a token, don't inline it. - ⚙ No inline
styleand no<style>tags (exception: dynamic values like a chart width or a CSS variable set from data, which go throughstyle={{ "--x": v }}and a token-based class; document the exception with a lint disable comment and reason). - ⚙ Classes must be static strings. Use
cvavariants orcn()with full class names, never `bg-${color}`. - Every color token comes in a pair:
--xand--x-foreground. Never put text on a surface without using its paired foreground. - Brand lives in one place: the
:root/.dark/[data-brand]blocks of the theme file. A rebrand must be a diff to that file only.
Components
- ⚙ Don't restyle a component from outside via
classNameto change its look (color, radius, padding). Add a variant incomponents/ui/<name>.tsx.classNamefrom outside is for layout only (margin, grid placement, width). - Check shadcn first (
shadcn search,shadcn docs, the shadcn skill) before writing a new component. Composition beats creation. - One component per concern. No "god" components with 15 boolean props; prefer composition (
<Card><CardHeader/>…) andasChild/renderslots. - Every interactive component has all states: default, hover, focus-visible, active, disabled, loading (if async), selected/checked, invalid, and read-only where relevant.
- Destructive actions use
AlertDialogwith the action named in the button ("Delete project"), never "OK".
Layout
- Spacing only from the 4px scale. Gaps between siblings via
gap-*on the parent, not margins on children. - Content width is a token (
max-w-(--container-content)etc.), never a magic number. - One primary button per view region. Secondary actions are
variant="outline"orghost. - Dense by default for product UI (h-8/h-9 controls, text-sm body). Comfortable density is a per-surface choice, not per-component.
Accessibility (never cut)
- WCAG 2.2 AA: 4.5:1 body text, 3:1 large text and UI boundaries/focus indicators. Check both themes.
- Visible
focus-visiblering on everything focusable (ring-ring). Neveroutline-nonewithout a replacement. - Hit targets ≥ 24×24 CSS px (WCAG 2.5.8); aim for 32+ in dense UI, 44 on touch.
- Icon-only buttons have
aria-label(and aTooltipwith the same text). - Status is never color-only: pair color with an icon or label.
- Respect
prefers-reduced-motion; respectprefers-color-schemeas the default theme. - Keyboard: every flow works without a mouse. Overlays trap focus and restore it on close (shadcn primitives do this; don't break it).
Content
- Sentence case for all UI text. Buttons are verbs ("Create project"), not "Submit".
- Numbers, IDs, timestamps and code use
font-monoandtabular-nums. - Empty, loading and error states are designed for every list, table and chart. No blank screens.
4. Done means
pnpm lintpasses with zero errors and no new disables without a reason.- Both themes checked, plus at least one alternate brand (
[data-brand="demo"]) to prove white-labeling works. - Checked at 375, 768, 1280 and 1536 px.
references/checklist.mdpasses for every new component.
5. Influences and credits
Built on and borrowing from: shadcn (shadcn/ui, @shadcn/lint, the open-code component model), Radix UI / WorkOS, Base UI (MUI team), React Aria (Adobe), Tailwind Labs (Tailwind CSS v4, Refactoring UI by Adam Wathan & Steve Schoger), Vercel Geist, Linear's product UI, GitHub Primer, Atlassian Design System tokens, IBM Carbon (product density, data tables), Material 3 (token tiers, state layers), Radix Colors (12-step scales), Open Props, Every Layout (Heydon Pickering & Andy Bell), the W3C Design Tokens Community Group format, and icon sets Lucide, Heroicons, Tabler, Phosphor. Credit the ones a project actually uses in its own docs.
keep it where your ai can reach it.
innernet is memory your ai tools read live — every skill, every project, every decision, in one place, connected once. save this skill to yours, or publish one of your own as a link like this.