figma-local 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -395,7 +395,7 @@ fig-start --safe --here # launch from your project dir; Claude sees both you
395
395
 
396
396
  ## Claude Code Plugin (Skills)
397
397
 
398
- figma-local ships as a Claude Code plugin with 8 skills that teach coding agents how to use it automatically:
398
+ figma-local ships as a Claude Code plugin with 9 skills that teach coding agents how to use it automatically:
399
399
 
400
400
  | Skill | Triggers on |
401
401
  |-------|------------|
@@ -407,6 +407,7 @@ figma-local ships as a Claude Code plugin with 8 skills that teach coding agents
407
407
  | **figma-document** | "document this component", "full spec sheet", "deep breakdown" |
408
408
  | **figma-screenshot** | "take a screenshot", "export as PNG/SVG", "capture this" |
409
409
  | **figma-compare** | "compare", "does this match", "visual diff", "check against design" |
410
+ | **figma-library** | "library components", "import from library", "team library variables" |
410
411
 
411
412
  ### Install the skills
412
413
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "figma-local",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Control Figma Desktop with Claude Code. Smart read, write, and AI-prompt export. No API key required.",
5
5
  "author": "elvke",
6
6
  "license": "MIT",
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: figma-library
3
+ description: |
4
+ Use this skill when the user wants to access, browse, import, or use components and variables from a Figma team library or external Figma file. Triggers on: "library components", "import component", "library variables", "team library", "use components from another file", "get the button from the library", "what components are available", "design system components", "import from library", "library collections". Also use when building UI and the user references a design system or component library in another Figma file.
5
+ allowed-tools:
6
+ - Bash(fig library *)
7
+ - Bash(fig library)
8
+ - Bash(fig inspect *)
9
+ - Bash(fig read *)
10
+ ---
11
+
12
+ # Figma Library
13
+
14
+ Access team library components and variables from other Figma files. Import components by key and browse available design tokens.
15
+
16
+ ## Prerequisites
17
+
18
+ - The `fig` CLI must be connected: `fig daemon status`. If not: `fig connect --safe`.
19
+ - The Figma plugin must have `teamlibrary` permission in its manifest. If library commands fail with a permission error, re-import the plugin in Figma (Plugins → Development → Import from manifest).
20
+ - Libraries must be enabled in the current Figma file (check Assets panel → team library icon).
21
+
22
+ ## Usage
23
+
24
+ ### List library variable collections
25
+
26
+ See what variable collections are available from linked libraries:
27
+
28
+ ```bash
29
+ fig library collections
30
+ ```
31
+
32
+ Returns: collection name, library name, and collection key for each.
33
+
34
+ ### List library variables
35
+
36
+ Browse all variables across all linked library collections:
37
+
38
+ ```bash
39
+ fig library variables
40
+ ```
41
+
42
+ Filter by name:
43
+
44
+ ```bash
45
+ fig library variables --name "color"
46
+ fig library variables --name "spacing"
47
+ fig library variables --name "radius"
48
+ ```
49
+
50
+ Returns: variable name, type (COLOR, FLOAT, STRING), key, collection, and library name.
51
+
52
+ ### List library components
53
+
54
+ Find library components that are already used on the current page:
55
+
56
+ ```bash
57
+ fig library components
58
+ ```
59
+
60
+ Filter by name:
61
+
62
+ ```bash
63
+ fig library components --name "button"
64
+ fig library components --name "input"
65
+ fig library components --name "card"
66
+ ```
67
+
68
+ Returns: component name, component set, key, description, and whether it's remote (library) or local.
69
+
70
+ ### Import a component by key
71
+
72
+ Import a library component onto the canvas by its key:
73
+
74
+ ```bash
75
+ fig library import --key "abc123def456..."
76
+ ```
77
+
78
+ Import and rename:
79
+
80
+ ```bash
81
+ fig library import --key "abc123def456..." --name "PrimaryButton"
82
+ ```
83
+
84
+ The imported component instance is placed at the viewport center and selected.
85
+
86
+ ### JSON output
87
+
88
+ All commands support `--json` for structured output:
89
+
90
+ ```bash
91
+ fig library collections --json
92
+ fig library variables --json
93
+ fig library variables --name "color" --json
94
+ fig library components --json
95
+ ```
96
+
97
+ ## Workflow: Building with library components
98
+
99
+ 1. **Discover** what's available:
100
+ ```bash
101
+ fig library collections
102
+ fig library variables --name "color"
103
+ fig library components --name "button"
104
+ ```
105
+
106
+ 2. **Import** the components you need:
107
+ ```bash
108
+ fig library import --key "<key-from-step-1>"
109
+ ```
110
+
111
+ 3. **Inspect** the imported component to get its specs:
112
+ ```bash
113
+ fig inspect --deep
114
+ ```
115
+
116
+ 4. **Read** variables to get token values:
117
+ ```bash
118
+ fig library variables --name "primary" --json
119
+ ```
120
+
121
+ 5. **Replicate** in code using the exact specs and token values.
122
+
123
+ ## Workflow: Extracting a design system
124
+
125
+ 1. List all variable collections:
126
+ ```bash
127
+ fig library collections --json
128
+ ```
129
+
130
+ 2. Export all variables grouped by type:
131
+ ```bash
132
+ fig library variables --name "color" --json > colors.json
133
+ fig library variables --name "spacing" --json > spacing.json
134
+ fig library variables --name "radius" --json > radii.json
135
+ ```
136
+
137
+ 3. Find key components:
138
+ ```bash
139
+ fig library components --json
140
+ ```
141
+
142
+ 4. Import and document each:
143
+ ```bash
144
+ fig library import --key "<key>"
145
+ fig document --json
146
+ ```
147
+
148
+ ## Tips
149
+
150
+ - If `fig library components` returns empty, drag some components from the Assets panel onto the page first — the command scans instances on the current page.
151
+ - Use `fig library variables --json` and pipe to `jq` for filtering: `fig library variables --json | jq '.[] | select(.resolvedType == "COLOR")'`
152
+ - After importing a component, use `fig inspect --deep` to get full specs including variable bindings.
153
+ - Component keys are stable across file versions — save them for repeated imports.