ESP
← Back

Dua Dupla DS

Figma + Storybook + a three-phrase pipeline. What actually works, what isn’t magic, and why the human remains the handbrake.

Dua Dupla pipeline: human, Cursor, Figma, Storybook, CodePen, and publish

Date: Nov 2025 – Aug 2026.

Description: A Design System with an AI-powered creation and documentation process—without giving up human judgment.

Role: Product Designer & DesignOps. I designed the system, wrote the rules and skills, designed Foundations and components in Figma, and built the documentation in Storybook through to production.

Platform: Figma · Storybook (web) · Gemini Notebook assistant.

Methodology: DesignOps. Discipline externalized: three phrases, two human gates, and a corpus for the assistant.

Tools: Figma MCP, Cursor, Storybook, CodePen, GitHub, Vercel, Gemini Notebook.

Spoiler alert: I did not build an “autonomous agent that designs on its own.”

What did I build? My AI puts it this way: “An operating system for designing and documenting through an AI agent—made of written rules, skills with checklists, commands, and a three-step pipeline that forces me to validate as a human before moving on.”

The Dua Dupla Design System—documented in Figma and Storybook, deployed on Vercel—is the result of that work, done side by side with Cursor.

If you’re expecting a “press a button and get the full DS” system, this isn’t that. If you care about how to constrain a model so it doesn’t invent tokens, doesn’t jump to code without Figma, and doesn’t push until you say “Push,” keep reading.


The real problem

A Design System isn’t just nice-looking components. It’s:

When you work with a coding assistant, the risk isn’t that it doesn’t know CSS. The risk is that it mixes phases: draws in Figma, implements in Storybook, and pushes to GitHub in the same breath… without you having looked at anything, or having a chance to validate it.

That happened enough times that I turned it into a rule.


What’s actually in the repo

There aren’t “9 agents running in parallel” in this project. There is:

1. AGENTS.md — a map of roles (orchestrator, figma draw, Storybook docs, release…). It’s the contract for who does what.

2. Rules (.cursor/rules/*.mdc) — policies that are always or almost always active. Real examples:

3. Skills (.cursor/skills/*/SKILL.md) — step-by-step procedures. The two I use most for components:

4. Commands: /draw-figma-component and /add-new-component to trigger the right role.

The structure looks roughly like this:

.cursor/
  commands/     # slash commands
  rules/        # DS policies
  skills/       # procedures + checklists
apps/docs/src/
  stories/      # *.stories.ts + design-system.css
  stories/lib/  # render helpers + CSS per component
docs/           # specs, token mapping, visual targets
AGENTS.md
Repository structure: .cursor/rules, skills, commands, apps/docs/src/stories, and docs

The process lives in the repo: rules, skills, stories.

Important honesty: the plan and AGENTS.md describe a Figma → React → Storybook (Astro) → Vercel path. In this repository, what’s in production today is Storybook with HTML/TS helpers under apps/docs. I’m not pretending there’s already a React npm package ready for product. Storybook is live (still Work in Progress): dua-dupla-storybook.vercel.app.


The trick that has given me the most value: three phrases

From Figma to Storybook to production in three steps

From Figma to Storybook to Production.

Instead of a mega-prompt, the flow for a new component is literally this:

Step 1 — “Let’s do component X”

I write: “Let’s do Component X.” The assistant creates the component and specs in Figma. It doesn’t do Storybook, commit, or push.

Step 2 — “Document in Storybook”

I write: “Document in Storybook.” The assistant creates the render helper, CSS with tokens, Docs/Playground stories, and build-storybook. It doesn’t push. I review the code the assistant generates for each component. I drop it into a tool like CodePen, render it there, and compare it with Figma: same tokens, sizes, states, and variants. If the result doesn’t match, I fix it before moving on. Still no push here.

Step 3 — “Push”

I write: “Push.” Cursor does commit → git push → waits for Vercel Ready and a smoke check. Commit to GitHub, redeploy on Vercel, and publish Storybook so the team can use it.

Between steps 1 and 2 I review the component in Figma, check that variables are applied correctly, and can fix a color, a typeface, a spacing value, or a variant.

