Overview

A component could look settled in a design library and still behave differently in the product. I used the real Virsive Button as the test case for a structured contract: one that records approved decisions in a form that can be reviewed and validated.

Role
Product design and prototyping
Timeline
Research since August 2026
Scope
Button contract
Status
Research in progress

The short version

Problem
Differences appeared in foundations, themes and component-level decisions. A mapping could tell us which components corresponded, but it could not decide which version was right when the two disagreed.
Approach
A structured contract records the Button’s exposed label and icon properties, mapped variables and layout rules so a schema can reject incomplete or invalid information.
Prototyped
A workbench that mirrors Virsive’s component properties, where every accepted change updates the contract, preview and React output.
Finding
One validated definition can drive a narrow visual and code-related slice. The reverse repository-to-design path and system-wide synchronization remain research questions.
60
Button variants
4
states
15
semantic types

01 · Gap

The gap was bigger than a handoff problem.

A component could look settled in a design library and still behave differently in the product. Differences appeared in foundations, themes and component-level decisions.

A mapping could tell us which components corresponded, but it could not decide which version was right when the two disagreed.

Virsive Button diff comparing the design source with code output before review
Virsive Button diff
The same component can carry different decisions. The reviewed contract records which values both outputs must share.

02 · Contract

From instructions to a contract.

Detailed Markdown helped explain intent, but vague state descriptions and outdated values could still lead to different results.

I used the real Virsive Button as the test case: 60 variants, four states and fifteen semantic types. A structured contract records its exposed label and icon properties, mapped variables and layout rules so a schema can reject incomplete or invalid information.

Verified Virsive Button source, reviewed JSON contract and generated React output side by side
Verified source · Reviewed contract · React output
Schema validation keeps the last approved model active when a draft is invalid.

03 · Workbench

Testing one contract through every visible output.

The workbench mirrors Virsive’s component properties: state, semantic type, label and icon swaps. Layout and token controls share the inspector so every accepted change updates the contract, preview and React output.

Next research stepsNext steps include repository-to-design reconstruction, conflict resolution, version history and testing generation across a wider component set.

04 · Adoption

The harder question: where does a contract begin?

A team may start with code, design, or both. Extraction provides evidence, not instant authority.

Missing behavior still has to be specified, and conflicting values still need a decision before the contract can become the reviewed source.

Code first

Extract props and token references. Review states or behavior the implementation cannot express.

Design first

Extract variants, tokens and layout rules. Review behavior the component library does not show.

Both exist

Compare confirmed, missing and conflicting decisions. Resolve differences instead of averaging them.

Three entry paths, code first, design first and both exist, leading through extraction and review to one approved contract
Three starting paths, one reviewed contract
Extraction produces evidence. Review turns it into an approved contract.

05 · Findings

A clearer, testable way to ask what “in sync” should mean.

The experiment shows a promising way to make component decisions explicit and generate or validate a narrow slice from structured data.

It also exposed the real work: identifying the same component across tools, filling gaps a source cannot express, and deciding what happens when sources disagree.

The reverse repository-to-design path and system-wide synchronization remain research questions.

06 · Impact

A working proof of concept, still in research.

To investigate drift between design and code, I scoped the experiment to the Virsive Button and built a local workbench around a structured contract. This made the synchronisation path concrete enough to test before extending it to the wider system.

The proof of concept generated a JSON contract for an atomic design-system component and demonstrated a local synchronisation path between the contract, preview and React output. The verified workbench uses the Virsive Button as its test case.

Agent-assisted development has started in the code and design file. The current sync path runs locally in the workbench, with broader integration in development and testing.