Skill v1.0.0
currentAutomated scan100/100name: headless-step-design description: "Step 5 (design) of the Hostinger Headless flow. Derives three distinct design directions from brief.md (plus any reference sites and brand assets), lets the user pick one in a single question, checks the chosen one against the 8-point grid and WCAG 2.2 AA, draws the logo (the site name as text beside a small SVG icon that is also the favicon), following any logo wish the owner gave, then writes design.md — tokens, type, logo, components, per-page composition, accessibility and imagery — as the contract the frontend implements (the framework/stack is chosen later by the frontend step). When the brief says to keep an existing look, writes design.md from that look and its own logo instead. Prepare work: runs during the provision wait and never touches the backend." metadata: version: "1.0.0"
headless-step-design
Turn the brief into a look the user has chosen, and write it down so the frontend can't drift from it. One question, three options, one spec. The output is files (design.md plus the logo), not a conversation: the frontend step implements design.md, not the chat.
In: brief.md (required), content-model.md (if it exists yet), reference sites and assets the user gave. Out: ~/.hostinger/<domain>/design.md and the logo files in ~/.hostinger/<domain>/brand/.
Build mode "Bring your own frontend"? This step defers to the user. Readbrief.md→ Build modefirst. When it is Bring your own frontend, follow `bring-your-own-frontend.md` instead of Steps 1–7: no threedirections and no prescriptivedesign.mdover their project.
This is prepare work: it runs while provision settles (see Background provision & the instance barrier in the top-level SKILL.md). Nothing here calls the Hostinger connector or the backend.
Keep it short. Refine already asked about tone and look; don't ask again. The step asks the user one question: either the keep/change question (Step 1 and keep-look.md) or the three directions (Step 4), never both. "You decide" is a valid answer.
Talk like a person, not a designer. Everything the user reads describes how the site will look and feel: colours by name ("hot pink, butter yellow"), lettering by feel ("big chunky rounded headlines"), and the details they'll notice ("photos tilted like stickers on a scrapbook"). No hex codes, font names, or design and tech words (palette, accent, tokens, shape language, contrast, favicon, wordmark, lockup, WCAG, 8-point grid, Next.js, SSR, state.json), even when the owner's own brand guide names them. This covers every message until the step ends, including the keep/change question, your one-line confirmation after the pick and the message you hand off with.
Two hard rules apply to every direction, however loud or quiet it is:
- The 8-point grid. Every spacing, sizing and layout value is a multiple of 8 px (details in
5.2).
- WCAG 2.2 Level AA. Colour, focus, motion, target size and reflow are decided here, so the
frontend can't build them wrong (details in 5.1 and 5.3).
These rules are for you, not the user. Never mention them: no grid, contrast, WCAG or accessibility talk in anything the user reads, and no "all options follow…" reassurances. The user judges the look in the preview; the rules just make sure it works.
Step 1 — Read the workspace, then the resume check
Read brief.md, state.json, and content-model.md if it exists.
- `design.md` already exists and this is not a redesign → don't overwrite it. Describe the
current look in two or three plain sentences and ask: keep it, or change something? That is this step's one question.
- Keep → leave the file alone and go straight to the
state.jsonupdate at the end of Step 7. - Change → edit only what they asked for, re-run the 5.x checks on what changed, then save.
- The site is already deployed (
deploy.jsonexists, orstate.jsonhasdeployed_at) and the
user asked for a different look → this is a redesign. Tell them plainly: their content stays as it is, only the look changes, and they'll see a preview before it goes live. Then run Steps 2–7 as normal. The current design.md becomes one more signal in Step 2, so carry over what the user wants to keep and move away from the rest.
- The brief says to keep the current look (Design direction says so in the owner's words:
"keep the look we have", "same look, new platform") → follow `keep-look.md` instead of Steps 2–6. No three directions and no new logo. A live site, screenshots or a brand guide alone are signals for Step 2, not a request to keep.
Step 2 — Collect the signals
Before inventing anything, gather what already constrains the design:
| Signal | Where | How it constrains | |
|---|---|---|---|
| Tone, purpose, audience | brief.md → Tone, Purpose, Audience | Sets the mood all three directions must fit | |
| Brand assets | brief.md → Assets | Logo, brand colours and fonts are fixed in every direction. Never recolour a supplied logo; Step 6 uses it instead of drawing an icon | |
| Pages and entities | content-model.md → Navigation, Pages, Articles; if it doesn't exist yet, brief.md → Pages | Drives the component inventory and page composition | |
| Reference sites | URLs in the brief or the conversation | Cues to borrow (see below) | |
| Images already sourced | content-model.md → the image lines under Articles, or the image URLs in content.json on WordPress (skip if none yet) | Glance at a few at small size; keep accents from clashing with their dominant colours | |
| Current design (redesign only) | existing design.md | What to keep, what to move away from |
Reference sites. Open each one in a real browser if you have one. Static fetches are often blocked or rate-limited; without a browser, fetch the HTML and its linked CSS instead. If neither works, say so in one line and continue from the brief alone. Pull cues:
- Fonts: the computed
font-familyofh1/h2and of bodyp. - Colours: background colours weighted by painted area (element width × height), the top 5–8.
Skip transparent and semi-transparent backgrounds and overlays (cookie banners, modals, chat widgets). Text colours come from headings, paragraphs and links.
- Feel: look at the first screen and one further down (screenshots shown to you, not saved in
the workspace) and note what creates the feel: type weight, colour blocking, shapes, density.
Borrow cues, never assets (the owner's own site under keep-look.md is the exception). Don't use its logo, copy, images or exact layout. The brief wins over the live site when they disagree (the user's words are what they want). Note the mismatch in the direction.
Brand colours that fail contrast are still fixed, but only in roles where they pass. A pale brand yellow can be a background band or a large decorative shape, never body text. Say so in the direction.
Step 3 — Derive three directions
Write three directions that all fit the brief but are genuinely different. Vary at least two of: palette (temperature, saturation, light vs. dark), type personality (geometric, grotesk, serif, display), and shape language (sharp vs. round, flat vs. outlined, airy vs. dense). Three shades of one idea is not a choice. Neither is a wildcard that ignores the brief.
Order them: A is the recommendation, the closest reading of the brief and references. B and C push in different directions.
Each direction carries exactly this:
- Name — 2–3 evocative words ("Sticker-book maximal", "Quiet gallery").
- Mood — one line on how the site feels.
- Palette — 5–7 hex colours with roles (base, text, primary accent, secondary accents, surface).
These are the core colours the user sees; Step 5 may add derived shades (link, muted, error, focus) as tokens.
- Type — a display font and a body font, both self-hostable through
@fontsource. - Shape language — corners, borders, shadows and density in one phrase ("chunky 3 px ink
outlines, hard 8 px offset shadows, tilted cards").
- Signature element — the one memorable move (a scrolling marquee, stickers, oversized numerals,
a duotone photo treatment). If it moves on its own, it gets a pause control (5.3).
- Logo idea — one line on the small icon beside the name ("a smiling sun in butter yellow with
an ink outline"). When the brief carries a logo wish (Design direction or Assets), every direction's logo idea is that wish in its own style. A wish is words describing a logo; a logo file in Assets is a supplied logo and wins (Step 6).
Only offer what can pass. Don't run contrast or font checks before asking: Step 5 checks the chosen direction, and fixes it with a shade of the same hue or the closest font that resolves, which keeps the look the user picked from words. Don't offer a look that only works by breaking the rules, such as body text on a neon accent or a marquee that can't be stopped. Loud is fine; inaccessible is not.
Avoid the template look unless the brief asks for neutral: Inter or Roboto everywhere, a blue-to-purple gradient hero, centred hero with three feature cards, grey cards on white. Every direction should look like this site, not a starter theme.
Step 4 — Ask once
Ask one question, with A marked as the recommendation. With a structured question UI (multiple choice plus an "other" field), each option's label is the direction's name and its description is one or two plain sentences, under ~160 characters. Without one, write each option as one line in the same shape.
The description says what the site would feel like, the main colours by name, what the lettering is like, the logo idea, and the one detail they'll remember. Hex codes and font names stay in your notes. The question may end with one plain clause saying they can add a logo idea to their pick, but never suggest one or give an example: that idea would end up in the logo.
Sticker-book maximal — Loud and playful, like a scrapbook: candy pink, butter yellow and lilac,chunky headlines, tilted sticker photos and a smiling-sun logo.
Midnight disco — A dark, glowing night-out feel: deep purple with neon pink, yellow andturquoise, heavy rounded headlines and a logo like a neon sign.
Then:
- Pick → use it as written, and confirm the look in one line.
- "You decide" → use A, and tell them in one line which look you went with.
- Skipped tool result → not an answer: write the three directions as plain lines
and wait for the reply (see When you ask the user in the top-level SKILL.md).
- A mix ("A's colours with C's fonts") → merge them. Don't ask again.
- Something else → build a direction from what they said, run Step 5, and use it. Don't send
three new options.
Logo wish. An answer can carry a logo idea next to the pick ("A, and make the logo a little teapot"); it replaces the chosen direction's logo idea, and wins over a wish from the brief. Whenever the logo follows a wish, from the answer or the brief, add it once to the line that confirms the pick: "The logo follows your idea: a little teapot." If it can't be a small icon as said (a detailed illustration, a photo), draw a simple version of it and name what you simplified in that same line. Don't ask a follow-up.
Don't ask about anything else in this step.
Step 5 — Check the chosen direction
Fix any problem found here by adjusting the direction, not by asking the user. Don't report these checks or their fixes; the user sees the result in the preview.
5.1 Contrast — WCAG 2.2 SC 1.4.3 and 1.4.11
Which pairs count: walk the component inventory you're about to write (Components table). For each component, list every foreground/background combination in every state: default, hover, focus, active, error. Include text on coloured bands (footer links on dark, marquee text, chips), placeholder text and photo credits. Compute the WCAG contrast ratio for each:
| Kind | Examples | Minimum | |
|---|---|---|---|
| Body text | paragraphs, links, footer text, input text, placeholder text, captions | 4.5:1 | |
| Large text | ≥ 24 px regular, or ≥ 18.66 px (14 pt) bold | 3:1 | |
| Non-text | input and button boundaries (when the outline is the only edge), focus indicator against each adjacent colour, icons that carry meaning, chip outlines | 3:1 |
A pair that fails gets a darker or lighter shade of the same hue; never drop a brand colour. A new shade becomes a token (for example --color-link or --color-muted). Disabled controls and pure decoration are exempt, but say which elements those are. Text on photos needs a scrim or solid backing that gets the text to 4.5:1 against the lightest part of the image. If you can't guarantee that, don't put text on photos. Record every pair and its ratio in design.md.
Compute every pair in one run: list them all, then pass the list to this command as JSON (6-digit hex, kind body, large or non-text). Re-run it once over the pairs you shaded, not pair by pair.
node -e 'const L = h => { const c = h.match(/\w\w/g).map(x => parseInt(x, 16) / 255).map(v => v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4);return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]; };const min = { body: 4.5, large: 3, "non-text": 3 };for (const [fg, bg, kind, what] of JSON.parse(process.argv[1])) {const [x, y] = [L(fg), L(bg)].sort((m, n) => n - m), r = (x + 0.05) / (y + 0.05);console.log(`${r >= min[kind] ? "pass" : "FAIL"} ${r.toFixed(2)}:1 ${kind} ${fg} on ${bg} ${what}`);}' '[["#1a1a1a","#fff8ee","body","body text on base"],["#ffffff","#c2185b","large","button label"]]'
5.2 The 8-point grid
Values are checked in px at the default 16 px root (0.5rem = 8 px).
| What | Rule | |
|---|---|---|
| Spacing (padding, margin, gap) | Multiples of 8: 8 16 24 32 48 64 96 128. 4 px is the only half-step, and only inside small components (chip padding, icon-to-label gap) | |
| Component sizes | Heights and fixed widths are multiples of 8. Buttons, nav items and inputs are 48 px tall minimum | |
| Radii | 8 16 24 32, or 999px for pills. 4 px only on elements under 32 px tall | |
| Line heights | Fixed-size text: multiples of 8 (16/24, 18/32, 24/32), or of 4 for text ≤ 14 px (12/16, 14/20). Fluid headings (clamp() sizes) use a unitless line-height (1.0–1.2) and are exempt, because their line box can't stay on the grid at every size | |
| Fluid spacing | clamp() for spacing or sizes uses grid values at both ends. Fluid font sizes are exempt | |
| Shadow offsets | 4 or 8 multiples | |
| Layout | Content width, gutters and breakpoints are multiples of 8 (e.g. 1200, 768, 1024, 1280) | |
| Exempt | Border and outline widths (1–4 px), focus offset, font sizes, the 999px pill radius, the 4-multiple line heights above, and anything that isn't a length (angles like a -2deg tilt, durations, opacity) |
Every value in the Tokens block must pass this table.
5.3 WCAG 2.2 AA — what the design must decide
These criteria are settled at design time. Write each answer into the Accessibility section of design.md.
| Criterion | The design must specify | |
|---|---|---|
| 1.4.1 Use of colour | Links in running text are underlined, not colour-only. States (active nav, selected, error) also change shape, weight or an icon, not only colour | |
| 1.4.4 Resize text | Font sizes in rem; nothing breaks at 200 % zoom | |
| 1.4.10 Reflow | Works at 320 CSS px wide with no horizontal scroll. Every component has a stated ≤ 320 px behaviour; decorative pieces never widen the page | |
| 1.4.12 Text spacing | No fixed-height boxes around text, so nothing clips when a user overrides spacing (line-height 1.5, paragraph spacing 2×, letter-spacing 0.12 em, word-spacing 0.16 em). Fixed line-height tokens are fine; clipping is not | |
| 2.2.2 Pause, Stop, Hide | Anything that moves on its own for more than 5 s (marquee, carousel, animated sticker) has a visible pause control, and doesn't move at all under prefers-reduced-motion. Hover-to-pause alone doesn't count | |
| 2.3.1 Three flashes | Nothing flashes more than 3 times a second | |
| 2.4.7 Focus visible | One focus style (e.g. 3 px outline, 2 px offset) whose colour reaches 3:1 against every surface it can appear on. Name a second colour for surfaces where the first fails | |
| 2.4.11 Focus not obscured (new in 2.2) | Sticky headers, cookie bars and chat bubbles never cover the focused element. Either the header isn't sticky, or scroll-padding-top: var(--header-h) | |
| 2.5.8 Target size (new in 2.2) | Interactive targets ≥ 24 × 24 px with spacing. On this grid: 48 px for buttons, nav and inputs, ≥ 24 px for inline icon buttons | |
| 3.2.6 Consistent help (new in 2.2) | The contact or help link sits in the same place on every page (e.g. last nav item and footer) | |
| 3.3.2 Labels | Every form field has a visible label; placeholders are never the only label | |
| 1.1.1 Text alternatives | Content images get alt text describing what they show; purely decorative images and shapes get empty alt or aria-hidden |
5.4 Fonts resolve
For each family, prefer the variable package and fall back to the static one: @fontsource-variable/<slug>, then @fontsource/<slug>. Look up every family in one command:
for f in <slug-1> <slug-2>; do for p in @fontsource-variable/$f @fontsource/$f; dov=$(npm view $p version 2>&1) && echo "$p $v" || { echo "$v" | grep -q E404 && echo "$p none" || echo "$p error"; }; done; done
One package per family must answer with a version. If neither does (both none), swap to the closest family that does, and look up only the swaps in one more run. error means the lookup failed, not that the package is missing: re-run it for that family instead of swapping. Record the exact package names.
5.5 The header fits on one line
The header is where a cramped width shows first: the logo, every nav item and the call-to-action button share one row, and when they run out of room they wrap mid-phrase ("Services &" over "Pricing", "Book" over "Appointment"). That always looks broken. Decide it here so the frontend can't build it that way.
- Labels never break mid-phrase. Nav links and the header button get
white-space: nowrap, so a
two-word label stays on one line or not at all.
- Collapse before it wraps — not at 320 px. The inline nav is replaced by a menu (hamburger)
button at the width where the logo, all nav items and the button stop fitting on one line, which is usually wider than the mobile breakpoint. Estimate that width from the number of nav items and their label lengths, round up to a multiple of 8, and make it the header's own breakpoint. Below it, only the logo and the menu button show; the nav items and the CTA move into the opened menu. At 320 px the icon, the site name (--text-logo, white-space: nowrap) and the menu button still fit one row; lower --text-logo for a long name until they do. A supplied or kept logo and the menu button must fit too; lower --logo-h (still ≥ 24 px) until they do.
- Keep header labels short. A nav label is one or two short words; a button label is a two-word
verb phrase at most ("Book now", not "Book an Appointment"). When the content model gives a long navigation label, the header may show a shorter form ("Contact & Booking" → "Contact") while the page keeps its full name — note the shortened label in the Header + nav row.
- Record the header breakpoint in Grid, shape & motion and the
nowrap+ collapse rule in the
Header + nav component row (and its ≤ 320 px cell).
Step 6 — Draw the logo
The user supplied a logo → copy it into brand/ unchanged, note it in the Logo section, and skip the rest of this step. Never redraw or recolour it.
Otherwise the logo is the brief's Site name, spelled as the user confirmed it, as text in the display font, beside one small icon. Write the icon by hand as brand/logo-mark.svg: the chosen direction's logo idea (or the owner's logo wish, Step 4) in palette colours, simple enough to read at 16 px on light and dark tab bars, because it is also the favicon. Give it a viewBox and no text inside: the name beside it is the text. No emoji or raster clip-art.
Keep it quick: a few minutes, no installs, build scripts or preview loops.
Don't show the logo to the user in this step; they see it in the preview.
Step 7 — Write design.md and hand off
Write design.md from the template below. Fill every section. The Tokens block is copied verbatim into the frontend's global stylesheet, so it must be valid CSS. Every colour, font, type size, line height, space, radius and shadow used elsewhere in the file must exist in it as a token. The template's token list is the minimum: add what the design needs (--color-error, --color-on-accent, --leading-h3…) under the same naming scheme. Breakpoints are the one exception: CSS custom properties don't work inside @media, so they are listed in Grid, shape & motion as plain px values.
Then update state.json: set "stage": "frontend" (also for a redesign: restyle, then validate and deploy) and updated_at to the current UTC time (ISO 8601). Don't touch provision or add other keys.
If content prepare hasn't sourced images yet, it now follows design.md → Imagery (see 04-content-model/SKILL.md).
Hand off in one or two plain sentences, as Talk like a person says: "The look is set: warm cream, brown lettering, berry buttons and your loaf logo." Nothing after it: no font names, file names or stages, and gaps such as a missing icon file or a font that may not load go in the final report.
design.md template
# Design — <domain>> Direction **<name>**, selected on <YYYY-MM-DD> from three options (others offered: <B name>,> <C name>). <"Picked by the user." | "User said 'you decide'; recommendation A used." |> "Merged by the user: <what>."> — or, when kept: "Kept the owner's current look from <site URL |> screenshots | brand guide>, confirmed on <YYYY-MM-DD>."## Direction<2–3 sentences: the mood, what it borrows from the references (and any brief/reference mismatch),the signature element.>## Stack**<chosen by the frontend step>** — design doesn't decide the stack. The frontend step (06) picks andconfirms the framework (default Next.js SSR; ecommerce must be SSR) and records it in`state.json → frontend`. Leave this as a placeholder for the frontend step to fill in.## Tokens
:root { / colour — semantic names, never "--pink-2" / --color-base: #…; --color-text: #…; --color-surface: #…; --color-muted: #…; --color-primary: #…; --color-accent-1: #…; --color-accent-2: #…; --color-link: #…; --color-focus: #…; --color-focus-alt: #…; / for surfaces where --color-focus is < 3:1 / / type / --font-display: '<Family> Variable', <fallback stack>; --font-body: '<Family> Variable', <fallback stack>; --text-body: …rem; --leading-body: …rem; / 8-multiple in px / --text-small: …rem; --leading-small: …rem; / 4-multiple in px / --text-h1: clamp(…rem, …, …rem); --text-h2: clamp(…); --text-h3: …rem; --leading-display: 1.05; / unitless; fluid headings are grid-exempt / / 8-point grid / --space-half: 4px; --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px; --space-6: 48px; --space-8: 64px; --space-12: 96px; --space-16: 128px; --target-min: 48px; / shape / --radius-sm: 8px; --radius-card: …; --radius-pill: 999px; --border: …; --shadow: …; --shadow-hover: …; --focus-ring: 3px solid var(--color-focus); --focus-offset: 2px; / layout / --content-max: …px; / multiple of 8 / --header-h: …px; / header band height, multiple of 8; scroll-padding-top uses it if sticky / --logo-h: …px; / header icon (or supplied logo) height, multiple of 8, ≥ 24 / --text-logo: …rem; / site name beside the icon; icon + name + menu button fit at 320 px / }
## Palette roles| Token | Hex | Used for ||---|---|---|## Contrast| Foreground | Background | Kind (body text / large text / non-text) | Ratio | Needs | Passes ||---|---|---|---|---|---|## Type- **Display:** <family> (`@fontsource-variable/<slug>@<version>`), weights …, tracking …; sizes `--text-h1…h3`, `--leading-display`- **Body:** <family> (`@fontsource-variable/<slug>@<version>`); `--text-body` / `--leading-body`, measure ≤ 68ch## Logo- **Concept:** <what the icon shows, plus "From the owner: '<their words>'" only when it followstheir wish | "Supplied by the user" | "Kept from <source>" | "No logo: owner kept the current look"(header shows the site name as text in `--font-display`)>- **Files:** `brand/logo-mark.svg` (header icon at `--logo-h`, and the favicon)- **Use:** the frontend copies `brand/` into `public/`. Header: `<a href="/"><img src="/logo-mark.svg"alt="" style="height: var(--logo-h)"><Site name></a>`, the name as text in `--font-display`, sothe link's accessible name is the site name. Favicon: `<link rel="icon" href="/logo-mark.svg"type="image/svg+xml">`. A supplied or kept logo goes in the link alone, as`<img src="/<file>" alt="<Site name>" style="height: var(--logo-h)">`, with its own favicon if onewas supplied or kept, else the browser default.- **Don't:** recolour or stretch the icon, or replace the name text with an image of it.## Grid, shape & motion<section padding desktop/mobile (space tokens), gutters, breakpoints in px (multiples of 8), borders,radii, shadows, hover behaviour, every animation and its pause control, and "no motion underprefers-reduced-motion".>## Accessibility (WCAG 2.2 AA)- **Focus:** <style; which colour on which surface>- **Targets:** <48 px controls; inline exceptions>- **Links & states:** <underline rule; how active/error states differ beyond colour>- **Motion:** <what moves, where its pause control is>- **Sticky elements:** <none | header uses --header-h + scroll-padding-top>- **Help:** <where the contact link sits on every page>- **Text on images:** <none | scrim spec and resulting ratio>- **Reflow:** <anything special at 320 px>- **Exempt from contrast:** <disabled controls / decorative shapes, named>## Components| Component | Renders (from content model) | Look | ≤ 320 px ||---|---|---|---|| Header + nav | Navigation items | … Nav links and the button never wrap (`white-space: nowrap`); the inline nav collapses to a menu button at <px> (the width it stops fitting one line). | Logo + menu button only; nav items and CTA inside the menu || Post card | Article: image, category, title, excerpt | … | … || … | | | |## Page composition- **<Page>** — <sections top to bottom, each naming its component and band colour>- …## Imagery<subjects, mood and colour fit for photos; search keywords; treatment (frame, crop ratio, radius,duotone…); alt text written from what the photo shows.>## Don'ts- <3–6 site-specific rules, e.g. "no grey cards", "never put body text on the primary accent">
Invariants
- Self-hosted fonts only (
@fontsource). No Google Fonts or other font CDN links in the output. - The tokens block is the only source of values (breakpoints excepted). Components and pages
reference tokens, never raw hex codes, pixel values or font names.