.claude/skills/duplicate-page/SKILL.md
--- name: duplicate-page description: "[EXPERIMENTAL] Duplicate an existing web page by capturing it through Figma as a structured design intermediary and generating high-fidelity React + Tailwind components. This skill is experimental — it does not fit reliably into the project workflow and may produce inconsistent results. Use when user says "duplicate page", "clone page", "copy page", "replicate page", "recreate page", "make a copy of this site", provides a URL they want to reproduce as a Rea
npx skillsauth add TETRA2000/figma-web-studio .claude/skills/duplicate-pageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
⚠️ Experimental: This skill is not yet fit for the project's standard workflow and cannot produce reliable results. Use with caution and expect manual adjustments.
Faithfully reproduce an external web page as a React + Tailwind page in this project. Unlike create-page (which uses screenshots as loose inspiration), this skill routes the source page through Figma's capture engine to extract structured layout, colors, and typography — then converts the Figma design back into project-native React + Tailwind code.
Pipeline: URL → Figma Design → Structured Code Extraction → Adapted React Components & Page
repository or local (default: ask user)true)This skill requires the Figma MCP server (figma@claude-plugins-official).
If unavailable, report: "Figma MCP server not connected. Enable figma@claude-plugins-official in .claude/settings.json or check your Figma authentication." Then fall back to the create-page skill with the URL as referenceUrl.
Before Figma captures the page, use playwright to understand the page structure and prepare it for clean capture. This step matters because pages often have cookie banners, popups, and lazy-loaded content that would pollute the capture.
playwright-cli open {url}
playwright-cli resize 1440 900
playwright-cli snapshot
playwright-cli eval "window.scrollTo(0, document.body.scrollHeight)"
playwright-cli eval "window.scrollTo(0, 0)"
playwright-cli screenshot --filename=reference-original.png
playwright-cli close
Record the page sections you identified (e.g., header/nav, hero, features, pricing, footer) — you'll use this to guide the Figma structure inspection in Step 3.
Important limitation: generate_figma_design runs in an isolated browser context that does not share session profiles (cookies, authentication, local storage) with the user's regular browser. This means:
Because of this, ask the user to capture the page manually:
figma.com/design/:fileKey/:fileName?node-id=:nodeId)fileKey and nodeId from the URL (convert - to : in nodeId)Optional — try automated capture first:
If the user prefers, you can attempt generate_figma_design as a first pass:
generate_figma_design with:
url: The source page URLoutputMode: newFile (creates a new Figma file)fileName: "Duplicate - {domain} - {date}" (e.g., "Duplicate - stripe.com - 2026-03-15")captureId — poll for completion every 5 seconds (up to 10 polls)fileKey and root nodeId from the responseIf the automated capture fails, falls back to manual clipboard capture as described above.
Use get_metadata to understand the layer hierarchy of the captured Figma design. This reveals the logical sections Figma identified from the DOM.
get_metadata with fileKey and root nodeIdFor each top-level section identified in Step 3, call get_design_context to extract React + Tailwind code. Extracting per-section (rather than the whole page at once) produces cleaner, more manageable code.
get_design_context with:
fileKey and section nodeIdget_metadata and extract those individuallyLoad the project's design system to adapt the extracted code:
shared/references/component-registry.md — discover existing components to reuseshared/references/tailwind-theme.md — project design tokensshared/references/figma-compat-rules.md — compatibility constraintsshared/references/image-handling.md — image asset workflowThis is where raw Figma-extracted code becomes project-native. The goal is faithful visual reproduction while using the project's design system.
If extractComponents is true:
Analyze each extracted section for reusability:
For each component to extract:
src/components/{Name}/{Name}.tsx (or src/components/_local/{Name}/{Name}.tsx for local scope){Name}.stories.tsx with representative storiesbg-[#6366f1]) to theme tokens (e.g., bg-primary)If extractComponents is false:
Keep all sections inline within the page component.
Create the page file composing all sections:
src/pages/{route}/index.tsxsrc/pages/_local/{route}/index.tsxThe page should:
Handle image assets:
src/assets/images/{route}/ with content-hash filenamessrc/assets/images/asset-map.json with new mappings<img> tags with explicit width/heightAdd documentation entries:
Add page entry to docs/pages.md (or docs/_local/pages.md for local scope):
## {Title}
- **Route**: `/{route}`
- **Title**: {page title}
- **Description**: Duplicated from {url}
- **Path**: `src/pages/{route}/index.tsx`
- **Dependencies**: {list of components used}
- **Figma**: {Figma file URL}
If new components were created, add entries to docs/components.md (or docs/_local/components.md)
Update shared/references/component-registry.md with new components
Perform a three-way comparison to verify fidelity:
http://localhost:5173/{route}get_screenshotIf discrepancies are found:
After verification passes:
add_code_connect_map to link the Figma design to the React codeReport:
create-page skill with URL as referenceUrlget_design_context: Break into smaller sub-sections via get_metadataUser: "Duplicate https://stripe.com/pricing — route it to /pricing"
get_design_contextsrc/pages/_local/pricing/index.tsx composing all componentsdevelopment
Fetch current Figma design state and apply changes back to React code. Use when user says "sync from Figma", "pull Figma changes", "update from Figma", "apply Figma changes", or wants to bring Figma edits into code.
tools
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
testing
Import an exported project archive, placing assets into the correct directories. Use when user says "import project", "import bundle", "import package", "unpack project", or has a .tar.gz archive to import.
tools
Push React components and pages to Figma using the Figma MCP server. Use when user says "export to Figma", "push to Figma", "create Figma design", "send to Figma", or wants to create a Figma design from code.