/ceh-ui-design:design-uifrom ceh-ui-design
Load this skill when making any frontend visual design decision: page or app-shell layout, navigation, hierarchy and spacing, a theme or brand, or a restyle. Trigger on "design the UI", "lay out this page", "make it look professional", "polish this UI".
Ships in ceh-ui-design. 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.
Deliver a UI that is modern, intuitive, and coherent. Done when the review pass at the end of the Rules passes.
Work in this order:
references/examples.md that a rule names.Two failure modes produce almost all bad UI, and this file targets both:
Answer these five questions and state the answers (one line each) so the choices are reviewable:
The user asks for options ("show me a few directions", "I can't picture it"), the design pass leaves
question 2 or 4 with two answers that both fit, or a flow's behavior is the open question: read
references/examples.md § Variants board and build the board before the real UI.
| Archetype | Use for | Structure |
|---|---|---|
| App shell | Data-dense tools, ≥6 nav destinations, daily-use apps | Fixed sidebar (nav) + scrollable content pane; topbar only for global search/account |
| Top-nav | Content and marketing sites, ≤5 destinations | Horizontal nav bar + full-width sections below |
| Focused flow | Auth, checkout, onboarding, wizards, single forms | Single centered column, minimal or no nav, one action per step |
| Dashboard grid | Metric overviews, monitoring | App shell + card grid; cards sized by importance, not uniformly |
| Document | Business plans, reports, specs read top to bottom | One reading column + contents rail; no hero, no primary action, no calls to action |
The surface kind (design-pass question 1) picks the archetype; the destination count only breaks a tie between two that both fit. A plan or report is a Document even when it ships as a web page: it is read, not sold or operated, so site furniture only gets between the reader and the text.
Do not mix archetypes on one surface. An app does not get a marketing hero; a login page does not get a sidebar. An in-page contents rail (Navigation) is the Document's own navigation, and a long page in another archetype may add one without becoming a second archetype.
max-width: 65ch). Never let body text span a wide viewport.p-[13px].Decide the mobile form of the archetype up front: sidebar collapses to a drawer or bottom tab bar (pick one, not both); top-nav collapses to a menu button; dashboard grids stack to one column in card-importance order; tables wrap their cells first, and only a table whose wrapped cells still cannot fit reflows to key-value cards or, last, scrolls inside its own container — never squash columns (see Humanized tables).
text-foreground → medium/medium/text-foreground →
small/regular/text-muted-foreground). More levels than three and the eye ranks nothing.h1) when the page has an identity beyond its nav label: an entity name
("Invoice #1042"), a scope ("Settings — Billing"), or content the user navigated into.h1 under it is noise. Either add value (count, date range, status) or drop it and
promote the content — in app shells, the eyebrow-above-panel header (Finishing recipes) is the
usual replacement.h1 per page, always.bg-sidebar-accent text-sidebar-accent-foreground and aria-current="page". A user should know
where they are from the nav alone.A long single document (report, spec, docs page) lists its own sections. Those links scroll, they do not navigate, so the frequency-order and max-7 rules above do not apply.
h2 sections or runs past ~3 screens.h2, and a top bar cannot carry
nested levels.h2 to h6 with its heading text, each
level indented one step further than its parent. Markdown renders all five levels, and a reader
jumps to a subsection as often as to a chapter.aria-current="location",
driven by an IntersectionObserver on the sections. The URL cannot say where the reader is.scroll-padding-top to its height so a jumped-to
heading never lands under it.background, card, muted, foreground and
border. The brand hue lives only in --primary, reserved for the primary action,
active/selected states, and focus — that scarcity is what makes it read as "the important thing".
shadcn's --secondary and --accent are neutral surfaces, never the brand.destructive. Use it when something is destructive or
failed. Success and warning take no colour of their own: the word carries them ("1 succeeded"),
with a badge variant and an icon. Never colour for decoration or variety.bg-background for the page, bg-sidebar for chrome (sidebar,
topbar), bg-card with a border or ring-1 ring-foreground/10 for cards, bg-muted for recessed
wells. In light mode --background and --card are both white, so a card is told apart by its
border, never by its fill. When chrome, toolbar, and content all share one surface they blend
into a single slab.--chart-1 to --chart-5 in order; do not invent chart colors.Every list, table, and detail view ships with all four states designed:
text-destructive.
Never a raw error string as the whole view.tabular-nums) so columns align.Match density to usage frequency: tools someone uses all day run dense (32–36px table rows,
text-xs to text-sm in tables, compact p-2 to p-3 padding); occasional consumer flows run
airy (py-8 and up between sections, larger type). Choose once per surface and apply consistently
— mixed density inside one view reads as broken.
The core rules make a UI correct; these recipes make it finished. Apply them on the first
build. In page order: the command dock (global state), section headers, then how data is displayed
(tables, lifecycle colors, monograms, stat blocks, diagrams), then controls and motion. Worked markup
for tables and diagrams lives in references/examples.md.
A recipe that applies only when its component is present lives there too. Read only the section named, when its condition holds:
references/examples.md § Command dock.references/examples.md §
Lifecycle stepper.references/examples.md § Identity monogram.references/examples.md §
Input as recessed well.PROJECTS · 2)
and a one-line muted caption explaining what the section is. The eyebrow is
text-xs font-medium uppercase tracking-wide text-muted-foreground.PROJECTS, QUEUED ORDERS, ROUND HISTORY) so the
pages read as one system. This replaces the redundant page title.Default table styling is the strongest primitive tell. Every data table gets this treatment:
Table sits alone in a card; its eyebrow header sits above the card.# column with a bare integer; outcomes
as words ("1 succeeded", and "2 failed" in text-destructive).Badge in one of its variants (default, secondary, outline,
destructive), with the lifecycle colour from its stage, never plain text and never a pill of your
own.tabular-nums; rows get a hover:bg-muted/50 wash and pointer; rows that navigate
are keyboard operable (tabindex="0" + Enter); the last row drops its separator.bg-muted on the row and
border-l-2 border-primary on its first cell.table-fixed so content cannot renegotiate column widths.wrap-anywhere, and drop shadcn's whitespace-nowrap on
a column that holds sentences), so a wide table fits its column. Give a Badge with long text
inside a cell whitespace-normal, because one long label that does not wrap forces the whole
table to scroll. Scroll the table's own container only when wrapped cells still cannot fit, as
with a wide table on a phone.text-3xl, tabular-nums)
over a tiny muted label, an eyebrow above the group.text-destructive on the value only when it carries a failure, and only when nonzero.Diagrams are Mermaid, each in a plain panel beside the text it illustrates. A diagram can render without an error and still be unreadable:
A ~~~ B) and give each direction LR, or Mermaid lays
them out in an arbitrary order.gantt chart with axisFormat %b %Y, set tickInterval 2month or wider, or the axis
labels overlap.xychart-beta's height under config.xyChart.height in the diagram's front
matter, or a chart with few bars renders far too tall.npx -p @mermaid-js/mermaid-cli mmdc -i <file>.md -o <out>.md, then look at the rendered
result, because overflowing labels and a diagram scaled down to unreadable text both pass the
CLI.On a page that renders Mermaid itself:
flowchart: { wrappingWidth: 200 } to mermaid.initialize. Mermaid 12 wraps node labels at
120px, so flowcharts render as tall, narrow boxes; a larger value scales wide diagrams down until
the text is too small to read.await document.fonts.ready before mermaid.run(), so labels are measured in the web font, not
the fallback.references/examples.md).<br/>, then turn the flow top to bottom, then split it at a
natural pause. Check after a split that no node or edge was lost. xychart-beta labels start at
14px and gantt labels at 10px, so check those two by eye.overflow: hidden card, or the diagram clips with no scrollbar.Exactly one small motion per interactive element, using Tailwind's duration-* and ease-*
utilities: affordances (the monogram →) slide in on hover/focus; state changes transition color
rather than snapping. Never animate more than one property group per element, and never decorate
static content with motion.
Motion explains a change: where an element came from, where it went, or that the app heard the input. Motion that explains nothing is decoration, and it gets cut.
duration-150 for hover, press, and color changes;
duration-200 for an element entering, expanding, or a menu opening; duration-300 for an
overlay, drawer, or route change. Nothing in product UI runs longer.ease-out, so it starts fast and
lands soft. Moving between two on-screen positions uses ease-in-out. An exit runs at the next
shorter duration than its enter, because the user has already moved on.Spinner after about 300 ms of waiting;
no entrance animation on page load, no staggered list reveals, no looping motion outside a
loading state.motion-reduce: override (motion-reduce:transition-none, motion-reduce:animate-none). Motion
driven from script (the Web Animations API, a motion library, a scroll handler) checks
matchMedia('(prefers-reduced-motion: reduce)') itself and swaps the movement for an instant
change or a fade.scrollbar-width: thin with scrollbar-color: var(--input) transparent — the OS-default chunky
scrollbar breaks any polished surface it appears on.Before calling the UI done, verify:
bg-primary, text-muted-foreground). A px value is
allowed for a fixed component dimension the scale does not cover (a stepper node, a monogram
tile, a content-column cap).theme.css and global.css installed whole, per Install, with the theme's
fonts; every interactive component from UI SDK, and every component UI SDK lacks from shadcn's
nova source with its source named to the user; a contents list where In-page contents calls for
one; for a Mermaid page, document.fonts.ready awaited and every diagram measured. A less-code
comment is no exemption: the theme is the shortcut, and a partial copy of it is the drift
Install warns about.The theme layer is UI SDK components for behaviour, styled the shadcn way: Tailwind utilities on shadcn's colour and font tokens, shaped like shadcn's nova style. The theme files hold only the tokens, so the whole app re-themes from one file.
Take the first that holds:
package.json depends on react and vite: the theme layer.vite.config, which is why 2 reads package.json for react.A calling skill that renders a page without a build links theme.css directly and reads its
variables in plain CSS, as its own steps say.
| Theme | Feel | Type | Palette |
|---|---|---|---|
| Meridian | Restrained mainstream SaaS, calm neutrals | Inter · JetBrains Mono | Cool-gray neutrals, blue primary |
| Tidewater | Editorial / boutique, serif headings | Fraunces · Hanken Grotesk · JetBrains Mono | Mint sidebar and muted surfaces, teal primary |
Ask the user to pick one unless they already named one. With no human to answer, take Meridian,
the neutral default, and say so. Both define the same shadcn tokens, so the choice is look and
feel: swap later by replacing theme.css.
<pm> below is bun: an existing project keeps its own package manager, read from its lockfile,
and bun is the default when it has none.
| Step | React on Vite |
|---|---|
| New project | bun create vite <name> --template react-ts --no-interactive, then bun install |
| Tailwind | bun add tailwindcss @tailwindcss/vite, and tailwindcss() from @tailwindcss/vite in vite.config.ts plugins |
| UI SDK | bun add @ui-sdk/react @ui-sdk/core (needs React 19). Do not import @ui-sdk/core/web.css: its default look fights the nova shapes |
| Global CSS, new project | copy references/global.css to src/global.css, change main.tsx's import './index.css' to import './global.css', delete src/index.css, and delete src/App.css and its import, so no template style fights the theme |
| Global CSS, existing project | keep the entry CSS. Add @import "./theme.css"; as its first line. When it has no @import "tailwindcss", add the rest of global.css below its first line. When it already has Tailwind, add only the @custom-variant, :root { --radius }, @theme and @layer base blocks it lacks. When it already holds shadcn's :root and .dark token blocks, delete them, because theme.css now defines those tokens |
| Theme | copy references/<theme>/theme.css beside the global CSS, as theme.css |
| Dark mode | toggle .dark on <html>, as shadcn's Vite ThemeProvider does |
global.css imports theme.css first, so the theme's web-font import lands above Tailwind, then
wires each token into a Tailwind colour (bg-primary, text-muted-foreground, bg-chart-1),
sets shadcn's radius scale, and gives body the background, foreground and font-sans, and h1
to h6 font-heading, so Tidewater's Fraunces headings need no class.
Our own edit on top of shadcn: nova's shapes, taken from shadcn's style-nova.css, for styling UI
SDK's parts. A copied shadcn file already carries them.
| Part | Shape |
|---|---|
| Button | h-8 rounded-lg px-2.5 text-sm font-medium; variants default (bg-primary text-primary-foreground, one per view), outline, secondary, ghost, destructive, link; size sm is h-7 |
| Input | h-8 rounded-lg border border-input bg-transparent px-2.5, no shadow |
| Focus | focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:border-ring on every focusable part |
| Card | rounded-xl bg-card ring-1 ring-foreground/10, 16px (p-4) padding, footer bg-muted/50 |
| Dialog | 16px padding, 384px wide (max-w-sm), overlay bg-black/10 |
| Menu | rounded-lg, items px-1.5 py-1 |
| Slider | track 4px (h-1), thumb 12px round (size-3 rounded-full) |
| Accordion | rows py-2.5 |
Style each UI SDK part through its data-slot and state attributes (data-pending,
data-checked, data-open, and the others its docs list), with Tailwind utilities on the tokens,
to the table's shapes.
@ui-sdk/react/<name>.
Its API and parts are in the installed node_modules/@ui-sdk/react/docs/llms.txt: read it there
rather than guessing.ui-sdk agent skill
guides building it on @ui-sdk/core. Its page gives npx skills@latest add vercel-labs/ui --skill ui-sdk; the bun form, bunx skills@latest add vercel-labs/ui --skill ui-sdk, is
unverified.The components UI SDK lacks, from shadcn's list (each triggers the notice above):
recharts), Code Block (shiki), Data Table
(@tanstack/react-table), Message Scroller and Questionnaire (@shadcn/react).Drawer and its tooltip
for Tooltip) and Trace (swap its collapsible for Collapsible). Direction is not offered: it
only provides right-to-left support to Radix and Base UI components, and this layer uses neither.UI SDK names some shadcn components differently: Context Menu and Dropdown Menu are Menu, Input
OTP is OTP Input, Radio Group is Radio, Sheet is Drawer, Sonner is Toast, Toggle Group is
Segmented Control.
shadcn's installer is never run. For each component:
https://ui.shadcn.com/r/styles/base-nova/<name>.json (lowercase, hyphenated: button-group).
Data Table and Typography have no registry item: copy them from their docs page,
https://ui.shadcn.com/docs/components/<name>.files[] from its content: a component to src/components/ui/<file>, a
hook to src/hooks/<file>.@/registry/base-nova/ui/<x> to
./<x>, @/registry/base-nova/hooks/<x> to ../../hooks/<x>, and IconPlaceholder to the
lucide-react icon its lucide="..." attribute names.registryDependencies entry: a component UI SDK has (button, input, textarea, separator,
sheet, tooltip, collapsible) is swapped for UI SDK's part, so a project never holds two Buttons.
One UI SDK lacks is copied the same way.dependencies, which can miss some
(class-variance-authority in Badge): cn always, the class-name helper every file imports.
For Attachment, Badge, Breadcrumb, Bubble, Button Group, Item, Marker or Sidebar also
@base-ui/react, which they import only for the helper behind their render prop. For
Attachment, Button Group, Code Block, Message Scroller, Questionnaire, Sidebar or Trace also
bun add -d shadcn and @import "shadcn/tailwind.css"; below @import "tailwindcss"; in the
global CSS: it holds the variants and utilities those files use (data-horizontal:,
scroll-fade-*, shimmer), and shadcn's CLI is never run.Accessibility comes with UI SDK's parts and the focus ring above. Keep semantic HTML (<button>,
<nav>, <main>) — see ceh-web-frontend:make-ui-accessible.
The built UI in the project's own files, with the chosen theme's theme.css and global.css
installed whole on React on Vite. Done when every item of the review pass holds. Open the final
reply with the five design-pass answers, one labeled line each (Surface, Layout, Primary action,
Theme, States), before any list of changes. Then one line "Not in UI SDK:" listing each component
taken from shadcn's source with where it came from ("shadcn's source" or "shadcn's source with
swapped imports"), or "none" when every component came from UI SDK; with no human present the line
still goes in the reply. Then name any review-pass item that does not hold, with the reason.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub cheneeheng/ceh-claude-code-library --plugin ceh-ui-design