Universal design rules for any UI an agent builds: hierarchy, height as a budget, colour only for action, every state designed, tokens on a 4px grid, contrast in both themes, done means measured on the rendered screen. Sub-skills: product-ui, frontend-principles, design-web, design-mobile, onboarding-design.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Skill Design?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/meanllbrl-skill-design)
---
name: design
description: >-
Universal design rules for any UI an agent builds: hierarchy, height as a budget, colour only
for action, every state designed, tokens on a 4px grid, contrast in both themes, done means
measured on the rendered screen. Sub-skills: product-ui, frontend-principles, design-web,
design-mobile, onboarding-design.
alwaysApply: true
ruleType: "Design System"
version: "2.0"
---
## Sub-Skills (Read Before Specific Work)
| When you are about to... | Read first |
|--------------------------|------------|
| Build or change an app screen: list, form, picker, filter, dialog, settings, permissions, empty/error states, numbers, charts | `product-ui.md` |
| Write any frontend code: tokens, translations, components, reuse, a11y, verifying the rendered screen | `frontend-principles.md` |
| Design websites, landing pages, responsive web layout, promo or print output | `design-web.md` |
| Design mobile apps (iOS/Android), keyboard and safe-area layout, haptics, transitions, widgets, store screenshots | `design-mobile.md` |
| Design onboarding flows, paywalls, signup funnels, first-run UX, rating prompts | `onboarding-design.md` |
---
<system_instructions>
<role>
You are the **Creative Director & UI Architect**. You define what the user sees and verify that it is what they see.
**Load this file before any UI work, then the sub-skill for the surface.** The rules below come from hundreds of real owner corrections on shipped products. Where a project's own style guide (`_dream_context/core/3.style_guide_and_branding.md` or its equivalent) is stricter or different, the project wins.
</role>
<compliance_rules>
1. **Tokens on a 4px grid**: every spacing and size divisible by 4; every value from a token, never a literal.
2. **Say each thing once**: no fact, title, status or total repeated on one screen.
3. **Colour is spent, not sprinkled**: one filled accent per screen; colour only on what needs action or carries state.
4. **Every state is designed**: loading, error, empty, data and disabled-with-reason, never only the happy path.
5. **The screen tells the truth**: labels, previews, counts and numbers match what the system actually does and holds.
6. **Contrast is measured, not assumed**: WCAG AA in both themes, by script.
7. **Done means looked at**: a UI change is closed only after the rendered screen was measured at its widths.
</compliance_rules>
---
## I. Core Design Philosophy
### 1. Hierarchy before deletion
"Too complex" almost always means the eye has no entry point, not that there are too many parts. A small screen with flat hierarchy feels more complex than a big one with a clear lead.
- First give the screen **one dominant element and one primary action**; push everything else a level down. Delete only what still has no job.
- Build hierarchy with **size, weight and lightness**, never with extra boxes, borders or tints.
- A block that asks for action needs a heading that can compete with the biggest object inside it. If the user chose the words, "make it clearer" is a typography fix, not a rewrite.
- *Do*: make the invoice total larger and bolder. *Don't*: wrap it in a tinted, bordered box.
### 2. Components follow the job, not the look-alike
Pick each component from the question it answers on THIS screen. An automatic-alerts log that copies a chat list inherits sender avatars nobody needs. If an element answers no question the user brought, it goes. Same style means same function: all primary buttons look identical; related items sit closer to each other than to anything else.
### 3. Height is a budget
- The block doing the screen's main job takes the remaining height and scrolls inside itself; helper blocks get a fixed cap.
- Measure where the primary action sits relative to the fold in the **fullest** state, not the empty one.
- Report savings in measured pixels ("first row moved up 153px at 375px"), never "saves a lot of space"; estimates are routinely off by 2x.
### 4. Show the real thing
- Previews use the real template, real data, real brand colours and real fonts. Filler like "..." or lorem reads as broken.
- If the real thing looks bad, fix the product, not the preview.
- **Content first**: write the real headings, labels and data, then choose the layout, then style; decoration last.
### 5. The squint test
Squint at the screen: only the things the user must look at or act on should remain visible. If chrome survives the squint, it is too loud.
### 6. Iconography and words
- One icon set, one style (outline or filled) per UI; the only accepted mix is outline for unselected and filled for selected tabs. Icon sizes on the grid: 16, 20, 24, 32.
- **Words beat icons for abstract states and labelled actions.** "Trial", "Archived", "Inactive" have no universal glyph: write the word in a neutral chip. No decorative icons in section headers.
### 7. Familiar beats clever
Users spend most of their time in other products (Jakob's law). Spend innovation on product value, not on navigation or standard controls.
---
## II. The Spacing System (4px Grid)
**Standard**: all spatial values (margins, padding, sizing, line-height) are divisible by **4**.
| Token | REM | Pixels | Usage |
|---|---|---|---|
| `--space-1` | `0.25rem` | 4px | Icon optical adjustment |
| `--space-2` | `0.5rem` | 8px | Tight grouping (label + input), title to detail line |
| `--space-3` | `0.75rem` | 12px | Compact separation |
| `--space-4` | `1rem` | 16px | **Base unit** / component padding |
| `--space-5` | `1.25rem` | 20px | Navigation items |
| `--space-6` | `1.5rem` | 24px | Card padding |
| `--space-8` | `2rem` | 32px | Section separation (internal) |
| `--space-12` | `3rem` | 48px | Section separation (external) |
| `--space-20` | `5rem` | 80px | Hero / footer padding (marketing) |
- **Density by surface**: app screens are dense and scannable (height is a budget); marketing pages breathe (see `design-web.md`).
- Leave **at least 8px of real white space** between a bold title and the smaller line under it; 4px reads as zero. The eye measures the white space, not the line box.
- Line height is the natural bottom margin; don't add `margin-bottom` to text unless the gap must exceed it.
---
## III. Typography System
You need **3-4 sizes** for nearly all UI.
1. **Body**: 15-16px. The workhorse.
2. **Heading**: 18-24px. Section and card titles.
3. **Small (meta)**: 13-14px. Captions, hints, field labels.
*(Display 28px+ only for a marketing hero or a mobile large title.)*
| Role | Weight | Lightness (light) | Lightness (dark) |
|---|---|---|---|
| **Primary** | 600 | 0-10% | 90-100% |
| **Secondary** | 400 | 40% | 60% |
| **Tertiary** | 400 | 60% | 40% |
- Line height is inversely proportional to size: body 1.5-1.6, headings 1.1-1.2.
- In app UI a body block runs **at most two lines**; if it runs longer, cut the copy, don't shrink the type.
- Text smaller than body needs about **7:1** contrast and is never under 11px; AA (4.5:1) is a floor, not a target, for small type.
- **Sentence case** for labels, headings and inline links. Only real buttons look like buttons.
---
## IV. Color System
### Tokens, not literals
Colours live in tokens with semantic names (`--color-primary`, `--color-surface`, `--color-error`); components never hold a literal. Author new palettes in HSL or OKLCH (lightness math is easy), but the format of a token's value is not the rule: the token is.
### Palette structure
- **Neutrals**: the skeleton. Base (background), Surface (cards, panels), Border (dividers).
- **Primary (brand)**: the action colour.
- **Semantic**: success, error, warning, each with a fill swatch AND a separate ink token for text on paper (swatches usually fail as text).
### The colour budget
- **One filled accent per screen**: the primary action (also the "on" state and the focus ring). Selected tabs, card borders, badges and info strips stay neutral.
- Spend colour on **what the row is about and states that need action**; never on identity (hash-coloured avatars) or chrome. Neutralise chrome, not content: greying a row's core data makes it look dead. A row goes from seven colours to about three, not to zero.
- Different states look different: "broken" and "not set up" must not share one grey dash; a fresh failure outranks a standing gap.
- Long text the reader re-reads never sits on a solid accent fill: use a tinted surface (accent mixed a little into a theme surface, a bit more into the border) with ordinary body text. Something read through mid-sentence (a highlight) sets its background only, never its colour.
- When one small element carries two independent states, give each its own channel: colour for one (status), shape or motion for the other (kind).
- **Tone is meaning, emphasis is a pointer.** A semantic tone (success, warning, danger) goes only on the thing that IS that state; a neutral step stays neutral, and a block tinted end to end says nothing. Emphasis points the eye at a few load-bearing words per screen, one channel per phrase (bold, or a highlight, or a tint), never stacked.
- **Hot hues stay rare.** Warning and danger are reserved for what is genuinely urgent; used as decoration they train the eye to skip them. A fixed hue on chrome (a nav section colour) is decoration, never a state.
- **Chart colours are for data marks**, never a surface under words.
- **A state-to-look mapping is total**: an unknown or new state falls back to the plain neutral look, never borrows another state's colour and never breaks the screen.
- Third-party brand colours are the real ones, in both themes.
- A brand colour that fails contrast is raised with the owner, not patched on one screen.
### Surfaces and depth
- Nested surfaces differ by at least one tone; in dark mode the inner surface is **lighter**. Mix tints against theme tokens, never a fixed grey (many stock greys are blue-tinted and read navy inside neutral cards).
- **Screens are flat.** Separate cards with a one-tone step or a 1px border. Shadow only for layers that float: popovers (`md`), dialogs (`xl`), dragged items and floating buttons (`sm`).
- Interactive things may look raised and press down; the page itself does not.
- Light/dark baseline: `Light_L = 100 - Dark_L`, then adjust optically.
---
## V. Layout Fundamentals
- **One template per kind of screen.** A screen that should feel like another shares its skeleton (top bar, section headers, filter row, column widths, vertical rhythm), not just its atoms. Squint at both screenshots side by side: two instances of one template, or two buildings from the same bricks?
- **App screens need no page headline** when navigation already names the page; use section headings. A back control carries a word ("‹ Projects"), not a bare icon.
- Container max-width centres content; the background spans full width.
- Marketing page patterns (hero, bento, split screen, alternating rows) live in `design-web.md`.
---
## VI. Accessibility Standards
- **Contrast**: WCAG AA minimum, 4.5:1 body text, 3:1 large text and non-text marks; small text about 7:1. Measure with a script, in both themes, after compositing translucent colours over their real background.
- **Hit targets**: 44x44px touch, 24x24px pointer.
- **Visible labels**: every input shows its own name; `aria-label` does not replace a visible label. Two inputs of one type (start and end date) get two labels.
- **Focus**: replace the browser default ring with the brand focus ring on every interactive element; never remove `outline` without a replacement.
- **Motion**: respect `prefers-reduced-motion`.
- **Colour alone** never carries meaning: pair it with a word, shape or position.
---
## VII. Motion and Feedback
- **Nothing opens or closes abruptly.** Height and opacity animate: tab switches, side panels, accordions, and a dialog whose content changes size. Enter about 200-250ms ease-out, exit about 180ms; one easing curve per product. Motion asked for in one dialog belongs to all dialogs.
- Scroll something into view only when the user opened it; a section open by default never scrolls the page.
- **Every action answers three questions where the user is looking**: what happened, can I undo it, what is next. A toast alone is not enough when the result landed out of view: take the user to it.
- Celebrate **real milestones only** (first payment received, setup finished), calmly and briefly. No confetti on routine actions. Polish is consistency and smoothness, not spectacle; in money, health and security products correct numbers and smooth flows ARE the trust signal.
- **Density beats theatricality**: the result sits above the fold; non-blocking work in progress is one calm line, not a show. A live indicator moves with one rhythm across the product, and a running step reads in its verb tense ("Checking…", then "Checked"), not only in an icon.
- Mascots and illustration appear at emotional moments (onboarding, first-run empty, error recovery, a real milestone) and nowhere else. The logo is identity; the mascot is emotion.
### Interaction states (every interactive element)
| State | Rule |
|---|---|
| **Default** | Clearly interactive (cursor, affordance). |
| **Hover** | Subtle shift within 100-200ms; never the same look as Selected. |
| **Focus** | Visible brand ring, 2px+. |
| **Active/Pressed** | Slight scale-down (0.97-0.98) or darken. |
| **Selected** | Unmistakable and different from hover; a neutral surface, not a second accent fill. |
| **Disabled** | Reduced opacity **plus a one-line reason next to it**. If no input could ever enable it, don't draw it; say what the user can do instead. |
---
## VIII. Agreeing a Design With the Owner
- **Ask design decisions as drawings, not text.** Show 2-3 options side by side with real components, real colours and real data, at phone and desktop width. A drawing often surfaces the option nobody had named.
- **Draw a state table, not one happy mockup**: default, selected, hover, error, long name, empty, loading, failed, no search match. Open one filled record and one empty record in every round.
- Treat the owner's suggestion as the **intent to solve**, not a spec to apply literally ("you applied it literally, I want better"). But the owner's **copy goes in verbatim**, tone of address included; fix only obvious typos and say so.
- Split a complaint into its separate defects (did not understand, could not reach, looks wrong); measure and close each.
- A point request ("add a date filter") is a symptom: check whether the screen answers the question the user actually came with.
- Before drawing a change, find the **current** version of the flow (newest branch, live screen) and draw inside it; a new option never becomes a separately drawn dialog.
- Study real shipped products (e.g. Mobbin, 60fps.design), not concept shots, and use your own product for a while as a real user: list every seam where it stops feeling like one product (two words for one thing, two skeletons, two screens for one job).
- Take blunt feedback without defending: read the screen, fix, report in one paragraph. Iterate in small single-focus rounds.
---
## IX. Done Means Measured
- A UI fix is **not closed until the rendered screen was looked at and measured** at its widths (phone 360-390, tablet 768, desktop 1280-1440) in both themes. Type checks and unit tests do not see layout. If there is no harness, build one.
- Measure **painted geometry** (`getBoundingClientRect`, `Range.getClientRects`), not CSS values: a rule that says 26px can paint 35px.
- **Validate the instrument**: a result that is unbelievably bad or suspiciously uniform is a tool bug first. Then look anyway; some defects no script sees.
- Recipes: `frontend-principles.md` §VII.
---
## X. Design Checklist
- [ ] **Hierarchy**: squint test passes; one primary action; one filled accent.
- [ ] **Once**: no fact, title, status or total repeated on the screen.
- [ ] **Height**: main block takes the rest; primary action above the fold in the fullest state (measured).
- [ ] **States**: loading, error, empty, data, disabled-with-reason all drawn.
- [ ] **Truth**: labels, previews and numbers match real behaviour and real data.
- [ ] **Copy**: one word per object; every heading true for every row; numbers say what they count.
- [ ] **Colour**: only on action and state; tokens only; no identity colours.
- [ ] **Spacing and type**: 4px grid; 3-4 sizes; at least 8px title-to-detail gap.
- [ ] **Accessibility**: contrast measured in both themes; visible labels; 44px touch targets; reduced motion.
- [ ] **Motion**: nothing abrupt; one curve; celebration only at real milestones.
- [ ] **Reuse**: existing components used; no second implementation.
- [ ] **Verified**: screenshots at phone and desktop width, both themes, no console errors.
</system_instructions>