Figma to Web
An agentic plugin and workflow for Google Antigravity and Claude Code that turns Figma frames into production Laravel Blade screens with pixel precision, verified against the design with automated measurements and pixel-diff testing at every breakpoint.
What It Does
- Extracts Section Node Styling to JSON First: Reads Figma frames through the Figwright MCP server and exports the exact styling, layout, typography, fills, and effects of every page section into structured JSON files (
docs/design/<screen>/sections/<name>.json), along with design tokens and 1x reference images.
- Flexible Styling Setup:
- Tailwind CSS is NOT mandatory: If the target project uses Tailwind CSS (
tailwind.config.js or @tailwindcss/vite), it maps Figma tokens to @theme/tailwind config and uses utility classes.
- Bootstrap: If configured, it leverages Bootstrap's grid and components with custom token overrides.
- Plain Custom CSS: If no framework is configured, it generates clean, semantic CSS (
resources/css/tokens.css, components/*.css, screens/*.css) using modern vanilla CSS best practices (good-css and css skills).
- Responsive & Adaptive Architecture: Builds the widest frame desktop-first, then applies
@media (max-width) queries and container queries (@container), leveraging fluid typography and touch-target accessibility from the integrated responsive-design skill.
- Automated Fidelity & Responsive Verification: Tests fonts, verifies element geometry to within 1 pixel via headless Chrome, performs pixel-diff comparisons against Figma 1x exports, and sweeps viewport widths (320px to 1920px) for overflow, overlap, and clipped text.
- Baseline Diff & Full Reporting: Saves baseline node states with Figwright's
design_diff and reports all breakpoints covered, derived decisions, and pixel-diff metrics.
Requirements
- Google Antigravity or Claude Code.
- Figma desktop app with the Figwright plugin imported (free Figma tier is sufficient; no Dev Mode seat needed).
- Node.js 20.19+ or 22.12+.
- Google Chrome or Microsoft Edge (for headless pixel checks and responsive sweeps).
- PHP 8.2+, Composer, and a Laravel application (the skill scaffolds one if missing).
Installation & Auto-Loading
In Google Antigravity
This repository is pre-configured to auto-load in Antigravity:
In Claude Code
From a local copy:
claude plugin marketplace add "D:\ai agent\figma-to-web"
claude plugin install figma-to-web@figma-to-web-marketplace
Or run for a single session:
claude --plugin-dir "D:\ai agent\figma-to-web"
Install checking script dependencies once:
npm install --prefix scripts
Figwright Setup
The plugin starts the Figwright MCP server (@figwright/mcp) over a local WebSocket on 127.0.0.1:3055.
- Download the Figwright plugin zip from Figwright Releases and unzip it.
- In the Figma desktop app: Menu → Plugins → Development → Import plugin from manifest… and select
manifest.json.
- Open your Figma design and launch Plugins → Development → Figwright (status will display Connected).
- Keep Figwright running in the background. The plugin interacts with Figwright strictly using read-only tools.
Commands & Skills
| Command / Trigger | What It Does |
|---|
/figma-to-web:build-screen <figma-url>… | Builds one screen end to end, one URL per breakpoint frame |
/figma-to-web:extract-tokens <figma-url>… | Extracts tokens, section JSONs, and shared components |
/figma-to-web:verify-fidelity <screen> | Measures and pixel-diffs a screen against its Figma frames |
/figma-to-web:check-responsive <screen> | Sweeps viewport widths (1920px down to 320px) and catches breaking layouts |
Pasting a figma.com URL in chat also auto-triggers the workflow.
Design Artifacts Folder Structure
Before writing Blade views or stylesheets, the plugin creates a structured design directory: