One brief, many screens: keeping AI-built interfaces on brand

APIKeyClaudeFree · Updated 2026-11-22 · 8 min read

Colour swatches and sketchbook on a desk
A small set of decisions keeps every generated page aligned.

People who are not designers by training increasingly use AI tools to produce interfaces, and a recurring discovery is that the results improve sharply once they stop describing each page from scratch. Instead, they first define a small design system, colours, type scale, spacing, a handful of components, and then ask the model to build every page from it. The pages look like they belong together, revisions get shorter, and fewer tokens go into restating style on every request.

This guide shows how to write such a design brief in a form language models follow well, how to feed it to any chat API or coding tool, and how to check output against it. It is written for developers and makers building landing pages, dashboards or small apps with AI help, whichever model they use.

Frequently asked questions

What is a design system in this context?

A short, explicit set of decisions about how an interface looks and behaves: colour tokens, font sizes, spacing steps, border radii, and how common components such as buttons, cards and forms are built. For AI use, it is a text document the model reads before generating.

What are design tokens?

Named values for visual decisions, such as --color-primary or --space-4. Code refers to the names instead of raw values, so changing a token updates every place it is used. Models follow named tokens more consistently than loose descriptions.

How does a design brief differ from a style prompt like modern and clean?

Adjectives leave every decision to the model, which falls back on generic defaults. A brief states the decisions themselves, so the model has little to invent and outputs stay consistent across requests.

Does a design system really save tokens?

It usually does over a project. You spend some tokens including the brief, but you avoid long style descriptions in each request and, more importantly, many rounds of corrections. Shorter revision cycles are where the savings come from.

Which is better for UI generation, a frontier model or a smaller one?

Frontier models produce more polished layouts and handle complex components better. Smaller models can follow a clear brief well for simple pages. A strict brief narrows the gap because it removes guesswork.

Should the brief be CSS, JSON or prose?

A mix works best: CSS custom properties for tokens, short prose rules for usage, and one or two code examples of key components. Models handle all three well.

Can I use the same brief across different AI tools?

Yes. That is one of its main benefits. Store it as a file in your project and include it in prompts, project instructions or a coding assistant's rules file, whichever tool you use.

Step by step

  1. Decide a small token set — Define colours, type scale, spacing and radii as CSS custom properties, keeping the list short and contrast-checked.
  2. Define key components — Write one code example and two or three rules for buttons, cards, form fields, navigation and headings.
  3. Add layout and voice rules — State content width, breakpoints, section spacing, mobile-first intent and a few lines on copy tone.
  4. Feed the brief on every request — Store it as a project file and include it in the system message or the coding tool's rules, asking the model to flag anything missing.
  5. Check and refine — Run an automated check for raw values, review visually, and update the brief whenever a mistake repeats.

Why page-by-page prompting drifts

Ask a model for a pricing page today and a features page tomorrow, and you will often get two different shades of blue, two button styles and spacing that does not line up. Each request is independent; the model has no memory of yesterday's choices unless you supply them. Even within one long session, earlier decisions get diluted as the context fills.

The usual reaction is to correct each page: "make the buttons match", "use the same heading size". Those corrections cost tokens, time and patience, and they rarely stick for the next page. A design brief moves those decisions from corrections into the input.

Models fill gaps with defaults

When a prompt does not specify a decision, the model picks what is most common in its training data. That is why unconstrained output tends to look generic. A brief replaces those defaults with yours.

Consistency is cheaper than correction

One page of rules read once per request is shorter than several rounds of fix-ups. The more pages you build, the more the brief pays off.

Step one: decide the tokens

Start small. You need a primary colour, a neutral scale for text and backgrounds, one accent for warnings or highlights, a type scale of four or five sizes, a spacing scale of six to eight steps, and one or two radius values. Write them as CSS custom properties, because models produce CSS constantly and treat named variables reliably.

Resist adding dozens of tokens. Every extra choice is another thing the model can misuse. A tight set forces consistency, and you can extend it later when a real need appears.

Pick colours with contrast in mind

Check that text and background pairs meet accessibility contrast guidelines before you hand them to a model. The model will use your pairs faithfully, including bad ones.

:root {
  --color-bg: #ffffff;
  --color-surface: #f6f7f9;
  --color-text: #1b1f24;
  --color-muted: #5b6470;
  --color-primary: #1f6feb;
  --color-primary-text: #ffffff;
  --color-warning: #b35900;

  --font-body: system-ui, sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;
  --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;

  --radius-sm: 6px;
  --radius-lg: 14px;
}
Paint cans in graduated shades
Named tokens give the model a fixed palette to work from.

Step two: define a few components

Tokens alone still leave room for interpretation. Add short definitions for the components you use most: button (primary and secondary), card, form field, navigation bar and section heading. For each, give one code example and two or three rules.

Examples matter more than descriptions. A single correct button in HTML and CSS teaches the model padding, radius, font weight and hover style at once. Rules then cover what the example cannot show, such as "only one primary button per section".

Say what not to do

Short prohibitions prevent the most common drift: "no gradients", "no drop shadows", "no raw hex values outside :root". Pair each with the alternative so the model knows what to do instead.

  • Button: padding var(--space-3) var(--space-5), radius var(--radius-sm), one primary per section.
  • Card: background var(--color-surface), radius var(--radius-lg), padding var(--space-5), no shadows.
  • Heading: section titles use var(--text-xl); page title var(--text-2xl), never both on one screen twice.
  • Form field: label above input, full width on mobile, error text in var(--color-warning).

