@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.
Files changed (59) hide show
  1. package/CLAUDE.md +30 -10
  2. package/README.ko.md +90 -25
  3. package/README.md +139 -25
  4. package/agents/teams/figma/figma-builder.md +29 -1
  5. package/agents/teams/review-debate-team.md +1 -1
  6. package/commands/vibe.analyze.md +324 -170
  7. package/commands/vibe.figma.md +549 -34
  8. package/commands/vibe.harness.md +177 -0
  9. package/commands/vibe.run.md +44 -27
  10. package/commands/vibe.scaffold.md +195 -0
  11. package/commands/vibe.spec.md +375 -947
  12. package/commands/vibe.trace.md +17 -0
  13. package/commands/vibe.verify.md +19 -10
  14. package/dist/cli/commands/init.d.ts.map +1 -1
  15. package/dist/cli/commands/init.js +29 -1
  16. package/dist/cli/commands/init.js.map +1 -1
  17. package/dist/cli/commands/update.d.ts.map +1 -1
  18. package/dist/cli/commands/update.js +4 -2
  19. package/dist/cli/commands/update.js.map +1 -1
  20. package/dist/cli/postinstall/constants.d.ts +1 -1
  21. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  22. package/dist/cli/postinstall/constants.js +6 -1
  23. package/dist/cli/postinstall/constants.js.map +1 -1
  24. package/dist/cli/setup/ProjectSetup.d.ts +12 -1
  25. package/dist/cli/setup/ProjectSetup.d.ts.map +1 -1
  26. package/dist/cli/setup/ProjectSetup.js +259 -72
  27. package/dist/cli/setup/ProjectSetup.js.map +1 -1
  28. package/dist/cli/setup.d.ts +1 -1
  29. package/dist/cli/setup.d.ts.map +1 -1
  30. package/dist/cli/setup.js +1 -1
  31. package/dist/cli/setup.js.map +1 -1
  32. package/hooks/scripts/figma-guard.js +220 -0
  33. package/package.json +1 -1
  34. package/skills/arch-guard/SKILL.md +1 -1
  35. package/skills/capability-loop/SKILL.md +106 -2
  36. package/skills/chub-usage/SKILL.md +43 -43
  37. package/skills/claude-md-guide/SKILL.md +175 -175
  38. package/skills/design-teach/SKILL.md +33 -33
  39. package/skills/devlog/SKILL.md +38 -38
  40. package/skills/event-comms/SKILL.md +23 -13
  41. package/skills/event-ops/SKILL.md +28 -19
  42. package/skills/event-planning/SKILL.md +13 -1
  43. package/skills/priority-todos/SKILL.md +1 -1
  44. package/skills/vibe.figma/SKILL.md +234 -154
  45. package/skills/vibe.figma.convert/SKILL.md +123 -112
  46. package/skills/vibe.figma.extract/SKILL.md +141 -129
  47. package/skills/vibe.interview/SKILL.md +358 -0
  48. package/skills/vibe.interview/checklists/api.md +101 -0
  49. package/skills/vibe.interview/checklists/feature.md +88 -0
  50. package/skills/vibe.interview/checklists/library.md +95 -0
  51. package/skills/vibe.interview/checklists/mobile.md +89 -0
  52. package/skills/vibe.interview/checklists/webapp.md +97 -0
  53. package/skills/vibe.interview/checklists/website.md +99 -0
  54. package/skills/vibe.plan/SKILL.md +216 -0
  55. package/skills/vibe.spec/SKILL.md +1155 -0
  56. package/{commands/vibe.spec.review.md → skills/vibe.spec.review/SKILL.md} +269 -108
  57. package/vibe/templates/claudemd-template.md +74 -0
  58. package/vibe/templates/constitution-template.md +15 -0
  59. 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 속성 → SCSS 직접 변환 (추정 없음)
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. screenshot으로 콘텐츠를 이미지화 금지
25
- ✅ BG 렌더링 (TEXT 자식 없는 배경), 벡터 글자 GROUP, 섹션 스크린샷(검증용)
26
- ❌ TEXT 자식 프레임, INSTANCE 반복, 버튼/가격, 섹션 통째 렌더링
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 CSS background-image만. <img> 태그 금지.
28
+ 2. BG must use CSS background-image only. <img> tag is forbidden.
29
29
 
30
- 3. Phase 4 코드 생성 screenshot 호출 금지.
31
- Phase 2 재료만 사용. 복잡해도 HTML+CSS로 구현.
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
- 입력: 모든 URL을 한번에 받는다
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: 재료 확보 (→ vibe.figma.extract)
45
- → Phase 3: 리매핑 (MO↔PC 매칭 → remapped.json)
46
- → Phase 4: 순차 코드 생성 (→ vibe.figma.convert)
47
- → Phase 5: 컴파일 게이트
48
- → Phase 6: 시각 검증 루프
49
-
50
- 작업 디렉토리:
43
+ → Phase 1: Storyboard analysisfunctional 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. 스택 감지: package.json → react/vue/svelte, next/nuxt, scss/tailwind
66
- 2. 피처명: Figma 파일명 → kebab-case
67
- 3. 디렉토리: components/{feature}/, public/images/{feature}/, styles/{feature}/
68
- 4. 컴포넌트 인덱싱 → /tmp/{feature}/component-index.json
69
- (50 이하 스캔, props/slots/classes 추출, 2 이내)
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. 디자인 토큰 스캔 → /tmp/{feature}/project-tokens.json
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
- 사용자 입력: URL 또는 PDF/이미지를 줄바꿈으로 입력
80
+ User input: enter URLs or PDF/images separated by newlines
81
81
 
