figma-arrange-component-set
Skill83 starsChanged 6 months agoMITView on GitHub
Organize a Figma COMPONENT_SET's variants into a clean, labeled grid — rows and columns derived from the variant properties, with row labels on the left, column headers on top, and a titled white container. Use when a variant set is a messy pile and you want a presentable, documentation-ready layout — triggers: 'arrange my variants in a grid', 'organize this component set', 'lay out the variants with labels', 'make a variant matrix', 'clean up my component set layout', 'add row/column headers to my variants'. Picks the last property (usually State) as columns and the rest as rows by default. NOT something the native MCP's read-only tools do — this writes a new organized layout to the canvas.
In this repository22 other files it gives its agents.
- figjam-create-contentSkill
- figma-analyze-component-setSkill
- figma-annotationsSkill
- figma-audit-accessibilitySkill
- figma-blame-nodeSkill
- figma-check-design-paritySkill
- figma-commentsSkill
- figma-component-propertiesSkill
- figma-deep-componentSkill
- figma-design-system-inventorySkill
- figma-export-tokensSkill
- figma-extract-design-systemSkill
- figma-generate-changelogSkill
- figma-generate-component-docSkill
- figma-import-tokensSkill
- figma-library-variablesSkill
- figma-lint-designSkill
- figma-manage-variablesSkill
- figma-scan-code-accessibilitySkill
- figma-setup-design-tokensSkill
- figma-slidesSkill
- figma-version-historySkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
One property → columns: if your set has a single property axis, all variants land in one row.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
figma-arrange-component-set — labeled variant grid
Reorganize the variants inside a COMPONENT_SET into a tidy matrix: it parses each variant's
properties (Size=md, State=hover), uses one property for columns and the rest for rows, centers
each variant in a grid cell, and wraps everything in a white container frame with a title, left-edge
row labels, and top column headers. The result is the kind of variant sheet you'd show in design-system
docs.
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).- Understanding what the variants mean (state machine, CSS) → use
figma-analyze-component-set. - This writes a new layout to the canvas — it is a design-system authoring capability the native
MCP's
get_design_context/get_metadata(read-only) do not cover.
Workflow
- Identify the set. Get the
COMPONENT_SET_IDfrom selection, search, or a pasted id. (You can also leave the constant blank and select the set on the canvas — the script falls back to the current selection.) - Pick the column axis (optional). By default the last variant property becomes columns
(usually
State); everything else becomes rows. Override withconst COLUMN_PROPERTY. - Run
scripts/arrange-component-set.jsviause_figma(skillNames: "figma-arrange-component-set"). AdjustGAP/CELL_PADDINGconstants if needed. - Verify visually. Take a screenshot. The script returns
containerId, the (re-created)componentSetId, and the grid shape (rows/columns, labels). Variants are centered per cell.
How it works
- Re-creates the set with
figma.combineAsVariants()so it gets Figma's native purple dashed frame (#9747FF, dashed[10,5], inside stroke). Old labels/containers from a previous run are removed first, so re-running is idempotent. - Grid math: cell size = max variant size + padding; the set is resized to fit
cols × (cell+gap). Variants are positioned by matching their parsed property values to the row/column index. - Labels are auto-layout frames built outside the component set (component sets don't nest well in auto-layout) and aligned to each row's vertical center / each column's horizontal center.
Notes
- Fonts: the script loads
Inter Regular+Inter Semi Boldfor labels — if Inter isn't available in the file, swap the family in theloadFontAsynccalls. - Destructive-ish: it deletes the original set and rebuilds it via clones. The variants and their
properties are preserved, but the node id of the set changes (returned as
componentSetId). - One property → columns: if your set has a single property axis, all variants land in one row. Multi-axis sets generate every row combination (cartesian product of the non-column properties).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

