Back to HTML Pub

Your AI Can Build One Great Page. Here's How to Get It to Build a Whole Site That Matches.

Michael Sacca•
AI-Native Publishing
Frontend Development
Tutorials

Ask an LLM to build you a page and you'll usually get a good page. Colors that work, reasonable typography, a decent layout. Ask it to build you ten pages — a home page, an about page, a services page, a blog, a contact page — one at a time, and you'll get ten pages that were clearly made by ten different designers who never spoke to each other. The blue on page 3 is not the blue on page 7. The nav is in a different place. The buttons are rounded here and square there.

This isn't the model being flaky. It's the model having no memory between prompts. Each generation is a fresh roll of the dice on every aesthetic decision, because you never told it what the decisions were. The fix is unglamorous and extremely effective: you write the decisions down once, in a file, and you make every future prompt point at that file.

What the spec file actually is

It's a single markdown or CSS file that lives in your project folder — I call mine design-system.md, but the format matters less than the contents. It needs to answer, in concrete terms, every question the model would otherwise answer by guessing:

  • Colors. Not "blue accent" — actual hex codes. Primary, secondary, background, text, borders. Six or seven values, written out.
  • Typography. The font family (one, maybe two), the heading scale, and body text size and line height. If your AI-generated site uses Google Fonts, name the exact family and weights.
  • Spacing. Most "mismatched" AI sites are really just spacing-mismatched. Pick a base unit — say 8px — and state that padding and margins come in multiples of it.
  • Components. What a button looks like (radius, padding, color), what a card looks like, what the form inputs look like. One or two sentences each, or better, actual CSS classes.
  • Nav and footer. The structure: which links, in what order, on every page. This is the thing AI gets most consistently wrong across pages, so pin it down hard.
  • Page template. A short description of the skeleton every page shares — where the header goes, where the main content sits, what the footer contains.

Here's a trimmed-down example of what the file looks like in practice:

# Design System

## Colors
- Primary: #1a4fd8
- Accent: #f4a62a
- Background: #ffffff
- Text: #1c1c1e
- Muted text: #6b7280
- Border: #e5e7eb

## Typography
- Font: Inter (400, 600, 700) via Google Fonts
- H1: 2.5rem, 700
- H2: 1.75rem, 600
- Body: 1rem, 400, line-height 1.6

## Spacing
- Base unit: 8px. All padding/margins in multiples of 8.

## Components
- Buttons: border-radius 6px, padding 12px 24px, background Primary, white text.
- Cards: border 1px Border, border-radius 8px, padding 24px, no shadow.

## Shared structure
- Every page: same header (logo left, nav right: Home, Services, About, Blog, Contact)
- Same footer: 3 columns — about blurb, links, contact info

Nothing in that file is clever. That's the point. It's a list of decisions, and decisions are exactly what the model lacks between prompts.

How to use it so the model actually follows it

The pattern is simple: the spec file gets attached or pasted into every generation prompt, and the prompt explicitly forbids improvisation. Something like:

Using the design system in design-system.md, build the Services page.
Every color, font, button style, and the nav and footer must match the
spec exactly. Do not introduce new colors, fonts, or components. If you
need something the spec doesn't cover, flag it and ask before adding it.

Two parts of that prompt do more work than the rest. The first is "do not introduce new colors, fonts, or components" — models will happily add a third accent color if a section feels like it needs one, and that's how drift starts. The second is "flag it and ask before adding it." That single instruction converts silent drift into a visible decision. When the model says "the pricing table needs a highlighted tier — should I use the accent color or add a new success green?" you get to say "use the accent," and the system stays coherent.

If you're working with Claude through a file-reading setup — or an MCP server that can read your project folder, which we've covered in Your Site Is Already Live. Here's How to Let Claude Edit It Without Rebuilding It — the spec file becomes even more powerful, because Claude reads it straight off disk and you don't have to paste it into every prompt. But the same pattern works entirely inside ChatGPT's canvas or any chat interface; you just re-attach the file each time.

Generate the pages in the right order

One more thing that keeps ten pages from becoming ten experiments: don't generate them all at once, and don't generate them in a random order.

Start with the home page. Treat it as the design reference — iterate on it until you actually like it, because everything else inherits from it. Then write the spec file from the finished home page. Easiest way is to just ask: "Here's the home page code. Write a design-system.md that captures its colors, fonts, spacing, and components, so future pages can match it." The model is good at reverse-engineering its own choices into a spec.

Then generate the remaining pages against that spec, one at a time, reviewing each before moving to the next. The review is fast — you're only checking "does this look like the home page's sibling?" — but it catches drift while it's still one page's worth of drift instead of nine pages' worth.

The prompt pattern for adding pages later

The real test of the system is six months from now, when you need a pricing page or a portfolio page and the original chat session is long gone. This is where most AI-built sites fall apart, because the new page gets built from a bare prompt with no context.

The pattern that prevents this is a standing instruction you keep saved somewhere — a "new page" template:

Read design-system.md. Build a new page at /pricing/index.html for
[describe the page's job and content]. Follow the spec exactly for all
colors, typography, spacing, buttons, forms, nav, and footer. The nav
order is defined in the spec — insert "Pricing" in [position]. Do not
introduce new styles. If the page needs a component the spec doesn't
define, propose it and wait for approval, then update design-system.md
with the approved component.

That last line is the part people miss, and it's the part that makes the system self-sustaining. When a genuinely new component gets built — a pricing table, an image gallery, an FAQ accordion — it goes into the spec. Now it's part of the design system, and every future page can use it without reinventing it. The spec grows as the site grows, and the site stays one product instead of accreting one-offs.

If you've set up a recurring maintenance loop like the weekly audit in Your AI Web Creator Built the Site. Here's the Prompt That Keeps Maintaining It Every Week., add one check to it: "compare every page against design-system.md and report any page that deviates." Drift that slips past you page by page gets caught by the loop.

Why this beats asking for the whole site in one shot

You might reasonably ask: why not just prompt "build me a 10-page site" and let the model handle consistency itself, in one generation? Sometimes that works, and for a small site it's worth trying. But in practice, single-shot full-site generations have two failure modes. The model runs out of output budget and quietly stubs out the later pages, or it gives you ten pages with consistent-but-generic design — no personality, because it spent its attention on breadth. Page-by-page generation against a spec gets you both consistency and the iteration time to make the home page actually good.

The spec file is fifteen minutes of writing that saves you from the thing that makes AI-built sites look AI-built: not bad design, but inconsistent design. One product, ten pages, zero experiments.

Keep Reading