82
- URL 분류 (자동):
83
- fileKey 다름 스토리보드 vs 디자인
84
- ROOT name "MO" → 모바일, "PC" → 데스크탑
82
+ URL classification (automatic):
83
+ Different fileKey → storyboard vs design
84
+ ROOT name contains "MO" → mobile, "PC" → desktop
85
85
 
86
- 스토리보드 분석:
87
- depth=3으로 프레임 수집 name 패턴으로 분류
88
- SPEC(기능정의서) → CONFIG(해상도) → PAGE(메인 섹션) → SHARED(공통)
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
- Phase 1에서 코드 파일 생성 금지
91
+ No code file creation during Phase 1
92
92
 
93
- 출력 (텍스트만):
94
- 1. 섹션 목록 테이블 (이름, Figma name, 높이, 설명)
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: 재료 확보 ← Research (병렬)
102
+ ## Phase 2: Gather Materials ← Research (parallel)
103
103
 
104
- **→ vibe.figma.extract 스킬의 규칙을 따른다.**
105
- **코디네이터 패턴: MO/PC 추출을 워커로 병렬 실행.**
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] = ~/.vibe/hooks/scripts/figma-extract.js
108
+ # [FIGMA_SCRIPT] = {{VIBE_PATH}}/hooks/scripts/figma-extract.js
109
109
 
110
- MO/PC 동시 추출 (각각 독립 워커):
111
- 워커-MO: screenshot → tree → images → 에셋 렌더링 → sections/
112
- 워커-PC: screenshot → tree → images → 에셋 렌더링 → sections/
113
- 워커의 결과가 모두 도달한 Phase 3 진행
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
- 단일 BP: 워커 1개로 순차 실행
115
+ Single BP: run sequentially with 1 worker
116
116
 
117
- 멀티 프레임 (같은 BP, 다른 페이지):
118
- 순차 추출 (500ms 간격), 부분 실패 허용
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: 데이터 정제 ← Synthesis (BP별 독립)
123
+ ## Phase 3: Data Refinement ← Synthesis (independent per BP)
124
124
 
