explored

Giving a design agent eyes

An agent can write CSS all day, but it can't tell whether the page looks right unless it sees it.

AI agents designed and built this site, and screenshots made most of the decisions. Headless Chrome covered desktop. Playwright covered phones and let the agent drive the page like a user.

The first design missed

The first version was a clean notebook look: warm off-white paper, dark ink, one accent colour. My verdict: it looked like a slideshow. I wanted something more striking.

The first design: a dark hero with the name, then white cards on off-white paper

Three designers at once

So Claude Code ran three design agents in parallel, each with its own direction (editorial, terminal, and atmospheric), its own git worktree, and its own preview server. Each one had to screenshot its work at desktop and phone sizes with headless Chrome, look at every screenshot, and iterate at least twice before reporting.

Editorial direction: a huge serif name on black, posts as a numbered list

Terminal direction: a shell prompt with a blinking cursor, posts as ls output

Atmospheric direction as I first saw it: the name in a large serif over a starry night sky

I compared the screenshots side by side and picked atmospheric: a full-width photo with the text on top. Then I asked for Norway, and the hero became Preikestolen in fog.

The atmospheric design after the Norway round: the name over fog, with the Preikestolen cliff below the fold

Why Playwright

Headless Chrome was the only option for three agents at once, since they would have had to share the one Playwright browser. It had a catch on phones: headless Chrome wouldn’t lay the page out at a real phone width, so a “phone” screenshot showed a wider layout, not a phone. The Playwright MCP server fixed that. It gives the agent a real browser it can resize to 390 by 844, navigate, and screenshot.

The homepage today on a 390 pixel wide phone, with the first post card peeking in at the bottom

Four decisions came straight from those screenshots:

  • The hero on phones. A full-height photo pushed every post below the fold. I cut the hero to 70% of the screen height so the first card peeks out and invites a scroll.

  • The arrow. The heading font, Newsreader, has no arrow glyph. A text arrow fell back to another font and sat thin and off-centre. It’s an inline SVG now.

    Before: a thin text arrow after the Posts heading After: a heavier inline SVG arrow

  • The footer rule. A thin line above the footer looked right on the homepage and doubled up on post pages, which already end in a ruled row. It’s homepage only.

  • Small misses. A broken image frame before the photo existed, a footer out of line with the text column, a footer floating mid-page on the short 404 page, and body text a touch too large on phones.

What screenshots don’t do

Tests cover what screenshots can’t. They run on every build of this Astro site. They check that every post appears in the sitemap and the archive, and that each tool page has exactly one main heading. I measured contrast instead of eyeballing it: the hero text stands out clearly against the fog, and the gradient behind the post list keeps small text above the 4.5:1 that accessibility guidelines ask for.

Where it goes wrong

  • Stale pages. The Playwright tab kept the old CSS after a rebuild, so the agent was judging yesterday’s page. A new query string on every visit fixed it.
  • Only Chromium. Every screenshot came from Chromium. I checked Firefox on my phone by hand but not Safari, and some effects on this site only run in Chromium anyway.

Terms of use

The photo is from Unsplash, by Valdemaras D., credited in the footer. The starry sky in the early draft was a temporary Unsplash photo by Benjamin Voros. Whatever the agent reads, screenshots included, goes to the model provider under its terms.

Where it ended up

Explored. I make the calls from screenshots instead of reading CSS, and agents that check their own screenshots catch small misses. Nothing enforces that check yet.