Capture de page web en Figma

VérifiéPrudence

Capture une page web en direct sous forme de design Figma en utilisant Playwright et un MCP de design Figma configuré. Il gère à la fois les sites externes (en contournant la CSP) et les serveurs locaux (en injectant un script de capture), puis interroge l'état d'avancement. Utile pour transformer rapidement n'importe quelle page en direct en un cadre Figma pour une revue de design.

Spar Skills Guide Bot
DeveloppementIntermédiaire
13002/06/2026
Claude CodeCursor
#webpage-capture#figma#playwright#design-conversion#mcp

Recommandé pour

Notre avis

Capture une page web live et la convertit en design Figma via Playwright et un MCP Figma configuré.

Points forts

  • Fonctionne avec des sites externes et locaux
  • Contourne les politiques CSP pour injecter le script de capture
  • Utilise l'API Figma pour une intégration directe
  • Automatise le processus de bout en bout

Limites

  • Nécessite Playwright et un MCP Figma configuré
  • Le polling de complétion peut être lent (max 10 tentatives)
  • Ne prend pas en charge les pages nécessitant une authentification complexe
Quand l'utiliser

Utilisez cette compétence pour convertir rapidement une page web en maquette Figma sans intervention manuelle.

Quand l'éviter

Évitez de l'utiliser pour des pages dynamiques lourdes ou lorsque la fidélité pixel parfait est requise.

Analyse de sécurité

Prudence
Score qualité85/100

The skill instructs running a Node.js script that strips CSP protections and injects Figma's capture code, which could be exploited on malicious sites, though the intended use is legitimate. No destructive commands or data exfiltration are evident. The combination of browser automation and security bypass warrants caution.

Points d'attention
  • Bypasses Content Security Policy headers on external websites to inject capture scripts, weakening page security during capture.
  • Uses Playwright browser automation with a user-supplied URL, which could expose the local environment to malicious page content.

Exemples

Capture external site
Capture https://www.ryanallen.com into my Figma file at https://www.figma.com/file/abc123/design
Capture local dev server
Convert my localhost:3000 page to Figma using file https://www.figma.com/file/xyz789/project

name: capture-webpage description: Capture a live webpage as a Figma design using Playwright and the configured Figma design MCP (for this repo, Figma Console MCP). Use when user says "capture page", "to Figma", or /capture-webpage. In Claude Code and Cursor, /skills lists all.

Capture Webpage

Capture a live webpage as a Figma design using Playwright and the configured Figma design MCP.

Inputs

You need two things from the user before starting:

  1. Webpage URL - The page to capture (e.g., https://example.com)
  2. Figma file URL - Where to put the generated design (e.g., https://www.figma.com/file/abc123/...)

If either is missing, ask the user before proceeding.

External Sites

For sites you don't control (e.g., ryanallen.com, competitor.com). Uses .claude/skills/capture-webpage/scripts/capture.js to bypass CSP and inject Figma's capture script.

1. Generate Capture ID

Use the Figma Console MCP (or other configured Figma design MCP) with the target Figma file details to get a capture ID and endpoint URL.

2. Run Capture Script

node .claude/skills/capture-webpage/scripts/capture.js "https://example.com" "CAPTURE_ID" 1920 1080

The script handles:

  • Launching browser with specified viewport
  • Stripping CSP headers
  • Fetching and injecting Figma's capture script
  • Calling window.figma.captureForDesign() to send page data to Figma
  • Cleanup

3. Poll for Completion

  • Wait 5 seconds after script starts
  • Call generate_figma_design with the captureId to check status
  • Repeat until status is completed (max 10 polls)

Local Sites

For localhost or dev servers where you can modify the HTML.

1. Generate Capture ID

Same as external sites - call generate_figma_design to get a capture ID and endpoint.

2. Add Capture Script to HTML

<script src="https://mcp.figma.com/mcp/html-to-design/capture.js" async></script>

3. Open Browser with Capture URL

open "http://localhost:3000#figmacapture=ID&figmaendpoint=ENDPOINT&figmadelay=1000"

4. Poll for Completion

Same polling process as external sites.

Requirements

  • Playwright installed (npm install playwright) - for capture.js script
  • Figma Console MCP (figma-console-mcp) or another Figma design MCP configured and authenticated for this project
Skills similaires