Dario Codipietro

Case study · 2026 · Lead Product Designer

GitLaw: Figma to code

Development at GitLaw had accelerated with agentic workflows. Design had not: it was still manual and iterative, and it ended in a handoff. I automated the path between Figma and the front-end repo in both directions, and made the repo the thing both sides agree on.

Role
Lead Product Designer
Team
Design, engineering, product, CEO
Shape
A sandbox, then the product repo, then a prototyping sibling
A four step loop: Figma mirrors Storybook, Claude Code iterates on designs and writes the code, Storybook is the source of truth, then delivery. Dedicated skills feed the middle step, and design, product, CEO, marketing and dev all feed into it.

Context

Two problems sat underneath the handoff, and they compounded.

Two libraries, no shared surface

Figma and the repo were separate systems, each holding its own copy of the design system, and over time the copies drifted. Thirteen semantic colours existed only in Figma. Nothing existed that both sides could open and look at together, so a built surface was compared to a Figma frame by eye, in review, after it had been built. When it did not match it was often rebuilt rather than corrected, and the work went back to design iteration. Rounds ran to ten and beyond.

A six step flow from Figma through design iteration, handoff, implementation and test to delivery, with dashed arrows returning from test and handoff to design iteration, and three notes beneath explaining the two libraries, the missing shared surface, and the review every built surface has to pass.

The loop before. Six steps from Figma to delivery, two of which return to design iteration, and a published surface that still has to clear QA and design review at the end.

Agents without context

Figma MCP and the out-of-the-box skills had already been released, so pointing an agent at the file was the obvious first move. Without context it hallucinated in both directions: shapes, hex values and hand-rolled positioning going into Figma, raw hex and Figma layer names coming back into code with tokens and variables missing. Iterating made it worse rather than better, because each round started from the previous round’s mistakes.

Figma on the left and code on the right, with Claude Code in the middle. Red tags under each side list what went wrong; dashed tags under the middle list the context the agent did not have: component keys, token map, reference screens, repo conventions.

Both directions, no context. The dashed tags in the middle are what the agent was missing. Without them the errors compound at every round instead of converging.

The approach

Make Storybook the canonical design system and keep it in the product repo, then write the skills that carry an agent between it and Figma in either direction. Figma mirrors Storybook rather than competing with it, and the agent reads the repo’s own conventions instead of guessing at them.

The diagram at the top of this page is the shape it took. The names clustered around the middle step are the point of it: the consequence that mattered most to the team was not speed, it was that anyone with access to the repository could put a UI change into the product. Product, marketing and the CEO, not only the two disciplines that already had the tools.

01Proof of concept

Rebuilding the system in a sandbox

To find out whether the idea held at all, I built a standalone sandbox outside the product. Agents rebuilt the entire design system in Storybook: each Figma component became a story, and each story was checked against a Figma screenshot before it was accepted. I then tested the result by prototyping full pages in Claude Code.

53components
1,475icons
175commits in 2.5 weeks
A grid of twelve Storybook component cards, each showing a rendered preview above its name: dialog, avatar, badge, button, checkbox, input, radio, select, switch, tab, tag and toast.

The sandbox Storybook. Twelve of the fifty-three components, built from the Fig-law library between January and February. The story is the artefact each Figma screenshot was checked against.

02Into the product

Storybook in the front-end repo

Once the sandbox proved the approach, the same method ran inside the product, with a lane the design side could work in: primitives, blocks, foundations and styles.

What made it repeatable was a playbook the agent reads at the start of every session. It lists what exists and what already has a story, so a session starts from the real state of the repo rather than from a guess. On day one, 18 of 54 primitives were covered, and the first commit added 17 stories.

A table of primitives with a story column marked either story or needs story, and a category column: avatar, badge, breadcrumb, button, button group, calendar, card and checkbox. A progress bar beneath reads 18 of 54 primitives had a story on day one.

The playbook. Every primitive, whether it already has a story, and the category it belongs to. The agent reads this first, which is what stops it rebuilding something that already exists.

03Engineering takes it over

Bricks

Engineers picked the Storybook work up and formalised it as bricks: small components with a clear contract, each with a story. They wrote the loop down themselves, in their own documentation. Edit the brick, write the story, screenshot it, compare the screenshot to the design, and go back to the start if it does not match. Every pull request now posts a Storybook URL as a comment.

