skills/index/SKILL.md
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".
npx skillsauth add tokyo-megacorp/figma-differ indexInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
testing
Subscribe to a Figma file for automatic syncing and semantic search. Adds the file to tracked.json, runs initial index + snapshot-all + frame.md generation, and initializes the QMD search collection. Use when the user runs /figma-differ:track or says "track this Figma file", "subscribe to Figma", "watch this design file", or "add to tracked files".
documentation
Refresh snapshots and search index for tracked Figma files. Fetches current state from Figma, generates frame.md documents, and updates the QMD search index. Use when the user runs /figma-differ:sync or says "sync Figma", "refresh snapshots", "update the Figma index", or "re-sync tracked files".
tools
Takes a snapshot of a Figma node — fetches its JSON structure and PNG screenshot and stores both to ~/.figma-differ/ for later diffing. Use when the user runs /figma-differ:snapshot with a Figma URL, or says "snapshot this Figma frame", "save a Figma baseline", or "take a Figma snapshot".
development
Bulk snapshots every frame in a Figma file — fetches all node JSONs, exports PNGs, and stores comments. Uses a single API call for the tree and batched image exports. Use when the user runs /figma-differ:snapshot-all with a Figma file URL, or says "snapshot all frames", "bulk snapshot", "baseline the whole file", or "snapshot everything in this Figma file".