Verify Code
verify_codeCheck Flutter or React + Tailwind code against a Figma design by rendering both at 2x, then report errors, differing pixel share, and a diff image.
Instructions
Check Flutter or React + Tailwind code against the design: renders it at 2x (Flutter with flutter test, React in headless Chrome with Tailwind) and compares the render with Figma's own 2x render of the node. Returns analyzer or runtime errors (overflows, missing assets, broken images), the share of differing pixels and a diff image (the design in grey, differing pixels in red).
React and HTML: without file it checks the code get_design_context generates and compares every layer's box too. With file (a .jsx or .tsx under a folder with package.json, or an .html page) it renders that file's default export or page: it must be self-contained apart from React and image imports; images load from the project's public folder. Pass css for the stylesheet with its tokens. React and Tailwind load from a CDN and the fonts from the system or Google Fonts. Needs Chrome and the puppeteer-core package.
Flutter: With file, it checks that widget inside its own Flutter project: the project's packages and assets, inside a MaterialApp, scaled by flutter_screenutil to the frame size when the project uses it. The widget needs a constructor without arguments. Without file, it checks the reference code get_design_context generates and also compares every layer's box. Use it after implementing a frame, and fix what it reports. Text in fonts it cannot find is drawn in a fallback font, and emoji have no colour font in the test, so text after them shifts. A run takes from 20 seconds to a few minutes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | React: a CSS file to load with the component, e.g. its global stylesheet with the design tokens. | |
| file | No | Flutter: the .dart file with the widget, under the project's lib/. React: the .jsx/.tsx component file. Absolute, or relative to the project. | |
| fonts | No | Folders with font files (default: the project's assets/fonts and the system fonts). | |
| nodeId | No | The ID of the node, eg. "123:456" or "123-456" (instance ids like "I1:2;3:4" work too). Omit it to use the current selection in Figma. | |
| widget | No | Flutter: the widget class in `file` (default: its first widget class). | |
| fileKey | No | The key of the Figma file. Accepted for compatibility; the file open in Figma Desktop is always used. | |
| flutter | No | Path of the flutter tool, when it is not on PATH. | |
| tailwind | No | React: the Tailwind major version (default: the project's, else 4). | |
| viewport | No | Lay the code out on a screen of this size, e.g. "360x780", and report runtime errors (overflows) and layers pushed off screen instead of comparing. | |
| framework | No | flutter or react (default: from the file, else as get_design_context picks: the client, then the project). | |
| clientLanguages | No | Comma separated languages of the client, e.g. "dart" (picks the framework). | |
| clientFrameworks | No | Comma separated frameworks of the client, e.g. "flutter" (picks the framework). |