From figma-differ
Discovers and catalogs all frames in a Figma file at any depth. Creates a frame manifest for bulk operations. Use when the user runs /figma-differ:index with a Figma file URL, or says "index this Figma file", "list all frames", "catalog Figma screens", or "discover frames".
How this skill is triggered — by the user, by Claude, or both
Slash command
/figma-differ:index <figma-file-url><figma-file-url>This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Extract `fileKey` from the Figma URL. Node ID is not needed — we're indexing the whole file.
Extract fileKey from the Figma URL. Node ID is not needed — we're indexing the whole file.
Verify a Figma token is loadable: bash scripts/auth.sh status (if it fails, tell the user to run bash scripts/auth.sh set and stop).
Create tasks per phase. Dispatch haiku subagent for the tree fetch + frame walk.
TaskCreate("Fetch file tree", activeForm: "Fetching <fileName> from Figma API...")
TaskCreate("Catalog all frames", activeForm: "Walking pages and extracting frames...")
Task lifecycle:
TaskUpdate(taskId, status: "in_progress")Agent(model: "haiku") — agent reports only counts, never raw outputTaskUpdate(taskId, status: "completed")~/.figma-differ/)bash $CLAUDE_PLUGIN_ROOT/scripts/figma-api.sh fetch_file_tree <fileKey>
This returns the entire node tree in one API call. Extract document.name from the top-level response — this is the fileName for the index.
Parse the JSON response. Collect all nodes where type == "FRAME" at any depth.
For each frame, record: id, name, type, and the page name (parent CANVAS node's name).
IMPORTANT: Do NOT use jq recursive descent (..) — it hangs on large (10-30MB) Figma trees.
Use explicit path traversal instead:
jq '[.document.children[] as $page |
$page.children[]? |
recurse(.children[]?) |
select(.type == "FRAME" or .type == "COMPONENT" or .type == "COMPONENT_SET") |
{id: .id, name: .name, type: .type, page: $page.name}]'
This walks: document → pages (CANVAS) → children → recurse into nested children. Collects FRAME, COMPONENT, and COMPONENT_SET nodes.
FIGMA_DATA="$HOME/.figma-differ"
mkdir -p "${FIGMA_DATA}/<fileKey>"
Write to ${FIGMA_DATA}/<fileKey>/index.json (overwrites any previous index):
{
"fileKey": "<fileKey>",
"fileName": "<document.name from response>",
"lastIndexed": "<timestamp>",
"frames": [
{ "id": "<nodeId>", "name": "<frameName>", "type": "FRAME", "page": "<pageName>" }
]
}
Indexed <fileName>
Found N frames across M pages:
Page "Screens": 45 frames
Page "Components": 120 frames
Page "Archive": 38 frames
Index saved to ~/.figma-differ/<fileKey>/index.json
Run /figma-differ:snapshot-all <url> to snapshot all frames.
npx claudepluginhub tokyo-megacorp/figma-differ --plugin figma-differCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.