Create an HTML prototype from a Figma frame
create-figma-prototypeConverts a selected or named Figma frame into an HTML page built from design system components, reports layers that cannot map, and supports rebuilding frames from files outside the library.
Instructions
Reads a frame from the Figma file the designer has open and returns it as one HTML page, built from the same components the design system ships. Name a frame, or omit the name to take whatever is selected in Figma. The Better Design plugin must be open in that file: run Plugins, Development, Better Design once and leave the panel open. Every layer that could not map is reported rather than dropped. For a frame from a file that was not built from a Better Design library, pass mode "model" and a catalog design system. The designer confirms in the plugin panel. By default you rebuild the frame yourself: the tool returns a prompt file and the frame's image, you write the answer to a file, and you call this tool again with frameId and answerPath so it checks the page and reports what is missing. Pass a projectId whose project keeps a client's Figma kit to build with that kit, and the page keeps each client component as a named part.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | library (the default) maps components from a Better Design library. model asks a model to rebuild a frame from any file. | |
| frame | No | The frame's name as it reads in Figma. Omit to use the current selection. | |
| model | No | Model mode with openai-compatible: the local model id. Defaults to gemma4:latest. | |
| theme | No | Model mode with a kit: the kit's brand theme, such as Matrix. Defaults to the kit's first theme. | |
| method | No | Model mode: page (the default) has the model write the whole page. blocks draws the frame in code first, so layout, text and icons match Figma, and the model only turns the client's components into working parts. blocks suits a cheaper model. | |
| system | No | Model mode: the catalog design system to build with, as find-design-system names it. | |
| frameId | No | Model mode, second call: the frameId the first call returned. | |
| kitPath | No | Model mode: a kit file from read-figma-kit. The page then uses that kit's colours, font and radius on the system's parts. | |
| provider | No | Model mode: agent (the default) hands the frame to you to rebuild; openai-compatible calls a local server, Ollama by default. | |
| projectId | No | Model mode: a Better Design project that keeps a Figma kit from read-figma-kit. The page wears that kit, builds with the project's design system unless system is given, and keeps each client component as a named part. | |
| answerPath | No | Model mode, second call: the file holding your answer, as the prompt file asks. | |
| outputPath | No | Where to write the HTML. Relative paths resolve against the working directory. | |
| drawInFigma | No | Model mode, second call: also draw the finished page on a new page of the open Figma file, each named part as an instance of the client's component found on the page Figma shows when the draw starts, so keep the frame's page open. Use a copy of the client's file; the designer confirms in the plugin panel. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | ||
| model | No | ||
| report | No | ||
| status | Yes | ||
| frameId | No | ||
| message | Yes | ||
| imagePath | No | ||
| components | No | ||
| promptPath | No |