Skip to main content
Claude Code

How Claude Code + Figma Killed My Old UI Workflow

My working Claude Code + Figma MCP setup: pulling variables and design context, mapping tokens to CSS custom properties, and where the bridge breaks.

7 min
Read time
1,273
Words
Published
Last revised
Engr Mejba Ahmed

Written by

Engr Mejba Ahmed

Share Article

How Claude Code + Figma Killed My Old UI Workflow

The design handoff is a translation step, and translation steps are where fidelity dies. My position after months of running the Figma MCP inside Claude Code: the win is not "AI turns mockups into code." The win is that design decisions — variables, spacing, component structure — become data your coding agent reads directly, so the translation step disappears instead of getting faster.

I ship UI for a living: Laravel Blade and Livewire fronts, React dashboards, and this blog's own theme. The Figma connector sits permanently in my Claude tool roster, and the most recent full redesign of my blog's surfaces went through exactly the workflow described below. Here is what it actually looks like, including the parts that still require a human.

How Claude Code + Figma Killed My Old UI Workflow - overview of what the figma mcp gives claude code, concretely, the workflow: tokens first, screens second

What the Figma MCP gives Claude Code, concretely

Strip away the demos and the MCP server hands your agent four capabilities that matter:

  • Design context. Ask for a frame and the agent gets structured data — layers, auto-layout, constraints, text styles — not a screenshot it has to squint at. This is the difference between "make it look like this picture" and "here is the spec."
  • Variables and tokens. get_variable_defs returns the file's color, spacing, and typography variables. This one tool is the backbone of my whole workflow, for reasons I will get to.
  • Screenshots on demand. The agent can render any node to an image mid-session, which enables a compare-and-converge loop.
  • Code Connect. You map Figma components to real components in your codebase, so when the agent reads a design that uses Button/Primary, it reaches for your button, not a freshly invented one.

Setup is unremarkable: enable the MCP server, authenticate, confirm the tools appear in your session. The interesting part is what you build on top.

The workflow: tokens first, screens second

The mistake I made early — and the mistake I see in most Figma-to-code content — is starting with screens. Point the agent at a dashboard frame, ask for the page, get plausible-looking markup with hardcoded hex values everywhere. It demos well and rots instantly, because the design file and the codebase now disagree about what "brand green" means.

The workflow that survived contact with real work inverts it:

Step 1: Pull variables, emit tokens. Before any screen work, I have Claude pull the Figma variable definitions and write them as CSS custom properties. On this blog that produced a token layer that now underpins every surface — background tiers, text tiers, border weights, brand colors — defined once, with light and dark values:

:root {
    --color-bg-primary: 255 255 255;
    --color-text-primary: 15 23 42;
    --color-border-default: 226 232 240;
    --color-brand-primary: 56 211 159;   /* #38D39F */
}

Storing them as RGB triplets instead of hex was a deliberate choice: Tailwind can then apply opacity modifiers (bg-brand/10) against the same token, so one variable serves every tint the design file uses.

Step 2: Map components before generating any. Code Connect, or even a plain markdown file listing "Figma component → Blade partial," stops the agent from reinventing primitives you already own. My theme keeps its partials in one directory; the mapping doc is short and pays for itself the first time the agent reuses a card component instead of hallucinating a new one.

Step 3: Build screens against tokens only. Now the agent implements frames, with one standing instruction: no raw color or spacing values — tokens or nothing. When I ran the full blog redesign this way, the pull request that landed touched every blog surface, and the reason it was reviewable at all is that the diff was mostly structure, not a thousand scattered hex codes. Change a token, and every surface moves together.

Step 4: Converge with screenshot diffs. The closing loop: the agent grabs the Figma frame render, screenshots the local build in a real browser (I use the Chrome DevTools MCP for this), and compares. Two or three rounds of "the card padding is 16px in the build, 24px in the design" gets you close enough that a human eye finishes the job. This loop is also where dark mode gets verified — the design file's dark variables and the site's .dark token block have to agree, and the agent can check both sides.

Why this beats the old handoff, in one sentence

The design file stops being a picture of the intended UI and becomes the source three other things are generated from: the token layer, the component mapping, and the acceptance check. Designers keep working where they work; nothing they decide has to be re-typed by a developer squinting at an inspect panel.

That last part is personal. I have lost entire afternoons to translation work — screenshotting components into frames, then reverse-engineering a designer's tweaks back into markup. Every hour of that added zero value to the product. This workflow is the first setup I have used where that tax actually went away rather than merely shrinking.

Where it breaks (told plainly)

Generated markup is a strong draft, not a merge. The agent produces correct structure and correct tokens, but it does not know your project's conventions unless you teach it. On a Laravel project, that means telling it which Blade components exist and what your CLAUDE.md says about them — otherwise you get React-ish idioms transliterated into Blade.

Complex auto-layout still confuses extraction. Deeply nested auto-layout with mixed constraints sometimes comes through as a structure that is technically faithful and practically wrong — flex where grid was intended. Budget a manual pass on any dense screen.

The loop is only as good as the design file's hygiene. If the Figma file uses detached instances and one-off styles, get_variable_defs returns a token layer full of noise. This workflow quietly forces design-system discipline on both sides — which I count as a feature, but it is real upfront work on messy files.

Rate limits are real on heavy sessions. A long session that pulls context for dozens of frames will hit API limits on lower Figma tiers. If this becomes your daily workflow, cost that in.

Where this fits among the adjacent workflows

If you are a designer approaching from the Figma side rather than the terminal side, I wrote a companion piece on keeping Claude Code and Figma in sync from the designer's seat. For the broader pattern — treating any design artifact as machine-readable input — my design-to-code workflow guide covers the non-Figma cases. If you drive Cursor instead of Claude Code, the Figma MCP + Cursor walkthrough maps the same ideas onto that editor. And the token-layer thinking here extends into a full AI design system workflow when you are building the system rather than consuming it.

A realistic first hour

Do not start with your hardest screen. Start here:

  1. Connect the MCP and pull get_variable_defs on your main design file. Just read the output — you will immediately see how healthy your variable setup is.
  2. Have Claude generate a token file (CSS custom properties or your framework's equivalent) from those variables, light and dark.
  3. Pick one small, well-structured frame — a card, not a dashboard — and have the agent implement it against the tokens, reusing an existing component where your mapping says one exists.
  4. Screenshot both sides and diff.

If that hour goes well, you have the foundation. Everything after is repetition with bigger frames.

The gap between what gets designed and what gets shipped has been a quiet tax on every product team I have worked with for eight-plus years. This is the first tooling generation where the fix is structural rather than cosmetic — the file becomes the spec, and the agent does the reading. Design-to-code pipelines like this one are part of what I build for clients; if your team is still paying the handoff tax, see what a workflow engagement covers on my services page.

Advertisement
Coffee cup

Enjoyed this article?

Your support helps me create more in-depth technical content, open-source tools, and free resources for the developer community.

Related Topics

Engr Mejba Ahmed

Engr Mejba Ahmed

Engr. Mejba Ahmed builds AI-powered applications and secure cloud systems for businesses worldwide. With 8+ years shipping production software in Laravel, Python, and AWS, he's helped companies automate workflows, reduce infrastructure costs, and scale without security headaches. He writes about practical AI integration, cloud architecture, and developer productivity.

Related Articles

Browse All

Comments

Leave a Comment

Comments are moderated before appearing.

Learning Resources

Expand Your Knowledge

Accelerate your growth with structured courses, verified certificates, interactive flashcards, and production-ready AI agent skills.

Sample Certificate of Completion

Sample certificate — complete any course to earn yours

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support