Kristjan Pikk

Kristjan Pikk

Product designer

Back to portfolio

Making a design system AI-native

AI agents could build interfaces, but they often missed components we already had, guessed at their properties, or created their own alternatives. Getting the result to use Pipedrive’s design system properly took extra work and made handoff harder.

I proposed separating the knowledge agents needed into two parts: component facts generated from code and written guidance explaining the design decisions behind them. With 2 engineers, we made both available to the people and agents building with the system.

Storybook’s Button documentation page beside the design system agent’s guidance for the same component, including its variants, sizes, and usage rules.
My role
Design systems lead: spec proposal and implementation, foundation guidance, Storybook migration, and component contributions.
Collaboration
2 engineers on the shared structure, metadata generation, and agent tooling.

The challenge

Getting agents to use what we already had

Our design system contained the components, tokens, and guidance for building Pipedrive experiences. But agents didn’t reliably find or understand them. They could produce a convincing interface that still needed reworking to use our system.

We started with handwritten reference files describing components and their options. I defined what designers needed and tested the integration; an engineer built the references and a check for outdated information.

The references helped, but they duplicated facts already in code. A component change could create another manual update. The check could flag outdated information, but maintaining both versions was still necessary.

We needed a way to keep the knowledge reliable as the system evolved.

A deal page an agent built to look like Pipedrive, titled “Us, but not really,” with the deal’s value, pipeline stage, contact, details, and activity timeline.

The approach

Write the decisions. Generate the component facts.

I proposed a spec for each component and developed the structure in an architecture document and a pull request. Each spec captures the component’s purpose, usage guidance, examples, and things to avoid.

Property names, allowed values, and defaults come from code. We author the reasoning around them: when to use a component, how to choose between its options, and why.

For a button, the code says that a critical variant exists. The guidance explains that it is used for destructive actions, such as deleting something. Together, they make both the available option and its intended use discoverable.

The guidance also captures experience decisions. For example, our container guidance explains why a drawer should preserve someone’s place in a list. It connects the component choice to the experience we want people to have.

I also created foundation specs for our visual language, including color, spacing, motion, elevation, and other shared decisions.

  1. Foundation

    The reasoning behind visual choices, like using critical color only for destructive actions.

  2. Primitive

    Turns those choices into tokens and icons, like the critical color and a trash icon.

  3. Component

    Combines primitives into building blocks with set options, like a critical button.

  4. Pattern

    Combines components into a recurring interaction, like confirming a deletion.

  5. Layout

    Places patterns on a full page, like deleting an account from settings.

Each layer builds on the one before it. Specs cover foundations, primitives, and components today; patterns and layouts are next.

The engineers built the tooling that combines the written specs with facts from code. It produces documentation for people and metadata—the structured information agents retrieve—from the same sources.

Written by usButton.spec.ts

whenToUse: {  variant: {    primary: 'The single primary/highest-emphasis action…',    critical: 'A destructive action (e.g. "Delete")…',  },},

From codeButton.tsx

export type ButtonVariant =  | 'primary'  | 'secondary'  | 'critical'  | … variant = 'primary'

Generated for the agentButton.json

{  "name": "button",  "props": [{    "name": "variant",    "values": ["primary", "secondary", "critical", …],    "defaultValue": "'primary'"  }],  "whenToUse": {    "variant": {      "critical": "A destructive action (e.g. \"Delete\")…"    }  }}
The agent reads one generated entry that combines the critical variant from code with the guidance from its spec.

Design system agent

One source, available where people build

The design system agent brings this knowledge into the AI tools people build with. A generated index helps it find the relevant components and foundations, then retrieve their properties, examples, and usage guidance. Its instructions tell it to consult the system and report gaps rather than invent unsupported options.

For designers and engineers, I led the migration to Storybook, bringing guidance and interactive examples together. I improved the foundation pages and component examples, and contributed changes to the components themselves.

Both experiences draw on the same underlying guidance. Keeping that guidance alongside code makes it part of maintaining the system. Checks flag missing specs and inconsistent metadata, while an AI review looks for guidance that code changes may have made outdated.

An agent conversation asking the design system agent for an upcoming meeting card, where the agent fetches the design system’s metadata and plans to find reusable components, confirm the plan, build the card, and check its quality.

What’s changed and what’s next

Specs for 84 components and 9 foundations are live, with metadata generated from the system. Designers and engineers can explore the guidance in Storybook, and the design system agent uses it to support building, including in Studio.

We now have a shared way to maintain and deliver this knowledge. We haven’t yet measured how much it improves the interfaces agents produce.

I want to introduce repeatable evaluations of both the design system and the output agents produce. Can agents find the right components and guidance? Do they use them accurately, and does the resulting interface follow our design practices? Alongside reviewing quality, we’ll compare completion time, correction effort, and token cost across the same tasks.

Those results will help us identify missing guidance, improve how the agent retrieves it, and test whether changes lead to better results. Patterns and layouts are also next, extending the system’s knowledge of how components work together.

Read how designers put this to work in Studio, our AI-assisted prototyping tool.

Back to portfolio