@noemuch/bridge-ds 2.3.0 → 2.5.1
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/.claude-plugin/plugin.json +31 -0
- package/.cursor-plugin/plugin.json +26 -0
- package/.mcp.json +12 -0
- package/CHANGELOG.md +93 -0
- package/CLAUDE.md +84 -0
- package/README.md +25 -10
- package/lib/cli.js +107 -134
- package/lib/mcp-setup.js +32 -28
- package/lib/scaffold.js +6 -3
- package/package.json +10 -3
- package/skills/design-workflow/SKILL.md +70 -17
- package/skills/design-workflow/references/actions/design.md +63 -12
- package/skills/design-workflow/references/actions/done.md +21 -3
- package/skills/design-workflow/references/actions/learn.md +147 -0
- package/skills/design-workflow/references/actions/quick.md +80 -0
- package/skills/design-workflow/references/actions/review.md +14 -3
- package/skills/design-workflow/references/actions/spec.md +24 -0
- package/skills/design-workflow/references/actions/sync.md +176 -0
- package/skills/design-workflow/references/figma-api-rules.md +112 -0
- package/skills/design-workflow/references/knowledge-base/README.md +18 -1
- package/skills/design-workflow/references/knowledge-base/schemas/assets.md +6 -0
- package/skills/design-workflow/references/knowledge-base/schemas/components.md +6 -0
- package/skills/design-workflow/references/knowledge-base/schemas/learnings.md +250 -0
- package/skills/design-workflow/references/knowledge-base/schemas/text-styles.md +6 -0
- package/skills/design-workflow/references/knowledge-base/schemas/validation.md +6 -0
- package/skills/design-workflow/references/knowledge-base/schemas/variables.md +6 -0
- package/skills/design-workflow/references/onboarding.md +51 -9
- package/skills/design-workflow/references/quality-gates.md +51 -2
- package/skills/design-workflow/references/templates/screen-template.md +12 -0
- package/skills/design-workflow/references/templates/spec-template.md +12 -0
- package/skills/design-workflow/references/transport-adapter.md +210 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Schema: learnings.json
|
|
2
|
+
|
|
3
|
+
> **Read this BEFORE writing or updating learnings.json.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
`learnings.json` stores corrections the user makes to generated designs. When Bridge generates a design and the user manually fixes it in Figma, the `learn` action extracts those changes and persists them here. Future generations consult these learnings to avoid repeating the same mistakes.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Required Structure
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"meta": {
|
|
18
|
+
"version": "1.0",
|
|
19
|
+
"lastUpdated": "YYYY-MM-DD"
|
|
20
|
+
},
|
|
21
|
+
"learnings": [
|
|
22
|
+
{
|
|
23
|
+
"id": "l-YYYYMMDD-NNN",
|
|
24
|
+
"scope": "contextual",
|
|
25
|
+
"context": {
|
|
26
|
+
"screenType": "settings",
|
|
27
|
+
"component": "card",
|
|
28
|
+
"section": "content"
|
|
29
|
+
},
|
|
30
|
+
"change": {
|
|
31
|
+
"property": "itemSpacing",
|
|
32
|
+
"from": { "token": "spacing/large", "value": 24 },
|
|
33
|
+
"to": { "token": "spacing/medium", "value": 16 }
|
|
34
|
+
},
|
|
35
|
+
"rule": "For settings screens, cards use spacing/medium (not large).",
|
|
36
|
+
"signals": 1,
|
|
37
|
+
"history": [
|
|
38
|
+
{ "date": "2026-03-20", "spec": "settings-screen" }
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"flags": [
|
|
43
|
+
{
|
|
44
|
+
"id": "f-YYYYMMDD-NNN",
|
|
45
|
+
"spec": "settings-screen",
|
|
46
|
+
"description": "Hardcoded hex #FF5722 on node 'StatusBadge'",
|
|
47
|
+
"resolved": false
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Field Requirements
|
|
56
|
+
|
|
57
|
+
### Top-level
|
|
58
|
+
|
|
59
|
+
| Field | Required | Description |
|
|
60
|
+
|-------|----------|-------------|
|
|
61
|
+
| `meta.version` | **YES** | Schema version (`"1.0"`) |
|
|
62
|
+
| `meta.lastUpdated` | **YES** | ISO date of last modification |
|
|
63
|
+
| `learnings` | **YES** | Array of DS-compliant changes detected (can be empty) |
|
|
64
|
+
| `flags` | **YES** | Array of non-DS-compliant changes that need user attention (can be empty) |
|
|
65
|
+
|
|
66
|
+
### Learning entry
|
|
67
|
+
|
|
68
|
+
| Field | Required | Description |
|
|
69
|
+
|-------|----------|-------------|
|
|
70
|
+
| `id` | **YES** | Unique ID: `l-YYYYMMDD-NNN` |
|
|
71
|
+
| `scope` | **YES** | `"contextual"` (screen/component-specific) or `"global"` (applies everywhere) |
|
|
72
|
+
| `context` | **YES** | Where this learning applies: `screenType`, `component`, `section` (all optional strings) |
|
|
73
|
+
| `change` | **YES** | What changed: `property`, `from` (token + value), `to` (token + value) |
|
|
74
|
+
| `change.property` | **YES** | Figma property name (e.g., `itemSpacing`, `fills`, `cornerRadius`) |
|
|
75
|
+
| `change.from` | **YES** | Original value: `{ "token": "...", "value": ... }` — token may be null if raw |
|
|
76
|
+
| `change.to` | **YES** | Corrected value: `{ "token": "...", "value": ... }` |
|
|
77
|
+
| `rule` | **YES** | Human-readable rule derived from the change |
|
|
78
|
+
| `signals` | **YES** | Number of times this correction has been observed |
|
|
79
|
+
| `history` | **YES** | Array of `{ "date", "spec" }` entries tracking each observation |
|
|
80
|
+
|
|
81
|
+
### Flag entry
|
|
82
|
+
|
|
83
|
+
| Field | Required | Description |
|
|
84
|
+
|-------|----------|-------------|
|
|
85
|
+
| `id` | **YES** | Unique ID: `f-YYYYMMDD-NNN` |
|
|
86
|
+
| `spec` | **YES** | Which spec triggered this flag |
|
|
87
|
+
| `description` | **YES** | What was changed and why it's flagged (e.g., hardcoded hex) |
|
|
88
|
+
| `resolved` | **YES** | `false` until user addresses it |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Scope Promotion Rules
|
|
93
|
+
|
|
94
|
+
A learning starts as `"contextual"` and can be promoted to `"global"`:
|
|
95
|
+
|
|
96
|
+
1. **Threshold:** `signals >= 3` AND observations come from at least 2 different `screenType` values
|
|
97
|
+
2. **Contradiction check:** If the same `property` has learnings pointing to different `to` tokens → do NOT promote. Instead, flag for user review.
|
|
98
|
+
3. **On promotion:** Change `scope` to `"global"`, keep `context` for reference but it no longer restricts matching.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Snapshot Structure
|
|
103
|
+
|
|
104
|
+
Snapshots are saved after design generation to enable diffing during `learn`.
|
|
105
|
+
|
|
106
|
+
**File:** `specs/active/{name}-snapshot.json`
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"meta": {
|
|
111
|
+
"spec": "settings-screen",
|
|
112
|
+
"generatedAt": "YYYY-MM-DDTHH:mm:ss",
|
|
113
|
+
"rootNodeId": "123:456",
|
|
114
|
+
"fileKey": "abc123"
|
|
115
|
+
},
|
|
116
|
+
"tree": {
|
|
117
|
+
"id": "123:456",
|
|
118
|
+
"name": "Settings Screen",
|
|
119
|
+
"type": "FRAME",
|
|
120
|
+
"width": 1440,
|
|
121
|
+
"height": 900,
|
|
122
|
+
"layoutMode": "VERTICAL",
|
|
123
|
+
"primaryAxisAlignItems": "MIN",
|
|
124
|
+
"counterAxisAlignItems": "MIN",
|
|
125
|
+
"itemSpacing": 0,
|
|
126
|
+
"paddingTop": 0,
|
|
127
|
+
"paddingBottom": 0,
|
|
128
|
+
"paddingLeft": 0,
|
|
129
|
+
"paddingRight": 0,
|
|
130
|
+
"cornerRadius": 0,
|
|
131
|
+
"boundVariables": {
|
|
132
|
+
"itemSpacing": "spacing/large"
|
|
133
|
+
},
|
|
134
|
+
"fills": [
|
|
135
|
+
{ "type": "SOLID", "color": "#F5F5F5", "boundVariable": "color/background/neutral/default" }
|
|
136
|
+
],
|
|
137
|
+
"componentKey": null,
|
|
138
|
+
"componentName": null,
|
|
139
|
+
"children": []
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Node tree extraction script
|
|
145
|
+
|
|
146
|
+
Use this via `figma_execute` to extract the snapshot tree (max depth 10):
|
|
147
|
+
|
|
148
|
+
```js
|
|
149
|
+
return (async function() {
|
|
150
|
+
var root = await figma.getNodeByIdAsync("ROOT_NODE_ID");
|
|
151
|
+
if (!root) return { error: "Node not found" };
|
|
152
|
+
|
|
153
|
+
function extractNode(node, depth) {
|
|
154
|
+
if (depth > 10) return null;
|
|
155
|
+
var data = {
|
|
156
|
+
id: node.id,
|
|
157
|
+
name: node.name,
|
|
158
|
+
type: node.type,
|
|
159
|
+
width: Math.round(node.width),
|
|
160
|
+
height: Math.round(node.height)
|
|
161
|
+
};
|
|
162
|
+
if (node.layoutMode) {
|
|
163
|
+
data.layoutMode = node.layoutMode;
|
|
164
|
+
data.primaryAxisAlignItems = node.primaryAxisAlignItems;
|
|
165
|
+
data.counterAxisAlignItems = node.counterAxisAlignItems;
|
|
166
|
+
data.itemSpacing = node.itemSpacing;
|
|
167
|
+
data.paddingTop = node.paddingTop;
|
|
168
|
+
data.paddingBottom = node.paddingBottom;
|
|
169
|
+
data.paddingLeft = node.paddingLeft;
|
|
170
|
+
data.paddingRight = node.paddingRight;
|
|
171
|
+
}
|
|
172
|
+
if (node.cornerRadius !== undefined) data.cornerRadius = node.cornerRadius;
|
|
173
|
+
// Bound variables
|
|
174
|
+
var bv = {};
|
|
175
|
+
try {
|
|
176
|
+
var bindings = node.boundVariables || {};
|
|
177
|
+
for (var prop in bindings) {
|
|
178
|
+
var b = bindings[prop];
|
|
179
|
+
if (b && b.id) bv[prop] = b.id;
|
|
180
|
+
else if (Array.isArray(b)) bv[prop] = b.map(function(x) { return x.id; });
|
|
181
|
+
}
|
|
182
|
+
} catch(e) {}
|
|
183
|
+
if (Object.keys(bv).length > 0) data.boundVariables = bv;
|
|
184
|
+
// Fills
|
|
185
|
+
if (node.fills && node.fills.length > 0) {
|
|
186
|
+
data.fills = node.fills.map(function(f) {
|
|
187
|
+
var fill = { type: f.type };
|
|
188
|
+
if (f.color) fill.color = "#" +
|
|
189
|
+
Math.round(f.color.r*255).toString(16).padStart(2,"0") +
|
|
190
|
+
Math.round(f.color.g*255).toString(16).padStart(2,"0") +
|
|
191
|
+
Math.round(f.color.b*255).toString(16).padStart(2,"0");
|
|
192
|
+
return fill;
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
// Component info
|
|
196
|
+
if (node.type === "INSTANCE") {
|
|
197
|
+
data.componentKey = node.mainComponent ? node.mainComponent.key : null;
|
|
198
|
+
data.componentName = node.mainComponent ? node.mainComponent.name : null;
|
|
199
|
+
}
|
|
200
|
+
// Children
|
|
201
|
+
if (node.children && node.children.length > 0) {
|
|
202
|
+
data.children = [];
|
|
203
|
+
for (var i = 0; i < node.children.length; i++) {
|
|
204
|
+
var child = extractNode(node.children[i], depth + 1);
|
|
205
|
+
if (child) data.children.push(child);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return data;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return { tree: extractNode(root, 0) };
|
|
212
|
+
})();
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## How Learnings Are Used
|
|
218
|
+
|
|
219
|
+
### During `spec` (Step 2.5)
|
|
220
|
+
|
|
221
|
+
Load `learnings.json`, filter by `screenType` matching the new spec's type. Display matching learnings as **"Known Preferences"** in the spec output.
|
|
222
|
+
|
|
223
|
+
### During `design` (Step 1e)
|
|
224
|
+
|
|
225
|
+
After pattern matching and before generation, load `learnings.json` and filter:
|
|
226
|
+
- **Global learnings:** Always apply
|
|
227
|
+
- **Contextual learnings:** Match by `screenType`, `component`, or `section`
|
|
228
|
+
|
|
229
|
+
List applicable learnings in the pre-script audit and integrate into generation scripts.
|
|
230
|
+
|
|
231
|
+
### During `done`
|
|
232
|
+
|
|
233
|
+
Persist any learnings from the current `learn` session. Clean up the snapshot file.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## File Location
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
knowledge-base/
|
|
241
|
+
learnings.json ← Persistent learning store
|
|
242
|
+
specs/active/
|
|
243
|
+
{name}-snapshot.json ← Temporary snapshot (deleted after done)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Transport Note
|
|
249
|
+
|
|
250
|
+
For official transport: remove the IIFE wrapper from the node tree extraction script, add `fileKey` and `description` to the `use_figma` call. See `references/transport-adapter.md` for details.
|
|
@@ -115,3 +115,9 @@ Group text styles by their first path segment:
|
|
|
115
115
|
- `code` — Monospace / code text
|
|
116
116
|
|
|
117
117
|
Weight/emphasis variants are the second segment: `regular`, `accent`, `emphasis`, `bold`.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Transport Note
|
|
122
|
+
|
|
123
|
+
For official transport: remove the IIFE wrapper from extraction scripts, add `fileKey` and `description` to the `use_figma` call. See `references/transport-adapter.md` for details.
|
|
@@ -180,3 +180,9 @@ If validation fails after remediation attempts, ask the user to verify:
|
|
|
180
180
|
1. The DS library is published (not just local)
|
|
181
181
|
2. The library is enabled in the target Figma file
|
|
182
182
|
3. The correct Figma file was used for extraction
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Transport Note
|
|
187
|
+
|
|
188
|
+
For official transport: remove the IIFE wrapper from extraction and validation scripts, add `fileKey` and `description` to the `use_figma` call. See `references/transport-adapter.md` for details.
|
|
@@ -151,3 +151,9 @@ frame.setBoundVariable('itemSpacing', spMedium);
|
|
|
151
151
|
var bgColor = await figma.variables.importVariableByKeyAsync("VariableID:19:114");
|
|
152
152
|
frame.fills = mf(bgColor); // using the mf() helper
|
|
153
153
|
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Transport Note
|
|
158
|
+
|
|
159
|
+
For official transport: remove the IIFE wrapper from extraction scripts, add `fileKey` and `description` to the `use_figma` call. See `references/transport-adapter.md` for details.
|
|
@@ -34,13 +34,31 @@ STEP 6 Done (archive + retro)
|
|
|
34
34
|
|
|
35
35
|
**Trigger**: any design-related request (spec, design, new component, new screen, setup, etc.)
|
|
36
36
|
|
|
37
|
-
### 0a. Check
|
|
37
|
+
### 0a. Check Figma MCP Transport
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
Detect which transport is available (see `references/transport-adapter.md` Section A):
|
|
40
|
+
|
|
41
|
+
1. **Check console transport:** Is `figma_execute` available? Try `figma_get_status()`.
|
|
42
|
+
2. **Check official transport:** Is `use_figma` available? Try `whoami()`.
|
|
43
|
+
|
|
44
|
+
| Result | Action |
|
|
45
|
+
|--------|--------|
|
|
46
|
+
| Console available | Use console transport. Verify: `figma_get_status()` returns `setup.valid: true` |
|
|
47
|
+
| Official only | Use official transport. Verify: `whoami()` succeeds, then test `use_figma` call |
|
|
48
|
+
| Both available | Use console (preferred — more capable, no response limits) |
|
|
49
|
+
| Neither available | **Block.** Show setup instructions for both options (see transport-adapter.md Section A) |
|
|
50
|
+
|
|
51
|
+
**Post-detection checks:**
|
|
52
|
+
|
|
53
|
+
| Check | Console | Official | Block message if fail |
|
|
54
|
+
|-------|---------|----------|-----------------------|
|
|
55
|
+
| Transport connected | `figma_get_status()` → `setup.valid: true` | `whoami()` succeeds + test `use_figma` call | Console: "Figma Desktop is not connected. Open: Plugins → Development → Desktop Bridge." / Official: "Figma MCP not authenticated. Check your Figma MCP configuration." |
|
|
56
|
+
| DS libraries enabled | Ask user to confirm | Ask user to confirm | "Make sure your DS libraries are enabled in the target Figma file (Assets panel → Team → Enable). Confirm when done." |
|
|
57
|
+
|
|
58
|
+
Report the active transport:
|
|
59
|
+
```
|
|
60
|
+
Transport: {console | official} ✓
|
|
61
|
+
```
|
|
44
62
|
|
|
45
63
|
**Note:** Setup check can be deferred to just before STEP 4 (design) if the user only wants to write a spec first. But it MUST pass before any Figma generation.
|
|
46
64
|
|
|
@@ -56,17 +74,41 @@ What do you want to design? (component or screen)
|
|
|
56
74
|
|
|
57
75
|
**If knowledge base is empty → build it:**
|
|
58
76
|
|
|
77
|
+
#### Knowledge Base Directory Selection
|
|
78
|
+
|
|
79
|
+
Determine where to create the knowledge base:
|
|
80
|
+
- If `./.claude/skills/design-workflow/references/knowledge-base/` already exists (npm scaffold mode) → use that path
|
|
81
|
+
- Otherwise (plugin mode or fresh project) → create and use `./bridge-ds/knowledge-base/`
|
|
82
|
+
|
|
83
|
+
Create these subdirectories in the chosen KB root:
|
|
84
|
+
- `registries/`
|
|
85
|
+
- `guides/tokens/`
|
|
86
|
+
- `guides/components/`
|
|
87
|
+
- `guides/patterns/`
|
|
88
|
+
- `guides/assets/`
|
|
89
|
+
- `ui-references/screenshots/`
|
|
90
|
+
|
|
59
91
|
#### KB Generation Flow
|
|
60
92
|
|
|
61
93
|
1. **Ask the user for the DS library file key/URL** (the Figma file containing their design system)
|
|
62
94
|
|
|
63
95
|
2. **Extract raw data via MCP tools:**
|
|
96
|
+
|
|
97
|
+
**Console transport:**
|
|
64
98
|
```
|
|
65
99
|
figma_get_design_system_kit({ file_key: "...", format: "full" })
|
|
66
100
|
figma_get_variables({ file_key: "..." })
|
|
67
101
|
figma_get_styles({ file_key: "..." })
|
|
68
102
|
```
|
|
69
103
|
|
|
104
|
+
**Official transport** (no `figma_get_design_system_kit`): Use the composite strategy from `references/transport-adapter.md` Section D:
|
|
105
|
+
```
|
|
106
|
+
get_variable_defs({ fileKey: "..." })
|
|
107
|
+
search_design_system({ query: "*", includeComponents: true })
|
|
108
|
+
search_design_system({ query: "*", includeStyles: true })
|
|
109
|
+
```
|
|
110
|
+
Supplement with `use_figma` extraction scripts from the schemas as needed.
|
|
111
|
+
|
|
70
112
|
3. **Write registries** (raw JSON, deterministic):
|
|
71
113
|
|
|
72
114
|
**CRITICAL: Read the schema for each registry BEFORE writing it:**
|
|
@@ -278,7 +320,7 @@ Now we can design the screen with real DS components.
|
|
|
278
320
|
**Prerequisites (ALL must pass):**
|
|
279
321
|
- [ ] Spec validated (STEP 2 passed)
|
|
280
322
|
- [ ] New components created if needed (STEP 3 passed)
|
|
281
|
-
- [ ]
|
|
323
|
+
- [ ] Figma MCP transport connected (STEP 0 check)
|
|
282
324
|
- [ ] DS libraries enabled
|
|
283
325
|
|
|
284
326
|
**If any prerequisite fails → block with specific message from Block Messages Reference.**
|
|
@@ -344,8 +386,8 @@ Ready for the next design!
|
|
|
344
386
|
|
|
345
387
|
| Situation | Message |
|
|
346
388
|
|-----------|---------|
|
|
347
|
-
| No MCP
|
|
348
|
-
| Not connected | "Figma Desktop is not connected. Open: Plugins → Development → Desktop Bridge." |
|
|
389
|
+
| No MCP transport | "No Figma MCP transport detected. See `references/transport-adapter.md` Section A for setup instructions (console or official)." |
|
|
390
|
+
| Not connected | Console: "Figma Desktop is not connected. Open: Plugins → Development → Desktop Bridge." / Official: "Figma MCP not authenticated. Check your configuration." |
|
|
349
391
|
| Libraries not enabled | "Enable your DS libraries in the target Figma file: Assets → Team → Enable." |
|
|
350
392
|
| No knowledge base | "Knowledge base not built yet. Run: `setup`" |
|
|
351
393
|
| No active spec | "No active spec. Let's create one: component or screen?" |
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
| Gate | Blocking | Check |
|
|
8
8
|
|------|----------|-------|
|
|
9
|
-
|
|
|
10
|
-
| Connected to Figma
|
|
9
|
+
| Figma MCP transport available | Yes (before design) | Console: `figma_get_status()` returns valid connection / Official: `whoami()` succeeds (see transport-adapter.md Section F) |
|
|
10
|
+
| Connected to Figma | Yes (before design) | Console: `setup.valid: true` / Official: `whoami()` + test `use_figma` call |
|
|
11
11
|
| DS libraries enabled | Yes (before design) | User confirmation |
|
|
12
12
|
| Knowledge base exists | Yes (before spec) | `registries/` has JSON files |
|
|
13
13
|
| Registry schemas followed | Yes | All registry files match schemas in `schemas/` — every entry has `key` field |
|
|
@@ -121,6 +121,33 @@
|
|
|
121
121
|
|
|
122
122
|
---
|
|
123
123
|
|
|
124
|
+
## Phase: learn (after design corrections)
|
|
125
|
+
|
|
126
|
+
| Gate | Blocking | Check |
|
|
127
|
+
|------|----------|-------|
|
|
128
|
+
| Active spec exists | Yes | `specs/active/{name}-spec.md` present |
|
|
129
|
+
| Snapshot exists | Yes | `specs/active/{name}-snapshot.json` present |
|
|
130
|
+
| Figma MCP transport available | Yes | Console: `figma_get_status()` / Official: `whoami()` (see transport-adapter.md) |
|
|
131
|
+
| Root node still exists | Yes | Plugin API execution can find the node from snapshot meta |
|
|
132
|
+
| Changes classified | Yes | Every change classified as LEARNING or FLAG |
|
|
133
|
+
| Learnings have valid tokens | Yes | Every LEARNING references a token from `registries/variables.json` |
|
|
134
|
+
| Flags surfaced to user | Yes | All FLAG items reported before saving |
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Phase: sync (DS incremental update)
|
|
139
|
+
|
|
140
|
+
| Gate | Blocking | Check |
|
|
141
|
+
|------|----------|-------|
|
|
142
|
+
| Knowledge base exists | Yes | `registries/` has JSON files |
|
|
143
|
+
| Figma MCP transport available | Yes | Console: `figma_get_status()` / Official: `whoami()` (see transport-adapter.md) |
|
|
144
|
+
| Diff computed before apply | Yes | Report shown to user before any registry modification |
|
|
145
|
+
| Breaking changes confirmed | Yes (if removals) | User explicitly approves deletion of removed items |
|
|
146
|
+
| Registry validation after update | Yes | Sample import test passes (3-5 keys per registry) |
|
|
147
|
+
| Guides patched for removals | Yes (if removals) | No guide references deleted components/tokens |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
124
151
|
## Skip Policy
|
|
125
152
|
|
|
126
153
|
- **Non-skippable (NEVER):** spec creation, spec validation, new components check, pattern matching, visual fidelity review, DS component reuse audit (Rule 18), pre-script element audit, registry loading
|
|
@@ -129,3 +156,25 @@
|
|
|
129
156
|
1. Warn user about quality impact
|
|
130
157
|
2. Log the skip reason
|
|
131
158
|
3. Flag in review as advisory issue
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Phase: Quick Mode
|
|
163
|
+
|
|
164
|
+
Quick mode relaxes some gates while keeping critical ones:
|
|
165
|
+
|
|
166
|
+
### Relaxed (non-blocking in quick mode)
|
|
167
|
+
- Pattern matching: best-effort, not blocking
|
|
168
|
+
- Spec creation and validation: skipped entirely
|
|
169
|
+
- New components check: skipped (use what exists in registries)
|
|
170
|
+
- Formal review: skipped (user can run separately)
|
|
171
|
+
- Acceptance criteria: none (no spec)
|
|
172
|
+
|
|
173
|
+
### Still enforced (BLOCKING even in quick mode)
|
|
174
|
+
- Pre-script element audit (Rule 18) — every element must be in registries
|
|
175
|
+
- Zero hardcoded hex colors — all colors via setBoundVariableForPaint
|
|
176
|
+
- Atomic generation — 4-6 scripts with screenshots between
|
|
177
|
+
- DS component reuse — NEVER recreate existing components as raw frames
|
|
178
|
+
- Registry loading — must load and cross-reference before generating
|
|
179
|
+
- Canvas positioning — 80px+ gaps, no stacking at (0,0)
|
|
180
|
+
- Script structure — follow figma-api-rules.md (Rule 17 / Rule 23)
|
|
@@ -128,6 +128,18 @@
|
|
|
128
128
|
|
|
129
129
|
---
|
|
130
130
|
|
|
131
|
+
## Known Preferences
|
|
132
|
+
|
|
133
|
+
> Learnings from previous designs that apply to this screen.
|
|
134
|
+
> Populated automatically from `knowledge-base/learnings.json` during spec writing.
|
|
135
|
+
> If none apply, write "None — no applicable learnings."
|
|
136
|
+
|
|
137
|
+
| Rule | Scope | Signals |
|
|
138
|
+
|------|-------|---------|
|
|
139
|
+
| `{rule}` | {global / contextual} | {n} |
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
131
143
|
## Responsive Rules
|
|
132
144
|
|
|
133
145
|
| Breakpoint | Layout change |
|
|
@@ -124,6 +124,18 @@ interface {Composed}Props {
|
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
127
|
+
## Known Preferences
|
|
128
|
+
|
|
129
|
+
> Learnings from previous designs that apply to this component.
|
|
130
|
+
> Populated automatically from `knowledge-base/learnings.json` during spec writing.
|
|
131
|
+
> If none apply, write "None — no applicable learnings."
|
|
132
|
+
|
|
133
|
+
| Rule | Scope | Signals |
|
|
134
|
+
|------|-------|---------|
|
|
135
|
+
| `{rule}` | {global / contextual} | {n} |
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
127
139
|
## Component Properties (Figma)
|
|
128
140
|
|
|
129
141
|
> Define ALL configurable properties for the Figma component.
|