@su-record/vibe 2.9.2 → 2.9.3
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.md +30 -10
- package/README.ko.md +90 -25
- package/README.md +139 -25
- package/agents/teams/figma/figma-builder.md +29 -1
- package/agents/teams/review-debate-team.md +1 -1
- package/commands/vibe.analyze.md +324 -170
- package/commands/vibe.figma.md +549 -34
- package/commands/vibe.harness.md +177 -0
- package/commands/vibe.run.md +44 -27
- package/commands/vibe.scaffold.md +195 -0
- package/commands/vibe.spec.md +375 -947
- package/commands/vibe.trace.md +17 -0
- package/commands/vibe.verify.md +19 -10
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +29 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +4 -2
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/postinstall/constants.d.ts +1 -1
- package/dist/cli/postinstall/constants.d.ts.map +1 -1
- package/dist/cli/postinstall/constants.js +6 -1
- package/dist/cli/postinstall/constants.js.map +1 -1
- package/dist/cli/setup/ProjectSetup.d.ts +12 -1
- package/dist/cli/setup/ProjectSetup.d.ts.map +1 -1
- package/dist/cli/setup/ProjectSetup.js +259 -72
- package/dist/cli/setup/ProjectSetup.js.map +1 -1
- package/dist/cli/setup.d.ts +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +1 -1
- package/dist/cli/setup.js.map +1 -1
- package/hooks/scripts/figma-guard.js +220 -0
- package/package.json +1 -1
- package/skills/arch-guard/SKILL.md +1 -1
- package/skills/capability-loop/SKILL.md +106 -2
- package/skills/chub-usage/SKILL.md +43 -43
- package/skills/claude-md-guide/SKILL.md +175 -175
- package/skills/design-teach/SKILL.md +33 -33
- package/skills/devlog/SKILL.md +38 -38
- package/skills/event-comms/SKILL.md +23 -13
- package/skills/event-ops/SKILL.md +28 -19
- package/skills/event-planning/SKILL.md +13 -1
- package/skills/priority-todos/SKILL.md +1 -1
- package/skills/vibe.figma/SKILL.md +234 -154
- package/skills/vibe.figma.convert/SKILL.md +123 -112
- package/skills/vibe.figma.extract/SKILL.md +141 -129
- package/skills/vibe.interview/SKILL.md +358 -0
- package/skills/vibe.interview/checklists/api.md +101 -0
- package/skills/vibe.interview/checklists/feature.md +88 -0
- package/skills/vibe.interview/checklists/library.md +95 -0
- package/skills/vibe.interview/checklists/mobile.md +89 -0
- package/skills/vibe.interview/checklists/webapp.md +97 -0
- package/skills/vibe.interview/checklists/website.md +99 -0
- package/skills/vibe.plan/SKILL.md +216 -0
- package/skills/vibe.spec/SKILL.md +1155 -0
- package/{commands/vibe.spec.review.md → skills/vibe.spec.review/SKILL.md} +269 -108
- package/vibe/templates/claudemd-template.md +74 -0
- package/vibe/templates/constitution-template.md +15 -0
- package/vibe/templates/plan-template.md +194 -0
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vibe.figma
|
|
3
|
-
description: Figma design to code —
|
|
3
|
+
description: Figma design to code — tree-based structural code generation
|
|
4
4
|
triggers: []
|
|
5
5
|
tier: standard
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# vibe.figma — Structural Code Generation
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Core Principles
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
Figma
|
|
13
|
+
The Figma tree is the source of truth for code. Screenshots are for verification only.
|
|
14
14
|
|
|
15
|
-
✅ Figma Auto Layout → CSS Flexbox 1:1
|
|
16
|
-
✅ Figma CSS
|
|
17
|
-
✅ Claude
|
|
18
|
-
✅
|
|
15
|
+
✅ Figma Auto Layout → CSS Flexbox 1:1 mechanical mapping
|
|
16
|
+
✅ Figma CSS properties → SCSS direct conversion (no guessing)
|
|
17
|
+
✅ Claude handles semantic decisions only: tag selection, component splitting, interactions
|
|
18
|
+
✅ Screenshots are used for verification only, not generation
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Immutable Rules
|
|
22
22
|
|
|
23
23
|
```
|
|
24
|
-
1.
|
|
25
|
-
✅ BG
|
|
26
|
-
❌ TEXT
|
|
24
|
+
1. Do NOT render content as images via screenshot
|
|
25
|
+
✅ BG rendering (backgrounds with no TEXT children), vector-text GROUPs, section screenshots (verification only)
|
|
26
|
+
❌ Frames with TEXT children, INSTANCE repetitions, buttons/prices, rendering entire sections
|
|
27
27
|
|
|
28
|
-
2. BG
|
|
28
|
+
2. BG must use CSS background-image only. <img> tag is forbidden.
|
|
29
29
|
|
|
30
|
-
3.
|
|
31
|
-
Phase 2
|
|
30
|
+
3. No new screenshot calls during Phase 4 code generation.
|
|
31
|
+
Use only Phase 2 materials. No matter how complex — implement with HTML+CSS.
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Full Flow
|
|
35
35
|
|
|
36
36
|
```
|
|
37
|
-
|
|
38
|
-
Storyboard: figma.com/...?node-id=aaa (
|
|
37
|
+
Input: receive all URLs at once
|
|
38
|
+
Storyboard: figma.com/...?node-id=aaa (if present)
|
|
39
39
|
MO Design: figma.com/...?node-id=xxx
|
|
40
|
-
PC Design: figma.com/...?node-id=yyy (
|
|
40
|
+
PC Design: figma.com/...?node-id=yyy (if present)
|
|
41
41
|
|
|
42
42
|
→ Phase 0: Setup
|
|
43
|
-
→ Phase 1:
|
|
44
|
-
→ Phase 2:
|
|
45
|
-
→ Phase 3:
|
|
46
|
-
→ Phase 4:
|
|
47
|
-
→ Phase 5:
|
|
48
|
-
→ Phase 6:
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
→ Phase 1: Storyboard analysis → functional spec document
|
|
44
|
+
→ Phase 2: Gather materials (→ vibe.figma.extract)
|
|
45
|
+
→ Phase 3: Remapping (MO↔PC matching → remapped.json)
|
|
46
|
+
→ Phase 4: Sequential code generation (→ vibe.figma.convert)
|
|
47
|
+
→ Phase 5: Compile gate
|
|
48
|
+
→ Phase 6: Visual verification loop
|
|
49
|
+
|
|
50
|
+
Working directory:
|
|
51
51
|
/tmp/{feature}/
|
|
52
52
|
├── mo-main/tree.json, bg/, content/, sections/
|
|
53
53
|
├── pc-main/tree.json, bg/, content/, sections/
|
|
54
|
-
└── remapped.json ← Phase 4
|
|
54
|
+
└── remapped.json ← sole input for Phase 4
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
Code output: placed directly in the project directory
|
|
57
57
|
components/{feature}/, styles/{feature}/
|
|
58
58
|
```
|
|
59
59
|
|
|
@@ -62,99 +62,122 @@ Figma 트리가 코드의 원천이다. 스크린샷은 검증용이다.
|
|
|
62
62
|
## Phase 0: Setup
|
|
63
63
|
|
|
64
64
|
```
|
|
65
|
-
1.
|
|
66
|
-
2.
|
|
67
|
-
3.
|
|
68
|
-
4.
|
|
69
|
-
(50
|
|
65
|
+
1. Stack detection: package.json → react/vue/svelte, next/nuxt, scss/tailwind
|
|
66
|
+
2. Feature name: Figma filename → kebab-case
|
|
67
|
+
3. Directories: components/{feature}/, public/images/{feature}/, styles/{feature}/
|
|
68
|
+
4. Component indexing → /tmp/{feature}/component-index.json
|
|
69
|
+
(scan up to 50 components, extract props/slots/classes, within 2 minutes)
|
|
70
70
|
5. Hooks/Types/Constants → /tmp/{feature}/context-index.json
|
|
71
|
-
6.
|
|
71
|
+
6. Design token scan → /tmp/{feature}/project-tokens.json
|
|
72
72
|
(SCSS > CSS Variables > Tailwind > CSS-in-JS)
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
77
|
-
## Phase 1:
|
|
77
|
+
## Phase 1: Storyboard Analysis
|
|
78
78
|
|
|
79
79
|
```
|
|
80
|
-
|
|
80
|
+
User input: enter URLs or PDF/images separated by newlines
|
|
81
81
|
|
|
82
|
-
URL
|
|
83
|
-
fileKey
|
|
84
|
-
ROOT name
|
|
82
|
+
URL classification (automatic):
|
|
83
|
+
Different fileKey → storyboard vs design
|
|
84
|
+
ROOT name contains "MO" → mobile, "PC" → desktop
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
depth=3
|
|
88
|
-
SPEC(
|
|
89
|
-
PDF
|
|
86
|
+
Storyboard analysis:
|
|
87
|
+
Collect frames at depth=3 → classify by name pattern
|
|
88
|
+
SPEC (functional definition) → CONFIG (resolution) → PAGE (main sections) → SHARED (common)
|
|
89
|
+
PDF/images follow the same structural extraction
|
|
90
90
|
|
|
91
|
-
❌
|
|
91
|
+
❌ No code file creation during Phase 1
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
1.
|
|
95
|
-
2.
|
|
96
|
-
3.
|
|
97
|
-
4. TypeScript
|
|
93
|
+
Output (text only):
|
|
94
|
+
1. Section list table (name, Figma name, height, description)
|
|
95
|
+
2. Functional definition per section ([Function] + [Interaction] + [State])
|
|
96
|
+
3. Common component list
|
|
97
|
+
4. TypeScript interface draft
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
---
|
|
101
101
|
|
|
102
|
-
## Phase 2:
|
|
102
|
+
## Phase 2: Gather Materials ← Research (parallel)
|
|
103
103
|
|
|
104
|
-
**→ vibe.figma.extract
|
|
105
|
-
|
|
104
|
+
**→ Follow the rules of the vibe.figma.extract skill.**
|
|
105
|
+
**Coordinator pattern: run MO/PC extraction as parallel workers.**
|
|
106
106
|
|
|
107
107
|
```
|
|
108
|
-
# [FIGMA_SCRIPT] =
|
|
108
|
+
# [FIGMA_SCRIPT] = {{VIBE_PATH}}/hooks/scripts/figma-extract.js
|
|
109
109
|
|
|
110
|
-
MO/PC
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
→
|
|
110
|
+
Simultaneous MO/PC extraction (each as an independent worker):
|
|
111
|
+
Worker-MO: screenshot → tree → images → asset rendering → sections/
|
|
112
|
+
Worker-PC: screenshot → tree → images → asset rendering → sections/
|
|
113
|
+
→ Proceed to Phase 3 only after both workers have completed
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
Single BP: run sequentially with 1 worker
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
Multi-frame (same BP, different pages):
|
|
118
|
+
Sequential extraction (500ms interval), partial failure allowed
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
---
|
|
122
122
|
|
|
123
|
-
## Phase 3:
|
|
123
|
+
## Phase 3: Data Refinement ← Synthesis (independent per BP)
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
**MO↔PC
|
|
125
|
+
**Split and refine each BP's tree.json by section.**
|
|
126
|
+
**MO↔PC matching (responsive) is NOT done at this stage.**
|
|
127
127
|
|
|
128
|
-
###
|
|
128
|
+
### BLOCKING Command — Writing custom refine scripts is strictly forbidden
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# MO
|
|
132
|
+
node {{VIBE_PATH}}/hooks/scripts/figma-refine.js \
|
|
133
|
+
/tmp/{feature}/mo-main/tree.json \
|
|
134
|
+
--out=/tmp/{feature}/mo-main/sections.json \
|
|
135
|
+
--design-width=720 \
|
|
136
|
+
--bp=mo
|
|
137
|
+
|
|
138
|
+
# PC
|
|
139
|
+
node {{VIBE_PATH}}/hooks/scripts/figma-refine.js \
|
|
140
|
+
/tmp/{feature}/pc-main/tree.json \
|
|
141
|
+
--out=/tmp/{feature}/pc-main/sections.json \
|
|
142
|
+
--design-width=2560 \
|
|
143
|
+
--bp=pc
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
⛔ **Phase 4 is blocked until these commands are executed.**
|
|
147
|
+
⛔ **Do NOT write custom refine scripts** (refine-sections.mjs, refine.js, etc. — all forbidden)
|
|
148
|
+
⛔ **Do NOT parse tree.json directly with Python/Node to produce sections.json**
|
|
149
|
+
✅ Use only the output of figma-refine.js. If the output is unsatisfactory, modify figma-refine.js.
|
|
150
|
+
|
|
151
|
+
### Core Principles
|
|
129
152
|
|
|
130
153
|
```
|
|
131
|
-
⛔ BP
|
|
132
|
-
⛔
|
|
133
|
-
⛔
|
|
154
|
+
⛔ Refine each BP independently. Do NOT mix MO and PC.
|
|
155
|
+
⛔ The refined JSON is the sole input for Phase 4.
|
|
156
|
+
⛔ The full subtree (recursive children) for each section must be included.
|
|
134
157
|
```
|
|
135
158
|
|
|
136
|
-
###
|
|
159
|
+
### Output
|
|
137
160
|
|
|
138
161
|
```
|
|
139
162
|
/tmp/{feature}/
|
|
140
163
|
mo-main/
|
|
141
|
-
sections.json ← MO
|
|
164
|
+
sections.json ← MO refinement result
|
|
142
165
|
pc-main/
|
|
143
|
-
sections.json ← PC
|
|
166
|
+
sections.json ← PC refinement result
|
|
144
167
|
|
|
145
|
-
sections.json
|
|
168
|
+
sections.json structure:
|
|
146
169
|
{
|
|
147
|
-
meta: { feature, designWidth, bp(
|
|
170
|
+
meta: { feature, designWidth, bp (the corresponding BP) },
|
|
148
171
|
sections: [
|
|
149
172
|
{
|
|
150
173
|
name: "Hero",
|
|
151
174
|
nodeId, name, type, size, css,
|
|
152
|
-
text, // TEXT
|
|
153
|
-
imageRef, //
|
|
154
|
-
fills, //
|
|
175
|
+
text, // TEXT nodes only
|
|
176
|
+
imageRef, // image fill
|
|
177
|
+
fills, // multiple fills (2 or more)
|
|
155
178
|
layoutSizingH, // HUG/FILL/FIXED
|
|
156
179
|
layoutSizingV,
|
|
157
|
-
children: [ // ⛔
|
|
180
|
+
children: [ // ⛔ full recursive subtree — down to leaf nodes
|
|
158
181
|
{ nodeId, name, type, size, css, children: [...] }
|
|
159
182
|
],
|
|
160
183
|
images: {
|
|
@@ -166,118 +189,175 @@ sections.json 구조:
|
|
|
166
189
|
}
|
|
167
190
|
```
|
|
168
191
|
|
|
169
|
-
###
|
|
192
|
+
### Node Refinement Rules
|
|
170
193
|
|
|
171
194
|
```
|
|
172
|
-
tree.json → sections.json
|
|
173
|
-
1.
|
|
174
|
-
2. VECTOR
|
|
175
|
-
3. isMask
|
|
176
|
-
4. BG
|
|
177
|
-
5.
|
|
178
|
-
6.
|
|
179
|
-
7.
|
|
195
|
+
Refinement applied when converting tree.json → sections.json:
|
|
196
|
+
1. Nodes with size 0px → remove
|
|
197
|
+
2. VECTOR decorative lines (w/h ≤ 2px) → remove
|
|
198
|
+
3. isMask nodes → remove
|
|
199
|
+
4. BG frames → separate from children, move to images.bg
|
|
200
|
+
5. Vector-text GROUPs → separate from children, add to images.content
|
|
201
|
+
6. Design text (TEXT with multiple/gradient fills or effects) → add to images.content
|
|
202
|
+
7. Remaining nodes → keep in children (with CSS, recursive)
|
|
180
203
|
```
|
|
181
204
|
|
|
182
|
-
###
|
|
205
|
+
### Multi-frame (same BP, different pages)
|
|
183
206
|
|
|
184
207
|
```
|
|
185
|
-
|
|
186
|
-
|
|
208
|
+
Identify common elements → extract shared components
|
|
209
|
+
Union of common tokens → shared _tokens.scss
|
|
187
210
|
```
|
|
188
211
|
|
|
189
212
|
---
|
|
190
213
|
|
|
191
|
-
## Phase 4: BP
|
|
214
|
+
## Phase 4: Per-BP Static Implementation ← Implement (sequential per BP)
|
|
215
|
+
|
|
216
|
+
**→ Follow the rules of the vibe.figma.convert skill.**
|
|
217
|
+
**⛔ Implement MO fully first → pass verification → then implement PC. No responsive conversion.**
|
|
218
|
+
**⛔ CSS values must use Figma original px as-is. vw conversion, clamp, @media are forbidden.**
|
|
219
|
+
|
|
220
|
+
### BLOCKING Command — SCSS must only use script output
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Step A: Auto-generate SCSS skeleton (run once per BP)
|
|
224
|
+
node {{VIBE_PATH}}/hooks/scripts/figma-to-scss.js \
|
|
225
|
+
/tmp/{feature}/{bp}-main/sections.json \
|
|
226
|
+
--out=/path/to/project/assets/scss/{feature}/
|
|
192
227
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
228
|
+
# Step B: Per-section validation (after writing each section's code)
|
|
229
|
+
node {{VIBE_PATH}}/hooks/scripts/figma-validate.js \
|
|
230
|
+
/path/to/project/assets/scss/{feature}/ \
|
|
231
|
+
/tmp/{feature}/{bp}-main/sections.json \
|
|
232
|
+
--section={SectionName}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
⛔ **Writing SCSS files directly without calling figma-to-scss.js invalidates Phase 4.**
|
|
236
|
+
⛔ **Do NOT write custom SCSS generation scripts** (to-scss.mjs, generate-scss.js, etc. — all forbidden)
|
|
237
|
+
⛔ **Do NOT proceed to the next section without a figma-validate.js PASS.**
|
|
238
|
+
⛔ **Do NOT write CSS values directly inside scoped style blocks** — only @import of external SCSS files is allowed.
|
|
239
|
+
✅ Use figma-to-scss.js output as-is. If unsatisfactory, modify figma-to-scss.js.
|
|
196
240
|
|
|
197
241
|
```
|
|
198
|
-
Phase 4A: MO
|
|
199
|
-
|
|
200
|
-
⛔
|
|
201
|
-
1. sections.json
|
|
202
|
-
2.
|
|
203
|
-
3. figma-to-scss.js → SCSS
|
|
204
|
-
4. Claude: HTML
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
✅
|
|
221
|
-
✅
|
|
222
|
-
✅
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
242
|
+
Phase 4A: MO Static Implementation
|
|
243
|
+
Input: /tmp/{feature}/mo-main/sections.json
|
|
244
|
+
⛔ No parallelism. Process one section at a time:
|
|
245
|
+
1. Read the target section from sections.json
|
|
246
|
+
2. Write an image vs HTML classification table (BLOCKING)
|
|
247
|
+
3. figma-to-scss.js → auto-generate SCSS skeleton (px as-is) — Step A once
|
|
248
|
+
4. Claude: HTML structure + semantic tags + layout + interactions (Vue/React files only)
|
|
249
|
+
⛔ No CSS written directly in <style> blocks — only @import or @use allowed
|
|
250
|
+
5. figma-validate.js → compare SCSS vs sections.json — Step B
|
|
251
|
+
├─ PASS → next section
|
|
252
|
+
└─ FAIL → fix discrepancies → re-run step 5 (repeat until P1=0, no round cap)
|
|
253
|
+
→ Phase 5 (MO compile) → Phase 6 (MO visual verification)
|
|
254
|
+
|
|
255
|
+
Phase 4B: PC Static Implementation
|
|
256
|
+
Input: /tmp/{feature}/pc-main/sections.json
|
|
257
|
+
Same process as MO
|
|
258
|
+
→ Phase 5 (PC compile) → Phase 6 (PC visual verification)
|
|
259
|
+
|
|
260
|
+
Phase 4C: Responsive Integration (after both MO+PC pass verification)
|
|
261
|
+
→ Separate flow to be established (TODO)
|
|
262
|
+
|
|
263
|
+
Claude's role (restricted):
|
|
264
|
+
✅ Image classification: BG / content / decoration / vector-text
|
|
265
|
+
✅ HTML semantics: section/h1/p/button tag selection
|
|
266
|
+
✅ Component splitting: v-for repetition, shared components
|
|
267
|
+
✅ Interactions: @click, state variables, conditional rendering
|
|
268
|
+
✅ Execute figma-to-scss.js / figma-validate.js commands
|
|
269
|
+
❌ Do NOT modify SCSS CSS values (use figma-to-scss.js output as-is)
|
|
270
|
+
❌ Do NOT write CSS directly in <style> blocks
|
|
271
|
+
❌ Do NOT use vw conversion, clamp, @media, or create custom functions/mixins
|
|
272
|
+
❌ Do NOT write custom refine/generate scripts (refine.mjs, to-scss.mjs, etc.)
|
|
273
|
+
|
|
274
|
+
SCSS Setup (before the first section):
|
|
227
275
|
index.scss, _tokens.scss, _base.scss
|
|
228
|
-
|
|
276
|
+
Token mapping: reference existing tokens from project-tokens.json → create new ones if no match
|
|
229
277
|
|
|
230
|
-
|
|
231
|
-
component-index.json
|
|
278
|
+
Component matching (before each section):
|
|
279
|
+
Compare against component-index.json → import if matched, create new if not
|
|
232
280
|
|
|
233
|
-
|
|
234
|
-
1
|
|
235
|
-
2
|
|
281
|
+
Multi-frame:
|
|
282
|
+
Step 1: shared components first → components/shared/
|
|
283
|
+
Step 2: unique sections per frame
|
|
236
284
|
```
|
|
237
285
|
|
|
238
286
|
---
|
|
239
287
|
|
|
240
|
-
## Phase 5:
|
|
288
|
+
## Phase 5: Compile Gate
|
|
241
289
|
|
|
242
290
|
```
|
|
243
|
-
|
|
291
|
+
No round cap. Loop until compile succeeds (or stuck → ask user).
|
|
244
292
|
|
|
245
|
-
0.
|
|
246
|
-
→ Phase 5
|
|
293
|
+
0. Capture baseline (before Phase 4): record existing tsc + build errors
|
|
294
|
+
→ Phase 5 only fixes NEW errors
|
|
247
295
|
|
|
248
296
|
1. TypeScript: vue-tsc/svelte-check/tsc --noEmit
|
|
249
|
-
2. Build: npm run build (
|
|
250
|
-
3. Dev
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
297
|
+
2. Build: npm run build (120s timeout)
|
|
298
|
+
3. Dev server: npm run dev → detect port → polling
|
|
299
|
+
|
|
300
|
+
On error: parse → auto-fix → re-check
|
|
301
|
+
Termination conditions:
|
|
302
|
+
✅ Success: all checks pass → enter Phase 6
|
|
303
|
+
⚠️ Stuck: same errors as previous round → ask user
|
|
304
|
+
1. Provide direct fix instructions → retry next round
|
|
305
|
+
2. "proceed" — record remaining errors as TODO, proceed to Phase 6
|
|
306
|
+
3. "abort" — halt workflow
|
|
307
|
+
ultrawork mode: on stuck, record TODO without prompting and proceed to Phase 6
|
|
308
|
+
|
|
309
|
+
On completion: preserve dev server PID → used in Phase 6
|
|
310
|
+
|
|
311
|
+
⛔ After Phase 5 passes (or user proceeds), must enter Phase 6. Do NOT output a "completion summary".
|
|
312
|
+
⛔ Do NOT declare work complete without Phase 6.
|
|
258
313
|
```
|
|
259
314
|
|
|
260
315
|
---
|
|
261
316
|
|
|
262
|
-
## Phase 6:
|
|
317
|
+
## Phase 6: Visual Verification Loop ← Verify (parallel) MANDATORY
|
|
263
318
|
|
|
264
|
-
**⛔ Phase 6
|
|
265
|
-
**⛔ Phase 6
|
|
266
|
-
|
|
319
|
+
**⛔ Phase 6 is mandatory, not optional. Enter automatically upon Phase 5 completion.**
|
|
320
|
+
**⛔ If Phase 6 is skipped, the entire task is considered "incomplete".**
|
|
321
|
+
**Coordinator pattern: independent per-section verification can be run as parallel workers.**
|
|
267
322
|
|
|
268
323
|
```
|
|
269
|
-
|
|
270
|
-
|
|
324
|
+
No round cap. Loop until P1=0 (or stuck → ask user).
|
|
325
|
+
Infrastructure: src/infra/lib/browser/ (Puppeteer + CDP)
|
|
271
326
|
|
|
272
|
-
1.
|
|
327
|
+
1. Capture rendered screenshot → pixelmatch comparison against Figma screenshot
|
|
273
328
|
diffRatio > 0.1 → P1
|
|
274
|
-
2. CSS
|
|
329
|
+
2. CSS value comparison: computed CSS vs tree.json expected values
|
|
275
330
|
delta > 4px → P1, ≤ 4px → P2
|
|
276
|
-
3.
|
|
277
|
-
4. P1
|
|
331
|
+
3. Check for missing images and text
|
|
332
|
+
4. Fix P1 issues first (refer to tree.json, no guessing) → revalidate compile → reload
|
|
333
|
+
|
|
334
|
+
Narrowing scope (noise reduction):
|
|
335
|
+
Round 1: P1+P2+P3 all
|
|
336
|
+
Round 2: P1+P2
|
|
337
|
+
Round 3+: P1 only (continue until P1=0)
|
|
338
|
+
|
|
339
|
+
Termination conditions:
|
|
340
|
+
✅ Success: P1 = 0 AND no new findings → complete
|
|
341
|
+
⚠️ Stuck: same findings as previous round → ask user
|
|
342
|
+
1. Provide direct resolution → retry next round
|
|
343
|
+
2. "proceed" — record remaining issues as TODO, complete
|
|
344
|
+
3. "abort" — halt workflow
|
|
345
|
+
ultrawork mode: on stuck, record TODO without prompting and complete
|
|
346
|
+
|
|
347
|
+
Responsive: after MO verification, change viewport → same loop against PC screenshots
|
|
348
|
+
Cleanup: shut down browser + dev server
|
|
349
|
+
|
|
350
|
+
⛔ "Completion summary" output is only allowed after Phase 6 is complete (or user proceeds).
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
---
|
|
278
354
|
|
|
279
|
-
|
|
280
|
-
종료: 브라우저 + dev 서버 정리
|
|
355
|
+
## Error Recovery
|
|
281
356
|
|
|
282
|
-
|
|
283
|
-
|
|
357
|
+
| Failure | Recovery |
|
|
358
|
+
|---------|----------|
|
|
359
|
+
| figma-extract.js script error | Check Node.js version (>=18 required). Verify Figma API token in config. Retry once. |
|
|
360
|
+
| figma-to-scss.js parse failure | Validate input tree.json structure. If malformed, re-run extract phase. |
|
|
361
|
+
| figma-validate.js comparison failure | Skip automated validation, present screenshot side-by-side for manual review |
|
|
362
|
+
| Puppeteer/CDP not available | Skip visual verification phase, rely on manual browser check |
|
|
363
|
+
| Figma API rate limit (429) | Wait 60s and retry. If persistent, reduce node scope. |
|