figma_diff
Compare two Figma file snapshots by node ID to list added, removed, renamed, or moved pages and layers, while ignoring property edits.
Instructions
Compare two snapshots of one file by node id. Figma keeps a node's id through renames and moves, so the id says what is the same layer: pages added, removed or renamed; top-level layers (a page's children, and the children of its sections) added, removed, renamed (same id, other name) or moved (same id, other parent, so a move to another page shows in from.page/to.page; a layer carried inside a moved section keeps its parent and is not listed); and removedNodes, the topmost node of each subtree gone from the visible pages, with the page and path it had and removedCount, how many nodes went with it (itself included); figma_locate on old and new answers for any id under it. Only ids, names and parents are compared: an edit to text, fills, sizes or any other property is reported nowhere. byPage counts each page's added, removed, renamed, moved (moved in; movedOut, moved from it to another page) and removedNodes, every page counted, excluded ones too: read it, then pass page for the one you need. page or exclude_pages (default: the project's excludePages, echoed as excludedPages) narrow the lists before the limit. Every list stops at limit, shared between the pages it covers so a page with many changes cannot crowd out the rest; counts has each total, and truncated says whether any list was cut. A node created and deleted between the two snapshots is in neither. old may be the word previous: the snapshot this account's cache held for new's key before its latest export (one per key, kept by every export that replaces a snapshot). new is then read from that cache, never from a local copy, and refresh exports it again first, which keeps the snapshot it replaces as previous: so 'previous ' with refresh compares the last export with the live file. old and new are each dated, as the server's instructions say: report the changes as between those two times. Where path does not split on ' / ' into its names, pathIds follows it: one id per name, page first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new | Yes | The newer file: a .fig path, file key or figma.com URL; a key or URL when old is previous. A node-id in a URL is ignored | |
| old | Yes | The older file: a .fig path, file key or figma.com URL, or the word previous for the snapshot that new's latest export replaced | |
| page | No | Only changes on this page, by its name in either file; a name neither has is an error listing the pages | |
| limit | No | Most entries in each list (default 100) | |
| refresh | No | Export new again through the browser first (old is never refreshed). Has no effect when new is a path to a .fig, and the result's new carries refreshIgnored | |
| exclude_pages | No | Pages to leave out, by name, before the limit: their changes neither fill a list nor count in counts, and byPage still counts them. Default: excludePages in the project's .figma-reader.json, unless page is given; an empty list covers every page |