FigmaMCP

Turn a written spec into Figma frames with an AI agent

This tutorial shows how to let Claude Code or Codex build a screen in Figma from a written spec. You describe the sections, fields, buttons and copy in plain words. The agent builds one screen frame with auto layout, one frame per section and layers named after your spec, in the file you have open in the Figma desktop app on your Mac.

What you will do

You will copy one skill, open the FigmaMCP plugin in your file and give the agent a spec. The agent plans a layer tree, builds it, exports a picture to check the result and reports the tree. Use it for a first draft of a screen from a product spec or a PRD section, which a designer then refines.

Steps

  1. Set up FigmaMCP

    Install the FigmaMCP Mac app and connect Claude Code or Codex. If you have not done this yet, follow the tutorial Edit a Figma file with Claude Code in 5 minutes first.

    Setup is the same for every task. See Edit a Figma file with Claude Code in 5 minutes or Figma MCP setup for Mac.

  2. Copy the figma-spec-to-frames skill

    Copy the skills/figma-spec-to-frames folder from the FigmaMCP releases page into ~/.claude/skills/ for Claude Code, or ~/.codex/skills/ for Codex. Then start a new agent session.

    A skill is a short instruction file that tells the agent which tools to call, in which order. The FigmaMCP app installs only the base figmamcp skill, so you copy this one yourself. Get it from skills/figma-spec-to-frames.

  3. Open the plugin and check the switch

    Open the file in the Figma desktop app, then choose Plugins, Development, FigmaMCP. Make sure the AI can edit this file switch is on. If it is off, every write is refused with READ_ONLY_MODE and the agent stops.

    FigmaMCP plugin panel showing Connected to a file, the AI can edit this file switch turned on, and 1 AI session connected
    The FigmaMCP panel in Figma. With the switch off, the agent can only read.
  4. Write the spec and say where the screen goes

    List the screen’s sections, fields, buttons and copy in plain words. Name the page or frame the screen goes on, and give its width, for example 375 for a phone or 1440 for desktop.

    If you leave out the place, the agent asks. If you leave out the width, it asks or uses 375 and says so.

  5. Let the agent plan the layer tree

    Before it writes, the agent turns the spec into a tree: one screen frame, one frame per section, such as header, form and actions, and the text, fields and buttons inside each. It names each layer with the spec’s own words, such as Email field, not Frame 12.

    For a long or vague spec, the agent shows you the tree first, so you can correct it before anything is built.

  6. Let it build the frames

    The agent creates the screen frame with vertical auto layout, to the right of the frames already on the page, so nothing overlaps. Each section fills the width of the screen and hugs its content. Each field or button is a small auto-layout frame with its label inside.

    If the file has local styles or variables that match the spec, the agent links them instead of typing a literal color. The settings it uses, such as direction, spacing and padding, are the ones on Figma MCP auto layout.

  7. Check the picture and the tree

    The agent exports the screen as a PNG with node_export_visual and looks at it. It fixes spacing or order, then shows the screen in Figma. It reports the layer tree and anything in the spec it could not build.

    Check the screen in Figma as you would check a colleague’s first draft. It is a wireframe-level start for a designer to style, not a finished visual design.

The skill’s worked example

The skill includes this example. It shows the prompt, the calls the agent is expected to make and the tree it is expected to report. It is an example written in the skill, not a recorded run.

Prompt: “In Figma, on Page 1, build a 375-wide Login screen from this spec: title Welcome back; subtitle Sign in to continue; an Email field and a Password field, each a 48px-high outlined box with the label as placeholder text; a full-width blue Sign in button; a Forgot password? link under it. Use auto layout everywhere.”

Frames the agent is expected to build for the Login example
FrameLayoutInside it
LoginVertical, spacing 24, padding 24, hug height, white fillHeader, Form, Actions
HeaderVertical, spacing 8, fills the widthTitle (24, bold), Subtitle (14)
FormVertical, spacing 12, fills the widthEmail field, Password field: 48 high, gray stroke, corner radius 8
ActionsVertical, spacing 12, centeredSign in button (blue, 48 high), Forgot password? (blue, 14)

The tree the agent is expected to report:

Login (VERTICAL, 375 wide)
├─ Header: Title, Subtitle
├─ Form: Email field, Password field
└─ Actions: Sign in button, Forgot password?

What the agent will not do

Notes

Next: rename Figma layers with an AI agent, run a design QA pass on the new screen, all tutorials, or all tools.

Last updated: