Frontend Design skill for Codex

Interfaces with a point of view, not a template. Codex stops producing the default purple-gradient, three-card layout. It writes a direction card first, derives type pairing, an OKLCH palette, a compositional grid and one signature move from it, builds tokens before sections, then screenshots the page at desktop, mobile and dark mode and scores it against a rubric until it passes.

  • Design & UX
  • $frontend-design
  • 267 lines
  • 3 files
  • ~3,150 tokens
  • MIT
  • Updated
  • Editor's pick

Install

curl -fsSL codexskills.dev/install.sh \  | sh -s -- frontend-design

Installs to ~/.agents/skills/frontend-design/ for every project on this machine.

104-line POSIX script. No sudo, no telemetry. Read install.sh

Use it in Codex

Start a prompt with $frontend-design, or pick it from /skills. You can also just describe the task: Codex reads the description below and loads the playbook when your request matches.

What Codex reads before loading it

Produces distinctive, production-grade web interfaces by committing to a named aesthetic direction, then deriving type, OKLCH color, layout, texture and motion from it, and checking the result in a screenshot critique loop. Bans the generic AI look (purple gradients, Inter everywhere, three icon cards). Use when asked to build or restyle a landing page, marketing site, app screen, portfolio or component, when the user says a UI looks generic, bland, templated or "AI-made", or wants it bold, editorial or premium.

Use it when

  • Building a new page, site or app screen where visual quality matters
  • A UI reads as templated, bland or obviously AI-generated
  • The brief asks for bold, editorial, premium or on-brand styling
  • Prototyping several aesthetic directions before committing

Use something else when

How to check the result

Screenshots at 1440 px, 390 px and dark mode score at least 4 on average with nothing below 3 on the direction rubric, and body text contrast is at least 4.5:1.

The mistake it prevents

Picking fonts and colors one at a time without a written direction, which drifts back to Inter, a blue accent and centered cards.

~/.agents/skills/frontend-design/SKILL.md

--- name: frontend-design description: Produces distinctive, production-grade web interfaces by committing to a named aesthetic direction, then deriving type, OKLCH color, layout, texture… license: MIT ---

Done well means a stranger can name the direction in three words from one screenshot, every visual choice traces back to that direction, and the page still ships: AA contrast, real states, no horizontal scroll at 360 px, and reduced motion respected. Pretty but untraceable is decoration; traceable but broken is a mood board.

Before touching anything

  • Read AGENTS.md and the package manifest: framework, CSS approach (Tailwind, CSS modules, vanilla), component library, and the dev-server command.
  • Look for an existing design system: tokens files, tailwind.config.* or @theme blocks, a components/ui folder, Storybook. Decide with this table:
SituationWhere distinctiveness comes from
Greenfield page or prototypeEverything: direction, type, palette, layout, motion
Existing brand, no systemKeep logo and brand hue; push type, composition, imagery
Mature design systemComposition, content hierarchy, imagery, one sanctioned accent move. Never fork tokens
User supplied a mockupFidelity first; only fill gaps with the mockup’s own logic
  • Find the real content: product name, actual copy, screenshots, data. Lorem ipsum hides hierarchy problems; write plausible specific copy if none exists and mark it as draft.

Workflow

- [ ] 1. Extract the brief (audience, single job, tone, constraints)
- [ ] 2. Commit to a direction and write the direction card
- [ ] 3. Set type
- [ ] 4. Build the palette in OKLCH
- [ ] 5. Choose the compositional system
- [ ] 6. Add texture and detail
- [ ] 7. Design motion
- [ ] 8. Build: tokens first, then sections, then states
- [ ] 9. Screenshot critique loop (max 3 rounds)
- [ ] 10. Report with the output contract

1. Extract the brief

Write four lines before any code: who is looking, the one thing the page must get them to do or understand, three tone words, and hard constraints (brand colors, framework, dark mode, performance budget). If the user gave none of this, choose and state your assumptions in one sentence rather than asking a questionnaire.

2. Commit to a direction

Generate three candidate directions, then pick the one with the most tension against the category default (a payroll tool styled like a Swiss railway timetable beats one styled like every other payroll tool). For named, ready-to-use directions with type, color and layout recipes, read references/directions.md when you need a starting point or the brief gives no aesthetic cue.

Write the direction card into your notes and keep it open for every later decision:

Direction: Lab notebook
Words: precise, warm, annotated
World it borrows from: graph paper, margin notes, specimen labels
Signature move: hand-set margin annotations that point at product UI
Type: Newsreader (display, text) + IBM Plex Mono (labels, data)
Palette: warm paper neutral, graphite ink, one oxide-red accent
Banned here: gradients, glass, pill buttons, drop shadows

The signature move is the one thing someone remembers. Every page gets exactly one; two signature moves compete and both read as noise.

3. Type

Type carries most of the personality. Rules:

  • Pair by contrast of role, not similarity: a characterful display face with a sober text face, or one superfamily used at extreme size contrast. Never two similar sans serifs.
  • Display sizes are where the direction shows: go large (clamp up to 4.5–8rem for heroes) with tight leading (0.9–1.05) and negative tracking (-0.02em to -0.04em) on big sans.
  • Body: 16–20 px, line-height 1.45–1.65, measure 55–75ch (max-width: 65ch).
  • All-caps labels need +0.06em to +0.12em tracking and a smaller size.
  • Use real weights from the font (load only the ones used) and font-variant-numeric: tabular-nums for any number that changes or aligns.
If you reached forTry instead (by direction)
Inter / Roboto / system for headlinesEditorial: Instrument Serif, Fraunces, Newsreader. Technical: Martian Mono, JetBrains Mono. Bold: Bricolage Grotesque, Unbounded, Archivo (wide/expanded widths)
Poppins / Montserrat for “friendly”Hanken Grotesk, Schibsted Grotesk, Young Serif, General Sans (Fontshare)
A single sans for everythingDisplay serif + grotesk text, or grotesk + mono for labels

Load fonts with font-display: swap, self-host or use Google Fonts CSS2 with only the needed axes, and preload the display face if it is above the fold. Fetching fonts needs network; if the sandbox has it off, add the <link>/@font-face and a good fallback stack, and tell the user the font downloads at runtime.

4. Palette in OKLCH

Build colors where lightness is perceptual, so steps look even and hue swaps keep contrast:

:root {
  /* neutral with temperature: chroma 0.005-0.02, never pure gray */
  --paper: oklch(0.97 0.012 85);
  --paper-2: oklch(0.93 0.015 85);
  --ink: oklch(0.22 0.02 60);
  --ink-muted: oklch(0.45 0.02 60);
  --rule: oklch(0.85 0.015 85);
  /* one accent, used on at most ~10% of any viewport */
  --accent: oklch(0.58 0.17 35);
  --accent-ink: oklch(0.98 0.01 35);
}
  • Dominant neutral 70–85% of surface, secondary neutral for bands, accent for the single action and the signature move. Accent everywhere means accent nowhere.
  • Tint shadows and borders with the neutral hue instead of black at low alpha.
  • Check text contrast: 4.5:1 body, 3:1 large text and UI boundaries. For ramps, semantic roles and contrast scripts, hand off to color-systems.

5. Compositional system

Pick one and say it in the direction card:

SystemUse whenKey move
Asymmetric 12-colProduct marketing, portfoliosContent spans 7 + offset 1, images bleed off one edge
Editorial with margin columnLong reads, docs-like productsNarrow side column for notes, captions, numbers
Full-bleed bandsStory told in chaptersAlternate surface color per band, vary band height
Index / tableCatalogs, changelogs, data productsRows, hairline rules, mono metadata, no cards
PosterLaunches, eventsOne giant type lockup, image as background plane
BentoGenuinely heterogeneous items of unequal weightUnequal cell sizes; never 6 equal tiles
.page {
  display: grid;
  grid-template-columns:
    [full-start] minmax(1rem, 1fr)
    [content-start] repeat(12, minmax(0, 5.5rem))
    [content-end] minmax(1rem, 1fr) [full-end];
  column-gap: clamp(1rem, 2vw, 2rem);
}
.page > * { grid-column: content; }
.bleed { grid-column: full; }
.lede { grid-column: content-start / span 7; }

Break the grid once, on purpose (an image crossing a band edge, a number hanging into the margin). Spacing comes from one scale (for example 4, 8, 12, 16, 24, 32, 48, 64, 96, 128) with section padding at the large end; cramped sections are the most common amateur tell. Deeper grid and rhythm decisions belong to layout-grids.

6. Texture and detail

  • Choose one corner personality for the whole page: 0 (architectural), 2–4 px (precise), or very large (soft). Mixing 8 px cards with pill buttons with square images is noise.
  • Separate with rules, surface shifts or whitespace before shadows. If shadows, use two layers tinted with the neutral hue.
  • Grain lifts flat color without a gradient:
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
  • Prefer real product UI, photography or diagrams over generic 3D blobs and stock people. Crop product screenshots tight on the interesting part; a full app screenshot at 30% scale shows nothing.
  • One icon family, one stroke weight, sized to the text it sits beside.

7. Motion

One orchestrated moment beats twenty scattered effects:

@media (prefers-reduced-motion: no-preference) {
  .reveal > * {
    animation: rise 600ms cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i, 0) * 70ms);
  }
}
@keyframes rise { from { opacity: 0; translate: 0 12px; } }
  • Hover and press feedback 120–200 ms; entrances 400–700 ms; never animate layout properties (width, top) when transform/translate/opacity will do.
  • Scroll effects only where they explain something (a diagram assembling, a number counting to its real value). Detailed state feedback belongs to micro-interactions.

8. Build

  1. Tokens first (custom properties or @theme), then layout shell, then sections top to bottom, then states.
  2. Semantic HTML: one h1, landmarks, buttons for actions and links for navigation.
  3. Every interactive element gets hover, :focus-visible, active and disabled styles.
  4. Test at 360, 768, 1440 px. Type and spacing use clamp(); nothing relies on a fixed viewport height for content.

9. Screenshot critique loop

Run the dev server (per AGENTS.md), then capture. Playwright browsers need a one-time npx playwright install chromium, which downloads and may need network approval.

mkdir -p .shots
npx playwright screenshot --full-page --viewport-size "1440,900" http://localhost:5173 .shots/desktop.png
npx playwright screenshot --full-page --viewport-size "390,844" http://localhost:5173 .shots/mobile.png
npx playwright screenshot --full-page --color-scheme dark --viewport-size "1440,900" http://localhost:5173 .shots/dark.png

Open each image (Codex can view local images) and score 1–5, honestly, against the card:

Criterion5 looks like
DirectionNameable in three words; matches the card
Focal pointOne obvious entry per viewport; eye path is clear
TypePairing intentional, scale has real contrast, measure comfortable
ColorAccent disciplined, neutrals have temperature, contrast passes
CompositionNot a template; grid broken once on purpose
CraftAlignment exact, spacing from the scale, states present, mobile intact

Pass when no score is below 3 and the average is at least 4. Otherwise fix the three lowest items, re-capture, and re-score. Stop after three rounds and report what remains. Squint test: blur your attention to the shapes; if the hero reads as “centered text, two buttons, image below”, the composition is still generic.

Generic tells and replacements

TellReplace with
Purple-to-blue gradient heroFlat tinted neutral with grain, or a full-bleed photograph
Gradient text on the headlineSize, weight or a single accent word in solid color
Three equal cards with icons in rounded squaresNumbered list, table, or unequal bento with real visuals
Centered hero, two buttons, mockup belowLeft-aligned lockup on asymmetric grid, product cropped and bleeding
Glassmorphism panels everywhereSolid surfaces separated by rules or surface steps
Same radius + shadow on every elementOne corner personality, borders over shadows
Emoji or mixed icon setsOne family, consistent stroke
Grayscale “trusted by” logo strip as section 2A specific quote or metric with attribution, placed where it supports a claim
Sparkle icons and “AI-powered” chipsShow the output the product produces
Every section the same height and paddingVary density: one tight band, one roomy band

Hard rules

  • Never ship text below 4.5:1 contrast for the sake of a mood; adjust lightness in OKLCH.
  • Never load more than two families plus a mono, or weights you do not use.
  • Never put body text over an unprotected photo; add a scrim or move the text.
  • Never hide the primary action below decorative content on mobile.
  • Do not invent brand assets (logos, customer names, testimonials) and present them as real; label placeholders clearly.
  • When the user names a direction, follow it even if another would score higher.

Output contract

