Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.
library-variables-figma — discover & import team-library variables
Browse the variables published by libraries the current file subscribes to, then import the ones you need. Imported variables get a local id that behaves like any local variable (bind it, read it, reference it).
Skill boundaries
- `use_figma` rules — load the official `figma-use` skill first; it is the full Figma Plugin API reference. Essentials these scripts rely on: plain JS with top-level
await+return(no IIFE, nofigma.closePlugin();console.logis not returned), inputs inlined asconstat the top of each script, colors in 0–1 range, load fonts before any text op,await figma.getNodeByIdAsync(...), and atomic errors (a failed script applies nothing — read the error, fix, retry). - Local (non-library) variables →
export-tokens-figma,manage-variables-figma.
Workflow
- Discover. Run `scripts/list-library-variables.js` via
use_figma (skillNames: "library-variables-figma"). Optionally set the LIBRARY_NAME / COLLECTION_NAME / TYPE filters. It returns each subscribed collection and the key of every variable in it.
- Import. Put the variable
key(s) into
`scripts/import-library-variable.js` and run it. It returns the new localId for each. Re-importing is idempotent (same local id).
- Use. Bind the imported variable to node properties or reference it from local semantic tokens
(see figma-use / manage-variables-figma for binding).
Notes
- Only subscribed libraries appear. If a collection is missing, enable the library in the file's
library settings first (a manual Figma step).
getVariablesInLibraryCollectionAsynctakes the collection key, not its id.- Library variables are read-only references to the source — edit values in the library file, not
here.

