Mirror Display
What it is
Mirror Display is a kiosk app for a mirror-coated screen in the XLab, the demo space I run for Gensler's DXD group: a black background, invisible through the mirror coating, with the time, local weather, air quality, and a live SFO departures board floating on the glass.
The app itself is intentionally simple. What this case study is actually about is the process behind it: how much planning up front it takes to get an AI agent to build something correctly in one long autonomous run, instead of a back-and-forth chat. I wrote a phased spec with its own success metric, let Claude Code execute it with almost no intervention, and stepped in twice: once to approve a dependency, once to correct three things the spec couldn't catch on its own.
Stack and tools
Frontend: Vite, React, TypeScript.
Backend: Hono on Node, one process serving both the static build and /api/*.
Testing: Vitest for units, Playwright for end-to-end and visual-regression (screenshot diffing via pixelmatch/pngjs).
Design extraction: a pixel-measurement script (pngjs) that reads colors, fonts, and layout straight off the Figma export instead of hand-tuning CSS to match it by eye.
Data: Open-Meteo for weather (no key needed), Aviationstack for flights (mocked until a key is provisioned).
Package manager: pnpm. Repo setup: GitHub CLI. Built with Claude Code executing the phased brief above.
Writing the brief so the agent could run on its own
Before any code, I wrote a phased build plan, not a one-line prompt: five build slices with pass/fail criteria for each, an explicit list of dependencies the agent could add without asking, required stop-and-report conditions, and a Windows packaging stage at the end. Here's the skeleton of it:
PHASE 0: Derive design assets (commit when done)
Measure colors, fonts, spacing, row heights directly from the Figma export
Generate design/reference.png as the literal target for every visual test
PHASE 1: Slices 1-5
Scaffold + verify pipeline + static layout
Clock (blinking colon) + date
Weather adapter (mock -> live Open-Meteo)
Metrics (air quality, wind, humidity)
Flight board UI (mock data, pagination, auto-rotation)
PHASE 2: Real flight adapter, proven against SYNTHETIC data
Quota guard, disk cache, fixed fetch schedule
pnpm test:contract validates the mapper against a REAL fixture
when present, else skips with a clear message
PHASE 3: Kiosk hardening + Windows packaging
Wake lock, scheduled reload, pixel-shift, self-recovering error boundary
start-mirror.bat: restart-on-exit loop, health check, kiosk launch
STOP AND REPORT if:
a dependency outside the allowed list is needed
the same failure repeats 3 times
a step would change the design or the spec
Definition of done: pnpm verify passes AND the rendered screenshot
matches the design within 2% pixel difference.
That last line did most of the work. Giving the agent a number it could check itself, a screenshot diff under 2%, meant it didn't need me in the loop to judge whether something looked right. It could render its own output, compare it to the design pixel by pixel, and decide for itself whether to keep iterating. That's most of why this ran in one long sitting instead of fifteen rounds of "can you fix the spacing here."
What it did with it
Claude Code ran the whole plan: a script that measures the Figma export's colors and layout directly instead of eyeballing them, all five build slices, the real weather and flight adapters, a full test suite, and the Windows kiosk scripts. It stopped exactly once to ask permission, correctly: it needed a TypeScript linting dependency outside the allowed list, flagged it, and waited. I said yes.
It got exactly three things wrong, and all three were the same kind of mistake: it matched the design image literally where the actual product needed something different. It rendered temperatures in Celsius and times in 24-hour format because that's what the mock showed, and let the flight board's header run edge to edge past the row backgrounds below it. [Screenshot: the two annotated review screenshots marking up the 12-hour/Fahrenheit/alignment feedback -- a good before/after pair] I caught all three by looking at the running app myself and sent the corrections back in one pass.
Where it stands
pnpm verify is green (unit tests, Playwright end-to-end, a production build) on a Vite/React/TypeScript frontend and a small Hono/Node backend, and the measured screenshot diff against the design sits at 0.53%, under the 2% bar the spec set. [Screenshot: the rendered kiosk screen at design resolution, or the passing pnpm verify output]