**Direction:** <name>: <three words>. Signature move: <one line>.
**Type:** <display> / <text> / <mono>, scale <ratio>, body <size/line-height>
**Palette:** <neutral>, <ink>, <accent> (OKLCH), contrast checked: body <x:1>, accent button <y:1>
**Layout:** <system>, breakpoints tested 360/768/1440
**Screenshots:** .shots/desktop.png, .shots/mobile.png, .shots/dark.png
**Critique (final round):** Direction 5, Focal 4, Type 5, Color 4, Composition 4, Craft 4
**Known gaps:** <draft copy, placeholder images, fonts load from network>

What the zip contains

Codex reads bundled files only when a step points to them. Every one is shown here, so you can review it before installing.

agents/openai.yamlgenerated from this page

Gives the Codex app a display name, a one-line description and a starter prompt for this skill.

interface:
  display_name: "Frontend Design"
  short_description: "Interfaces with a point of view, not a template"
  default_prompt: "$frontend-design Build a landing page for our invoice API that doesn't look like every other SaaS site"
references/directions.md137 lines, 7.2 KB
# Direction recipes

Ten starting directions. Each is a coherent bundle; take one whole, then change one axis
to make it the project's own. Fonts are free (Google Fonts unless marked Fontshare).
OKLCH values are starting points; verify contrast after any change.

## How to choose

| Product category default | Directions with useful tension |
|---|---|
| B2B SaaS (blue, rounded, gradient) | Swiss timetable, Lab notebook, Index catalog |
| Developer tools (dark, neon, mono) | Print manual, Lab notebook, Quiet luxury |
| Consumer finance (trust blue) | Quiet luxury, Editorial magazine, Civic signage |
| Creative portfolio (big serif, black) | Index catalog, Risograph zine, Brutalist utility |
| Health and wellness (pastel, soft) | Civic signage, Editorial magazine, Botanical field guide |
| AI products (purple glow) | Print manual, Swiss timetable, Botanical field guide |

## 1. Swiss timetable

- Fits: logistics, scheduling, infrastructure, anything with times and numbers.
- Type: Schibsted Grotesk or Hanken Grotesk at heavy weights for display; same family
  for text; tabular numerals everywhere.
- Color: white `oklch(0.99 0 0)`, near-black ink, one signal color (yellow
  `oklch(0.88 0.17 95)` as a background band, never as text on white).
- Layout: strict 12-column grid, flush-left, hairline rules between rows, big numerals
  as section markers.
- Motion: rows slide in 8 px with 40 ms stagger; clocks and counters tick.
- Signature: a departure-board style table showing real product data.
- Fails when the content has no structure to tabulate.

## 2. Lab notebook

- Fits: research tools, analytics, scientific or data-heavy products.
- Type: Newsreader or Source Serif 4 for display and body; IBM Plex Mono for labels.
- Color: warm paper `oklch(0.97 0.012 85)`, graphite `oklch(0.25 0.015 60)`, oxide
  accent `oklch(0.58 0.17 35)`; faint graph grid via repeating linear gradients at 4%.
- Layout: main column plus margin column for annotations and figure captions.
- Motion: annotations draw in (SVG stroke-dashoffset) when their target enters view.
- Signature: hand-placed margin notes with leader lines pointing at product UI.
- Fails when overused on marketing claims; annotations must say something specific.

## 3. Editorial magazine

- Fits: content products, publishers, consumer brands with a story.
- Type: Instrument Serif or Fraunces (use its SOFT and WONK axes sparingly) for display
  at 6–9rem; a neutral grotesk for text; drop caps on long reads.
- Color: off-white, deep ink, one seasonal accent; photography carries the color.
- Layout: varied column counts per section, pull quotes breaking the grid, full-bleed
  photo spreads, captions in small caps.
- Motion: almost none; slow image fades. Restraint is the point.
- Signature: a cover-style hero with masthead lockup over a single photograph.
- Fails without strong photography.

## 4. Print manual

- Fits: developer tools, CLIs, hardware, APIs.
- Type: Martian Mono or JetBrains Mono for headings, a plain grotesk for prose.
- Color: light mode first, cream or pale gray paper, black ink, one safety orange
  `oklch(0.70 0.19 45)` for warnings and the main action.
- Layout: numbered sections (1.0, 1.1), figure numbers, specification tables, boxed
  callouts with thick left rules.
- Motion: terminal output types in once in the hero; everything else static.
- Signature: a real command and its real output, typeset like a figure.
- Fails if the product cannot show actual output.

