---
name: techboidesign-techboi-design-system-builder
title: techboi design system builder
kind: skill
description: >
  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.
updated: 2026-12-03
authored_by: Techboidesign
author_url: https://github.com/Techboidesign
source_url: https://github.com/Techboidesign/skill-pack/tree/HEAD/skills/techboi-design-system-builder
brought_by: kt
license: MIT
---

# 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.

```bash
# 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:
1. Copy `templates/eslint.config.mjs` (or `templates/.oxlintrc.json`) into the project root and add `"lint": "eslint ."` to `package.json`.
2. Replace the generated theme block in the global CSS with `templates/theme.css`, then set the brand (see `references/theming.md`).
3. Append `templates/AGENTS.md` to the project's `AGENTS.md` / `CLAUDE.md` so every agent runs the linter after changes.
4. 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
   ```
   (Run `pnpm dlx shadcn@latest search` or `view` to check names; some, like `date-picker`, are compositions documented on the site rather than a single add.)
5. Verify: `pnpm lint` passes, `pnpm dlx shadcn@latest info` shows 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.

1. **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`.
2. **Primitives**: the shadcn components, restyled only through tokens and `cva` variants inside `components/ui/*`.
3. **Composites** (product components built from primitives): page header, stat tile, filter bar, data table, empty state, command palette, settings row, etc. Live in `components/` (not `ui/`).
4. **Layouts**: app shell, dashboard, list/detail, settings, auth, onboarding, error. See `references/layouts.md`.
5. **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 `style` and no `<style>` tags (exception: dynamic values like a chart width or a CSS variable set from data, which go through `style={{ "--x": v }}` and a token-based class; document the exception with a lint disable comment and reason).
- ⚙ Classes must be static strings. Use `cva` variants or `cn()` with full class names, never `` `bg-${color}` ``.
- Every color token comes in a pair: `--x` and `--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 `className` to change its look (color, radius, padding). Add a variant in `components/ui/<name>.tsx`. `className` from 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/>…`) and `asChild`/`render` slots.
- 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 `AlertDialog` with 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"` or `ghost`.
- 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-visible` ring on everything focusable (`ring-ring`). Never `outline-none` without 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 a `Tooltip` with the same text).
- Status is never color-only: pair color with an icon or label.
- Respect `prefers-reduced-motion`; respect `prefers-color-scheme` as 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-mono` and `tabular-nums`.
- Empty, loading and error states are designed for every list, table and chart. No blank screens.

## 4. Done means

- `pnpm lint` passes 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.md` passes 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.