125
- **각 BP tree.json 섹션별로 분할 + 정제한다.**
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 독립 정제. MO PC를 섞지 않는다.
132
- 정제된 JSON Phase 4의 유일한 입력이다.
133
- 섹션별 전체 하위 트리(children 재귀) 반드시 포함해야 한다.
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(해당 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, // 이미지 fill
154
- fills, // 다중 fill (2 이상)
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 subtreedown 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. 크기 0px 노드 제거
174
- 2. VECTOR 장식선 (w/h ≤ 2px) → 제거
175
- 3. isMask 노드제거
176
- 4. BG 프레임 → children에서 분리, images.bg로 이동
177
- 5. 벡터 글자 GROUP → children에서 분리, images.content에 추가
178
- 6. 디자인 텍스트 (fills 다중/gradient, effects 있는 TEXT) → images.content에 추가
179
- 7. 나머지 노드 → children 유지 (CSS 포함, 재귀)
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 nodesremove
199
+ 4. BG framesseparate from children, move to images.bg
200
+ 5. Vector-text GROUPsseparate from children, add to images.content
201
+ 6. Design text (TEXT with multiple/gradient fills or effects) → add to images.content
202
+ 7. Remaining nodeskeep in children (with CSS, recursive)
180
203
  ```
181
204
 
182
- ### 멀티 프레임 (같은 BP, 다른 페이지)
205
+ ### Multi-frame (same BP, different pages)
183
206
 
184
207
  ```
185
- 공통 요소 식별공유 컴포넌트 추출
186
- 공통 토큰 합집합공유 _tokens.scss
208
+ Identify common elementsextract shared components
209
+ Union of common tokens shared _tokens.scss
187
210
  ```
188
211
 
189
212
  ---
190
213
 
191
- ## Phase 4: BP 스태틱 구현 ← Implement (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
- **→ vibe.figma.convert 스킬의 규칙을 따른다.**
194
- **⛔ MO 먼저 전체 구현 → 검증 통과 → PC 구현. 반응형 변환은 하지 않는다.**
195
- **⛔ CSS 값은 Figma 원본 px 그대로. vw 변환, clamp, @media 금지.**
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
- 입력: /tmp/{feature}/mo-main/sections.json
200
- 병렬 금지. 섹션씩 순차:
201
- 1. sections.json에서 해당 섹션 Read
202
- 2. 이미지 vs HTML 판별 테이블 작성 (BLOCKING)
203
- 3. figma-to-scss.js → SCSS 골격 자동 생성 (px 그대로)
204
- 4. Claude: HTML 구조 + 시맨틱 태그 + 레이아웃 + 인터랙션
205
- 5. figma-validate.js SCSS vs sections.json 대조
206
- ├─ PASS다음 섹션
207
- └─ FAIL불일치 수정 → 5번 재실행 (P1=0 까지, 횟수 제한 없음)
208
- Phase 5 (MO 컴파일)Phase 6 (MO 시각 검증)
209
-
210
- Phase 4B: PC 스태틱 구현
211
- 입력: /tmp/{feature}/pc-main/sections.json
212
- MO와 동일한 프로세스
213
- Phase 5 (PC 컴파일) → Phase 6 (PC 시각 검증)
214
-
215
- Phase 4C: 반응형 통합 (MO+PC 모두 검증 통과 후)
216
- 별도 플로우로 수립 (TODO)
217
-
218
- Claude의 역할 (제한적):
219
- 이미지 분류: BG / 콘텐츠 / 장식 / 벡터 글자
220
- HTML 시맨틱: section/h1/p/button 태그 선택
221
- 컴포넌트 분리: v-for 반복, 공유 컴포넌트
222
- 인터랙션: @click, 상태 변수, 조건부 렌더링
223
- SCSS CSS 수정 금지 (figma-to-scss.js 출력 그대로 사용)
224
- vw 변환, clamp, @media, 커스텀 함수/믹스인 생성 금지
225
-
226
- SCSS Setup (첫 섹션 전):
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.jscompare SCSS vs sections.json — Step B
251
+ ├─ PASSnext section
252
+ └─ FAIL fix discrepanciesre-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
- 토큰 매핑: project-tokens.json에서 기존 토큰 참조 매칭 되면 새 생성
276
+ Token mapping: reference existing tokens from project-tokens.json create new ones if no match
229
277
 
230
- 컴포넌트 매칭 ( 섹션 ):
231
- component-index.json 대조 매칭되면 import, 되면 생성
278
+ Component matching (before each section):
279
+ Compare against component-index.json → import if matched, create new if not
232
280
 
233
- 멀티 프레임 시:
234
- 1단계: 공유 컴포넌트 먼저 → components/shared/
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
- 최대 3라운드 자동 반복.
291
+ No round cap. Loop until compile succeeds (or stuck → ask user).
244
292
 
245
- 0. 베이스라인 캡처 (Phase 4): tsc + build 기존 에러 기록
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 (120초 타임아웃)
250
- 3. Dev 서버: npm run dev → 포트 감지폴링
251
-
252
- 에러 시: 파싱자동 수정 재체크
253
- 3라운드 실패: 에러 목록을 사용자에게 보고 (Phase 6 진행 불가)
254
- 완료 시: dev 서버 PID 보존 → Phase 6에서 사용
255
-
256
- Phase 5 통과 반드시 Phase 6 진입. "완료 요약" 출력 금지.
257
- Phase 6 없이 작업 완료 선언 금지.
297
+ 2. Build: npm run build (120s timeout)
298
+ 3. Dev server: npm run dev → detect portpolling
299
+
300
+ On error: parseauto-fixre-check
301
+ Termination conditions:
302
+ Success: all checks passenter 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: 시각 검증 루프 ← Verify (병렬) MANDATORY
317
+ ## Phase 6: Visual Verification Loop ← Verify (parallel) MANDATORY
263
318
 
264
- **⛔ Phase 6 선택이 아닌 필수. Phase 5 통과 즉시 자동 진입.**
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
- 최대 3라운드. P1=0 때까지.
270
- 인프라: src/infra/lib/browser/ (Puppeteer + CDP)
324
+ No round cap. Loop until P1=0 (or stuck → ask user).
325
+ Infrastructure: src/infra/lib/browser/ (Puppeteer + CDP)
271
326
 
272
- 1. 렌더링 스크린샷 캡처Figma 스크린샷과 pixelmatch 비교
327
+ 1. Capture rendered screenshotpixelmatch comparison against Figma screenshot
273
328
  diffRatio > 0.1 → P1
274
- 2. CSS 수치 비교: computed CSS vs tree.json 기대값
329
+ 2. CSS value comparison: computed CSS vs tree.json expected values
275
330
  delta > 4px → P1, ≤ 4px → P2
276
- 3. 이미지·텍스트 누락 체크
277
- 4. P1 우선 수정 (tree.json 참조, 추정 금지) → 컴파일 재검증리로드
331
+ 3. Check for missing images and text
332
+ 4. Fix P1 issues first (refer to tree.json, no guessing) → revalidate compilereload
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
- 반응형: MO 검증 후 viewport 변경 → PC 스크린샷과 동일 루프
280
- 종료: 브라우저 + dev 서버 정리
355
+ ## Error Recovery
281
356
 
282
- Phase 6 완료 후에만 "완료 요약" 출력 허용.
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. |