ingest-figma
Pull design tokens + frame structure from a Figma URL via the Figma REST API. Requires FIGMA_TOKEN env var.
How do I install this agent skill?
npx skills add https://github.com/bluzir/claude-code-design --skill ingest-figmaIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill extracts design tokens from Figma via the official REST API or from local SVG files. It follows security best practices by using environment variables for API authentication and communicating only with official Figma domains.
- Socketpass
No alerts
- Snykwarn
Risk: MEDIUM · 1 issue
What does this agent skill do?
Ingest Figma
Extract design system from a Figma file using the REST API. Falls back to SVG-import if no token available.
Preflight
Bash(test -n "$FIGMA_TOKEN" && echo has-token || echo no-token)— check env var- If
no-token:- Tell user: "No
FIGMA_TOKENfound. Two options: (a) Get a token at https://www.figma.com/developers/api#access-tokens andexport FIGMA_TOKEN=...in your shell, or (b) export the frame as SVG in Figma (Right-click frame → Copy as → Copy as SVG) and paste the file toartifacts/ingested/— I'll parse the SVG." - Stop; wait for user response.
- Tell user: "No
Parse URL
Figma URL format: https://www.figma.com/(file|design|proto)/<fileKey>/<name>?node-id=<nodeId>
Extract:
fileKey— alphanumeric after/file/or/design/nodeId— query paramnode-id(URL-decoded, often contains:)
Steps (token path)
-
Fetch file nodes:
Bash(curl -H "X-FIGMA-TOKEN: $FIGMA_TOKEN" \ "https://api.figma.com/v1/files/<fileKey>/nodes?ids=<nodeId>&depth=2" \ -o /tmp/figma-<ts>.json) -
Fetch style definitions:
Bash(curl -H "X-FIGMA-TOKEN: $FIGMA_TOKEN" \ "https://api.figma.com/v1/files/<fileKey>/styles" \ -o /tmp/figma-styles-<ts>.json) -
Parse JSON:
- Colors: walk
document.children→ findfillswithtype === 'SOLID'→ extractcolor {r,g,b}→ convert to hex - Effects (shadows): find
effectswithtype === 'DROP_SHADOW' - Text styles: find
stylewithfontFamily,fontSize,fontWeight,lineHeightPx - Components: traverse for
type === 'COMPONENT'andtype === 'COMPONENT_SET' - Local styles from
/styles: styles endpoint returns named variables
- Colors: walk
-
Write:
artifacts/ingested/figma-<fileKey>-tokens.jsonSame schema as
ingest-github, plus"source": { "figma_url": "...", "file_key": "...", "node_id": "..." }. -
Offer next step:
- "Extracted X colors, Y text styles, Z components from Figma. Saved to
artifacts/ingested/figma-<fileKey>-tokens.json." - Continue with
/create-design-systemor start artifact skill.
- "Extracted X colors, Y text styles, Z components from Figma. Saved to
Steps (SVG fallback path)
- User drops SVG file in
artifacts/ingested/ Readthe SVG content- Extract
fill="#..."/stroke="#..."/style="...color..."attributes - Recognize
<text>elements for font info (font-family,font-size,font-weight) - Build partial tokens.json with
"source": { "svg": "<path>" }+ confidence flags - Note: SVG export loses component structure, only visual primitives
Rate limits
Figma API: 50 req/min for free tier. Fetching one frame + styles = 2 requests, well under limit.
Security
FIGMA_TOKEN in env only — never written to disk or logged.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/bluzir/claude-code-design/ingest-figma">View ingest-figma on skillZs</a>