Medius · AI · Internal tooling · Sept 2024 – Aug 2025

From Figma to production React — automatically.

An AI pipeline that speaks a 350-component design system.

90–95% fidelity

The problem

Every release, engineers manually translated Figma designs into React code compliant with a 350+ component design system — a full-time tax across dozens of product teams. Every existing tool failed the same way: Figma’s own AI scored under 30% accuracy, V0 and Bolt.new have no concept of your design system, and fine-tuned models hallucinated props that don’t exist. None of them know what your components are allowed to look like.

My role

Owned implementation end-to-end, pairing with the platform architect in an XP-style setup — they owned architectural calls, I owned the build.

Constraints

Hard correctness requirement — generated code had to use only real components with real props. No budget for a labeled fine-tuning dataset. Output had to be trusted without a human reviewing every generation.

What I built

  1. Extract Figma node metadata and screenshots.
  2. Match them against a component catalogue built from Storybook docs — id, real JSX snippet, exact props and defaults, screenshot.
  3. Generate JSX with GPT-4o, constrained to that catalogue.
  4. Render the result live behind an error boundary.
  5. Reflect. A reflexion loop feeds render errors back to the model for self-correction.
  6. Converse. A chat interface lets designers say “make the button smaller” in plain English.
  7. Log every generation to structured JSON.

Outcome

90–95% visual fidelity against the original designs, strict adherence to component and prop constraints, and fully automated error recovery on common failure classes — the only approach tested that scored high on automation, component awareness, reusability, accuracy and design-system support at once.

The win wasn’t a better model — it was building the smallest ground-truth structure the model has to stay inside.

Read the essay

A longer write-up of how this was built.

Code Connect: Teaching GPT-4o to Speak a Design System

Stack

  • GPT-4o
  • React
  • TypeScript
  • Figma API