Design & UI
Make interfaces that look intentional and premium, not template-generic. This is
the single biggest quality lever in the app builder. Apply it to DOM / overlay
UI — pages, chrome, HUD, menus, forms. (For a 3D game's gameplay canvas, see
the building-games skill; this skill governs the DOM UI layered over it.)
Read references/ for depth (loaded on demand — don't inline it all):
references/refined-ui.md — the full product-chrome/overlay design system.
references/typography.md — type scale, pairing, rhythm.
references/surfaces.md — elevation, borders, shadows, layering.
references/animations.md — motion, easing, transitions.
references/performance.md — keep UI smooth (60fps, no jank).
1. Design-system-first (do this before styling anything)
Define the system once, then compose from it. Never sprinkle ad-hoc values.
- Tokens in CSS (Tailwind v4 is CSS-first). Put the palette, radii, and fonts
in
src/styles.css under @theme as CSS variables; consume them as Tailwind
utilities. One source of truth.@import "tailwindcss";
@theme {
--color-bg: #0b0b0f; --color-surface: #16161d;
--color-fg: #e7e7ea; --color-muted: #a0a0ab;
--color-primary: #14b8a6; --color-border: #26262f;
--radius: 0.75rem; --font-sans: "Inter", system-ui, sans-serif;
}
- Use shadcn/ui components (Radix primitives +
cva variants + tailwind-merge)
for buttons, dialogs, dropdowns, inputs, etc. They're accessible and consistent.
Generate them into src/components/ui; style via tokens, not inline hex.
- Tailwind v4 base fix — buttons need a pointer cursor. v4's Preflight makes
<button> use cursor: default, which feels broken. Add this once in
src/styles.css so buttons/clickable roles show a pointer:@layer base {
button:not(:disabled),
[role="button"]:not(:disabled) { cursor: pointer; }
}
- Ban ad-hoc styling: no raw hex in JSX, no
text-white/bg-black literals,
no arbitrary values like p-[16px] or text-[13px]. If you need a value,
it becomes a token or a scale step.
2. The quantified rubric (cheap rules that prevent "ugly")
- ≤ 3–5 colors total (one primary + neutrals + at most one accent). No random
extra hues. Don't default to purple unless asked.
- ≤ 2 font families (often one). Pair a display/heading with a body, or use one.
- Line-height 1.4–1.6 for body; tighter for large headings.
- When you override a background color, override the foreground/text color too
(contrast must hold — check both light and dark).
- Mobile-first: design the ~390px layout first, then scale up. No horizontal
overflow; tap targets ≥ 44px.
- Consistent spacing scale (4/8-based). Generous whitespace beats cramming.
- One accent, used sparingly for primary actions — not everywhere.
3. Anti-AI-slop (the tells that make output look generic — avoid)
- No gradient-blob filler, no giant hero gradients as a substitute for content.
- No emoji as icons — use a real icon set (
lucide-react).
- No hand-drawn SVG illustrations/maps/charts — use real libraries (
recharts
for charts) or real generated images.
- No placeholder images / lorem-gray boxes in the final product — generate
real images or use real content; set
crossOrigin="anonymous" on canvas images.
- Avoid the overused-font look (default system-only, or Comic Sans-tier picks).
- Every element earns its place. Cut decorative noise. Establish a system,
then vary with intent — not randomness.
- Match the existing UI when editing an app in place; don't introduce a second
visual language.
4. Layout & hierarchy
- Clear visual hierarchy: one primary action per view; size/weight/color express
importance. See
references/typography.md and references/surfaces.md.
- Use real layout structure (grid/flex, container max-widths), not absolute-position
hacks. Align to a consistent grid.
- Empty states, loading states, and error states are part of the design — don't
ship blank/janky intermediate states.
5. Motion (subtle, purposeful)
- Short, eased transitions (150–250ms) on hover/press/enter; respect
prefers-reduced-motion. Details in references/animations.md.
- Never animate layout in a way that causes jank; prefer transform/opacity.
6. Game overlays (when this pairs with building-games)
The gameplay canvas is owned by building-games. This skill styles the DOM
overlay: start/"click to play" screen, HUD, score, menus, pause, mobile
controls. Keep overlay readable over the canvas (backdrop, contrast), and keep it
out of the pointer-lock/gameplay input path.
Finish checklist (before you call UI done)
- Tokens defined in
@theme; no ad-hoc hex / arbitrary values in JSX.
- ≤ 5 colors, ≤ 2 fonts, consistent spacing scale.
- Contrast holds; foreground overridden wherever background is.
- Mobile (~390px) has no overflow; targets ≥ 44px.
- Real icons/images/charts — none of the anti-slop tells.
- Loading/empty/error states handled; motion subtle and reduced-motion-safe.
- Rendered and eyeballed in a browser (see AGENTS.md verification), not just curl.
1---2name: design-ui3description: Design and build polished, non-generic UI for this TanStack Start + React + Tailwind v4 + shadcn/Radix app. Use whenever you create or restyle any interface surface — pages, landing pages, dashboards, forms, modals, nav, and game overlays (start screens, HUD, menus). Covers design tokens, layout, typography, color, spacing, motion, and the anti-"AI-slop" rules that keep output from looking generic. Triggers on "design", "UI", "make it look good", "polish", "landing page", "theme", "style", "redesign", "ugly", "clean up".4---56# Design & UI78Make interfaces that look intentional and premium, not template-generic. This is9the single biggest quality lever in the app builder. Apply it to **DOM / overlay10UI** — pages, chrome, HUD, menus, forms. (For a 3D game's gameplay canvas, see11the `building-games` skill; this skill governs the DOM UI layered over it.)1213**Read `references/` for depth** (loaded on demand — don't inline it all):14- `references/refined-ui.md` — the full product-chrome/overlay design system.15- `references/typography.md` — type scale, pairing, rhythm.16- `references/surfaces.md` — elevation, borders, shadows, layering.17- `references/animations.md` — motion, easing, transitions.18- `references/performance.md` — keep UI smooth (60fps, no jank).1920---2122## 1. Design-system-first (do this before styling anything)2324Define the system once, then compose from it. **Never** sprinkle ad-hoc values.2526- **Tokens in CSS (Tailwind v4 is CSS-first).** Put the palette, radii, and fonts27 in `src/styles.css` under `@theme` as CSS variables; consume them as Tailwind28 utilities. One source of truth.29 ```css30 @import "tailwindcss";31 @theme {32 --color-bg: #0b0b0f; --color-surface: #16161d;33 --color-fg: #e7e7ea; --color-muted: #a0a0ab;34 --color-primary: #14b8a6; --color-border: #26262f;35 --radius: 0.75rem; --font-sans: "Inter", system-ui, sans-serif;36 }37 ```38- **Use shadcn/ui components** (Radix primitives + `cva` variants + `tailwind-merge`)39 for buttons, dialogs, dropdowns, inputs, etc. They're accessible and consistent.40 Generate them into `src/components/ui`; style via tokens, not inline hex.41- **Tailwind v4 base fix — buttons need a pointer cursor.** v4's Preflight makes42 `<button>` use `cursor: default`, which feels broken. Add this once in43 `src/styles.css` so buttons/clickable roles show a pointer:44 ```css45 @layer base {46 button:not(:disabled),47 [role="button"]:not(:disabled) { cursor: pointer; }48 }49 ```50- **Ban ad-hoc styling:** no raw hex in JSX, no `text-white`/`bg-black` literals,51 no arbitrary values like `p-[16px]` or `text-[13px]`. If you need a value,52 it becomes a token or a scale step.5354## 2. The quantified rubric (cheap rules that prevent "ugly")5556- **≤ 3–5 colors total** (one primary + neutrals + at most one accent). No random57 extra hues. Don't default to purple unless asked.58- **≤ 2 font families** (often one). Pair a display/heading with a body, or use one.59- **Line-height 1.4–1.6** for body; tighter for large headings.60- **When you override a background color, override the foreground/text color too**61 (contrast must hold — check both light and dark).62- **Mobile-first**: design the ~390px layout first, then scale up. No horizontal63 overflow; tap targets ≥ 44px.64- **Consistent spacing scale** (4/8-based). Generous whitespace beats cramming.65- **One accent, used sparingly** for primary actions — not everywhere.6667## 3. Anti-AI-slop (the tells that make output look generic — avoid)6869- **No gradient-blob filler**, no giant hero gradients as a substitute for content.70- **No emoji as icons** — use a real icon set (`lucide-react`).71- **No hand-drawn SVG** illustrations/maps/charts — use real libraries (`recharts`72 for charts) or real generated images.73- **No placeholder images / lorem-gray boxes** in the final product — generate74 real images or use real content; set `crossOrigin="anonymous"` on canvas images.75- **Avoid the overused-font look** (default system-only, or Comic Sans-tier picks).76- **Every element earns its place.** Cut decorative noise. Establish a system,77 then vary with intent — not randomness.78- **Match the existing UI when editing** an app in place; don't introduce a second79 visual language.8081## 4. Layout & hierarchy8283- Clear visual hierarchy: one primary action per view; size/weight/color express84 importance. See `references/typography.md` and `references/surfaces.md`.85- Use real layout structure (grid/flex, container max-widths), not absolute-position86 hacks. Align to a consistent grid.87- Empty states, loading states, and error states are part of the design — don't88 ship blank/janky intermediate states.8990## 5. Motion (subtle, purposeful)9192- Short, eased transitions (150–250ms) on hover/press/enter; respect93 `prefers-reduced-motion`. Details in `references/animations.md`.94- Never animate layout in a way that causes jank; prefer transform/opacity.9596## 6. Game overlays (when this pairs with `building-games`)9798The gameplay canvas is owned by `building-games`. This skill styles the **DOM99overlay**: start/"click to play" screen, HUD, score, menus, pause, mobile100controls. Keep overlay readable over the canvas (backdrop, contrast), and keep it101out of the pointer-lock/gameplay input path.102103---104105## Finish checklist (before you call UI done)106- Tokens defined in `@theme`; no ad-hoc hex / arbitrary values in JSX.107- ≤ 5 colors, ≤ 2 fonts, consistent spacing scale.108- Contrast holds; foreground overridden wherever background is.109- Mobile (~390px) has no overflow; targets ≥ 44px.110- Real icons/images/charts — none of the anti-slop tells.111- Loading/empty/error states handled; motion subtle and reduced-motion-safe.112- Rendered and eyeballed in a browser (see AGENTS.md verification), not just curl.