Automated summary
Extracts design tokens and component definitions from a Figma file through the Figma MCP server and saves them as local JSON files for hp-gen.
Strengths
- Actually tests the MCP connection with a get_metadata call before extracting, and gives detailed troubleshooting messages on failure
- Handles both design system library files and page-based website design files with sections
- Writes the Figma file key back into the config so the URL isn't needed on later runs
- Communicates in the language set by defaultLocale (ko, en, vi)
Limitations
- Requires a Figma MCP server that is installed, authenticated and reachable; otherwise the skill exits
- Depends on a plugin-specific config file (.claude/homepage-plugin.json), so it is not easily reusable outside that plugin
- Only produces local JSON files — generating components is left to hp-gen
Use it when you need to pull the latest tokens and component definitions from a Figma file into local JSON before running hp-gen.
Avoid it for simply browsing a Figma file, or when no Figma MCP server is set up and accessible.
Security analysis
SafeThe skill reads and writes local configuration and JSON files, and interacts with the official Figma MCP server to retrieve design data. It does not instruct destructive commands, exfiltration, obfuscation, or disabling of safety. The allowed tools include Bash and Agent, but the skill text does not use Bash for shell execution; Agent is used to call MCP tools for legitimate purposes.
No concerns found
How this analysis is madeExamples
Sync the design tokens from https://www.figma.com/design/abc123XYZ/My-Site into local JSON files so I can run hp-gen.Refresh the design tokens for my homepage plugin from Figma — the file key is already in .claude/homepage-plugin.json.Pull just the Home page sections from this Figma link: https://www.figma.com/design/abc123XYZ/My-Site?node-id=12-345name: hp-design-sync description: "Sync design tokens and component definitions from Figma into local JSON files. Requires Figma MCP." argument-hint: "[figma-file-url]" user-invocable: true allowed-tools: Read, Write, Edit, Glob, Grep, Bash, Agent
Sync Design Tokens from Figma
Extract design tokens and component definitions from a Figma file via the official Figma MCP server, saving them as local JSON files for use by hp-gen.
Supports both design system library files and page-based design files (where each Figma page represents a website page with sections as child frames).
Instructions
Step 0: Read Configuration
Read .claude/homepage-plugin.json. Extract defaultLocale for communication language.
Language mapping:
ko→ Koreanen→ Englishvi→ Vietnamese
Step 1: Resolve Figma File Key
Determine the Figma file key from one of these sources (in priority order):
- Skill argument — if
[figma-file-url]was provided, extract the file key using regex:figma\.com/(file|design)/([a-zA-Z0-9]+) - Configuration — read
figmaFileKeyfrom.claude/homepage-plugin.json - User prompt — if neither is available, ask the user for a Figma file URL
Also extract nodeId from URL if present (query param node-id). This allows targeting a specific page or frame.
Once resolved, if figmaFileKey is not already in .claude/homepage-plugin.json, update the config file to add figmaFileKey and figmaFileUrl fields.
Step 2: Verify Figma MCP Connection
2.1 Tool Discovery
Check that Figma MCP tools are available. Look for tools matching any of these patterns:
mcp__figma__*mcp__figma_desktop__*mcp__Figma__*
If no Figma MCP tools are found, display an error message with setup instructions:
Figma MCP not connected.
To set up the Figma MCP server:
- Remote (recommended): Add
https://mcp.figma.com/mcpas an MCP server- Or install the Figma desktop MCP plugin
See: https://developers.figma.com/docs/figma-mcp-server/
Then exit.
Identify the exact tool name prefix (e.g., mcp__figma__ or mcp__figma_desktop__) for passing to the agent.
2.2 Connectivity Test
After identifying the tool prefix, perform an actual MCP call to verify the connection works:
Call {mcpToolPrefix}get_metadata with the fileKey from Step 1.
- Success: The tool returns file metadata (page names, node structure). Proceed to Step 3 using this response (avoids a redundant call).
- Failure / Error / Timeout: Display an error:
Figma MCP connection failed.
Tools with prefix
{mcpToolPrefix}were found but the connection test failed. Error: {error message}Possible causes:
- The MCP server is not running or unreachable
- The Figma file key is invalid:
{fileKey}- You don't have access to this Figma file
- The MCP server needs re-authentication
Try restarting the MCP server or re-adding it.
Then exit. Do NOT proceed to the agent if the connectivity test fails.
Step 3: Discover File Structure and Classify Pages
Use the get_metadata response from Step 2.2 (do not call again — reuse the connectivity test result).
3.1 Determine File Structure
Analyze the result to determine the file structure:
- Page-based: The file contains pages with names like "Home", "About", "Services", etc. Each page has child frames representing sections (hero, features, etc.). This is the common case for website design files.
- Library-based: The file contains pages with names like "Components", "Styles", "Tokens", "Primitives". This is a design system library.
3.2 Classify Pages
For page-based files, classify each page into one of four categories using name pattern matching:
| Category | Name Patterns (case-insensitive) | Purpose |
|---|---|---|
| website | "Home", "About", "Services", "Pricing", "Contact", "Blog", "FAQ", "Landing", "Portfolio" and other website page names | Website pages with sections |
| layout | "Layout", "Shared", "Common", "Global", "Navigation" | Header/Footer/Nav definitions |
| icons | "Icons", "Iconography", "Icon Set", "Icon Library" | Icon component library |
| components | "Components", "Design System", "Library", "UI Kit", "Atoms", "Molecules" | Additional UI components |
Pages that do not match any non-website pattern default to website.
Viewport detection: For website pages, detect if multiple viewport variants exist. Common patterns:
- Same page name with viewport suffix: "Home - Desktop", "Home - Mobile", "Home - Tablet"
- Same page name with size suffix: "Home 1440", "Home 375", "Home 768"
- Separate pages named "Mobile", "Tablet", "Responsive"
- Frames within a page with different widths (check via
get_metadatachild frame dimensions)
If multiple viewports are detected, group them by page and record the viewport info in selectedPages:
{ "name": "Home", "nodeId": "0:1", "pageType": "website", "viewport": "desktop", "viewportWidth": 1440 }
{ "name": "Home - Mobile", "nodeId": "0:4", "pageType": "website-mobile", "viewport": "mobile", "viewportWidth": 375, "desktopPageName": "Home" }
If no mobile/tablet variants are found, this is normal — the section generator will apply responsive breakpoint inference rules.
For library-based files, all pages default to components category.
3.3 User Confirmation
Display the classified pages with their detected categories to the user:
Detected pages:
[website] Home (5 sections)
[website] About (3 sections)
[layout] Layout (Header, Footer)
[icons] Icons (24 components)
[components] Components (Card, Badge, Avatar, ...)
Ask:
"Which pages should we extract? You can also change page categories if the auto-detection is wrong. (Enter page names or 'all')"
The user can:
- Select which pages to extract
- Override a page's category (e.g., reclassify a page auto-detected as
componentstowebsite)
If a nodeId was extracted from the URL in Step 1, pre-select the corresponding page.
Step 4: Check Existing Design System
Read docs/design-system/design-tokens.json if it exists.
- If it exists, show the last sync time (
extractedAtfield) and ask: "Update existing tokens or replace entirely?"- Update — agent merges new values with existing ones
- Replace — agent overwrites completely
- If it does not exist, proceed with fresh extraction.
Step 5: Launch Design Token Extractor Agent
Launch the design-token-extractor agent with the following parameters:
fileKey— the Figma file key from Step 1mcpToolPrefix— the MCP tool name prefix identified in Step 2selectedPages— list of{ name, nodeId, pageType }objects selected by the user in Step 3.pageTypeis one of"website","website-mobile","website-tablet","layout","icons","components"fileStructure—"page-based"or"library-based"(from Step 3)projectRoot— current working directoryoutputDir—docs/design-system/mode—"update"or"replace"(from Step 4, default"replace"for fresh extraction)figmaAccessToken— (optional) read from.claude/homepage-plugin.json. If present, enables REST API image export fallback. If absent, omit this parameter.
Step 6: Validate Output
After the agent completes, first check for extraction failure:
6.0 Check for total failure:
- If
docs/design-system/extraction-error.jsonexists, read it and display the error:Design token extraction failed. {error message from the file}
No design tokens were extracted. Check your Figma MCP connection and try again. Then exit without proceeding to Step 7.
6.1 Structural validation — verify the output files exist and are well-formed:
-
docs/design-system/design-tokens.jsonmust exist and contain:$schemafield equal to"design-tokens-v1"colorsobject with at leastprimary,background,foregroundcssVariablesobject with:rootcontaining at least 10 CSS variable entriestypographyobject withfontFamilyextractionStatsobject
-
docs/design-system/component-map.jsonmust exist and contain:$schemafield equal to"component-map-v1"pagesobject with at least one page entry (for page-based files) ORglobalComponentsobject (for library-based files)extractionStatsobject
If structural validation fails, report which fields are missing and suggest re-running.
6.2 Extraction coverage validation — verify that meaningful data was extracted from Figma:
Read extractionStats.overallCoverage from design-tokens.json.
- Coverage >= 0.5 (50%+) → proceed normally
- Coverage < 0.5 but > 0 → display a warning:
Ask the user whether to proceed or retry.Low extraction coverage ({coverage*100}%). Most design tokens are using default values, not values from your Figma file. This may indicate that the Figma file has non-standard variable naming, or that some MCP tool calls failed during extraction.
You can:
- Proceed with the current tokens (defaults will be used for missing values)
- Re-run
/homepage-plugin:hp-design-syncto retry extraction
- Coverage == 0 → display an error:
No tokens were extracted from Figma. All values in the output are defaults. This likely means the Figma MCP connection failed silently during extraction.
Please verify your Figma MCP connection and re-run
/homepage-plugin:hp-design-sync. Then exit.
6.3 Content image validation (page-based files only):
Read component-map.json and check sections that have contentImages:
-
For each section with
contentImages.status !== "none":- Verify that files referenced in
contentImages.images[].pathactually exist at{projectRoot}/src/assets/{path} - Count total extracted vs failed
- Verify that files referenced in
-
If any images have
extracted: false, collect allmanualExportentries and display a single actionable guide:The following images need to be exported manually from Figma:
| # | Figma Layer | Section | Save To | |---|---|---|---| | 1 | {manualExport.figmaNodeName} | {sectionType} |
{manualExport.saveTo}| | 2 | ... | ... | ... |Export steps:
- Open the Figma file
- Select the layer listed above
- In the right panel, click "Export" → Format: PNG, Scale: 2x
- Save to the path shown in "Save To" (relative to project root)
After placing the files, proceed with
/homepage-plugin:hp-plan. Missing images will use placeholder values during code generation — optional image props will be omitted, required ones will get a TODO comment. -
If
contentImages.extractionSummaryshowstotal: 0across all sections but image-bearing section types exist (HeroSection, TeamSection, etc.), display a note:No content images were found in the Figma sections.
This is common when logos or illustrations are drawn as vector shapes rather than placed as image files. Figma MCP cannot export vector-only nodes as files.
You can add images after running
/homepage-plugin:hp-planby exporting from Figma (Select layer → right panel "Export" → PNG @2x) and placing them insrc/assets/images/{pageName}/{sectionType}/.
6.4 Layout validation (if any selected page had pageType: "layout", or component-map.json contains sharedComponents):
- If
component-map.jsonhassharedComponents.HeaderorsharedComponents.Footer:- Verify
docs/pages/_shared/layout-plan.jsonexists - Verify screenshot files referenced in
sharedComponents[].screenshotRefexist underdocs/design-system/
- Verify
- If layout pages were selected but
sharedComponentsis empty or missing, display a warning:No layout components were detected in the layout page(s).
The page was classified as a layout page but no Header or Footer frames were found. You can define the layout manually during
/homepage-plugin:hp-plan.
6.5 Icon map validation (if any selected page had pageType: "icons"):
-
Verify
iconMapexists incomponent-map.json -
If
iconMap.unmappedCount > 0, display a warning:{unmappedCount} icon(s) could not be mapped to Lucide icons.
Unmapped icons:
- {figmaName} — no Lucide match (custom SVG path saved)
- ...
These will use inline SVG rendering during code generation.
-
If
iconMap.totalCount === 0, display a note:No icon components were found in the icon page(s).
6.6 Additional components validation (if any selected page had pageType: "components"):
- Verify
additionalComponentsexists incomponent-map.json - Display the list of discovered additional components:
Additional components extracted: {count} {ComponentName1}, {ComponentName2}, ...
- If
additionalComponentsis empty, display a note:No additional components found beyond the standard 7 UI components.
Step 7: Display Summary
Show extraction results:
- File structure detected (page-based / library-based)
- Pages extracted by category:
- Website pages (with section counts per page)
- Layout pages (Header/Footer extracted: Y/N)
- Icon pages (mapped/total icons)
- Component pages (additional component count)
- Number of color tokens extracted
- Number of typography scales
- Number of sections discovered and mapped
- Number of UI components identified (Button, Input, etc.)
- Content images extracted: {extracted} / {total} across {sectionsWithImages} sections
- If any images failed: list failed images by section type
- Layout components: Header (Y/N), Footer (Y/N) — if extracted
- Layout plan pre-populated:
layout-plan.json(Y/N) — if layout extracted - Icons: {mapped}/{total} mapped to Lucide, {unmapped} custom — if icons extracted
- Additional components: {count} discovered — if component pages extracted
Show next step guidance:
- If layout was extracted: "Layout pre-populated from Figma. Run
/homepage-plugin:hp-planto review and customize header/footer definitions." - If layout was NOT extracted: "Run
/homepage-plugin:hp-planto define pages, sections, and layout." - If icons were extracted: "Icon mappings saved. Section generator will use matched Lucide icons during
/homepage-plugin:hp-gen." - "Run
/homepage-plugin:hp-design-syncagain to re-sync after Figma updates."
Communication Language
Use the defaultLocale from the configuration for all user-facing output:
ko→ Koreanen→ Englishvi→ Vietnamese
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/sync-figma-design-tokens-locally-mu26hb73/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/sync-figma-design-tokens-locally-mu26hb73' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/sync-figma-design-tokens-locally-mu26hb73/download' --output '.skill-downloads/sync-figma-design-tokens-locally-mu26hb73/SKILL.md.part' && mv '.skill-downloads/sync-figma-design-tokens-locally-mu26hb73/SKILL.md.part' '.skill-downloads/sync-figma-design-tokens-locally-mu26hb73/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Tools declared by the author (check availability in your agent): Read, Write, Edit, Glob, Grep, Bash, Agent
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/sync-figma-design-tokens-locally-mu26hb73/SKILL.md' && test -s '.skill-downloads/sync-figma-design-tokens-locally-mu26hb73/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/hp-design-sync' && cp -R '.skill-downloads/sync-figma-design-tokens-locally-mu26hb73' '.claude/skills/hp-design-sync'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/sync-figma-design-tokens-locally-mu26hb73'openskills read 'sync-figma-design-tokens-locally-mu26hb73'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/sync-figma-design-tokens-locally-mu26hb73/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.