BUSINESS CASE FOR SAGA COMMERCE

Example case: AI agents for B2B ordering

07 System

One source of truth for every channel.

Every channel runs on 1 design system, agent-first where it helps. AI tools and agents read it as files, and every build runs the checks.

How it connects

1 doc goes in, and the same order comes out in every channel. The buyer’s and the merchant’s agents and AI tools read the same system.

  1. Requirements docThe 1 source of truth
  2. HypothesisA bet a test can prove wrong
  3. TestA replay, shadow mode or A/B
Design systemI own it. The design team builds it, with front end.
  1. 1Tokens47 primitives, 58 semantic, 38 roles
  2. 2ComponentsIn code, described by the skills
  3. 3Skills5 files, 1 per channel, and rules.md

AI tools read it as files

  • Webshop
  • WhatsApp
  • Email
  • Voice
  • AgentsBuyer’s, merchant’s
  • New channel1 skill, 1 renderer
  • Every build runs ds:check on the tokens and ds:check-card on the Teams card. Then the design team reviews, and I sign off.
  • Any buyer’s agent gets the same rules, plus a check on who it is. If a buyer brings an agent from another provider, it first proves who it is and that the buyer’s company allows it. The check is built after the pilot.
  • It grows by data. A merchant is 1 colour and its console settings. A channel is 1 skill and 1 renderer. So the 50th merchant needs no new design work.

Not yet, on purpose: a model drawing a buyer’s screen live. A reviewed renderer builds every card. The card check reads Teams cards only, for now.

  1. The requirements doc says what the order must do, and for whom.
  2. Each need becomes a hypothesis that a test can prove wrong.
  3. Only what passes a test goes into the system.
  4. AI tools build every channel from the skills. Agents read the same schema.
  5. A new channel is 1 skill and 1 renderer, drafted from 1 prompt.
  6. What ships is measured, and the results go back into the doc.

Evidence first

A test decides what goes live. Every change starts as a line in 1 requirements doc.

Source of truth

1 doc says what a feature must do, and how we will know it works.

The PM and I write it, as the agent behaviour spec.

  1. The researcherHypothesisEvery hypothesis is a bet a test can prove wrong.In this case: At a fit score of 85 out of 100, the agent picks the rep’s part.
  2. Researcher and engineerTestThe agent’s rules go through a replay, then shadow mode. A/B where traffic allows.In this case: A year of past orders, replayed from week 1. 5 sales reps test the case card in weeks 2 to 4.
  3. The designers, with AI toolsDesignDesigners build from the same tokens and skills. Every fit score shows its reason.
  4. Engineer and QAShip1 release goes out to every channel. The build runs the checks, then QA and I sign off.

Agent gateA category acts alone only at 90% agreement with the reps in its replay. It must hold in shadow mode, then a person switches it on.

One change, everywhere

Design, engineering and AI read 1 set of token files. 3 layers, primitive to semantic to role, plus 1 merchant file.

Follow 1 token

  1. Primitivecolor.brand.500={color.brand.base}, the merchant’s override#1f4fbfDelta PartsThis raw value is each merchant’s 1 colour.
  2. Semanticsurface.brand={color.brand.500}Semantic gives it a meaning, the brand’s surface.
  3. Roleaction.primary-bg={surface.brand}The role says where it acts, the main button’s fill.
  4. On screenApprove €325.50action.primary-bgCall the workshop leadaction.person-bgThe approver taps it for the Golf in bay 2, at step B5.
Merchant
Change 1 primitive, and every role built on it follows. 6 of 38 roles use the brand. A pale brand gets dark text, so white never fails 4.5:1. A raw value gets a meaning, then a place, then a screen. color.brand.500 is #1f4fbf. surface.brand points to it, and action.primary-bg points to surface.brand. Swap in Rijnmond Foodservice’s primitive, #2f6b3f. The names above it stay. Approve follows. “Call the workshop lead” stays purple at every merchant.

