/uxd-design:uxd-figma-readfrom uxd-design
Retrieves design context from a Figma file including screenshots, page structure, node metadata, and design tokens. Handles URL parsing, Figma MCP detection with REST API fallback, page discovery, and frame export.
Ships in uxd-design. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Reusable Figma access layer — parses a Figma URL, detects whether the Figma MCP is available, falls back to the REST API if not, and returns screenshots, page structure, and metadata for downstream use.
Other skills that need Figma input should reference this skill rather than implementing their own access logic.
This skill needs read access to the Figma file. It supports two paths — try them in order.
If the Figma MCP is connected, this skill uses get_screenshot, get_metadata, and get_variable_defs directly.
Detect availability: attempt a get_metadata call with the file key (no node ID). If it succeeds, use Path A for the rest of the workflow. If the MCP server requires authentication, call mcp_auth for the Figma server first, then retry.
If the Figma MCP is unavailable, fall back to the REST API with a Personal Access Token.
The user needs one environment variable:
export FIGMA_PAT="your-personal-access-token"
Tokens are created at: https://www.figma.com/developers/apps — create a token with file_content:read scope.
Before making any API call, verify the token is set:
if [ -z "$FIGMA_PAT" ]; then
echo "ERROR: Set FIGMA_PAT to your Figma personal access token."
echo "Create one at https://www.figma.com/developers/apps"
exit 1
fi
If the token is missing, stop and ask the user to set it. Do not proceed without valid credentials.
See references/figma-rest-api.md for the full REST API reference.
Extract the file key and node ID from the URL the user provides.
Figma URLs follow these patterns:
https://www.figma.com/design/<FILE_KEY>/<FILE_NAME>?node-id=<NODE_ID>
https://www.figma.com/file/<FILE_KEY>/<FILE_NAME>?node-id=<NODE_ID>
Parse out FILE_KEY and NODE_ID. The node ID in the URL uses - as a separator (e.g., 16-1047) but the REST API expects : (e.g., 16:1047). Convert accordingly.
If no node-id is present, the scope is the entire file starting from the first page.
Get the file's page names, top-level frames, and overall organization. Page names are critical context — designers use them to organize options, states, flows, and versions.
Path A (MCP):
get_metadata with the file key and no nodeId to get the list of pages and their namesget_metadata again with the target page ID (e.g., 0:1) as the nodeId to get the top-level frames within that page — this returns an XML tree with frame IDs, names, and positionsPath B (REST API):
curl -s -H "X-Figma-Token: $FIGMA_PAT" \
"https://api.figma.com/v1/files/$FILE_KEY?depth=2" \
| python3 -m json.tool
Return to the calling workflow:
Export the relevant frames as images so downstream skills have visual context.
Path A (MCP):
Screenshot each individual top-level frame discovered in Step 2 — do not screenshot the page node. Page-level screenshots combine all frames into a single image, making details hard to read and losing the ability to associate each screenshot with a specific design option.
For each frame:
get_screenshot with the frame's node ID (e.g., 16:1047), not the page ID (e.g., 0:1)get_variable_defs with the same frame node ID to get design tokens in use — this tool does not work on page-level nodesUse maxDimension (default 1024, max 65536) to control image resolution. For detailed design review, use 2048. For thumbnails or quick overviews, 1024 is sufficient. The response includes both the rendered size and the original canvas size so you can decide whether to re-request at higher resolution.
Path B (REST API):
NODE_IDS="16:1047,16:1048" # comma-separated node IDs
curl -s -H "X-Figma-Token: $FIGMA_PAT" \
"https://api.figma.com/v1/images/$FILE_KEY?ids=$NODE_IDS&format=png&scale=2"
This returns temporary URLs (expire after 30 days). Download the images for analysis.
Alternatively, use the helper script:
bash "$CLAUDE_SKILL_DIR/scripts/export-figma-frames.sh" "$FILE_KEY" "$NODE_IDS"
Provide the following to the downstream workflow:
| Output | Source |
|---|---|
| Page names and IDs | Step 2 |
| Frame names and IDs | Step 2 |
| Per-frame screenshots (images) | Step 3 — one screenshot per top-level frame |
| Design tokens in use | Step 3 (MCP: get_variable_defs per frame, REST API: GET /v1/files/:key/styles) |
| File metadata (name, last modified) | Step 2 |
| Structural interpretation | Step 2 (e.g., "file contains 3 design directions across 3 pages") |
| Problem | Action |
|---|---|
Figma MCP unavailable and no FIGMA_PAT set | Stop and ask the user to either connect the Figma MCP or set FIGMA_PAT |
| MCP returns auth error or "needs authentication" | Call mcp_auth for the Figma server, then retry the original call |
get_variable_defs returns "select a layer first" | You passed a page-level node ID — retry with a frame-level node ID from Step 2 |
| REST API returns 403 | Token lacks file_content:read scope or the file isn't shared with the token owner |
| REST API returns 404 | File key or node ID is incorrect — ask the user to verify the URL |
Node IDs export as null | Node is invisible or has 0% opacity in Figma — ask the user to make it visible |
| URL doesn't match expected pattern | Ask the user for the Figma file URL |
| Rate limited (429) | Wait for Retry-After seconds and retry; batch node IDs to reduce request count |
ids parameter instead of one request per frame. MCP get_screenshot requires one call per node.depth=2 on the REST API file endpoint to avoid downloading the entire node tree when you only need pages and top-level frames.| Doc | When to load |
|---|---|
| figma-rest-api.md | REST API endpoints and patterns for Path B |
eval/cases/frame-not-page/annotations.yaml (opens in a new tab)eval/cases/frame-not-page/input.yaml (opens in a new tab)eval/cases/frame-not-page/metadata.xml (opens in a new tab)eval/cases/missing-credentials/annotations.yaml (opens in a new tab)eval/cases/missing-credentials/input.yaml (opens in a new tab)eval/cases/url-parse-file-path/annotations.yaml (opens in a new tab)eval/cases/url-parse-file-path/input.yaml (opens in a new tab)eval/cases/url-parse-no-node-id/annotations.yaml (opens in a new tab)eval/cases/url-parse-no-node-id/input.yaml (opens in a new tab)eval/cases/url-parse-node-id/annotations.yaml (opens in a new tab)eval/cases/url-parse-node-id/input.yaml (opens in a new tab)eval/eval.yaml (opens in a new tab)references/figma-rest-api.md (opens in a new tab)scripts/export-figma-frames.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/uxd-canvas-createCreate or refine a canvas as local JSON Canvas, a Miro board, or both. Covers journey maps, service blueprints, architecture diagrams, user flows, affinity maps, mind maps, and Mermaid diagrams. Use when turning a brief, research, an existing canvas, or a Miro board into a spatial artifact./uxd-canvas-exportExport a canvas as a local HTML viewer, canvas.json, or Mermaid. Accepts a local canvas or a Miro board. Use when sharing a journey map locally, producing a static file, or preparing a canvas for publish. Does not update Miro./uxd-canvas-publishPublish an exported canvas to a git repository, GitHub Pages, GitLab Pages, or Vercel. Use when sharing a finished static copy for review or updating a hosted preview. Creating or updating a Miro board is uxd-canvas-create./uxd-design-handoffProduce an implementation-ready design handoff spec from a validated design. Maps UI elements to design system components, enumerates all states, and generates testable acceptance criteria. Use when transitioning from design to development.npx claudepluginhub rh-uxd/ai-helpers --plugin uxd-designOther plugins' skills for the same job