Design systems · AI · 2026

A design system WBK’s AI tools can build from

WBK’s DS3 already lives in Figma variables. This work made it something an AI can follow too: a contract for every component, checks that score every screen in English and Arabic, and one way in for new parts.

Role
Product designer, framework and build
For
AI tools that build WBK screens, and the people who review them
What it adds to DS3
  • Contracts
  • Rules
  • Decision map
  • Checks
  • Triage

Used across projects on Webook’s DS3. The tokens, names and components are DS3’s; the contracts, rules, checks and triage are what I added on top.

DS3

Tokens
Components
Templates
Contracts and rulesWhen, never, and the checks
AI buildsReads only what the screen needs
ChecksEnglish & Arabic, dark & light
The screen ships
New parts to triage

1 / 5DS3 tokens, components and templates

01

More people build WBK screens now.

WBK sells tickets, flights, hotels and merch, in English and Arabic, in dark and light. A season like Riyadh Season needs dozens of new screens in weeks. With AI tools, PMs prototype event pages, marketing builds campaign pages, and squads ship faster than the design team can review.

Give an AI DS3’s component library and it still guesses: which button is the one that buys, how far apart a card’s parts sit, whether a price says “SAR” or uses the riyal sign, what flips in Arabic. Nothing in the library answers that, so screens drift, and nobody sees it until a release.

  • 2languages, with Arabic mirrored
  • 2themes, dark and light
  • 82semantic colours in DS3
  • 45Shop components in the prototype alone

So the system needs what a library leaves out: when to use each part, what never to do, and a check for both.

02

Tokens, components and templates

Figma and code, the same names

DS3 lives in Figma as variables. In the WBK Shop prototype, a script already turns them into a generated file, and nothing in the app writes a colour by hand: every name points to a DS3 path. The framework builds on that, and keeps the two in step through Figma’s MCP server, so a screen an AI builds in code opens in Figma with the same components, and a fix made in Figma comes back to code as a pull request.

Figma

DS3 variablesColour, spacing, type
ComponentsSame names as code

Repository

ds3.generated.tsGenerated, never edited
colors.tsApp names → DS3 paths
components/Built only from tokens
A screenOpens in Figma with the same components
A fix made in Figma comes back to code as a pull request, and the harness checks it like any other change.
AGENTS.md              what an AI reads first, in order
tokens/ds3.generated.ts DS3's Figma variables, generated, never edited
tokens/colors.ts       the app's names, each a path into DS3
components/            one component per contract, typed props
templates/             event page, listing, checkout step, order pass
contracts/             one per component: use for, never, lives in, checked by
rules.md               spacing, type, colour and direction between components
decision-map.md        the contracts, indexed by job, built from them
harness/               the checks that score every screen

Semantic tokens, verbatim

DS3 names a value by its job, not its look, and keeps Figma’s spelling exactly, typos included. A screen asks for Bg-Accent, not “pink”, and for Gap-L, not “12”.

/* Colour: dark theme, from Color/Colors Semantic/Dark */
Backgrounds/Bg-Accent        #ff2c79
Backgrounds/Bg-Primary       #0b0b0e
Content/Content-Primary      #e4e4e7
Content/States/Content-Positive #22c55e

/* Spacing: from Spacing Semantic */
UI Elements/Gaps/Gap-S  4   Gap-M 8   Gap-L 12   Gap-XL 16
Section/Gab/⌶ Gab-Default 16   ⌶ Gab-Wide 24      // "Gab", as Figma spells it
Container/Radius/Container-Radius-M 30

/* Type: Figtree for English, Vazirmatn for Arabic */
Titles/Title Section    700 22/28   // Arabic: 600, one step lighter
Body/Body-Default       400 15/22

Components and templates

Components are built only from tokens. Templates are whole WBK screens built from components: an event page, a listing, a checkout step and an order pass. A new screen starts from the template that fits its job; if none fits, the AI says which came closest, so the screen reaches triage as a possible template.

03

Contracts and rules

A contract for every component