Between 2 and 3 I review the Storybook docs (locally, on a localhost URL) and also pull the component code into CodePen—or a similar sandbox—to validate that the visual result matches Figma. I only move on when that parity convinces me. The model doesn’t “finish the job” until I validate everything and type the “Push” command. That’s when it goes to GitHub and redeploys on Vercel.

Example: designing the Progress component. In Figma it ended up as Size Sm/Md × Value 0–100 × Tone Primary/Success. I changed the Primary indicator to fg/interactiveSecondary/default. Then I asked it to document in Figma and Storybook. And after validating in Storybook and CodePen against Figma, I said “Push.” Commit 3e817ff, deploy Ready, stories components-progress — docs and — playground in production. No skipped steps.

Progress component specs in Figma: sizes, values, tones, and tokens

Progress component designed and documented in Figma.


After Push: the DS assistant

The process no longer ends with Push. Once Storybook is in production, Cursor generates a .md file with the documentation for the component we just created. I upload it by hand to Gemini Notebook. There’s no official API; we don’t pretend there’s magic there.

That notebook is the virtual assistant for the design system. The team asks questions there instead of flooding Slack: “When do I use an Alert?”, “What’s the hex for Error?”, “Can I put two primary buttons next to each other?”. Answers are anchored to the corpus—the uploaded component documentation—and don’t invent. They close with a link to Storybook + Figma.

It isn’t a chatbot that improvises. It’s the system corpus, queryable.


What each component costs

When the flow closes, Cursor gives me an estimate of what the full design and documentation process for that component cost: tokens consumed, dollars, and euros.

It isn’t a billing dashboard. It’s a line of honesty at the end of each cycle: how much it cost, in numbers, to externalize the discipline for that component—Figma, Storybook, validations, push, and markdown export—without selling the idea that “AI does it for free.”

Alert component cost

Alert component cost, Cursor spend.


Foundations first

Another non-negotiable rule: variables only in the Foundations file. In the Components file, variables are consumed; they aren’t created. When the agent draws in Figma, it has to bind existing variables (bg/basic/tertiary, fg/feedback/success, radius-full…). If a token is missing, the decision happens in Foundations—you don’t “hardcode” a loose value in the component and forget about it.

That also shows up in code: CSS with --ds-* mapped from the token dictionary, not magic per component.


What we document in Storybook

Each component isn’t “a loose story.” The skill requires, at minimum:

At the start I created Foundations in Figma plus the Button, Button Icon, Checkbox, Radio, and Switch components. Then Cursor created the rest; we started with the simpler ones: Divider, Badge, Tag, Avatar, Spinner, and Progress. In the coming days we’ll move on to more complex components.

Not everything was born perfect. Avatar needed typography tweaks. Progress changed tokens mid-way. Badge and Tag went through variant refinements and documentation navigation updates. That’s Design System work, with or without AI.

Progress component documentation in Storybook: variants, anatomy, and measurements

Progress component documented in Storybook.


What an agent is (and isn’t)

When I say agents, I mean documented roles the assistant takes on when it reads a skill or a command—not nine independent processes making decisions on their own.

What it usefully automates:

What it doesn’t automate (and shouldn’t):


Honest lessons

  1. Write the process down. Trusting chat memory doesn’t scale. Rules and skills outlive the conversation.
  2. Human gates, not fake speed. The gates feel slow; they prevent redoing several layers at once.
  3. Name the real stack. If the repo is HTML + Storybook, say so. Don’t sell React if it isn’t there yet.
  4. AI gets design details wrong. Typography, mislinked tokens, token spelling. The value is in the short loop: catch → fix → continue.
  5. The reusable DS is the process, not just the buttons. This .cursor/ + AGENTS.md layout is meant to be copied into another project by swapping Figma URLs and tokens.

Closing

Building a Design System with AI isn’t about replacing the designer or the developer. It’s about externalizing discipline: the checklist you always forget, the “don’t mix phases,” the “variables only in Foundations,” the “don’t push until I say Push.”

The system isn’t smart. It’s insistent. And for a DS, insistence is almost everything.

If you want to implement an AI-based creation and documentation process like this in your Design System, write to me.


The video

Full flow creating the Alert component: from the phrase in Cursor to the set in Figma, documentation in Storybook, CodePen, the push to production, and closing the cycle.

Creating the Alert component · ~4 min