The loop works because a brick has no server dependencies. It renders in Storybook with props and an IntlProvider, which is what makes the screenshot cheap enough to take on every round.

This is the point at which it stopped being a design initiative.

265files in one PR
4engineers in 2 weeks
A markdown document from the repo titled 15-bricks.md, explaining that bricks exist to enable a visual feedback loop, followed by a five step numbered list ending with: if it doesn't match, go to step 1.

The bricks document. Written by an engineer, not by design. Step five is the whole mechanism: if the screenshot does not match the design, go back to step one.

04Outcomes

Code from Figma

With the skills in the repo, an agent matches repo components against a Figma file someone shares with it, and the design can then be iterated in code until it matches what was asked for. The components it reaches for are the stories in Storybook, and those are the same components that go to production.

48files in the landing PR
13tokens code was missing
The same signed-in landing page twice: the Figma frame above, the page built from it below, with a note between them stating that the components and tokens are the same.

One run, both ends. The Figma frame above, the page built from it below. The note between them is the only claim being made: same components, same tokens, iterated in Claude Code until it matched.

Figma from a prompt

The same pipeline runs the other way. Ask for a screen in plain words and the agent builds it in Figma from the library: components by key, colours as variables, auto-layout throughout, checked against a template, three variants in one pass. A single command classifies the request, creates the file, updates the ticket and repairs its own rules when a run goes wrong. That last part is why the playbook behind it grew from one file to twelve over three weeks.

Three overlapping Figma frames of the same settings memories screen, labelled list, grouped and cards, generated from one command.

Three variants, one command. The same settings screen as a list, as grouped controls and as cards. Built in Figma from the library rather than drawn, which is why the components and the colours are the real ones.

05Validation

Checking it against other practitioners

I posted an outline of the process publicly to see whether it held up outside our own repo: Storybook in the repo, align the Figma library, shells as templates. The replies confirmed that other designers were automating the same loop, and one of them named the gap I would take on next. How do people who never touch a coding agent still take part?

A posted outline of the three steps with two replies beneath it from other practitioners, the second one highlighted, asking how non-developers might still collaborate in the new workflow.

The thread. Two replies: one confirming the direction, one asking the question the next piece of work had to answer.

06Improvements

A repo for people who do not write code

Adoption stopped at designers and developers, which is the gap the thread had pointed at. To let product and the CEO explore and validate fresh ideas, I set up a sibling repo for early-stage prototyping.

It works because of three deliberate differences from the product repo.

  1. It does not hold strictly to front-law components, so exploration has more room, but it keeps the tokens and the same design language.
  2. It carries full product context, so what gets explored is informed by what the product can do and what the stack allows.
  3. It keeps project status in the repo, so a prototype can be evolved across sessions rather than depending on what one session remembers.
31prototypes in 5 weeks
58PRs by the CEO
122sessions recorded
A prototype of the signed-in product home rendered in the playground, with numbered markers on the sidebar and the greeting, and a status file panel on the right recording the current version and the latest session.

A prototype in the playground. Single-file HTML in the product palette and type. The status file on the right is what lets the next session pick up where the last one stopped.

What worked, and what did not

Worked

  • A consistent process for generating code from Figma, and for iterating on Figma from code.
  • A much faster cycle from design to implementation.
  • A prototyping playground that kept the whole team in sync on new ideas.

Did not

  • Figma generation stayed relatively slow, and it was never fully reliable.
  • The prototyping repo was disconnected from Storybook, which left it valuable mainly as an ideation tool.
  • The Figma library still had to be aligned with Storybook by hand.

The last of those is the one that mattered. As long as the Figma library has to be kept in step by a person, a person is still the integration layer between the two systems. The next project took that job away: agents own the design cycle end to end, which is what Building Fiuto is about.

Contact

Get in touch

Product design lead across research, design systems and handover, with coding agents in the loop. Contract, outside IR35, or a permanent lead role.

Available
Now
Location
London, remote or hybrid, UK and EU
Right to work
UK settled status, EU citizen

Send a message

The role, the team, the timing. It reaches me directly.