A component’s code says how it looks. Its contract says when to use it and what never to do with it, which an AI can’t infer. Every contract has the same parts, and the last line names the checks that enforce it.

# Buy bar
The price and the one action that buys, pinned to the bottom of a
product, event or package screen.

## Use for
- The screen's main purchase: Add to bag, Book, Buy tickets

## Never
- Two pink (Bg-Accent) buttons in one bar
- A price written as text: use Price, with the riyal sign
- Scrolling away with the page

## Lives in
Product, event and package screens. Never inside a sheet.

## Checked by
CTA-01, PRICE-01

Rules, written as values

Contracts can’t say how components sit together, so the rules do: surfaces, type, spacing, colour, motion and direction. Every answer is a token or a named component. “Comfortable spacing” fails; “Gab-Wide between sections, Gap-L inside a card, Gap-M between buttons” passes.

RuleWritten as
SpacingGab-Wide between sections, Gap-L inside a card, Gap-M between buttons
One action that buysOne Bg-Accent button per screen; every other action is Secondary
PricesAlways the Price component with the riyal sign; never “SAR” typed out
Arabic typeVazirmatn, one weight lighter than Figtree at the same level
DirectionArrows, chevrons and progress mirror in Arabic; logos, media and maps don’t
ThemesEvery screen in dark and light, from the same semantic tokens

04

AI builds

What the AI reads first

Every AI coding tool starts at AGENTS.md. It sets the order: the rules, the decision map, then the contract of each component the screen will use, and nothing else. The AI reads what the screen needs, so a new component adds one short contract, not a longer prompt.

AGENTS.mdRead first, sets the order
rules.mdSpacing, type, colour, direction
decision-map.mdThe job → the component
contracts/Only the ones this screen uses
The screenEN & AR, dark & light
A labelled NewPartWhen nothing fits
# AGENTS.md
1. Read rules.md
2. Read decision-map.md, find the component for each job
3. Read the contract of every component you'll use
4. Start from the template that fits: event, listing, checkout, order pass
5. Build in English and Arabic, dark and light
6. If no component fits, build a NewPart and label it

The decision map, in WBK’s jobs

The map holds each contract’s “use for” lines, sorted by job. When a nearby job belongs to another component, the last column says so. It’s rebuilt from the contracts on every change, so nobody edits it by hand.

The jobUseInstead
The one action that buysBuy barA second action: Secondary button
A price, with or without a dealPriceA total in the bag: Price, size Large
Pick how many ticketsQuantity stepperPick a size: Option chip
Narrow a listFilter chip rowSwitch views of one list: Segmented control
Say it workedToastSomething that needs a decision: Sheet
A live signal, like selling fastDemand pillA count of items: a numeral, not a pill

Only what DS3 has

Four rules decide what a screen may use, and each can pass or fail:

  • CMP-01Build only with components that have a contract.
  • CMP-02No new variants. The contract lists every variant there is.
  • CMP-03If no component fits, build one and keep going, labelled with its name, its job and why nothing fit.
  • CMP-04Never restyle a component. A new look is a new part, under CMP-03.

The types enforce part of this before any check runs: a component takes no style prop, and its variants are only the ones its contract lists. A labelled new part looks like this, as an AI would write it for a Riyadh Season pass:

<NewPart
  name="countdown-chip"
  base="demand-pill"
  job="Show the time left before a ticket sale closes"
  why="Demand pill shows a status, not a live countdown">

05

Checks

The harness

On every pull request, the harness opens each screen in a headless browser, at phone width, in English and Arabic, in dark and light, and runs the checks. The score is the share of checks that apply and pass. Each check is a few lines:

Pull requestAn AI or a designer opened it

Headless browser

EN · DarkEN · LightAR · DarkAR · Light
ChecksTOKEN · PRICE · RTL · AR-TYPE · THEME · CTA
Every check passesThe screen ships
A check failsFixed in the same pull request, then run again
// PRICE-01  every price is the Price component, with the riyal sign
const typed = texts.filter(t =>
  /\bSAR\b|ر\.س|﷼/.test(t.textContent) && !t.closest('[data-c="price"]'));
set('PRICE-01', texts.length > 0, typed.length === 0,
  `${typed.length} prices typed as text`);

The checks only WBK needs

  • TOKEN-01Every token a screen names exists in DS3, spelled as Figma spells it. An invented name shows no error; the value just goes missing.
  • PRICE-01Every price is the Price component with the riyal sign; never “SAR” or the old ligature typed in.
  • RTL-01In Arabic, arrows, chevrons and progress mirror; logos, play buttons and maps stay put.
  • AR-TYPE-01Arabic text is Vazirmatn, one weight lighter than the English at the same level.
  • THEME-01Every text reaches 4.5:1 contrast against what’s behind it, in dark and in light.
  • CTA-01One Bg-Accent button per screen.

When a check fails

A failed check names the rule, what broke, and the contract it comes from. The harness doesn’t change the screen: the AI fixes it in the same pull request, and the screen ships only when every check passes, so an error never reaches triage.

event-page  ar · dark
  ✓ TOKEN-01
  ✗ PRICE-01   2 prices typed as text      ← contracts/price.md
  ✗ RTL-01     back chevron not mirrored   ← rules.md#direction
  ✓ AR-TYPE-01
  ✓ THEME-01
  ✓ CTA-01
  score 4 / 6   fix in this pull request, then run again

06

Ships, and new parts go to triage

Once every check passes, the screen ships with its new parts labelled, and each one opens an item in the tracker the team already uses. Only new parts reach triage, never errors.

An AI builds a screenFrom DS3 and its contracts
Pull requestScored; errors fixed here
The screen ships
New partsStill labelled
Triage listThe part, the screen, who made it, how often it repeats

How triage decides

The design system team picks the first decision that fits, and every decision goes back into the system, so the next build uses it.

TriageNew parts only, never errors
Use what existsA DS3 component already does the job
Update the componentA refinement worth keeping
Becomes a componentIt reached triage more than once
WaitSeen once; stays labelled
Into the systemContracts, Figma and code, one name
The next build uses it

07

How it’s tested on a new feature

The real test is a feature DS3 doesn’t cover yet, like a Riyadh Season pass with a wallet pass, a live countdown and a zone map. This is the method for comparing builds with and without the framework.

  1. Same brief, two setupsBuild the feature three times with DS3’s components only, and three times with the framework. A fresh AI agent each time, none of them shown the harness.
  2. Four conditionsEvery screen in English and Arabic, dark and light.
  3. Count what mattersParts built outside the system with no label, labelled new parts, and the harness score.
  4. What shows it worksFewer unlabelled parts, every missing piece reaching triage with a job and a reason, and no Arabic or theme failures shipped.

08

For WBK’s teams

At WBK, screens come from many squads: Shop, ticketing, flights and hotels, marketing for each season. The rules stay the same; who does what changes.

QuestionWho, at WBK
Who builds screensDesigners, PMs and marketing, with AI tools
Who explores new partsDesigners in each squad
When nothing fitsThe part is built and labelled, the build carries on, the part goes to triage
Who decides what enters DS3The design system team, in triage
Who updates Figma, code and contractsThe design system team, one name in all three

Exploring still works: an explored part, a refined component and an improvised one get the same label and land in the same list.

09

What I’d carry into any design system

  1. Contracts

    “When” and “never” next to each component

    A library shows how a part looks; an AI also needs when to use it, in the same place.

  2. Rules

    Every rule as a value

    An AI applies Gap-L the same way every time; “comfortable” makes it guess.

  3. Two languages

    Check Arabic as hard as English

    Mirroring and type weight are where bilingual screens drift first, and both can be checked.

10

Where it applies

The framework was used across projects on Webook’s DS3. In the WBK Shop prototype, every colour, space and type size comes from DS3 through a generated file, so a token can’t drift from Figma; contracts, checks and triage sit on top of that.

Next case study
WBK Shop