Design-to-code parity

One component, one meaning, in Figma and in code

An agent can’t ship a design change until the design system and the codebase agree on what a change is. Parity is not a tidying exercise; it is the precondition for the loop.

Try it

What drift looks like to an agent

✗ 4 differences: an agent would have to guess

  • figmaButton / kind=secondary
    code<Button variant="outline">

    Property name and value differ

  • figmaButton / state=disabled
    codeisInactive

    State has a second name

  • figmacolor.text.muted
    code#8a8f98

    Hard-coded value instead of a token

  • figmaInlineNotice / tone=neutral
    codenot in code

    Drawn but never built

Illustrative names and values.

The contract

Names that survive the crossing

Variables and properties on the design side, tokens and types on the code side.

figma · variables (exported)yaml
color.text.muted:
  light: "#59606b"
  dark:  "#9aa1ac"
space.2: 8
radius.control: 6
Button:
  kind: [primary, secondary, quiet]
  size: [sm, md]
  state: [default, hover, focus, disabled]
system/contract.tstsx
// generated from the same names, checked in CI
export const tokens = {
  "color.text.muted": "var(--color-text-muted)",
  "space.2": "var(--space-2)",
  "radius.control": "var(--radius-control)",
} as const;

export interface ButtonProps {
  kind: "primary" | "secondary" | "quiet";
  size: "sm" | "md";
  disabled?: boolean; // hover, focus: CSS
}

Layers

What has to match

tokens

Same names, same values

Colour, space, type and radius are named once and resolve to the same value in the file and in code, in every theme.

components

Same inventory

Everything in the library exists in code, and everything shipped exists in the library. Gaps are listed, not ignored.

props

Same properties

Variant and property names match, so “secondary” in a design is “secondary” in a diff.

states

Same states

Hover, focus, disabled, empty, loading and error are designed and built, not left to whoever gets there first.

semantics

Same behaviour

Roles, keyboard rules and accessible names travel with the component as part of its contract.

checks

Kept true by CI

Parity is a pipeline check. When the two drift, the run fails and says where.

Enforced

A check that can say no

Parity decays unless something tests it. The check runs in the pipeline, and a difference stops agents from building on it until a person settles which side is right.

parity reportlog
$ parity check --design library --code system
✓ tokens        names and values match, both themes
✓ Button        kinds, sizes, states
✗ InlineNotice  drawn in Figma, missing in code
✗ Card          code has "flat", Figma does not
! 2 differences: agents will not build on these
# fix the system first, then run the ticket

Getting there

The order of work

  1. Inventory

    List every component and token on both sides.

  2. Name once

    Agree one name for each, and retire the rest.

  3. Close gaps

    Build what is only drawn; draw what is only built.

  4. Add the check

    Fail the pipeline when they differ.

  5. Then automate

    Only now let a ticket travel the loop.

Figma is mentioned to describe where design work happens. One-Framer is not affiliated with or endorsed by Figma.

One ticket in. One tested release out.

Agents carry the work between stages. People set direction and approve what ships.