Ask your agent
What it does
This skill helps plan and build a new UI surface with a clear visual direction, type and color system, responsive layout, component states, motion, and accessibility checks. It also gives a short pre-ship checklist so the result stays coherent instead of generic.
SKILL.md
---
name: frontend
description: Visual direction for new UI. Use when building a new page or surface, redesigning one, reworking a layout, or setting up a small design system. Covers picking a direction, type, color, layout, components, motion, accessibility and a short pre-ship checklist. For small fixes on existing screens, follow the existing design instead.
---
# Frontend
Build UI that feels intentional, current, quiet and sharp. Think Vercel clarity, Apple restraint, Linear's fast-reading density, and Awwwards-level composition only when the surface calls for it.
These are strong defaults, not laws. If the brief, the brand or the existing product says otherwise, follow that and keep the reasoning.
## 1. Name the job of the page first
Before any visual decision, decide what the page has to do. Pick one:
- **Persuade**: design has to earn attention. Landing pages, launches, portfolios.
- **Operate**: design has to disappear. Dashboards, tools, admin. Density, predictable controls, quiet motion.
- **Read**: comprehension first. Docs, articles, long-form.
- **Experience**: the content leads, the interface recedes. Galleries, showcases, immersive moments.
This decides how loud the page is allowed to be. The most common failure is mixing them up: a dashboard with hero-sized type, or a landing page that reads like a settings screen.
## 2. Decide the direction before writing code
For a new surface, settle these in one short pass and write them down in two or three lines:
1. What goes in the first viewport. If the subject is a product, place, object or person, show it, not just a slogan.
2. The mode (above) and a taste system (below).
3. Fonts, background, surface, border and text colors, one accent.
4. Section rhythm, grid, container width, how it collapses on mobile.
5. Component language: radius, borders, buttons, forms, cards, tables, nav, focus ring.
6. Motion level, what animates and what deliberately does not. Declare easing and duration tokens once.
7. Media: real photos, screenshots, generated images, or abstract.
That short note is the design. It's much cheaper to change now than after twelve components exist.
### Taste systems (pick one, commit)
- **Product Minimal**: neutral palette, exact spacing, strong type, restrained motion. Default for dev tools and SaaS.
- **Editorial Minimal**: whitespace, strong imagery, controlled drama, fewer boxes. Marketing and story pages.
- **Utilitarian Dashboard**: dense but calm, compact controls, clear data hierarchy.
- **Creative Showcase**: asymmetry, rich media, strong art direction, still usable. Portfolios and launches.
- **Brand Object Page**: the product or object is in the first viewport and drives the page.
### Three dials (optional starting point)
Each 1 to 10. Set them from the brief.
- **Variance**: 1 is perfect symmetry, 10 is artsy chaos.
- **Motion**: 1 is static, 10 is cinematic.
- **Density**: 1 is gallery-airy, 10 is cockpit-packed.
| brief sounds like | variance | motion | density |
|---|---|---|---|
| minimal, calm, editorial, Linear-style | 5-6 | 3-4 | 2-3 |
| premium consumer, Apple-like | 7-8 | 5-7 | 3-4 |
| playful, experimental, Awwwards | 9-10 | 8-10 | 3-5 |
| landing page, portfolio | 7-9 | 6-8 | 3-5 |
| trust-first, public sector, accessibility-critical | 3-4 | 2-3 | 4-5 |
| dashboard, admin, internal tool | 3-5 | 2-4 | 7-9 |
| docs, long-form | 4-6 | 2-3 | 3-4 |
What the bands mean:
- Variance 1-3: symmetric grid, centered. 4-7: some overlap, varied image ratios, left-aligned headers. 8-10: fractional grids like `2fr 1fr 1fr`, big empty zones. At 4+, collapse to one column below 768px.
- Motion 1-3: hover, focus, active only. 4-7: transitions on transform and opacity, staggered load-ins. 8-10: scroll-driven reveals, parallax.
- Density 1-3: section padding around `py-32` to `py-48`. 4-7: `py-16` to `py-24`. 8-10: tight padding, hairline dividers instead of cards, tabular numbers.
If you claim a high motion number, the page has to actually move. If you can't ship working motion, drop to 3 and ship a clean static page.
## 3. One idea, strongly
Good work has one memorable move and many quiet supporting decisions. Weak work has six premium tricks competing. Pick the one move (a composition, an interaction, a type stance, a piece of media) and keep the rest calm. If you can name three bold choices, you've spent none.
Minimal doesn't mean empty. Every element earns its place, whitespace is structure, and type, alignment and rhythm do the work before decoration does.
## 4. If UI already exists
Existing UI is evidence of intent. Before changing anything, note the fonts, colors, spacing, radius, borders, shadows, density and motion already in use, and name what looks deliberate.
- Fix alignment, hierarchy, spacing, contrast, consistency and missing states first. That solves most "this looks off" problems without restyling.
- Extending beats replacing unless a new direction was asked for.
- If asked to rework the layout, don't quietly change the typeface too.
## 5. Type
- **Sans**: Geist, Satoshi, Switzer, Outfit, Cabinet Grotesk, SF Pro, Manrope. Inter is fine when the brief wants neutral or standard.
- **Mono**: Geist Mono, JetBrains Mono, IBM Plex Mono, SF Mono. Use for code, dense numbers, tabular data.
- **Pairings**: Geist + Geist Mono, Satoshi + JetBrains Mono, Cabinet Grotesk + Inter Tight.
- **Serif**: only for editorial, luxury or heritage briefs with a reason. Avoid in dense software UI. Fraunces and Instrument Serif are heavily overused; consider Tiempos, GT Sectra, Reckless, Canela, EB Garamond, Cormorant, Playfair.
Scale (ratio 1.25 to 1.333 between steps):
| role | desktop | mobile |
|---|---|---|
| display | 48-72px | 36-48px |
| h1 | 36-56px | 30-40px |
| h2 | 28-40px | |
| card title | 16-22px | |
| body | 15-17px | |
| meta | 11-13px | |
- Body line-height around 1.6; headlines tighter but not below 1.1 (italic words with descenders need a little room).
- Reading columns 45 to 75 characters, about `max-w-[65ch]`.
- Fixed scale for app UI, fluid `clamp()` only on marketing pages.
- Emphasize a word with italic or bold of the same family, not by switching fonts.
## 6. Color
- Off-black and off-white, not pure `#000` / `#fff`.
- Backgrounds: `#ffffff`, `#fbfbfa`, `#f8fafc`, or `#09090b` for dark. Text: `#111111`, `#18181b`. Muted: `#71717a`. Borders: `#e4e4e7` or `rgba(0,0,0,0.06)`.
- **One accent**, used consistently. Secondary emphasis is a tint of that accent, not a second hue.
- Keep saturation controlled; deep or muted beats neon.
- Optionally tint neutrals very slightly toward the accent hue for cohesion.
- Red, amber and green are for status. Keep the status colors distinct from the accent.
- Soft tag colors (bg / text): red `#fdebec` / `#9f2f2d`, blue `#e1f3fe` / `#1f6c9f`, green `#edf3ec` / `#346538`, yellow `#fbf3db` / `#956400`.
Common defaults worth questioning: the purple-blue "AI glow" gradient, and the beige / brass / oxblood / espresso "premium" palette. Fine when the brand calls for it, tired as a reflex. Fresher families to try: cold silver and smoke, forest green with amber, cobalt and cream, terracotta and slate, monochrome plus one saturated pop.
### Building a color ramp
Most products need one neutral ramp, one accent ramp, and only the status ramps they actually show.
- Build in OKLCH (culori, colorjs.io, chroma.js), not by eye in HSL.
- Keep hue constant across the ramp. Saturation peaks in the middle and falls off at both ends.
- Light steps sit closer together than dark steps. Neither end reaches pure black or white.
- Example blue, 11 steps: `#eff6ff #dbeafe #bfdbfe #93c5fd #60a5fa #3b82f6 #2563eb #1d4ed8 #1e40af #1e3a8a #172554`
Role per step (Tailwind 50-950 / Radix 1-12): page bg 50/1, subtle bg 50/2, component bg 100/3, hover 200/4, active 200/5, subtle border 200/6, border 300/7, strong border or focus ring 400/8, solid fill 500/9, fill hover 600/10, low-contrast text 700/11, high-contrast text 900/12.
**Dark mode** is not just inverted. Lower the saturation (colors go neon on near-black), add more separation at the dark end, and recheck contrast. Pick one switching method (`prefers-color-scheme`, a `.dark` class, or `light-dark()`) and stick with it.
### Contrast
- WCAG 2: body text 4.5:1, large text 3:1, UI components 3:1.
- APCA if you use it: body Lc 75+ (90 preferred), headlines and labels 60+, text 36px+ 45+, UI parts 30+.
- To fix contrast, change lightness first. On mid-tone backgrounds, move the background, not just the text.
## 7. Layout
- CSS grid for multi-column structure. Constrain width with `max-w-7xl` or similar.
- `min-h-[100dvh]` instead of `h-screen` (avoids the iOS address-bar jump).
- Asymmetric desktop layouts collapse to one column on mobile, with no horizontal overflow.
- Give images and fixed-format elements real dimensions or aspect ratios.
- One radius system for the page: all sharp, all soft (12-16px), or all pill.
- No cards inside cards. Group with spacing, borders or dividers before shadows.
- Section spacing 64 to 128px depending on density. Let a hint of the next section show.
Patterns that work: split hero with a real product screenshot; bento grid where item count matches cell count; left rail plus dense content; wide media with captions; table-first dashboards.
Hero guidance: headline up to 2 lines, subtext about 20 words max, about 4 text elements total (optional eyebrow, headline, subtext, CTAs). Nav on one line, 64 to 72px tall.
Keep it varied: avoid the same image-plus-text split three sections in a row, and use eyebrows sparingly (roughly one per three sections).
If a layout feels crowded, check whether the real problem is too much content. Cut first, rearrange second.
## 8. Components
- **Buttons**: neutral solid or the accent. 4 to 8px radius. Hover, focus, disabled and active states. Small press feedback like `scale(0.98)`.
- **Forms**: labels above inputs, consistent height and radius, visible focus ring, specific errors below the field.
- **Cards**: only for grouping or hierarchy. Borders and spacing over heavy shadows; if you need a shadow, keep it soft and low-opacity.
- **Nav**: quieter than the content, with a clear active state.
- **Tables**: tabular numerals, row dividers, right-aligned numbers, empty / loading / error states that keep the table's size.
- **Focus ring**: style it on purpose. Removing the outline without a replacement is a bug.
- **Icons**: one library (Phosphor, Radix, Lucide), one stroke width across the project.
- **Imagery**: real product shots, screenshots or photos beat generic illustration and fake div-built UI.
## 9. Motion
Every animation should answer "why does this move?" Good answers: showing where something came from, state change, feedback, explaining a mechanism, softening an abrupt change.
**Frequency decides most of it:**
| how often it happens | motion |
|---|---|
| 100+ times a day (shortcuts, command palette, toolbar toggles) | none |
| tens of times a day (hover, tabs, list nav) | minimal or none |
| occasionally (modal, drawer, toast, popover) | normal |
| rarely (onboarding, success moments) | room for delight |
**Easing by direction:**
- Entering or exiting: ease-out. Moving on screen: ease-in-out. Hover and color: plain ease. Continuous (spinners, progress): linear.
- Avoid `ease-in` on UI; it feels laggy at the moment people are watching.
```css
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
```
**Durations:**
| element | duration |
|---|---|
| button press | 100-160ms |
| tooltip, small popover | 125-200ms |
| dropdown, menu | 150-250ms |
| modal, drawer | 200-500ms |
| marketing sequences | longer if justified |
Handy starting values:
- Fade-in on mount: 250-300ms ease-out.
- Page transition: 300ms, 20px offset.
- Modal: spring (stiffness 300, damping 25) or `{ type: "spring", duration: 0.5, bounce: 0.2 }`, from `scale 0.95, y 20`.
- Press: `scale(0.97)` on `:active`, 160ms.
- List stagger: 30-80ms between items.
- Skeleton pulse: 1.5s ease-in-out loop.
Springs for things people press or drag; fixed durations for passive things like fades and route changes. Keep bounce subtle (0.1 to 0.3).
**Good habits:**
- Never animate from `scale(0)`; start at 0.9 to 0.97 with opacity.
- Popovers and menus grow from their trigger; modals from the center.
- Animate `transform` and `opacity`, not `top`, `left`, `width`, `height`. Never `transition: all`.
- Anything that can be re-triggered quickly (toggles, toasts) should use transitions or springs, not keyframes, so it doesn't restart from zero.
- Scroll reveals via `IntersectionObserver`, a motion library's scroll hook, or CSS scroll-driven animation, not a raw scroll listener.
- Clean up loops, intervals and observers on unmount.
- Respect `prefers-reduced-motion`: drop movement, keep the opacity or color change that explains what happened.
- Wrap hover effects in `@media (hover: hover) and (pointer: fine)` so taps don't leave things stuck.
Often the best motion fix is deleting the animation.
## 10. Copy
- Name things by what people control, not how the system works ("notifications", not "webhook config").
- Active voice: a "Publish" button leads to a "Published" toast.
- Errors say what happened and how to fix it. No vague apologies.
- Empty states invite the next action.
- Skip filler words like "elevate", "unleash", "next-gen", fake metrics, and placeholder names like John Doe or Acme.
## 11. Things that usually look generic
Not banned, just worth a second thought before you use them:
- Emojis in UI
- Glowing purple-blue gradients, gradient text as the main idea
- Blobs, orbs, bokeh, mesh backgrounds
- Three equal feature cards as a whole section
- `rounded-3xl` on everything, heavy black shadows
- A centered hero with a vague headline and two buttons as the entire idea
- Zigzag image/text for three or more sections in a row
- Numbered eyebrows like `01 / about` everywhere
- Animated "scroll down" mouse icons
- Hand-drawn SVG icons instead of an icon library
## 12. Accessibility (part of done)
Fix these before shipping:
- Images without `alt`
- Icon-only buttons without an accessible name (`aria-label`)
- Inputs without a label
- Clickable `div`s without role, `tabIndex` and keyboard handling (just use a `button`)
- Links without `href` acting as buttons
- `outline-none` with no replacement focus style
- Status shown by color alone (add an icon or text)
- Touch targets smaller than 44 x 44px
- Skipped heading levels, positive `tabIndex`
## 13. Before you call it done
- [ ] Direction written down: mode, taste system, font, accent, motion level
- [ ] One clear signature move, everything else calm
- [ ] Mobile collapses cleanly, no horizontal scroll, text fits its containers
- [ ] Hover, focus, active, disabled, empty, loading and error states where relevant
- [ ] Contrast checked
- [ ] Accessibility list above is clean
- [ ] Motion respects reduced-motion; you've actually watched any animation you added
- [ ] One screenshot to catch breakage (not to grade your own taste; get a second opinion for that)
Verify with the lightest tool that answers the question: read the code first, then build and lint, then one screenshot for new layouts, and only open a full browser session for interaction, animation or responsive questions.
1 file
- SKILL.md15.1 KB