@noemuch/bridge-ds 2.0.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/LICENSE +21 -0
- package/README.md +147 -0
- package/bin/bridge.js +4 -0
- package/commands/design-workflow.md +1 -0
- package/lib/cli.js +172 -0
- package/lib/mcp-setup.js +47 -0
- package/lib/scaffold.js +120 -0
- package/package.json +39 -0
- package/skills/design-workflow/SKILL.md +205 -0
- package/skills/design-workflow/references/actions/design.md +207 -0
- package/skills/design-workflow/references/actions/done.md +48 -0
- package/skills/design-workflow/references/actions/drop.md +38 -0
- package/skills/design-workflow/references/actions/review.md +149 -0
- package/skills/design-workflow/references/actions/spec.md +128 -0
- package/skills/design-workflow/references/figma-api-rules.md +453 -0
- package/skills/design-workflow/references/knowledge-base/README.md +52 -0
- package/skills/design-workflow/references/onboarding.md +351 -0
- package/skills/design-workflow/references/quality-gates.md +127 -0
- package/skills/design-workflow/references/templates/screen-template.md +127 -0
- package/skills/design-workflow/references/templates/spec-template.md +171 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
# Onboarding — Guided Workflow
|
|
2
|
+
|
|
3
|
+
> This file defines the guided flow that EVERY user follows. Each step blocks until its prerequisites are met. No shortcuts, no skipping — the output quality depends on it.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Flow Overview
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
STEP 0 Setup check + Knowledge base
|
|
11
|
+
↓
|
|
12
|
+
STEP 1 Spec creation (component or screen)
|
|
13
|
+
↓
|
|
14
|
+
STEP 2 Spec validation (quality gates)
|
|
15
|
+
↓
|
|
16
|
+
STEP 3 New components check (screen mode only)
|
|
17
|
+
↓ ↓ (if new components found)
|
|
18
|
+
↓ STEP 3a Spec component
|
|
19
|
+
↓ STEP 3b Design component
|
|
20
|
+
↓ STEP 3c Validate component → loop back to 3a if more
|
|
21
|
+
↓ ↓
|
|
22
|
+
STEP 4 Design (generate in Figma via figma_execute)
|
|
23
|
+
↓
|
|
24
|
+
STEP 5 Review (audit against spec + tokens)
|
|
25
|
+
↓ ↓ (if issues found)
|
|
26
|
+
↓ STEP 5a Iterate → back to Review
|
|
27
|
+
↓ ↓
|
|
28
|
+
STEP 6 Done (archive + retro)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## STEP 0 — Setup Check + Knowledge Base
|
|
34
|
+
|
|
35
|
+
**Trigger**: any design-related request (spec, design, new component, new screen, setup, etc.)
|
|
36
|
+
|
|
37
|
+
### 0a. Check figma-console-mcp
|
|
38
|
+
|
|
39
|
+
| Check | How to verify | Block message if fail |
|
|
40
|
+
|-------|--------------|----------------------|
|
|
41
|
+
| figma-console-mcp available | Call `figma_get_status()` — should return connection info | "figma-console-mcp is not configured. Run: `claude mcp add figma-console -s user -e FIGMA_ACCESS_TOKEN=figd_YOUR_TOKEN -- npx -y figma-console-mcp@latest`" |
|
|
42
|
+
| Connected to Figma | `figma_get_status()` returns `setup.valid: true` | "Figma Desktop is not connected. Open your Figma file → Plugins → Development → Run the Desktop Bridge plugin." |
|
|
43
|
+
| DS libraries enabled | Ask user to confirm | "Make sure your DS libraries are enabled in the target Figma file (Assets panel → Team → Enable). Confirm when done." |
|
|
44
|
+
|
|
45
|
+
**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
|
+
|
|
47
|
+
### 0b. Knowledge Base Check
|
|
48
|
+
|
|
49
|
+
Check if `references/knowledge-base/registries/` contains JSON files.
|
|
50
|
+
|
|
51
|
+
**If knowledge base exists:**
|
|
52
|
+
```
|
|
53
|
+
Setup OK. Knowledge base found ({N} components, {N} variables, {N} text styles).
|
|
54
|
+
What do you want to design? (component or screen)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**If knowledge base is empty → build it:**
|
|
58
|
+
|
|
59
|
+
#### KB Generation Flow
|
|
60
|
+
|
|
61
|
+
1. **Ask the user for the DS library file key/URL** (the Figma file containing their design system)
|
|
62
|
+
|
|
63
|
+
2. **Extract raw data via MCP tools:**
|
|
64
|
+
```
|
|
65
|
+
figma_get_design_system_kit({ file_key: "...", format: "full" })
|
|
66
|
+
figma_get_variables({ file_key: "..." })
|
|
67
|
+
figma_get_styles({ file_key: "..." })
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
3. **Write registries** (raw JSON, deterministic):
|
|
71
|
+
- `registries/components.json` — component names, keys, variants, properties
|
|
72
|
+
- `registries/variables.json` — variable names, keys, types, values by mode
|
|
73
|
+
- `registries/text-styles.json` — text style names, keys, font specs
|
|
74
|
+
|
|
75
|
+
4. **Generate intelligent guides** (Claude analyzes registries and writes):
|
|
76
|
+
|
|
77
|
+
**Token guides:**
|
|
78
|
+
- `guides/tokens/color-usage.md` — Group colors by semantic role, create decision tree (when to use which token)
|
|
79
|
+
- `guides/tokens/spacing-usage.md` — Map spacing values to UI contexts (form gaps, section gaps, card padding, etc.)
|
|
80
|
+
- `guides/tokens/typography-usage.md` — Map text styles to hierarchy (display > heading > body > caption)
|
|
81
|
+
|
|
82
|
+
**Component guides:**
|
|
83
|
+
- `guides/components/overview.md` — Decision tree: "I need X" → use component Y. Cover every component.
|
|
84
|
+
- `guides/components/{group}.md` — Per-group guides (actions, form-controls, data-display, feedback, navigation, layout) with: when to use, when NOT to use, props, variants, examples
|
|
85
|
+
|
|
86
|
+
**Asset guides (if icons/logos/illustrations exist):**
|
|
87
|
+
- `guides/assets/icons.md` — Categorized icon catalog
|
|
88
|
+
- `guides/assets/logos.md` — Logo catalog
|
|
89
|
+
- `guides/assets/illustrations.md` — Illustration catalog with usage contexts
|
|
90
|
+
|
|
91
|
+
5. **Ask the user for product screenshots:**
|
|
92
|
+
```
|
|
93
|
+
To document your layout patterns, add screenshots of your product's key screens
|
|
94
|
+
to: .claude/skills/design-workflow/references/knowledge-base/ui-references/screenshots/
|
|
95
|
+
|
|
96
|
+
Ideal screenshots:
|
|
97
|
+
- Dashboard / home page
|
|
98
|
+
- List / category page
|
|
99
|
+
- Detail / form page
|
|
100
|
+
- Settings page
|
|
101
|
+
- Modal / dialog
|
|
102
|
+
- Empty state
|
|
103
|
+
- Multi-step flow
|
|
104
|
+
|
|
105
|
+
Drop the PNG/JPG files and confirm when done.
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
6. **Generate pattern guides** (Claude analyzes screenshots):
|
|
109
|
+
- `guides/design-patterns.md` — Layout patterns catalogue with zone placement, proportions, density rules
|
|
110
|
+
- `guides/patterns/form-patterns.md` — Form field patterns, validation, conditional fields
|
|
111
|
+
- `guides/patterns/navigation-patterns.md` — Sidebar, tabs, breadcrumbs patterns
|
|
112
|
+
- `guides/patterns/feedback-patterns.md` — Success, error, warning, loading states
|
|
113
|
+
- `ui-references/ui-references-guide.md` — Which screenshot for which pattern type
|
|
114
|
+
|
|
115
|
+
7. **Validation summary:**
|
|
116
|
+
```
|
|
117
|
+
Knowledge base built:
|
|
118
|
+
- {N} components documented ({N} with variants)
|
|
119
|
+
- {N} variables ({N} colors, {N} spacing, {N} radius)
|
|
120
|
+
- {N} text styles
|
|
121
|
+
- {N} layout patterns extracted from {N} screenshots
|
|
122
|
+
|
|
123
|
+
Ready to design. Run: `spec {name}`
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## STEP 1 — Spec Creation
|
|
129
|
+
|
|
130
|
+
**Trigger**: user describes what they want to design
|
|
131
|
+
|
|
132
|
+
**Prerequisites:**
|
|
133
|
+
- No conflicting active spec in `specs/active/` (if one exists, ask: "There's already an active spec: `{name}`. Continue it, drop it, or move to backlog?")
|
|
134
|
+
|
|
135
|
+
**Guided questions (ask ONE BY ONE, not all at once):**
|
|
136
|
+
|
|
137
|
+
### 1.1 Mode detection
|
|
138
|
+
```
|
|
139
|
+
Is this a DS component (Button, Card, Modal...) or a screen/page (dashboard, onboarding...)?
|
|
140
|
+
```
|
|
141
|
+
If unclear from context, ask explicitly. Do NOT assume.
|
|
142
|
+
|
|
143
|
+
### 1.2 Core description
|
|
144
|
+
```
|
|
145
|
+
Describe in 2-3 sentences:
|
|
146
|
+
- What is it? (what)
|
|
147
|
+
- For whom / what user goal? (user goal)
|
|
148
|
+
- In what context does it appear? (context)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 1.3 Content & structure
|
|
152
|
+
**Component mode:**
|
|
153
|
+
```
|
|
154
|
+
What are the elements of the component?
|
|
155
|
+
- What props/variants? (size, state, style...)
|
|
156
|
+
- What sub-elements? (icon, text, badge...)
|
|
157
|
+
- What states? (default, hover, disabled, loading...)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Screen mode:**
|
|
161
|
+
```
|
|
162
|
+
What are the sections of the screen?
|
|
163
|
+
For each section:
|
|
164
|
+
- What does it display?
|
|
165
|
+
- What DS components does it use?
|
|
166
|
+
- What realistic content?
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### 1.4 References
|
|
170
|
+
```
|
|
171
|
+
Do you have references? (existing Figma URL, screenshot, mockup, PM spec...)
|
|
172
|
+
```
|
|
173
|
+
If Figma URL provided → use `figma_take_screenshot` + `figma_get_component` to analyze.
|
|
174
|
+
|
|
175
|
+
### 1.5 Write the spec
|
|
176
|
+
Using the gathered info + DS knowledge base, write the spec to `specs/active/{name}-spec.md`.
|
|
177
|
+
Always use the appropriate template (`spec-template.md` or `screen-template.md`).
|
|
178
|
+
|
|
179
|
+
**On completion:**
|
|
180
|
+
```
|
|
181
|
+
Spec written: specs/active/{name}-spec.md
|
|
182
|
+
Let's validate it.
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
→ Auto-proceed to STEP 2.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## STEP 2 — Spec Validation
|
|
190
|
+
|
|
191
|
+
**Prerequisites:** spec file exists in `specs/active/`
|
|
192
|
+
|
|
193
|
+
**Run ALL quality gates from `quality-gates.md` (phases: spec → design).** Report as checklist.
|
|
194
|
+
|
|
195
|
+
**If ANY blocking gate fails:**
|
|
196
|
+
```
|
|
197
|
+
The spec isn't ready yet. Missing:
|
|
198
|
+
- {gate 1 that fails} → {concrete action to fix}
|
|
199
|
+
- {gate 2 that fails} → {concrete action to fix}
|
|
200
|
+
|
|
201
|
+
I'll fix it and we re-validate?
|
|
202
|
+
```
|
|
203
|
+
Fix the spec, then re-run validation. Loop until all gates pass.
|
|
204
|
+
|
|
205
|
+
**If ALL gates pass:**
|
|
206
|
+
```
|
|
207
|
+
Spec validated. All quality gates OK.
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
→ Screen mode: proceed to STEP 3
|
|
211
|
+
→ Component mode: proceed to STEP 4
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## STEP 3 — New Components Check (screen mode only)
|
|
216
|
+
|
|
217
|
+
**Prerequisites:** validated screen spec
|
|
218
|
+
|
|
219
|
+
**Check the "New DS Components Required" section of the spec.**
|
|
220
|
+
|
|
221
|
+
### If "None":
|
|
222
|
+
```
|
|
223
|
+
No new components to create. All patterns covered by existing DS.
|
|
224
|
+
Let's proceed to design.
|
|
225
|
+
```
|
|
226
|
+
→ Proceed to STEP 4.
|
|
227
|
+
|
|
228
|
+
### If new components listed:
|
|
229
|
+
```
|
|
230
|
+
{N} new component(s) identified in the spec:
|
|
231
|
+
1. {ComponentName} — {short description}
|
|
232
|
+
2. {ComponentName} — {short description}
|
|
233
|
+
|
|
234
|
+
We need to create them before designing the screen.
|
|
235
|
+
Starting with: {ComponentName 1}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
→ For EACH new component, run the sub-cycle:
|
|
239
|
+
|
|
240
|
+
### STEP 3a — Spec the component
|
|
241
|
+
Run STEP 1 in component mode, pre-filled with context from the screen spec.
|
|
242
|
+
|
|
243
|
+
### STEP 3b — Design the component
|
|
244
|
+
Run STEP 4 for the component (create in Figma with all variants).
|
|
245
|
+
|
|
246
|
+
### STEP 3c — Validate the component
|
|
247
|
+
Run STEP 5 (review) for the component.
|
|
248
|
+
On pass → `done` the component, then loop back to 3a for the next component.
|
|
249
|
+
|
|
250
|
+
**When ALL new components are done:**
|
|
251
|
+
```
|
|
252
|
+
All new components created and validated:
|
|
253
|
+
- {Component 1} → done
|
|
254
|
+
- {Component 2} → done
|
|
255
|
+
|
|
256
|
+
Now we can design the screen with real DS components.
|
|
257
|
+
```
|
|
258
|
+
→ Proceed to STEP 4 for the screen.
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## STEP 4 — Design
|
|
263
|
+
|
|
264
|
+
**Prerequisites (ALL must pass):**
|
|
265
|
+
- [ ] Spec validated (STEP 2 passed)
|
|
266
|
+
- [ ] New components created if needed (STEP 3 passed)
|
|
267
|
+
- [ ] figma-console-mcp connected (STEP 0 check)
|
|
268
|
+
- [ ] DS libraries enabled
|
|
269
|
+
|
|
270
|
+
**If any prerequisite fails → block with specific message from Block Messages Reference.**
|
|
271
|
+
|
|
272
|
+
**Before generating:** confirm scope with the user:
|
|
273
|
+
```
|
|
274
|
+
I'll generate:
|
|
275
|
+
- Type: {component with N variants | screen with N sections}
|
|
276
|
+
- Canvas: {1440px (web) | 390px (mobile) | 1024px (tablet)}
|
|
277
|
+
- States: {list of states to generate}
|
|
278
|
+
- Approach: atomic ({N} steps with screenshot verification between each)
|
|
279
|
+
|
|
280
|
+
Ready? I'll start generating.
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Wait for explicit user confirmation, then execute `actions/design.md`.
|
|
284
|
+
|
|
285
|
+
**Atomic generation (MANDATORY):** Never generate in a single monolithic script. Split into 4-6 small sequential steps (~30-80 lines each). After EACH step, verify visually with `figma_take_screenshot`. Fix issues before moving to the next step.
|
|
286
|
+
|
|
287
|
+
→ Proceed to STEP 5.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## STEP 5 — Review
|
|
292
|
+
|
|
293
|
+
**Prerequisites:** design generated in Figma
|
|
294
|
+
|
|
295
|
+
Execute `actions/review.md`. Present verdict:
|
|
296
|
+
|
|
297
|
+
- **PASS** → "Review OK. Design is spec-compliant. Archive it?"
|
|
298
|
+
- **NEEDS ITERATION** → fix issues via `figma_execute` scripts, re-review. Loop until PASS.
|
|
299
|
+
|
|
300
|
+
→ Proceed to STEP 6 on user confirmation.
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## STEP 6 — Done
|
|
305
|
+
|
|
306
|
+
**Prerequisites:** review passed + user confirmation
|
|
307
|
+
|
|
308
|
+
**Execute `actions/done.md`:**
|
|
309
|
+
1. Move spec to `specs/shipped/`
|
|
310
|
+
2. Update `specs/history.log`
|
|
311
|
+
3. Brief retro (3 questions)
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
## Done: {name}
|
|
315
|
+
|
|
316
|
+
Spec archived: specs/shipped/{name}-spec.md
|
|
317
|
+
Figma: {url if available}
|
|
318
|
+
|
|
319
|
+
### Quick retro
|
|
320
|
+
- What went well: {positives}
|
|
321
|
+
- What was friction: {improvements}
|
|
322
|
+
- What was learned: {reusable learnings}
|
|
323
|
+
|
|
324
|
+
Ready for the next design!
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Block Messages Reference
|
|
330
|
+
|
|
331
|
+
| Situation | Message |
|
|
332
|
+
|-----------|---------|
|
|
333
|
+
| No MCP server | "figma-console-mcp is not configured. Run: `claude mcp add figma-console -s user -e FIGMA_ACCESS_TOKEN=figd_YOUR_TOKEN -- npx -y figma-console-mcp@latest`" |
|
|
334
|
+
| Not connected | "Figma Desktop is not connected. Open: Plugins → Development → Desktop Bridge." |
|
|
335
|
+
| Libraries not enabled | "Enable your DS libraries in the target Figma file: Assets → Team → Enable." |
|
|
336
|
+
| No knowledge base | "Knowledge base not built yet. Run: `setup`" |
|
|
337
|
+
| No active spec | "No active spec. Let's create one: component or screen?" |
|
|
338
|
+
| Conflicting active spec | "There's already an active spec: `{name}`. Continue, drop, or backlog?" |
|
|
339
|
+
| Spec gate failed | "The spec isn't ready. Missing: {list}. I'll fix it?" |
|
|
340
|
+
| New components not created | "Component `{name}` doesn't exist in the DS yet. Let's create it first." |
|
|
341
|
+
| Design not generated | "No Figma design yet. Start generating?" |
|
|
342
|
+
| Review failed | "The design has {N} issue(s). I'll fix and re-review?" |
|
|
343
|
+
|
|
344
|
+
---
|
|
345
|
+
|
|
346
|
+
## Skip Policy
|
|
347
|
+
|
|
348
|
+
Users CAN explicitly ask to skip a non-critical gate. When they do:
|
|
349
|
+
1. Warn: "Sure? Skipping this step may impact quality."
|
|
350
|
+
2. If confirmed: log the skip reason, proceed, flag it in the review as advisory
|
|
351
|
+
3. **NEVER skip**: spec creation, spec validation, new components check, pattern matching, visual fidelity review, DS component reuse audit, pre-script element audit, registry loading
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Quality Gates
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Phase: setup (STEP 0)
|
|
6
|
+
|
|
7
|
+
| Gate | Blocking | Check |
|
|
8
|
+
|------|----------|-------|
|
|
9
|
+
| figma-console-mcp available | Yes (before design) | `figma_get_status()` returns valid connection |
|
|
10
|
+
| Connected to Figma Desktop | Yes (before design) | Status has `setup.valid: true` |
|
|
11
|
+
| DS libraries enabled | Yes (before design) | User confirmation |
|
|
12
|
+
| Knowledge base exists | Yes (before spec) | `registries/` has JSON files |
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Phase: spec → design (STEP 2)
|
|
17
|
+
|
|
18
|
+
| Gate | Blocking | Check |
|
|
19
|
+
|------|----------|-------|
|
|
20
|
+
| Spec has clear scope (component or screen) | Yes | Mode identified |
|
|
21
|
+
| Spec has description (what, user goal, context) | Yes | Non-empty |
|
|
22
|
+
| Spec has design tokens section | Yes | Tokens referenced |
|
|
23
|
+
| Spec has acceptance criteria | Yes | At least 3 checkboxes |
|
|
24
|
+
| Spec has Figma URL | No | Can be added later |
|
|
25
|
+
|
|
26
|
+
### Component-specific
|
|
27
|
+
| Gate | Blocking |
|
|
28
|
+
|------|----------|
|
|
29
|
+
| Props API defined | Yes |
|
|
30
|
+
| Architecture diagram present | Yes |
|
|
31
|
+
| Variant names listed | Yes |
|
|
32
|
+
|
|
33
|
+
### Screen-specific
|
|
34
|
+
| Gate | Blocking |
|
|
35
|
+
|------|----------|
|
|
36
|
+
| Layout structure defined | Yes |
|
|
37
|
+
| Sections breakdown present | Yes |
|
|
38
|
+
| DS components identified | Yes |
|
|
39
|
+
| "New DS Components Required" section filled | Yes |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Phase: new components resolution (STEP 3)
|
|
44
|
+
|
|
45
|
+
| Gate | Blocking | Check |
|
|
46
|
+
|------|----------|-------|
|
|
47
|
+
| All listed new components have been spec'd | Yes | Spec exists in `specs/shipped/` or `specs/active/` |
|
|
48
|
+
| All listed new components have been designed in Figma | Yes | Design generated and reviewed |
|
|
49
|
+
| All listed new components passed review | Yes | Review verdict = PASS |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Phase: pattern matching (STEP 3b)
|
|
54
|
+
|
|
55
|
+
| Gate | Blocking | Check |
|
|
56
|
+
|------|----------|-------|
|
|
57
|
+
| Pattern identified from `design-patterns.md` | Yes | Pattern name logged |
|
|
58
|
+
| Min 2 reference screenshots read and analyzed | Yes | Screenshot filenames logged |
|
|
59
|
+
| Pattern rules extracted and documented | Yes | Bullet list of rules to apply |
|
|
60
|
+
| If no pattern matches: user confirmed closest pattern | Yes | Explicit user choice |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Phase: design generation (STEP 4)
|
|
65
|
+
|
|
66
|
+
| Gate | Blocking | Check |
|
|
67
|
+
|------|----------|-------|
|
|
68
|
+
| **Atomic generation** | **Yes** | Design split into 4-6 sequential scripts (~30-80 lines each), never one monolithic script |
|
|
69
|
+
| **Screenshot verification between steps** | **Yes** | `figma_take_screenshot` called after EACH atomic step, issues fixed before proceeding |
|
|
70
|
+
| **Pre-script element audit (Rule 18)** | **Yes** | Before EACH script: list every visual element, verify against registries. NEVER recreate a DS component as raw frame |
|
|
71
|
+
| **Registry loaded before first script** | **Yes** | `components.json` and other registries read and available before writing any generation script |
|
|
72
|
+
| **Zero hardcoded hex colors** | **Yes** | Every color uses `setBoundVariableForPaint` or `setBoundVariable` with registry variables |
|
|
73
|
+
| **Canvas positioning (Rule 19)** | **Yes** | Components positioned with 80px+ gaps, never stacked at (0,0) |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Phase: design → review (STEP 4 → 5)
|
|
78
|
+
|
|
79
|
+
| Gate | Blocking | Check |
|
|
80
|
+
|------|----------|-------|
|
|
81
|
+
| Figma design exists | Yes | Generated via figma_execute |
|
|
82
|
+
| Canvas width correct | Yes | 1440px (web), 390px (mobile), 1024px (tablet) |
|
|
83
|
+
| Component properties exposed | Yes (component mode) | All text = TEXT prop, all icons = INSTANCE_SWAP, optionals = BOOLEAN |
|
|
84
|
+
| **No interaction state variants** | **Yes** | Hover/pressed/disabled handled via prototyping, NOT as separate variants |
|
|
85
|
+
| **Variants arranged in grid** | **Yes (component mode)** | Variants positioned in readable grid after `combineAsVariants()`, not stacked |
|
|
86
|
+
| **Zero raw elements (Rule 18)** | **Yes** | Every visible element checked against registries before creation. Raw frames/text only if justified. **FAIL if Avatar, Divider, Tag, Badge, or Button recreated as raw element** |
|
|
87
|
+
| **Design follows matched pattern layout** | **Yes** | Zones, proportions match pattern rules |
|
|
88
|
+
| **Content density matches reference** | **Yes** | Similar item count, whitespace balance |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Phase: review — visual fidelity (STEP 5)
|
|
93
|
+
|
|
94
|
+
| Gate | Blocking | Check |
|
|
95
|
+
|------|----------|-------|
|
|
96
|
+
| **Layout match** | Yes | Zones in correct positions per pattern |
|
|
97
|
+
| **Proportion match** | Yes | Relative widths/heights match pattern |
|
|
98
|
+
| **Density match** | Yes | Information density similar to reference screenshots |
|
|
99
|
+
| **Hierarchy match** | Yes | Visual weight of titles, sections, CTAs matches product patterns |
|
|
100
|
+
| **Card pattern match** | Yes (if cards present) | Size, grid, rhythm, internal layout per design patterns |
|
|
101
|
+
| **Navigation match** | Yes | Sidebar/stepper/tabs follow correct pattern |
|
|
102
|
+
| **Section organization** | Yes | Consistent spacing between sections, titles properly placed |
|
|
103
|
+
| **Whitespace balance** | Yes | Margins and breathing room consistent with product density |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Phase: review → done (STEP 6)
|
|
108
|
+
|
|
109
|
+
| Gate | Blocking | Check |
|
|
110
|
+
|------|----------|-------|
|
|
111
|
+
| All variants/sections in Figma | Yes | Matches spec list |
|
|
112
|
+
| Tokens correctly applied | Yes | No arbitrary values, variables bound |
|
|
113
|
+
| DS component instances (not raw frames) | Yes | Real instances from library |
|
|
114
|
+
| Visual fidelity review passed | Yes | All visual gates = PASS |
|
|
115
|
+
| User validated design | Yes | Explicit approval |
|
|
116
|
+
| All acceptance criteria met | Yes | Checkboxes checked |
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Skip Policy
|
|
121
|
+
|
|
122
|
+
- **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
|
|
123
|
+
- **Skippable with warning:** Figma URL in spec, individual structural review sub-checks
|
|
124
|
+
- When skipping:
|
|
125
|
+
1. Warn user about quality impact
|
|
126
|
+
2. Log the skip reason
|
|
127
|
+
3. Flag in review as advisory issue
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# {ScreenName}
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
{What screen, user goal, context of use.}
|
|
6
|
+
|
|
7
|
+
**Figma:** {figma_url}
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Visual Reference
|
|
12
|
+
|
|
13
|
+
> Identifies which design pattern this screen follows.
|
|
14
|
+
> The layout structure below MUST be based on these references.
|
|
15
|
+
|
|
16
|
+
| | |
|
|
17
|
+
|---|---|
|
|
18
|
+
| **Pattern** | {pattern name from `design-patterns.md`} |
|
|
19
|
+
| **Screenshots studied** | {list of screenshot filenames, min 2} |
|
|
20
|
+
| **Key composition rules** | {bullet list of specific rules from the pattern that apply} |
|
|
21
|
+
|
|
22
|
+
**Composition notes:**
|
|
23
|
+
{What was observed in the screenshots that informs this spec's layout: zone proportions, content density, visual hierarchy, navigation pattern, card rhythm, etc.}
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Layout Structure
|
|
28
|
+
|
|
29
|
+
> Based on the matched pattern above. The diagram MUST reflect the pattern's zone placement and proportions.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
┌─────────────────────────────────────────┐
|
|
33
|
+
│ Header │
|
|
34
|
+
├───────────┬─────────────────────────────┤
|
|
35
|
+
│ Sidebar │ Content Area │
|
|
36
|
+
│ │ │
|
|
37
|
+
│ │ │
|
|
38
|
+
├───────────┴─────────────────────────────┤
|
|
39
|
+
│ Footer │
|
|
40
|
+
└─────────────────────────────────────────┘
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Sections
|
|
46
|
+
|
|
47
|
+
### {SectionName}
|
|
48
|
+
- **Purpose**: {what this section shows}
|
|
49
|
+
- **DS Components used**: {Component (variant, size)}
|
|
50
|
+
- **Content**: {what data is displayed}
|
|
51
|
+
- **Behavior**: {interactions, scroll, collapse...}
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## States
|
|
56
|
+
|
|
57
|
+
| State | Description |
|
|
58
|
+
|-------|-------------|
|
|
59
|
+
| Empty | {what shows when no data} |
|
|
60
|
+
| Loading | {skeleton, spinner...} |
|
|
61
|
+
| Populated | {normal state with data} |
|
|
62
|
+
| Error | {error message, retry action} |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## DS Components Used
|
|
67
|
+
|
|
68
|
+
> Look up component keys in `knowledge-base/registries/components.json`.
|
|
69
|
+
> Use `knowledge-base/guides/components/overview.md` decision tree to choose the right component.
|
|
70
|
+
|
|
71
|
+
| Component | Variant/Size | Figma Key | Location |
|
|
72
|
+
|-----------|-------------|-----------|----------|
|
|
73
|
+
| `{Name}` | {variant} | {key from registry} | {section} |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## New DS Components Required
|
|
78
|
+
|
|
79
|
+
> List any UI patterns in this screen that are NOT covered by existing DS components.
|
|
80
|
+
> Each one will need its own `spec {component}` → `design` → `done` cycle BEFORE this screen is designed.
|
|
81
|
+
> If none, write "None — all patterns covered by existing DS components."
|
|
82
|
+
|
|
83
|
+
| Component Name | Used in Section | Description | Variants Needed |
|
|
84
|
+
|---------------|----------------|-------------|-----------------|
|
|
85
|
+
| `{Name}` | {section} | {what it does, why existing components don't cover it} | {list of variants/states} |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Content Structure
|
|
90
|
+
|
|
91
|
+
{Realistic data examples for each section}
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Design Tokens
|
|
96
|
+
|
|
97
|
+
### Layout
|
|
98
|
+
| Token | Value | Usage |
|
|
99
|
+
|-------|-------|-------|
|
|
100
|
+
| `{token}` | {value} | {usage} |
|
|
101
|
+
|
|
102
|
+
### Colors
|
|
103
|
+
| Token | Value | Usage |
|
|
104
|
+
|-------|-------|-------|
|
|
105
|
+
| `{token}` | {value} | {usage} |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Responsive Rules
|
|
110
|
+
|
|
111
|
+
| Breakpoint | Layout change |
|
|
112
|
+
|-----------|---------------|
|
|
113
|
+
| Desktop (>1024px) | {layout} |
|
|
114
|
+
| Tablet (768-1024px) | {layout} |
|
|
115
|
+
| Mobile (<768px) | {layout} |
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Acceptance Criteria
|
|
120
|
+
|
|
121
|
+
- [ ] {criterion}
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Open Questions
|
|
126
|
+
|
|
127
|
+
1. {question}
|