Build a prototype from Figma
Turn a Figma frame into a working page built from your design system's components.
Turn a frame into a page
With the Better Design plugin open in a Figma file, create-figma-prototype turns a frame into one HTML page built from that design system's components. Name a frame, or omit the name to take the current selection. The server starts a relay on http://localhost:4397 that only the plugin talks to, so the file never leaves your machine. This tool is local only: the hosted connectors cannot reach your Figma.
Read the file's kit
read-figma-kit reads the kit in the open file through the same plugin: the variables in every mode, the text and effect styles, and the components with their variant options. It writes them to one JSON file. You confirm the read in the plugin panel.
Pass that file to create-figma-prototype as kitPath in model mode, and the prototype uses the kit's colours, font and radius. Pass a projectId to also keep the kit on that project. In model mode, pass that projectId instead of kitPath: the prototype wears the project's kit, builds with the project's design system unless you name a system, and keeps each client component as a named part. The frame it read is kept on the project too, under the frame's name, the name its specs use.
Draw the page back into Figma
On the second call of model mode, pass drawInFigma: true to draw the finished page back into the open file, on a new page named Better Design: <frame>. Each named part becomes an instance of the client's component: the file's own, or one the file already uses from a library. A part the file does not hold stays a plain layer, and the answer names it. Draw only in a copy of the client's file. You confirm the drawing in the plugin panel.
Model mode, for files without a Better Design library
A frame from a file that was not built from a Better Design library has no components to map, so pass mode: "model" and a catalog system. The plugin asks you to confirm the frame. Your agent is the model: the tool writes a prompt file and the frame's image, your agent writes the page on its own plan, and a second call with frameId and answerPath checks the page and lists every layer that did not make it. No API key is needed.
To use a local model instead, pass provider: "openai-compatible": the tool calls Ollama at http://localhost:11434/v1 with gemma4:latest, or the server in BETTER_DESIGN_MODEL_BASE_URL, with BETTER_DESIGN_MODEL_API_KEY if it needs one.
Pass method: "blocks" to have the tool draw the frame itself first, so layout, text and icons match Figma, and ask the model only to turn the client's components into working parts. It suits a cheaper model.
What the page keeps
The page keeps what the frame shows beyond its layout: shadows, blurs, gradients, corners that differ, and the hover and pressed looks of a client component set.
Prototype links work too. A click, a hover or a timer moves to the next screen with the transition the designer chose, an overlay opens over the screen, and Back returns. A link to a frame outside the one you named brings that screen along. A "Change to" link swaps the component to its other variant: a checkbox ticks, and a button shows its hover variant while the pointer is over it. A reader who asks for less motion gets each change at once. Every link the page cannot run gets a line in the report.