Every agent state is a token, so every channel says the same thing. Act, ask, explain, fall back, hand over and be undone, in 5 state colours. The brand only marks actions.

Assumption: buyers read the 7 state pills at a glance. In the workshop visits, weeks 1 to 4, buyers say what each means. Under 8 of 10 right, the words change.

The playground

1 order renders in 5 channels, in any brand. Every render comes from the same tokens and skills.

Delta PartsOrder DP-20418, Garage Noord, UtrechtAgent actedAgent acted, workshop owner approved
  • 1 x Water pump, metal impeller Hollen, HP-2241€148.60ERP, 2 min agoFit 90From Utrecht branch, arrives 10:45Fit 90 of 100, above the cooling threshold of 85. The agent orders it, with undo.
  • 1 x Timing belt kit Original part, OE 04L 198 119 A€176.90ERP, 2 min agoFit 100From Utrecht branch, arrives 10:45Exact match, 100 of 100. The agent orders it, with undo.
Approved by the workshop owner, exact amount. Undo until 07:54€325.50
Trade
Delta Parts
Change the brand

color.brand.base #1f4fbf

Inside a skill

A skill is 1 short file an AI tool follows to build 1 thing. Every channel skill has the same 5 parts, in the same order.

skills/whatsapp-card.mdReads rules.md first

The skill file

# Skill: WhatsApp card

  1. Use when: the agent talks to a buyer or an approver in WhatsApp.Who reads it, and where.
  2. Limits, set by WhatsApp itself: max 3 reply buttons per message, a list of up to 10 rows, templates outside the 24 hour window.The channel’s own limits.
  3. Must show:1. Sender line: the merchant's name and "AI ordering agent".2. 1 short message, the point first.3. At most 4 facts: part, price, arrival, stamp. Each number with its source and age.4. Max 3 buttons. The primary first. A way to a person is always 1 of them, or in the text.5. On a safety part: no order button. Only "Talk to a sales rep".6. Approval card: the exact amount and why it needs approval. "Approval is for this amount. If the price moves, I'll ask again."The same facts, in the same order.
  4. Tokens: `chat.*`, `action.*`, `agent.*`.Role tokens, so any brand flows in.
  5. Checked: against `rules.md`, then a person reviews it. A Teams card as JSON also runs `pnpm ds:check-card`, the only shape the script reads today: a source and age on every number, at most 3 actions, no action on a safety part.Checked by a script, then by a designer.

The card the skill asks for, drawn by the case’s renderer

WhatsAppTo the workshop lead

Delta Parts, AI ordering agent

Agent acted

Your receipt.

Contract prices, ERP, 2 min ago

Undo orderTrack the vanTalk to a sales repMax 3

3 of 3 rules hold. A stamp on every number, 3 buttons at most, no action on a safety part.

Then a designer reviews the wording and the order, and I sign off.

The same file holds every card to the same facts, and 3 checks hold it to the rules that cost money or safety. So a mistake by an AI tool is caught before it ships.

Why it holds

The script reads Teams cards today. 2 for the same order, the same script on both.

examples/teams-card.ok.jsonPasses 3 of 3examples/teams-card.bad.jsonFails 3 of 3
Source and age on every numberPasses: 7 numbers, each stampedFails: €176.90 has none
At most 3 actionsPasses: 2 actionsFails: 4 actions
No action on a safety partPasses: None in the cardFails: “Order now” sits on the brake pads

The script checks 3 rules on every Teams card. A person judges the rest. In production, a card that fails goes to a sales rep.

Use it live

Paste this prompt into Cursor, and it builds a new channel. It reads the same files, and the channel appears below.

prompts/new-channel.md

It runs in Cursor’s chat in Agent mode, with the case’s repo open.

The new channel appears here.

Dry run, 25 Oct: Teams card at 2 sizes, 3 of 3 rules, type check passed.