## 5. Index catalog

- Fits: portfolios, marketplaces, changelogs, directories.
- Type: one grotesk at two sizes only (huge and small), plus mono for metadata.
- Color: monochrome with a hover color that appears only on interaction.
- Layout: long indexed list rows (number, title, category, year) with image preview
  following the cursor on hover; no cards.
- Motion: preview image follows pointer with a 120 ms ease; rows underline on hover.
- Signature: the list itself; density as luxury.
- Fails on touch if hover previews are the only way to see images; add thumbnails below
  768 px.

## 6. Quiet luxury

- Fits: premium consumer, fintech, hospitality.
- Type: a high-contrast serif (Gloock, DM Serif Display) at modest sizes; generous
  tracking on small caps; light text weights.
- Color: tinted dark `oklch(0.20 0.015 70)` or warm stone light, metallic-feeling accent
  via a narrow chroma range (`oklch(0.75 0.06 80)`), no saturated colors.
- Layout: lots of empty space, narrow centered column for copy, large single images.
- Motion: slow (700–900 ms) fades and gentle parallax under 20 px.
- Signature: one oversized product detail photograph.
- Fails when crammed; if there are more than five sections, choose another direction.

## 7. Civic signage

- Fits: health, government-adjacent, transit, education, accessibility-first products.
- Type: Atkinson Hyperlegible or Public Sans, large sizes, bold weights.
- Color: high-contrast pairs (deep green `oklch(0.40 0.09 160)` on white, white on
  green), plus a single wayfinding yellow; color always paired with a shape or label.
- Layout: big tap targets, numbered steps, pictograms, strong section dividers.
- Motion: minimal; focus states are thick and obvious.
- Signature: wayfinding-style step markers that guide the visitor through the page.
- Fails when the brand wants intimacy or exclusivity.

## 8. Risograph zine

- Fits: community, events, indie products, education for young audiences.
- Type: Bricolage Grotesque or Unbounded display, a friendly grotesk for text.
- Color: two or three spot inks (fluorescent pink `oklch(0.68 0.22 355)`, blue
  `oklch(0.50 0.17 260)`) with `mix-blend-mode: multiply` overlaps and grain.
- Layout: rotated stickers, misregistered offsets (2–4 px), collage imagery.
- Motion: stickers wobble on hover (rotate 2 to 3 degrees); nothing slides.
- Signature: duotone photography in the spot inks.
- Fails for enterprise trust or dense information.

## 9. Brutalist utility

- Fits: tools for experts, internal products, art-adjacent brands.
- Type: system mono or Space Mono, default-looking sizes on purpose, underlined links.
- Color: browser-default palette re-tuned (pure white, black, link blue), one alarm red.
- Layout: visible borders on everything, tables, no rounding, no shadows.
- Motion: none, or instant state changes.
- Signature: raw honesty; showing structure as decoration.
- Fails when it is an excuse for poor hierarchy; type scale and spacing still matter.

## 10. Botanical field guide

- Fits: sustainability, food, wellness, AI products wanting warmth.
- Type: Young Serif or Literata for display, a humanist sans for text, italic captions.
- Color: muted greens and ochres (`oklch(0.55 0.07 140)`, `oklch(0.78 0.10 85)`) on
  unbleached paper; illustrations in a single line weight.
- Layout: specimen plates: item, label, Latin-style descriptor, measurement.
- Motion: illustrations draw on scroll once; leaves of content unfold, not slide.
- Signature: product features presented as labeled specimens.
- Fails if illustrations are clip art; commission or hand-author them as SVG.

## Making it the project's own

Change exactly one axis of the recipe: swap the accent hue for the brand hue, flip to
dark, or move the signature move to a different section. Changing three axes at once
usually lands back at generic.

About this skill

Written and maintained by the Codex Skills editors to the same editorial standard as every skill here: a selective description, a real workflow, known pitfalls and a way to verify the work. First published , last updated . MIT licensed. Something wrong or out of date? Tell us.

esc
Just launched

Codex Skills Pro is live

79 premium skills for Codex, each with scripts, references and an evidence report that proves the result.

Bought one by one$882.21
All 79 skills$49
94% off

That's $0.62 a skill, paid once.

Get all 79 for $49Or pick single skills from $4.99 →

Secure checkout by Creem