The real source of truth for design systems (it’s not your Figma file)

Cristian Morales Achiardi
Written by Cristian Morales Achiardi
Nov 11, 2026

Debate the source of truth for design systems, and you’ll notice that engineers answer fast. The codebase. To them, it was settled years ago: The system is whatever the code says, because the code is what runs.

We designers are still arguing, and now with AI in the mix, the debate has really intensified. Figma? A docs site? Other tools?

I side with the engineer, then spend the rest of the meeting explaining why "the source of truth is code" didn’t mean what they thought it did. The source of truth lives as code, but that doesn’t mean whatever's implemented is automatically the source of truth. There’s a nuance: code can mean two different things.

One is the running implementation: the compiled components, the app in front of a user. That’s a claim about what the system does, and it can be wrong. The other is the files in your repo. More on that in a second.

Recorded or implicit

A Product Requirements Document (PRD) is never complete. It answers the questions someone thought to ask. The engineer building it hits those unanswered ones — the edge cases, the states, the naming — all while racing a sprint deadline. So they decide. Quietly, locally, in the moment.

The system drifts from gaps filled in the moment, just to keep things moving.

A decision is either recorded or implicit, and that’s a property of the decision. The debate had been a fight over real estate when the thing that actually mattered was state and access.

Diagram titled "Every gap gets decided. The question is how. Even as silence." A button PRD covers hierarchy and size but leaves a label overflow, a loading state, and "danger or destructive" unanswered. Someone settles those gaps mid-sprint, either implicitly in a Slack thread or their head, where drift starts, or in a recorded contract file that people can diff, review, trace, and expose.
Implicit decisions generate drift. Explicit decisions are contracts.

So when I say the source of truth lives in code, I mean raw folders and files under version control. Files earn that role through what they let you do: diff them, review them before they land, trace who changed what, and expose them in whatever shape the reader needs: a docs page for a designer, an endpoint for an agent, a schema for a linter. The repo is plumbing. What matters is what you run through it.

Decisions, and their contracts.

Decisions become laws

For decisions, I adopted the ADR — the Architecture Decision Record — borrowed from the engineers who’ve used them for over a decade. The rule is simple and severe. A decision, once accepted, becomes a law. You don’t edit it. You supersede it with a new one, or you deprecate it.

Diagram of scattered dots labeled a name, an edge case, and a state, flowing through an ADR into one record at docs/ADR/0012.md with status, context, decision, contract, and consequences. Implicit decisions are private, scattered, and silent. Recorded ones are public, central, and traceable.
ADR is a governance model for decisions.

This severity buys traceability. You can read why the system is shaped the way it is by walking the chain, including any laws you’ve repealed.

I have a record in my current system that recommends keeping the upstream library's prefix and never renaming it. We then decided the opposite. We forked it and renamed the whole surface. The record that argued against the fork is still there, marked superseded and linked to the one that overruled it. Anyone wondering why we carry a fork can read the exact moment it flipped and the cost analysis that flipped it. None of that reasoning is lost, because nothing was overwritten.

The law has a maturity gate, too. Before a first release, there’s nothing downstream to protect, so decisions stay molten and I edit them in place. Immutability switches on when consumers depend on stability, the same way an API version does.

Timeline of an ADR moving from draft to proposed to accepted, then superseded or deprecated. Before the v0 first release, a record gets edited in place. After it, ADR 0004, "Keep the upstream prefix," stays untouched and points to ADR 0011, "Fork and rename the surface," which supersedes it.
Each ADR has its own lifecycle: from draft to proposal to accepted. Then it can only be superseded or deprecated. We get traceability at the decision level.

An ADR drags a decision you’d otherwise make silently out into the open, before any implementation exists. A private, scattered choice becomes a public, central, traceable one. That’s the mechanism. The rest is bookkeeping.

Contracts are the artifacts of decisions

Decisions shape what, how, and why we build on the design system. To enforce a decision, you need an artifact. I call these contracts: anything you can validate against and audit with.

Contracts differ along two axes: how much they leave to interpretation, and who enforces them and when.

Four kinds of contracts 

A structural contract defines the shape everything else gets measured against. It defines what good looks like. I keep a schema every component's metadata file has to match, field for field, checked by a validator that fails the build on drift.

A generative contract (like an agent skill) written from design and engineering needs owns the moment code gets written. A scaffold routine an agent runs emits a component that already conforms: arrow functions, named exports, token-based CSS modules, metadata in the required shape, tests colocated. Nothing has drifted because no version ever did. A slightly looser generative contract can enforce more than a strict rule that only fires after the violation ships, because it prevents the mistake instead of detecting it.