Step three: add layout and voice rules

Layout rules keep pages aligned: maximum content width, grid columns at each breakpoint, vertical rhythm between sections. Three or four lines are enough, for example "content max width 1100px, sections separated by var(--space-7), single column under 700px".

If the model also writes copy, add a few lines on voice: sentence case for headings, no exclamation marks, short sentences, concrete benefits rather than superlatives. Copy is part of the design, and inconsistent tone is as noticeable as inconsistent colour.

Mobile first, stated explicitly

Models often design for wide screens and treat mobile as an afterthought. A rule like "design for 375px first, then enhance" changes the output structure noticeably.

Keep the brief under a page or two

A concise brief is read reliably on every request. Long documents get skimmed by the model just as they do by people, and rules in the middle are the first to be ignored.

Uniform building blocks forming a small house
Reusable components produce consistent layouts.

Step four: feed the brief to the model

Store the brief as a file in your project, for example design/brief.md with the CSS tokens included. In a coding assistant, reference it from the project's rules file so every session loads it. With a chat API, put it in the system message and keep the user message for the specific page.

Ask the model to use only the defined tokens and components, and to say explicitly when it needs something the brief does not cover. That prompt line turns silent inventions into visible requests you can approve or reject.

Ask for sections, not whole sites

Generating one section at a time keeps outputs short, easier to review and less likely to drift. Assemble pages from approved sections.

from pathlib import Path
from openai import OpenAI

client = OpenAI(base_url="https://api.apikeyclaudefree.com/v1", api_key="not-needed")
brief = Path("design/brief.md").read_text(encoding="utf-8")

system = (
    "You build HTML and CSS strictly from this design system. "
    "Use only the tokens and components defined below. "
    "If you need anything not covered, list it under 'Missing' at the end instead of inventing it.\n\n"
    + brief
)

resp = client.chat.completions.create(
    model="free-ai",
    messages=[
        {"role": "system", "content": system},
        {"role": "user", "content": "Build a pricing section with three plan cards and one primary button per card."},
    ],
    max_tokens=4000,
)
Path("pricing.html").write_text(resp.choices[0].message.content, encoding="utf-8")

Step five: check output against the brief

Automate the easy checks. A short script can flag any hex colour outside the token block, any font size not in the scale, or any inline style. These catch most drift before you even open the page in a browser.

Then review visually. Put new sections next to existing ones and look for mismatches. When you find one, fix the brief rather than only the page: add a rule or an example so the same mistake does not repeat.

Let the model review its own output

A second, short request that includes the brief and the generated code, asking "list every violation of the design system", often catches issues a regex cannot, such as two primary buttons in one section.

import re
import sys
from pathlib import Path

html = Path(sys.argv[1]).read_text(encoding="utf-8")
body = re.sub(r":root\s*\{[^}]*\}", "", html)

problems = []
problems += [f"raw colour {m}" for m in re.findall(r"#[0-9a-fA-F]{3,8}\b", body)]
problems += [f"raw size {m}" for m in re.findall(r"font-size:\s*\d+px", body)]
problems += ["inline style"] * len(re.findall(r"style=\"", body))

print("\n".join(problems) or "No token violations found")
Binder of layout sheets on a table
Store the brief as a file every tool can read.

Evolving the system as the project grows

A design brief is a living document. As you build more pages, you will discover components you did not plan for: a pricing table, a testimonial-free comparison grid, an empty state. When a new pattern appears twice, promote it into the brief with an example. When a token is never used, remove it.

Keep a short changelog at the top of the brief. Models do not need it, but you do: when an older page looks different, the changelog tells you whether it was built before or after a rule changed, and whether it needs regenerating.

Regenerate rather than patch

When a token changes, regenerating an old section from the updated brief is often faster and cleaner than editing it by hand, and it confirms the brief alone is enough to reproduce your design.

Share the brief with humans too

The same document helps collaborators and future you. A brief written clearly enough for a model is usually the clearest style guide a small team has ever had.

Choosing a model for interface work

Frontier models, Claude among them, produce noticeably more refined layouts, handle complex interactive components better and need fewer corrections. If interface quality is central to your product, a paid key through the provider's official console is worth it.

For simple marketing sections, documentation pages and internal tools, a mid-sized model following a strict brief does respectable work. The keyless endpoint here serves free-ai, an independent open-weight model of roughly 35B parameters. It is not Claude, and the site is not affiliated with Anthropic. Its context of 32,000 tokens comfortably holds a brief plus a section request; see what fits in a given context.

Smaller models need firmer rules

With compact models, examples and explicit prohibitions matter even more. The techniques in prompting smaller models apply directly to design briefs.

Watch for vendor defaults in plans

When a coding assistant plans the front end, check that it uses your brief rather than pulling in an unrequested component library or service, a pattern discussed in why assistants pick their own stack.

Measuring tape over a folded shirt
Check each output against the brief before accepting it.
Try the free API

Send a test prompt to the keyless free-ai endpoint from the chat box on the home page, no sign-up or key required.

Read also