---
name: "figma-rest-api-vector-exporter"
description: "Export design tokens, SVG vector icons, and layout nodes directly from Figma REST API."
metadata:
  author: "Figma"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "export icons from figma api"
  - "extract design tokens figma"
  - "sync figma components to git"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Figma REST API Automated Vector Exporter

Automates asset synchronization from Figma files to code repositories: fetching document trees, extracting color and typography tokens, and exporting optimized SVG icons via API.

## When to Invoke
Invoke this skill whenever you need to:
- export icons from figma api
- extract design tokens figma
- sync figma components to git

## Execution SOP & Rules
1. Authenticate API requests with X-Figma-Token header using secure environment variables.
2. Query document node trees with GET https://api.figma.com/v1/files/:file_key.
3. Generate image export URLs using GET /v1/images/:file_key?ids=...&format=svg.
4. Pipe downloaded SVGs directly through SVGO to strip editor metadata before committing to git.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