A detective contract catches what slipped through. A token auditor skill scans CSS for hardcoded values and reports each one against the token it should have used. The mistake still gets written. It just doesn’t get to pass.

An advisory contract guides a judgment a machine shouldn’t make alone: a CONTRIBUTING file with the release ritual, a composer skill that reads metadata and suggests which components to reach for. These live as prose or an agent skill because a person or a model still has to interpret them.

Keeping the record and the contract apart 

Determinism is only half the instruction. It decides how much a machine can check instead of a human having to trust it. The other half is home: a schema and a script for a linter, a skill for an agent, a README and a CONTRIBUTING for a person. One of my records decides that component lifecycle status has to be machine-readable data instead of a note on a docs site. So a lint rule, a CI gate, and an agent all read the same field. Written as prose, that decision is worth little. Written as a value something can enforce, it’s worth a lot.

Side-by-side comparison. Written as prose, "Badge is deprecated, please use Tag" gives the lint rule, CI gate, and agent nothing to parse, so lint passes, CI ships it, and the agent uses Badge. Written as a value in contracts/Badge.json, a deprecated status that names Tag as the replacement lets lint flag imports, CI block the merge, and the agent pick Tag.
A contract written as prose is soft because it leaves the door open for interpretation. A contract written as a value can be validated mechanically.

The record and the contract stay separate on purpose. The ADR states the decision and links its contracts. It doesn’t inline them. The decision "one brand-agnostic primitive palette is the source of truth" is stable. The palette, the per-brand deltas, and the build script that generates them all move constantly and live with the code as linked contracts. Keeping them apart is what lets an accepted decision hold still while its implementation churns underneath it. Until the decision needs to evolve.

Why tools will never win the argument

Figma renders half-truths, some quick examples; margin doesn’t exist, and while we can set line height as percentage values, variables don’t support it. Raise the complexity, and it gets worse: lots of super important props can live just as code.

Code Connect tries to solve this, but we can have a simpler setup: I keep a JSON map between token files and Figma variables, where the token files are canonical, and any Figma variable with no matching token reads as drift. The design tool holds what it can. The same approach also works for components. We match by existence, with code as source.

A documentation site holds prose, a soft contract. It doesn’t break stuff as it drifts. In my system, the CI pipeline (re)generates documentation automatically, so at least the prose can’t fall too far behind.

The engineer's answer, the codebase (as in what’s implemented or what renders on the browser), gets closer than either It’s version-controlled, diffable, reviewable. But it still points at the wrong layer: Implementation is downstream. The record and the contract are what it should answer to.

Agents raised the stakes

All of this got more urgent when agents started consuming the system.

An agent reading an implementation full of silent decisions just reproduces the silence. It can’t tell which choices in the code were deliberate and which were a guess. Give it encoded decisions and deterministic contracts instead, and you can hold it to them.

Diagram showing design intent moving from abstract, to named decisions like danger, primary, and quiet, to component props such as variant="danger". An agent decodes it in the reverse direction.
Design intent is ambiguous; we organize it into meaning, then encode it as values. An AI agent or people reading just our docs pick those values and try to decode the intent.

One of my records exists only because an agent reading a component registry will happily reach for a deprecated component if nothing in the data tells it not to. The fix was to make reliability a field the agent reads, not a convention it was meant to absorb.

AI raised the price of an implicit decision and the payoff of an encoded one, both at once. A human inheriting your gaps will at least ask around.

The source of truth was never a place

The real question is whether you write your decisions down in a way that can be enforced, or leave them scattered through an implementation, waiting to be rediscovered.

A design system is its contracts. Contracts are the artifacts of decisions. Put the decisions and their contracts in a repo, give each one a law and a shape, and let the implementation answer to them.

Timeline showing ADR 0007, "One brand-agnostic primitive palette is the source of truth," accepted and never edited since, while its linked contracts (the palette, the per-brand deltas, and the build script) each change many times over.

For me, that’s what "code is the source of truth" was always supposed to mean. It’s the opposite of "the codebase is always right."

If you want to see an example of how this all fits together, check out this public template. It has all the systems in place. It’s not very stable yet and still evolving, but it’s a good starting point for you to dig into contract-driven design systems.

Cristian Morales Achiardi
Cristian Morales Achiardi
Cristian came to design systems from advertising and branding, and has spent over a decade bridging design and engineering. At Southleft, he builds methodologies and infrastructure for AI-powered design systems. Through his independent practice at giorris.dev, he uses frameworks and facilitation to help teams grow AI fluency and a builder mindset.
Try zeroheight
The design systems platform that keeps teams and agents in sync
Start for free
Share this post