Dev figma capture

From Takazudo/claude-resources · View interactive version

Dev figma capture is an AI agent skill from the GitHub repository Takazudo/claude-resources. Capture web pages and send them to Figma as editable design files. Use when: (1) User wants to capture a webpage to Figma, (2) User says 'figma capture', 'send to figma', 'capture to figma', (3) User provides URLs to convert to Figma designs

How to use this skill

Skill file

Figma Capture

Capture web pages and convert them to editable Figma design files via Figma MCP.

Prerequisites

Workflow

Step 1: Parse Arguments

Step 2: Determine Capture Method

For each URL, decide the capture approach:

Is the page a local dev server (localhost, 127.0.0.1)?
  |
  +-- Yes: Does the page have Figma capture script embedded?
  |   |     (Check by fetching the page source and looking for
  |   |      "mcp.figma.com/mcp/html-to-design/capture.js")
  |   |
  |   +-- Yes → URL Fragment method (lightweight, no Playwright)
  |   +-- No  → Playwright injection method
  |
  +-- No (external site): → Playwright injection method

Step 3: Get Capture ID

Call mcp__figma__generate_figma_design to get a capture ID.

Step 4A: URL Fragment Method (if capture script is on page)

Open the URL with hash parameters:

open "<URL>#figmacapture=<CAPTURE_ID>&figmaendpoint=https%3A%2F%2Fmcp.figma.com%2Fmcp%2Fcapture%2F<CAPTURE_ID>%2Fsubmit&figmadelay=1000"

Wait 5-10 seconds, then poll capture status.

Step 4B: Playwright Injection Method

Run the bundled capture script:

node $HOME/.claude/skills/dev-figma-capture/scripts/figma-capture.mjs \
  --url <URL> \
  --capture-id <CAPTURE_ID>

The script:

  1. Opens the page in headless Chromium
  2. Strips CSP headers to allow injection
  3. Injects Figma's capture.js
  4. Triggers captureForDesign() and submits DOM to Figma

Options: --headless false (show browser), --delay <ms>, --selector <css>, --viewport-w <px>, --viewport-h <px>

Playwright dependency: The script requires playwright as a Node.js module. If not available in the current project, install it temporarily or check for a global install. The script imports playwright directly (not via npx).

Step 5: Poll and Confirm

Call mcp__figma__generate_figma_design with the captureId to check status. On success, it returns a claim URL. Open it for the user:

open "<claim-url>"

Multi-Page Capture

For multiple URLs:

  1. Capture first URL as newFile → get fileKey
  2. For each subsequent URL, call generate_figma_design with outputMode: "existingFile" and the fileKey to get a new capture ID
  3. Capture each page with its own capture ID
  4. Each page becomes a new page in the same Figma file

Troubleshooting

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.