About manage-variables-figma
A skill for making targeted changes to Figma variables, collections, and modes through the Figma Plugin API. It covers creation, bulk updates, naming, scopes, code syntax, and deletion.
Key features
- 01Create variables and collections
- 02Update variable values in bulk
- 03Rename variables and modes
- 04Set scopes and code syntax
- 05Add modes and delete items
Use cases
- 01Create or update design variables
- 02Align variable names with code tokens
- 03Manage modes and collection structure
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ southleft/ skills-for-figma --skill manage-variables-figmaAfter installing, type/manage-variables-figmain Claude Code to confirm it loaded.
Bundled filesreferences/variable-ops.mdscripts/batch-update-variables.js
Details
From the project READMEmanage-variables-figma — variable / collection / mode CRUD
Incremental, surgical edits to a Figma variable system: create one or many, update values in bulk,
rename, set scopes and code syntax, add/rename modes, and delete. All via use_figma, on any plan.
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).- From-scratch bootstrap →
setup-design-tokens-figma. Code sync →import-tokens-figma/export-tokens-figma.
Workflow
- Identify targets. Most ops need IDs. Get
variableId/modeId/collectionIdfrom theexport-tokens-figmaread script orget_variable_defs. Collections can also be looked up by name inside the script. - Pick the operation from references/variable-ops.md — it has a
complete, copy-paste
use_figmasnippet for each: create collection, create variable, batch create, batch update, rename, set scopes, add/rename mode, delete. - Run via
use_figma(skillNames: "manage-variables-figma"). For large value updates usescripts/batch-update-variables.js(10–50× faster than one-call-per-value). - Confirm. Every snippet returns the affected IDs/names. Read back with
get_variable_defsto verify. For deletes, confirm with the user first — removing a collection deletes all its variables and unbinds anything referencing them.
Key rules
- Colors are 0–1 range. Use
hexToRgbfor hex input. - Always set
scopeson new variables — the defaultALL_SCOPESpollutes every picker. - Set code syntax (
setVariableCodeSyntax('WEB', '--token-name')) so design↔code naming lines up. - Renames are safe — they preserve values and existing bindings. Deletes are destructive.
- Aliases: bind one variable to another with
v.setValueForMode(modeId, figma.variables.createVariableAlias(targetVar)).
Comments
Markdown supported