About library-variables-figma
A skill for browsing and importing variables from team libraries subscribed to by the current Figma file. Imported variables receive local IDs and can be bound or referenced like local variables.
Key features
- 01Browse variables in subscribed libraries
- 02Filter by library, collection, and type
- 03Import variables and return local IDs
- 04Keep repeated imports idempotent
Use cases
- 01Find design variables in team libraries
- 02Import library variables into the current file
- 03Bind imported variables to node properties
MCP support
The skill runs Figma Plugin API scripts through `use_figma`; the input does not describe it as an MCP server or client.
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ southleft/ skills-for-figma --skill library-variables-figmaAfter installing, type/library-variables-figmain Claude Code to confirm it loaded.
Bundled filesscripts/import-library-variable.jsscripts/list-library-variables.js
Details
From the project READMElibrary-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_figmarules — load the officialfigma-useskill first; it is the full Figma Plugin API reference. Essentials these scripts rely on: plain JS with top-levelawait+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.jsviause_figma(skillNames: "library-variables-figma"). Optionally set theLIBRARY_NAME/COLLECTION_NAME/TYPEfilters. It returns each subscribed collection and thekeyof every variable in it. - Import. Put the variable
key(s) intoscripts/import-library-variable.jsand run it. It returns the newlocalIdfor 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-figmafor 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.
Comments
Markdown supported