Personal project

A more reliable handoff from Figma to Codex

Contracts.Design

Overview

A design can be explicit in Figma while still leaving a coding agent to guess what matters, where it belongs in the code, and how the next change should work.

Contracts.Design is my personal exploration of that handoff. I designed and built a Figma plugin and local command-line bridge that give Codex structured design evidence, a focused task, and a way to report what it implemented.

Role
Designer & builder
Project
Independent personal project

Keep the context between changes

A screenshot communicates appearance, but it leaves structure, behavior, and implementation decisions for the agent to interpret. Even with direct access to Figma, the agent still needs to find the relevant evidence and decide where a change belongs. Repeating that work makes each iteration another opportunity to lose intent.

I approached this as a workflow problem. The useful handoff needed to retain what was already known, identify what still needed judgment, and carry the result into the next change.

From design intent to a checked implementation

  1. 01SelectChoose a Figma frame or component.
  2. 02Send contextPackage design evidence and interaction intent.
  3. 03ImplementGive Codex a focused implementation or update.
  4. 04Check & rememberInspect the result and retain its code location.
The workflow connects a design task to its implementation, then carries that context into the next iteration.

Give the agent evidence and a boundary

The plugin captures a selected Figma frame or component as a structured contract. That packet carries design evidence rather than relying on a screenshot and a longer prompt. Optional context describes the area, trigger, behavior, and state, capturing interaction details that a static design leaves open.

The distinction matters: visible design facts can be captured directly, while ambiguous behavior still needs a designer’s decision. I wanted the agent to spend its effort on those unresolved parts instead of reconstructing everything from scratch.

Contracts plugin showing a focused implementation target, editable design context, and the code location returned after implementation
The plugin brings the target, design context, and implementation location into one view. A focused view of the original product image. View full screen

Make implementation part of the loop

The contract travels through a bridge running on the designer’s computer. A short command tells Codex whether to implement a design, update existing work, or change visuals while preserving behavior. The detailed context stays in the packet rather than becoming another prompt to rewrite.

After implementation, the agent reports the destination file, code section, and actual behavior back. The plugin can show where the design now lives. A later update can start from that binding instead of asking the agent to search again.

Learn from an agent that made the result worse

One internal trial exposed an important failure. A generated starter already passed the checks for critical parts of the interface. The agent then restored raw styling from the design evidence, undoing corrections and causing those areas to fail.

More context had not prevented a regression. I tightened the implementation rules so the agent would preserve the starter’s established styling and work within the remaining task. The next comparison recovered the checks for those critical areas.

I kept whole-screen visual comparison separate from those checks. Passing the critical areas did not mean every pixel was closer to the reference, and a fast result did not establish correct behavior. That separation helped make the tradeoff visible instead of reducing quality to one score.

What I would carry forward

This project changed how I think about using AI in design work: capture explicit intent, name the uncertainty, constrain the change, and inspect the result. Give the next iteration a useful memory of what actually happened.

The evidence comes from internal development trials. It does not establish broad adoption or reliable output from arbitrary Figma files. Human review remains necessary, particularly when behavior is underspecified or the selected design has changed since it was sent. The goal is a handoff that is easier to steer and verify, with the designer still responsible for the result.

Next project · LaterAI Caption WriterView project