Pasting a Figma screenshot into a chat window produces UI that resembles the design. Shipping UI that matches it requires structured context — the Dev Mode MCP's layer tree, variables, and Code Connect mappings — plus a fidelity review that diffs pixels instead of trusting eyes. This module is that pipeline.
Divya, a senior frontend engineer at a Bengaluru services firm, picks up the client's new account-overview screen: a Figma frame, a component spec, a deadline.
She screenshots the frame, pastes it into her assistant: "build this in React + Tailwind." Output in forty seconds. It looks close.
The client's design lead runs it against the file. Spacing is 16px where the design says 20. The type scale is the model's guess, not the client's tokens. The card shadow is invented. The "verified" badge — a component the client's system already ships — has been rebuilt from scratch, wrong.
Eleven fidelity deviations on one screen. Each is small. Together they read as "this vendor doesn't care."
Divya switches pipelines: the client's Figma file via the Dev Mode MCP server — real layer tree, auto-layout constraints, variable names — plus Code Connect mappings to the client's component library. Same assistant, different context.
Generation now emits <Badge variant="verified"> and spacing.5 because it read them from the file. Her review sheet catches the two remaining deviations before the client does.
The screenshot pipeline fails for a knowable reason: a flat image destroys the design's structure. Auto-layout constraints, spacing tokens, variable bindings, component instances, interaction states — none of it survives rasterization, so the model reconstructs structure by guessing, and its guesses are trained on everyone else's designs, not your client's. Design-to-code that survives review is a context problem before it is a generation problem: feed the machine the design's data, not its picture. That is exactly what the Figma Dev Mode MCP server exists to do — and this module covers the full pipeline: MCP context, Code Connect grounding, structured fidelity review, managed pipelines like v0, keeping design files honest afterward, and doing all of it NDA-safely on client work.
The Figma Dev Mode MCP server turns "look at this design" into structured tool calls. Connected to Claude Code, Cursor, or VS Code Copilot, the agent can pull — for your currently selected frame — the real layer hierarchy, auto-layout constraints (direction, gap, padding, sizing rules), the variables and styles bound to every node (spacing tokens, color variables, type styles by name), component and instance relationships, and a rendered screenshot for visual reference. The generation prompt changes character completely: instead of "make it look like this image," it becomes "implement this layer tree, honoring these constraints, using these named tokens."
Operating discipline, in order:
Dev Mode MCP requires a paid Figma seat (Professional/Organization/Enterprise with a Dev or Full seat) — it is not on the free tier. The labs ship an exported design-context bundle (layer tree, variables, screenshots) so free-tier learners run the identical workflow; on client work, the client's own Figma plan typically carries the seat.
Even with perfect structural context, the agent faces a choice at every component instance: emit your <DatePicker> or rebuild a date picker from divs. Code Connect removes the choice. It maps Figma components to code components — this Figma Button is @acme/ui's Button, this variant property maps to this prop — so MCP responses carry the code-side truth alongside the design-side node, and generation emits imports instead of imitations.
This is the design-to-code twin of M2's registry grounding, and together they close the loop from both ends: Code Connect grounds what the design references, the registry grounds what code exists. Teams that wire both report the qualitative shift Divya saw — review conversations stop being about rebuilt primitives and start being about composition and states. Mapping is platform-UI work (each component once, maintained as the system evolves), which makes it a design-system team deliverable with track-record ROI: every mapped component is a class of fidelity deviation that can no longer occur.
Human eyes normalize. After two hours on a screen, 16px and 20px look the same, and the review that relies on squinting ships Divya's eleven deviations. The replacement is mechanical:
shadow-md, frame binds elevation.2 — fix before mergepending variant missing in implementation — design shows 3 states, code renders 2@acme/ui imports (Code Connect verified)Every deviation is a line item with evidence — not an impression.
The workflow behind that panel: render the implementation (Storybook or the running app), capture screenshots at the design's breakpoints via Playwright or chrome-devtools-mcp, export the Figma frame, and hand both images to a multimodal model with a structured request — "list every discrepancy in spacing, type scale, color, radius, shadow, and missing states; be specific; cite locations." The model is a tireless deviation-lister; you adjudicate each line (intentional deviation vs. defect vs. design-file staleness). Fix, re-capture, repeat until the list is empty or every remaining line is an approved deviation. Lab 02 runs exactly this against a frame with five seeded deviations — passing means your review sheet catches all five.
Ask the diffing model to classify each finding as measurable (spacing, color — verifiable in DevTools) or judgment (optical alignment, image crop). Verify every measurable claim against computed styles before acting — multimodal models occasionally hallucinate pixel values with great confidence, and one fabricated finding can send you polishing a non-defect.
Managed pipelines — v0 with Figma import, custom design-system bindings, and a Git panel that opens PRs — compress the whole flow into one product. Used with a contract, they are a legitimate accelerator; used without one, they are an off-system code firehose with merge access. The contract that works:
The test for whether a surface belongs inside the boundary: if a fidelity deviation or an off-system component on this screen would cost real review time to catch, it goes through the full pipeline, not the managed one.
Design-to-code has a return path now. After code-side iteration — the built screen evolved through review, the file didn't — the design file is lying, and every future generation from it inherits the lie. Code-to-canvas handback (Claude Code's generate_figma_design integration, from the Figma partnership) captures live running UI back into editable Figma layers, letting designers pull reality into the file instead of reconstructing it by hand. Treat it as a sync tool with a review gate on the design side — designers adjudicate what the canonical frame should absorb — and verify current availability before making it a team dependency; at launch it was Claude Code-exclusive.
For services engineers, the client's Figma file is client IP — and design assets leak through sloppier channels than code does. The "can I paste this?" decision tree extends to designs:
| Asset | Safe path | Never |
|---|---|---|
| Client Figma file | Client-tenant tools: their Figma plan's Dev Mode MCP, their sanctioned assistant (e.g., Copilot Business, client-tenancy Bedrock/Azure) | Personal AI accounts; consumer chat apps |
| Frame screenshots for prompts | Redact real user data, unreleased product names, PII in mock content before pasting | Full frames with real customer data or unannounced features |
| Generated code with client tokens | Stays in client repo, client CI | Reuse across clients ("it's just a Button") |
| Fidelity-diff image pairs | Client-sanctioned multimodal model only | Uploading both frame and build to a personal account |
The habits are cheap: default to the client's tool tenancy, keep a redaction pass in your screenshot workflow, and when no sanctioned multimodal path exists, fall back to structural review (computed-styles export plus the layer tree — text, not pixels) which most client Copilot deployments can handle.
DPDP Act 2023 liability extends to personal data inside design mocks — real names, emails, and account numbers pasted into Figma as "realistic content" travel with every screenshot you paste into a prompt. Redact the mock data, or better, get design files seeded with synthetic content from the start.
This module's playbooks: pb-09 (Figma Dev Mode MCP: From Frame to Production Component), pb-10 (Code Connect Mapping), pb-11 (Visual Fidelity Diffing with a Multimodal Model), pb-12 (v0-Class Pipelines with an Explicit Ownership Boundary), and pb-13 (Code-to-Canvas Handback). Lab 02 is the proving ground: a provided Figma file, five seeded deviations, and a fidelity-and-a11y review sheet that passes only when you catch all five.
Fidelity is a context problem before it is a generation problem. Feed the agent the design's structure — layer tree, variables, Code Connect mappings — not its screenshot; then review with a multimodal diff that lists deviations as evidence. Eyes approve; they no longer audit.