agentleFS
Zengxiansheng007Zengxiansheng007/skills-old/skills/figma-rest-sync/SKILL.md

figma-rest-sync

Skill1 starsChanged 3 months agoMITView on GitHub

Read, validate, cache, search, and export Figma design data through the Figma REST API for Claude Code workflows. Use when Claude Code needs the latest Figma UI prototype data, frame lookup, design text search, comments/notes retrieval, frame image export, or a local searchable index from Figma design files. This skill requires a Figma Personal Access Token on first use and must stop if the online Figma version cannot be verified or differs from the local cache.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to work with Figma files through the REST API while preserving strict version consistency.

    line 8
  2. Distinctive:

    Before any cache-backed query, image export, or brief generation, call online version check first.

    line 13
  3. Distinctive:

    Stop if the online Figma file cannot be reached, token is invalid, access is denied, file is missing, or request times out.

    line 14
  4. Very specific:

    Stop if local meta.version differs from remote version.

    line 15
  5. Distinctive:

    Do not use stale cache as fallback.

    line 16
  6. Distinctive:

    Do not print tokens, write tokens into outputs, or place tokens in skill files.

    line 17
  7. Very specific:

    Run scripts/figma_sync.py check --file <figma-url-or-file-key> to validate token and read remote version.

    line 22
  8. Very specific:

    If no local cache exists, run scripts/figma_sync.py sync --file <figma-url-or-file-key> after user confirms first sync.

    line 23
  9. Distinctive:

    All query commands enforce online version validation before reading local cache.

    line 29
  10. Very specific:

    Read references/error_policy.md when handling token, network, permission, cache, or version failures.

    line 33
  11. Very specific:

    Read references/cache_schema.md when implementing or reviewing cache/index changes.

    line 34
  12. Very specific:

    Read references/test_matrix.md before validating this skill or adding new Figma commands.

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Figma REST Sync

Use this skill to work with Figma files through the REST API while preserving strict version consistency. The online Figma file is the source of truth. Local cache only accelerates queries after the online version is verified.

Hard Rules

  • Require FIGMA_TOKEN before any Figma API call. If missing, ask the user for a Figma Personal Access Token and stop.
  • Before any cache-backed query, image export, or brief generation, call online version check first.
  • Stop if the online Figma file cannot be reached, token is invalid, access is denied, file is missing, or request times out.
  • Stop if local meta.version differs from remote version.
  • Do not use stale cache as fallback.
  • Do not print tokens, write tokens into outputs, or place tokens in skill files.

Workflow

  1. Parse the Figma URL into file_key and optional node_id.
  2. Run scripts/figma_sync.py check --file <figma-url-or-file-key> to validate token and read remote version.
  3. If no local cache exists, run scripts/figma_sync.py sync --file <figma-url-or-file-key> after user confirms first sync.
  4. For lookup, run scripts/figma_sync.py search --file <figma-url-or-file-key> --query "<keywords>".
  5. For a selected frame, run scripts/figma_sync.py frame --file <figma-url>.
  6. For image export, run scripts/figma_sync.py image --file <figma-url> --scale 0.5.
  7. For Claude-ready output, run scripts/figma_sync.py brief --file <figma-url>.

All query commands enforce online version validation before reading local cache.

References

  • Read references/error_policy.md when handling token, network, permission, cache, or version failures.
  • Read references/cache_schema.md when implementing or reviewing cache/index changes.
  • Read references/test_matrix.md before validating this skill or adding new Figma commands.

Output Expectations

Return concise Markdown for Claude Code:

  • file name and file_key
  • remote version and local version
  • selected node_id
  • matched frame/page name
  • relevant text snippets or comments
  • local image path when exported
  • clear blocking error and user recovery step when validation fails

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.