← All writing

5 min readAIProcessDeveloper tools

How our designers started shipping screens in code

I set up the workflow for our dashboard rebuild where designers build screens in the real app and engineers take them to production. The scripts, rules and branch policy behind it, and what it changed.

The usual way a screen gets built goes like this. A designer draws it in a design tool. An engineer rebuilds it in code, guessing at spacing, states and edge cases. The designer reviews the result, finds the differences, and the two go back and forth until it matches. Every screen is built twice, and the second build is where most of the drift creeps in.

When we started rebuilding our merchant dashboard as a new app, I was choosing its architecture anyway, so I tried to remove that second build. Designers would build screens in the app itself, with the same components that ship, and engineers would pick up from there. Here’s how that was put together.

The idea: one codebase, two halves of the job

The split is simple once you say it out loud:

  • Designers own how a screen looks and behaves, built with real components against mock data.
  • Engineers own what makes it real: live data, permissions, loading and error states, performance and release.

For that to work, a designer’s screen has to already be code an engineer is happy to keep. So most of the effort went into making the right way to build a screen the easy way.

1. Rules the agent reads before it writes anything

Designers build with an AI coding agent, so the conventions live in the repo, in the instructions file the agent reads first:

  • Every API call goes through a hook, and every feature has its own service file.
  • Forms use one form library, the same way everywhere.
  • UI comes from the design system’s components, never hand-rolled markup.
  • Imports use the same path aliases.

These are the same rules engineers follow. Written down once, they mean a designer’s screen and an engineer’s screen look like they came from the same person, which makes the hand-off a continuation rather than a rewrite.

2. Three scripts, so nobody needs to learn Git first

Designers shouldn’t need a terminal tutorial to contribute. I wrote three double-click scripts for macOS:

  1. Set up, once. Installs the developer tools, Node, the GitHub CLI, an editor and the coding agent, then clones the repo.
  2. Start a feature. Asks for a name, creates a design/<name> branch and runs the app against the test environment, so the designer sees the real product with their change in it.
  3. Publish a feature. Pushes the branch and adds a row to a feature tracker file in the repo: which screen, which branch, who made it.

That tracker became the queue. An engineer looking for the next thing to integrate reads the tracker, not a chat thread.

A starter prompt ships with the scripts. It tells the agent to build UI only: mock and masked data, no API calls, no credentials, no new dependencies. That keeps a design branch about design, and keeps anything sensitive out of it.

3. An agent inside the running app

Describing a change in a terminal is awkward when what you care about is a button on screen. So designers worked through Lumen, a small chat window I built that sits inside the running app in development. You point at a component, describe the change, and watch it update.

Lumen is on a short leash. It can’t read secret files, it can only use an allowed set of tools, it publishes only through pull requests from design branches, and the build fails if any of it reaches production. I wrote about that part in Guardrails for an AI agent that edits your app.

4. Branch policy as the safety net

Design work only ever lands on design/* branches. The main and release branches are protected and only take reviewed pull requests. A designer can experiment as much as they like, and the worst outcome is a branch nobody merges.

The engineer’s half

When a screen was ready, I (or another engineer) took the branch and made it real:

  • Swapped the mock data for hooks and services against the live API, and mapped the response into what the screen expected.
  • Added permissions, so each user sees only what their role allows.
  • Filled in the states mock data never shows: loading, empty, error, partial data.
  • Checked parity with the old app, where the screen replaced one.
  • Reviewed, merged and released it.

The designer’s layout, spacing and interactions stayed as they were. Nobody rebuilt a picture.

What changed

  • No translation step. A designer’s screen was already production code, using the design system that ships. The pixel-review round mostly disappeared.
  • Engineers worked on the hard parts. Our time went to data, permissions and performance instead of re-creating layouts.
  • It scaled. The merchant rewrite alone took in 37 design branches, and the app went from its first commit to production in about three months.

What I’d tell anyone trying it

  • The rules file is the product. When the agent produced something an engineer had to undo, the fix was nearly always a missing rule. Keep it current.
  • Watch someone use the scripts. I gave the design team a walkthrough, and the follow-up fixes were all small: a sign-in step that no longer blocks, better editor checks, a terminal window that closes itself. Each one was a reason to give up.
  • Keep mock data honest. Mocks shaped like the real API make integration quick. Mocks invented from scratch mean remapping everything later.
  • Be clear about authorship. When designers’ commits get squashed into an integration branch, say so in the pull request. Credit matters, and so does knowing who to ask.

The point was never to turn designers into engineers. It was to stop building every screen twice, and to let each person spend their time on the half of the job they’re best at. You can see where this fits in Architecting two dashboards.

↑↓ move↵ openesc close