figma-node-fetcher
Figma Node Fetcher
Fetch data by node from Figma URL and avoid downloading full file trees.
When To Use
Invoke when:
- User provides a Figma link and needs node JSON structure
- User needs node image export (screenshot, rendered PNG/SVG)
- User wants analysis for a specific node, not the whole file
- User says "fetch Figma data", "get Figma node", "export Figma image", or similar
Do NOT invoke when:
- URL has no
node-idquery — ask user to provide the specific node link - User asks to fetch an entire Figma file tree — not supported
- Request is outside supported endpoints (e.g., comments, version history, components API)
Prerequisites
- Node.js >= 18
FIGMA_ACCESS_TOKENenvironment variable (or.env.local/.figma.envfile with the token)- If token is missing, run
node {skill_dir}/scripts/init_figma_config.cjsto set up
Fixed Workflow
- Check token config:
FIGMA_ACCESS_TOKEN. - Validate Figma URL: must include
node-id. - Route by need:
- structure data →
type=node - rendered image →
type=image
- structure data →
- Choose fetch mode:
- single URL →
fetch - multiple URLs →
fetch-batch
- single URL →
- Run script and return standardized JSON output.
Config Policy
Read token in this order:
- environment variable
FIGMA_ACCESS_TOKEN {project_root}/.env{project_root}/.env.local{project_root}/.figma.env
Recommended location: {project_root}/.env.local
Scripts
1) Init config
node {skill_dir}/scripts/init_figma_config.cjs --project-root {project_root} --file .env.local
2) Check config
node {skill_dir}/scripts/figma_fetch.cjs check-config --project-root {project_root}
3) Validate URL
node {skill_dir}/scripts/figma_fetch.cjs validate-link --url "https://www.figma.com/file/xxx/xxx?node-id=1%3A2"
4) Fetch node JSON
node {skill_dir}/scripts/figma_fetch.cjs fetch \
--project-root {project_root} \
--url "https://www.figma.com/file/xxx/xxx?node-id=1%3A2" \
--type node \
--depth 2 \
--output-dir {project_root}/.figma-output/node
5) Fetch node image
node {skill_dir}/scripts/figma_fetch.cjs fetch \
--project-root {project_root} \
--url "https://www.figma.com/file/xxx/xxx?node-id=1%3A2" \
--type image \
--format png \
--scale 2 \
--output-dir {project_root}/.figma-output/image
6) Batch fetch (multiple URLs)
node {skill_dir}/scripts/figma_fetch.cjs fetch-batch \
--project-root {project_root} \
--url "https://www.figma.com/file/xxx/A?node-id=1%3A2" \
--url "https://www.figma.com/file/xxx/A?node-id=1%3A3" \
--type node \
--output-dir {project_root}/.figma-output/batch \
--clean-output
or:
node {skill_dir}/scripts/figma_fetch.cjs fetch-batch \
--project-root {project_root} \
--urls-file {project_root}/figma-urls.txt \
--type image \
--format png \
--output-dir {project_root}/.figma-output/batch-images
Input Contract
Required fields:
urltype(nodeorimage)output-dir
url must include node-id query.
Batch mode:
- Provide at least one
--urlor--urls-file - Each URL must include
node-id
Output Contract
Always return JSON with:
okmodetype- single mode:
figma.file_key,figma.node_id,output - batch mode:
success_count,failure_count,items,failures,output_dir
Error Handling
- Missing token: return
missing_token+ setup guidance. - Missing
node-id: fail fast with clear error. - No image URL from API: fail with explicit error.
- Batch mode partial failure: return non-zero code +
failuresarray.
API Scope Notes
Read and follow:
{skill_dir}/references/figma-rest-api-notes.md{skill_dir}/examples/integration.md
Supported endpoints only:
/v1/files/{file_key}/nodes/v1/images/{file_key}
Do not promise capabilities outside these scripts.
Execution Checklist
Before responding to user, verify:
-
FIGMA_ACCESS_TOKENis available (runcheck-configif uncertain) - Figma URL contains
node-idquery parameter - Correct
typeselected (nodefor JSON structure,imagefor rendered export) -
output-diris set to a project-relative path - Script returned
ok: true— if not, relay the error clearly - Response includes the standardized JSON output or saved file path
Boundary Enforcement
This skill ONLY handles:
- ✅ Validating Figma URLs with
node-id - ✅ Fetching node JSON structure via
/v1/files/{file_key}/nodes - ✅ Fetching node rendered images via
/v1/images/{file_key} - ✅ Batch fetching multiple nodes (JSON or image)
- ✅ Token configuration setup and validation
This skill does NOT handle:
- ❌ Fetching entire Figma file trees (no
node-id) → inform user this is unsupported - ❌ Figma comments, version history, or components API → outside scope
- ❌ Design-to-code generation → delegate to a frontend/product skill, use this skill as data provider
- ❌ Modifying Figma designs (read-only access)
Cross-Skill Orchestration
This skill can be called by other skills.
Recommended orchestration pattern:
- Product/Frontend skill receives Figma URL from user.
- Product/Frontend skill calls this skill (or runs
{skill_dir}/scripts/figma_fetch.cjs) to fetch node JSON/image. - Product/Frontend skill consumes the fetched artifacts to continue implementation.
Practical rule:
- Do not switch to this skill first unless the user request is specifically “fetch Figma data/image”.
- In mixed tasks (e.g., “build page from Figma”), keep the main skill as orchestrator and use this skill as a data provider.
More from learnwy/skills
english-learner
Use this skill on EVERY user message written in English to auto-detect grammar, word choice, and expression issues — teach corrections before proceeding with the task. Also use when the user looks up a single word, asks about a phrase like 'break the ice', requests translation, or asks for quiz/review. Triggers on: any English message, single English words, idioms, '查单词', '学英语', 'what does X mean', vocabulary review. Stores vocabulary in ~/.english-learner/ with mastery tracking and spaced repetition.
319memory-manager
Cross-session memory for AI. ALWAYS load this skill at session start to read SOUL.md and USER.md. This skill should be loaded for EVERY conversation to maintain continuity. Also triggers on "save memory", "end session", "update memory" for saving. Handles session history creation, memory consolidation, and USER.md/SOUL.md updates. Memory stored in ~/.learnwy/ai/memory/.
220trae-rules-writer
Use this skill when the user wants to create or update Trae IDE rules (.trae/rules/*.md) for AI behavior constraints. Use for: code style enforcement, naming conventions, commit message formats, or making the AI always follow specific patterns. NOT for skills (use project-skill-writer) or agents (use project-agent-writer). Triggers on: 'create rule', 'add rule', 'set up code style', 'enforce convention', 'configure AI behavior', 'AI rule', 'always do X', or when the user wants consistent AI behavior across sessions.
88knowledge-consolidation
Use this skill when the user wants to save, summarize, or persist knowledge from the current AI conversation into structured documents. Captures debugging breakthroughs, architecture decisions, patterns, and lessons learned. Triggers on: '总结一下', '记录下来', 'save this knowledge', 'document this', 'we figured it out', 'that was hard to solve', 'remember this', 'write this down', or when a hard-won insight should be preserved for future sessions. Saves to .trae/knowledges/, .claude/knowledges/, or .cursor/knowledges/ based on AI IDE.
59requirement-workflow
Structured software development workflow orchestrator using Spec-Driven Development (SDD). Transforms vague requirements into spec.md → tasks.md → implementation → verification. Triggers on: '开发功能', '实现这个', 'build this feature', 'implement', 'add new module', 'fix bug', 'develop', 'create feature'.
56trae-skill-writer
Create Trae IDE skills (SKILL.md files) for reusable AI capabilities. Use when user wants to: create a skill, make a reusable workflow, automate repetitive tasks, turn a conversation into a skill, or encapsulate a process for AI to follow. Triggers on: '创建 skill', 'write a SKILL.md', 'make this reusable', '.trae/skills/', 'I keep doing the same thing every time'. Do NOT use for rules (use trae-rules-writer) or agents (use trae-agent-writer).
31