← Back to writing

Making the app look like the design

Agents write good code because they can verify it. Once I built a verification step for Bille's screens, the implementation started to match the design.

aiagentsworkflowengineering

How do you get an agent to implement a screen the way you designed it? The short answer is that you do not ask better: you give it a way to check.

I have been working with coding agents for a while, and one thing stood out from the start. They write good code mostly where they can verify it. Tests, types and the build tell them whether what they did works, and with that signal they iterate until it does. It is hill-climbing: try, measure, keep what improves.

What took me longer to see is that this is not a property of code but of verification. If I build a robust way to check anything else, the same agent starts climbing that hill too. Today I think designing verification is one of the most important disciplines for working with AI, and this post is the case that convinced me.

Where the design got away from me

Bille is the personal finance app I have been working on, with agents doing a good share of the work. Every screen has an HTML mockup, with the same sample data the app uses, and an agent implements the screen against it.

When I started, the implementation drifted far from the design. It did not come out ugly: it came out as a different screen.

The best example is Home, the first thing anyone sees when they open the app. This is how things stood on October 10, 2026, in the second design review round of the PR that brought in the new brand.

Three screenshots of Bille's Home screen on a phone. Left, the design mockup with the pesos card, the Visa debt and the five-tab bar. Center, the implementation from October 10, with blocks per currency, a list of transactions and a two-tab bar. Right, the version on main from October 16, almost identical to the mockup.
Bille's Home on a phone, 390 × 844, light theme. Left: the design mockup, commit 78cb91e from 2026-10-16. Center: the implementation in review round 2 of PR #191, 2026-10-10, with 7.26% of pixels different. Right: Home on main on 2026-10-16, in the comparison run for PR #200, with 0.03%. All three screenshots are real, not reconstructed.

In the design, Sofi (a made-up test user) opens the app and sees a card with what she has in pesos across her favorite accounts, the Visa debt, a note from Bille with two things to look at, a search icon and a five-tab bar at the bottom. The implementation from that day had none of it. It had blocks per currency with negative balances in terracotta, a list of recent transactions with an edit button on every row, and a two-tab bar. Even the test user was someone else.

The agent had the mockup. What it did not have was a way to know how far off it was, and without that every small decision, a component that already existed or a pattern it found convenient, pushed it a little further away.

The number says where to look

The first thing I built was a visual diff between the mockup and a real screenshot of the app. Both images are generated at the same size with the same data. A script cuts each one into named regions (top bar, content, bottom bar, dialogs) and counts how many pixels differ in each region, against a threshold specific to that region. Every state of every screen ends up as pass, review or fail.

For the Home from October 10, the comparator reported 7.26% of pixels different across the whole screen. Fail. The Home that is on main today, measured on October 16, reported 0.03%. Pass.

And here is the detail I care about most: 7.26% understates the difference. To the eye, the two screens have almost nothing in common. But the light backgrounds on both are similar, and backgrounds are most of the pixels, so the number comes out small. That is why the number approves nothing: it marks where to look, and the review by eye decides.

That review is done by me or by an agent, with the screenshots side by side and the comparator’s result at hand. It looks at what the pixel cannot see:

  • The text, word by word, against the copy document. The copy lives in docs and the app copies it literally.
  • The ink, which has to be the brand’s black and not a similar gray.
  • The terracotta, which goes only on expenses.
  • Pesos and dollars, which are never added together.
  • The edges of the logic, like what happens when you undo a transaction that is already in another group.

Feedback goes as a review on the PR, with at most two rounds. With the design OK and the local checks green, whoever implemented it can merge without waiting for me.

And one rule that is not up for discussion: a threshold is never raised so that something passes. If it fails, the mockup or the app gets fixed. On Android the thresholds are more tolerant than on web, because there I prefer the native Material components over copying the design pixel by pixel, but I decide the thresholds and they do not move to hide a difference.

What changed around it

The Home case led me to build the verification, and the verification changed the rest of the process.

  • The integration branch was dropped. Screens stopped piling up on a separate branch.
  • A ticket is one complete screen. Design makes the mockup and the screen’s inventory, and only then is it implemented against that.
  • Base components are shared. Fidelity to the design is earned once in the component, and every screen that uses it inherits it.

The result showed up fast. When the new-brand PR merged, on October 12, 2026, the final comparison reported 95 states passing, 9 to review and 0 failing. Since then the implementation has largely matched the design, and with agents that is not easy.

What went wrong: twelve failures that were not the app’s

On Transactions, the screen with the list of expenses and income, the comparator marked all twelve states as failed. It looked like an implementation disaster and it was not. The mockups still had the old two-tab bar and a fixed text field at the bottom, which no longer existed in the app, and the screenshots were missing the dark veil that goes behind dialogs.

It was fixed on both sides, with the mockups updated and a PR on Android for the veil, without touching a single threshold. The twelve states moved to review, and what remains are differences in test data. Along the way, the review by eye found two logic errors in undo and an empty-state text that talked about a field that was no longer there (“Tell me the first one below…”). It now says “Tap Add and tell me the first one.”

The practice that stuck is that the verifier gets maintained too. On a structural change, the mockup is updated first. Otherwise the comparator fails because of an old design and not a real error, and a verifier that fails for the wrong reasons stops being useful fast.

The change that mattered

Describing the screen better to the agent did not fix it, and giving it a way to measure how far off it was did. An agent will climb any hill you mark out for it, and marking it well is the work that stays on this side.