DESIGNING THE SYSTEM BEHIND MYSTRA

I led Mystra’s design-system initiative from product diagnosis through architecture, documentation and engineering handoff. I turned fragmented UI rules into shared, machine-readable context: a code-first system of tokens, component contracts, live examples and guidance that designers, engineers and AI agents could use.

UI FOUNDATIONS

STORYBOOK

CODE-FIRST

AUDIT · DOCUMENTATION · GOVERNANCE

DESIGN · ENGINEERING · AI AGENTS

Industry

Genomics Software

Role

Product Designer

Date

2026

Mystra helps genomics researchers explore datasets, inspect variants and run complex analyses. Mystra AI brings analysis jobs into the same workflow. The design-system work had to support both the product UI and the increasingly AI-assisted ways the team built it.

REVERSE-ENGINEERING THE PRODUCT UI

There was more here than a collection of one-off components.

The code contained shared components, Chakra recipes, 11 colour palettes, 82 semantic tokens, eight text styles and shadows. But coverage was uneven, patterns had drifted and important rules were implicit. I mapped component usage, examined the foundations and compared light and dark modes to identify the systemic gaps.

FROM FRAGMENTED PATTERNS TO SYSTEM RULES

The brief began with documentation. The investigation exposed a broader systems problem: inconsistent component boundaries, duplicated patterns, incomplete token rules and no dependable contract between design intent and implementation. I reframed the work around making those rules explicit and usable.

The Mystra AI Execution trace page in Storybook, dark mode, showing the component's code, its collapsed "Thought for 2 min 21 sec" state in the playground, and its props.

THE AUDIT: FINDING THE SYSTEMIC GAPS

I audited shared components, fields, Mystra AI widgets and tokens across light and dark modes.

The audit found missing wrappers and undocumented high-use components: Alert.Root appeared in 50 files and LoadingSpinner in 31. Mystra AI repeated card treatments across 9 of 19 widgets. Fields used five mechanisms and three required-field conventions. Some labels lacked programmatic associations; tokens contained hard-coded values; the focus ring measured 2.56:1 against white, below WCAG’s 3:1 non-text contrast requirement.

Audit chart comparing production file usage counts for Alert, LoadingSpinner, DataTable, ConfirmActionDialog and Drawer against their Storybook documentation coverage.

TOKEN ARCHITECTURE: CONSISTENCY WITHOUT A BLANKET RESET

The goal was not to standardise every value. It was to establish a coherent semantic model without breaking useful conventions or forcing unnecessary migration.

Keep shared semantic names such as text.secondary, border.default and status.*. Retain Chakra’s bg family rather than introducing background.*. Distinguish bg, surface, bg.muted and bg.hover by role. Keep border.muted and border.subtle where their uses differ, even when values match. Rename selectively, including cta.primary.static to cta.fill, when usage supports it. Preserve existing primitives and aliases where they already work.

Three tiers of colour: a ramp of raw colours that are the same in every mode, semantic tokens that give each role a ramp colour per mode, and Button recipes that map props such as tone and variant to those tokens.
Keyline drawing of the error outline icon on a 24-pixel grid: a 20 by 20 live area inside 2 pixels of padding, a 20-pixel circle keyline and a 2-pixel stroke, with its rendered sizes of 12, 16 and 20 pixels.
Chip in Figma and in Storybook side by side, in light and dark mode, with matching neutral, indigo and purple tones.

STORYBOOK AS THE LIVE SYSTEM INTERFACE

Storybook made the specification executable: real components, states and variants, not static redraws.

Storybook became the live interface to the system: rendered components, states, variants and usage examples drawn directly from product code. It gave people and AI workflows a structured place to find the rules. The dependency stayed one-way: Storybook imported product code, never the reverse.

Button component documentation in Storybook, showing light and dark themes, interactive playground, states and props.

ONE SYSTEM. THREE WAYS TO WORK.

A shared source of truth, shaped for different workflows.

Diagram showing Storybook as the shared reference connecting code, designers and developers, coding agents, and the Figma library.

Designers explored real states, variants and themes. Engineers used imports, TypeScript props and working examples. AI agents consumed a generated manifest and component contracts. The same product rules informed all three.

Side-by-side examples of the Storybook component documentation read by a person and the structured component manifest read by an AI coding agent.

TESTING WHETHER AI COULD FOLLOW THE SYSTEM

I tested the system with agents, not just against documentation checklists.

Two agents built a filter panel and workflow card using the manifest without source access. The first run exposed a nested-button defect in UI.Select and gaps in the contracts. I refined the guidance. The second run produced no console errors or unsupported guesses. The exercise showed that agent output depends on the quality of the system context, not simply the prompt.

FROM COMPONENTS TO COMPOSITION

The library covered foundations, components, patterns, data visualisation, Mystra AI and guidance. Pages paired live specimens with imports, playgrounds, states, variants, props and composition examples. The focus was on showing how components work together, not just listing what existed.

Bar chart: what the Storybook documents. 108 pages by section: Components 61, Foundations 14, Patterns 9, Mystra AI 8, Data visualisation 6, Reference 4, Get started 3, Guidance 2 and Welcome 1.

GOVERNANCE FOR A LIVING SYSTEM

I defined checks for component inventory, links, documentation structure, accessibility, search, themes and the agent manifest. The aim was to keep the system connected to the code as both product and AI workflows evolved.

The documented checks provided a repeatable approach for detecting drift and maintaining the system as the product evolved.

EXTENDING THE EXISTING STACK

I extended the Chakra architecture already used by Mystra rather than introducing a parallel stack or rewriting the product.

Chakra remained the behavioural and accessibility foundation; Mystra recipes and tokens defined the product language. The system addressed focus visibility, dark-mode elevation, icon consistency, button tone and variant, and a shared Input → Field → specialised component model.

ENGINEERING HANDOFF

I prepared the architecture, token decisions, component guidance and Storybook reference for engineering review. The handoff included two pull requests for structural implementation and a carefully phased roadmap for full implementation of tickets, based on call sites and dependencies.

Toast in Figma and in Storybook side by side, in light and dark mode, with matching success, error, warning, loading and information states.
The Mystra design system handoff board, dated 13 October 2026: an implementation plan that moves from open pull requests to production, and the order in which tickets can start once earlier ones merge.

A SYSTEM THAT SCALES BEYOND THE UI

The system made design intent explicit, reusable and accessible to both people and machines.

The result was a documented target for the design system. Tokens, component APIs, interaction patterns, Storybook documentation and AI-readable contracts connected to the existing implementation. Designers could inspect the system, engineers could review how to extend it, and AI agents could work from structured guidance. The team had a clear route towards adoption, while production components remained unchanged at handoff.

Reach out if you're building/scaling complex products, exploring agentic design systems, or want a deep dive into my work. Let’s build!

Based In England, UK 🇬🇧

Reach out if you're building/scaling complex products, exploring agentic design systems, or want a deep dive into my work. Let’s build!

Based In England, UK 🇬🇧

Reach out if you're building/scaling complex products, exploring agentic design systems, or want a deep dive into my work. Let’s build!

Based In England, UK 🇬🇧