@su-record/vibe 2.16.4 → 3.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.
Files changed (267) hide show
  1. package/CLAUDE.md +8 -8
  2. package/README.en.md +46 -29
  3. package/README.md +41 -24
  4. package/agents/acceptance-tester.md +56 -0
  5. package/agents/architect.md +25 -67
  6. package/agents/build-error-resolver.md +28 -97
  7. package/agents/code-reviewer.md +89 -0
  8. package/agents/diagrammer.md +34 -169
  9. package/agents/documenter.md +43 -0
  10. package/agents/e2e-tester.md +46 -281
  11. package/agents/event/event-ops.md +54 -77
  12. package/agents/event/event-planner.md +63 -0
  13. package/agents/figma/figma-engineer.md +76 -0
  14. package/agents/implementer.md +26 -41
  15. package/agents/security-reviewer.md +56 -0
  16. package/agents/tester.md +37 -33
  17. package/agents/ui/design-reviewer.md +62 -0
  18. package/agents/ui/design-system-gen.md +63 -0
  19. package/dist/cli/commands/remove.d.ts.map +1 -1
  20. package/dist/cli/commands/remove.js +8 -10
  21. package/dist/cli/commands/remove.js.map +1 -1
  22. package/dist/cli/index.d.ts +0 -4
  23. package/dist/cli/index.d.ts.map +1 -1
  24. package/dist/cli/index.js +0 -4
  25. package/dist/cli/index.js.map +1 -1
  26. package/dist/cli/llm/model-refresh.js +1 -1
  27. package/dist/cli/llm/model-refresh.js.map +1 -1
  28. package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
  29. package/dist/cli/postinstall/claude-agents.js +16 -77
  30. package/dist/cli/postinstall/claude-agents.js.map +1 -1
  31. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  32. package/dist/cli/postinstall/constants.js +80 -296
  33. package/dist/cli/postinstall/constants.js.map +1 -1
  34. package/dist/cli/postinstall/cursor-agents.d.ts +5 -0
  35. package/dist/cli/postinstall/cursor-agents.d.ts.map +1 -1
  36. package/dist/cli/postinstall/cursor-agents.js +26 -68
  37. package/dist/cli/postinstall/cursor-agents.js.map +1 -1
  38. package/dist/cli/postinstall/cursor-skills.d.ts.map +1 -1
  39. package/dist/cli/postinstall/cursor-skills.js +26 -30
  40. package/dist/cli/postinstall/cursor-skills.js.map +1 -1
  41. package/dist/cli/postinstall/main.d.ts.map +1 -1
  42. package/dist/cli/postinstall/main.js +0 -2
  43. package/dist/cli/postinstall/main.js.map +1 -1
  44. package/dist/cli/setup/Provisioner.d.ts.map +1 -1
  45. package/dist/cli/setup/Provisioner.js +19 -21
  46. package/dist/cli/setup/Provisioner.js.map +1 -1
  47. package/dist/cli/utils.d.ts +4 -1
  48. package/dist/cli/utils.d.ts.map +1 -1
  49. package/dist/cli/utils.js +4 -1
  50. package/dist/cli/utils.js.map +1 -1
  51. package/dist/infra/lib/FrameworkDetector.js +4 -4
  52. package/dist/infra/lib/FrameworkDetector.js.map +1 -1
  53. package/dist/infra/lib/OrchestrateWorkflow.js +2 -2
  54. package/dist/infra/lib/OrchestrateWorkflow.js.map +1 -1
  55. package/dist/infra/lib/browser/launch.js +1 -1
  56. package/dist/infra/lib/browser/launch.js.map +1 -1
  57. package/dist/infra/lib/browser/types.d.ts +1 -1
  58. package/dist/infra/lib/browser/types.js +1 -1
  59. package/dist/infra/lib/constants.d.ts +1 -1
  60. package/dist/infra/lib/constants.d.ts.map +1 -1
  61. package/dist/infra/lib/constants.js +4 -5
  62. package/dist/infra/lib/constants.js.map +1 -1
  63. package/dist/infra/lib/evolution/__tests__/integration.test.js +7 -7
  64. package/dist/infra/lib/evolution/__tests__/integration.test.js.map +1 -1
  65. package/dist/infra/lib/memory/index.d.ts +0 -2
  66. package/dist/infra/lib/memory/index.d.ts.map +1 -1
  67. package/dist/infra/lib/memory/index.js +0 -2
  68. package/dist/infra/lib/memory/index.js.map +1 -1
  69. package/dist/infra/lib/telemetry/SkillTelemetry.test.js +1 -1
  70. package/dist/infra/lib/telemetry/SkillTelemetry.test.js.map +1 -1
  71. package/dist/tools/index.d.ts +0 -4
  72. package/dist/tools/index.d.ts.map +1 -1
  73. package/dist/tools/index.js +0 -4
  74. package/dist/tools/index.js.map +1 -1
  75. package/dist/tools/memory/autoSaveContext.d.ts +0 -1
  76. package/dist/tools/memory/autoSaveContext.d.ts.map +1 -1
  77. package/dist/tools/memory/autoSaveContext.js +13 -27
  78. package/dist/tools/memory/autoSaveContext.js.map +1 -1
  79. package/hooks/scripts/__tests__/code-check-detectors.test.js +2 -2
  80. package/hooks/scripts/__tests__/run-ledger.test.js +1 -1
  81. package/hooks/scripts/__tests__/scope-from-spec.test.js +12 -12
  82. package/hooks/scripts/__tests__/step-counter.test.js +1 -1
  83. package/hooks/scripts/code-check.js +16 -203
  84. package/hooks/scripts/context-save.js +0 -11
  85. package/hooks/scripts/lib/scope-from-spec.js +9 -6
  86. package/hooks/scripts/post-edit-dispatcher.js +1 -1
  87. package/hooks/scripts/prompt-dispatcher.js +7 -18
  88. package/hooks/scripts/session-start.js +25 -35
  89. package/package.json +2 -4
  90. package/skills/agents-md/SKILL.md +62 -15
  91. package/skills/arch-guard/SKILL.md +1 -1
  92. package/skills/brand-assets/SKILL.md +2 -2
  93. package/skills/capability-loop/SKILL.md +1 -1
  94. package/skills/chub-usage/SKILL.md +1 -1
  95. package/skills/commerce-patterns/SKILL.md +2 -2
  96. package/skills/commit-push-pr/SKILL.md +0 -1
  97. package/skills/context7-usage/SKILL.md +1 -1
  98. package/skills/design-refine/SKILL.md +140 -0
  99. package/skills/{design-polish → design-refine}/templates/polish-report.md +1 -1
  100. package/skills/{design-normalize → design-refine}/templates/token-audit.md +3 -3
  101. package/skills/design-review/SKILL.md +143 -0
  102. package/skills/{design-audit → design-review}/agents/a11y-auditor.md +1 -1
  103. package/skills/{design-audit → design-review}/agents/performance-auditor.md +1 -1
  104. package/skills/{design-audit → design-review}/agents/responsive-auditor.md +1 -1
  105. package/skills/{design-audit → design-review}/agents/slop-detector.md +1 -1
  106. package/skills/{design-audit → design-review}/frameworks/core-web-vitals.md +1 -1
  107. package/skills/{design-audit → design-review}/frameworks/wcag-checklist.md +1 -1
  108. package/skills/{design-audit → design-review}/orchestrator.md +3 -3
  109. package/skills/{design-critique → design-review}/templates/critique-report.md +3 -3
  110. package/skills/{design-audit → design-review}/templates/report.md +3 -3
  111. package/skills/design-teach/SKILL.md +11 -11
  112. package/skills/docs/SKILL.md +14 -16
  113. package/skills/e2e-commerce/SKILL.md +1 -1
  114. package/skills/event-comms/SKILL.md +1 -1
  115. package/skills/event-ops/SKILL.md +2 -2
  116. package/skills/event-planning/SKILL.md +1 -1
  117. package/skills/exec-plan/SKILL.md +2 -2
  118. package/skills/figma/SKILL.md +240 -148
  119. package/skills/figma/rubrics/css-mapping.md +125 -0
  120. package/skills/git-worktree/SKILL.md +1 -1
  121. package/skills/handoff/SKILL.md +1 -1
  122. package/skills/parallel-research/SKILL.md +14 -28
  123. package/skills/priority-todos/SKILL.md +1 -1
  124. package/skills/regress/SKILL.md +11 -0
  125. package/skills/restraint/SKILL.md +72 -0
  126. package/skills/seo-checklist/SKILL.md +2 -2
  127. package/skills/spec/SKILL.md +65 -836
  128. package/skills/test/SKILL.md +3 -3
  129. package/skills/tool-fallback/SKILL.md +2 -2
  130. package/skills/vercel-react-best-practices/SKILL.md +1 -1
  131. package/skills/vibe/SKILL.md +20 -35
  132. package/skills/vibe.analyze/SKILL.md +7 -9
  133. package/skills/vibe.docs/SKILL.md +1 -1
  134. package/skills/vibe.event/SKILL.md +27 -27
  135. package/skills/vibe.figma/SKILL.md +14 -18
  136. package/skills/vibe.harness/SKILL.md +5 -5
  137. package/skills/vibe.reason/SKILL.md +0 -2
  138. package/skills/vibe.review/SKILL.md +45 -49
  139. package/skills/vibe.run/SKILL.md +2 -5
  140. package/skills/vibe.run/references/parallel-agents.md +33 -98
  141. package/skills/vibe.spec/SKILL.md +38 -535
  142. package/skills/vibe.utils/SKILL.md +3 -3
  143. package/skills/vibe.verify/SKILL.md +70 -542
  144. package/skills/video-production/SKILL.md +1 -1
  145. package/vibe/rules/orchestrator-contract.md +5 -4
  146. package/vibe/rules/quality/performance.md +1 -1
  147. package/vibe/templates/claudemd-template.md +1 -1
  148. package/vibe/templates/spec-template.md +35 -185
  149. package/agents/architect-low.md +0 -41
  150. package/agents/architect-medium.md +0 -59
  151. package/agents/compounder.md +0 -265
  152. package/agents/docs/api-documenter.md +0 -99
  153. package/agents/docs/changelog-writer.md +0 -93
  154. package/agents/event/event-comms.md +0 -78
  155. package/agents/event/event-content.md +0 -68
  156. package/agents/event/event-image.md +0 -95
  157. package/agents/event/event-scheduler.md +0 -69
  158. package/agents/event/event-speaker.md +0 -86
  159. package/agents/explorer-low.md +0 -42
  160. package/agents/explorer-medium.md +0 -59
  161. package/agents/explorer.md +0 -48
  162. package/agents/figma/figma-analyst.md +0 -56
  163. package/agents/figma/figma-architect.md +0 -116
  164. package/agents/figma/figma-auditor.md +0 -86
  165. package/agents/figma/figma-builder.md +0 -104
  166. package/agents/implementer-low.md +0 -43
  167. package/agents/implementer-medium.md +0 -52
  168. package/agents/junior-mentor.md +0 -141
  169. package/agents/planning/requirements-analyst.md +0 -84
  170. package/agents/planning/ux-advisor.md +0 -83
  171. package/agents/qa/acceptance-tester.md +0 -86
  172. package/agents/qa/edge-case-finder.md +0 -93
  173. package/agents/qa/qa-coordinator.md +0 -131
  174. package/agents/refactor-cleaner.md +0 -143
  175. package/agents/research/best-practices.md +0 -199
  176. package/agents/research/codebase-patterns.md +0 -157
  177. package/agents/research/framework-docs.md +0 -188
  178. package/agents/research/security-advisory.md +0 -213
  179. package/agents/review/architecture-reviewer.md +0 -107
  180. package/agents/review/complexity-reviewer.md +0 -116
  181. package/agents/review/data-integrity-reviewer.md +0 -88
  182. package/agents/review/git-history-reviewer.md +0 -103
  183. package/agents/review/performance-reviewer.md +0 -86
  184. package/agents/review/python-reviewer.md +0 -150
  185. package/agents/review/rails-reviewer.md +0 -139
  186. package/agents/review/react-reviewer.md +0 -144
  187. package/agents/review/security-reviewer.md +0 -80
  188. package/agents/review/simplicity-reviewer.md +0 -140
  189. package/agents/review/test-coverage-reviewer.md +0 -116
  190. package/agents/review/typescript-reviewer.md +0 -127
  191. package/agents/searcher.md +0 -54
  192. package/agents/simplifier.md +0 -124
  193. package/agents/teams/debug-team.md +0 -74
  194. package/agents/teams/dev-team.md +0 -92
  195. package/agents/teams/docs-team.md +0 -84
  196. package/agents/teams/figma-team.md +0 -89
  197. package/agents/teams/fullstack-team.md +0 -87
  198. package/agents/teams/lite-team.md +0 -73
  199. package/agents/teams/migration-team.md +0 -82
  200. package/agents/teams/refactor-team.md +0 -98
  201. package/agents/teams/research-team.md +0 -90
  202. package/agents/teams/review-debate-team.md +0 -129
  203. package/agents/teams/security-team.md +0 -85
  204. package/agents/ui/ui-a11y-auditor.md +0 -93
  205. package/agents/ui/ui-antipattern-detector.md +0 -102
  206. package/agents/ui/ui-dataviz-advisor.md +0 -69
  207. package/agents/ui/ui-design-system-gen.md +0 -57
  208. package/agents/ui/ui-industry-analyzer.md +0 -49
  209. package/agents/ui/ui-layout-architect.md +0 -65
  210. package/agents/ui/ui-stack-implementer.md +0 -68
  211. package/agents/ui/ux-compliance-reviewer.md +0 -81
  212. package/agents/ui-previewer.md +0 -262
  213. package/hooks/scripts/__tests__/keyword-detector.test.js +0 -242
  214. package/hooks/scripts/keyword-detector.js +0 -226
  215. package/skills/characterization-test/SKILL.md +0 -209
  216. package/skills/characterization-test/agents/behavior-capturer.md +0 -50
  217. package/skills/characterization-test/agents/coverage-checker.md +0 -54
  218. package/skills/characterization-test/agents/reporter.md +0 -50
  219. package/skills/characterization-test/agents/test-writer.md +0 -49
  220. package/skills/characterization-test/rubrics/coverage-criteria.md +0 -53
  221. package/skills/characterization-test/templates/test-template.ts +0 -101
  222. package/skills/claude-md-guide/SKILL.md +0 -353
  223. package/skills/claude-md-guide/rubrics/anti-patterns.md +0 -88
  224. package/skills/design-audit/SKILL.md +0 -154
  225. package/skills/design-critique/SKILL.md +0 -140
  226. package/skills/design-distill/SKILL.md +0 -131
  227. package/skills/design-normalize/SKILL.md +0 -135
  228. package/skills/design-polish/SKILL.md +0 -132
  229. package/skills/figma-convert/SKILL.md +0 -236
  230. package/skills/figma-extract/SKILL.md +0 -242
  231. package/skills/interview/SKILL.md +0 -358
  232. package/skills/interview/checklists/api.md +0 -101
  233. package/skills/interview/checklists/feature.md +0 -88
  234. package/skills/interview/checklists/library.md +0 -95
  235. package/skills/interview/checklists/mobile.md +0 -89
  236. package/skills/interview/checklists/webapp.md +0 -97
  237. package/skills/interview/checklists/website.md +0 -99
  238. package/skills/plan/SKILL.md +0 -254
  239. package/skills/rob-pike/SKILL.md +0 -66
  240. package/skills/spec/references/askuser-examples.md +0 -57
  241. package/skills/spec/references/example-session.md +0 -87
  242. package/skills/spec/references/templates.md +0 -194
  243. package/skills/spec-review/SKILL.md +0 -725
  244. package/skills/systematic-debugging/SKILL.md +0 -142
  245. package/skills/techdebt/SKILL.md +0 -126
  246. package/skills/techdebt/agents/analyzer.md +0 -50
  247. package/skills/techdebt/agents/fixer.md +0 -41
  248. package/skills/techdebt/agents/reviewer.md +0 -47
  249. package/skills/techdebt/agents/scanner.md +0 -44
  250. package/skills/techdebt/orchestrator.md +0 -72
  251. package/skills/techdebt/rubrics/severity.md +0 -51
  252. package/skills/techdebt/scripts/scan.js +0 -90
  253. package/skills/techdebt/templates/report.md +0 -86
  254. package/skills/typescript-advanced-types/SKILL.md +0 -68
  255. package/skills/typescript-advanced-types/rubrics/type-patterns.md +0 -109
  256. package/skills/yagni-ladder/SKILL.md +0 -90
  257. /package/skills/{claude-md-guide → agents-md}/templates/claude-md.md +0 -0
  258. /package/skills/{design-polish → design-refine}/rubrics/polish-checklist.md +0 -0
  259. /package/skills/{design-normalize → design-refine}/rubrics/token-naming.md +0 -0
  260. /package/skills/{design-distill → design-refine}/templates/design-system.md +0 -0
  261. /package/skills/{design-audit → design-review}/agents/scorer.md +0 -0
  262. /package/skills/{design-audit → design-review}/rubrics/ai-slop-patterns.md +0 -0
  263. /package/skills/{design-audit → design-review}/rubrics/scoring.md +0 -0
  264. /package/skills/{design-critique → design-review}/rubrics/ux-heuristics.md +0 -0
  265. /package/skills/{figma-convert → figma}/rubrics/conversion-rules.md +0 -0
  266. /package/skills/{figma-extract → figma}/rubrics/image-rules.md +0 -0
  267. /package/skills/{figma-convert → figma}/templates/component.md +0 -0
@@ -126,24 +126,22 @@ Cursor is not supported — do not generate or check Cursor-specific context fil
126
126
  - **If exists** → regenerate from current `CLAUDE.md` + substitution, preserving user-specific additions outside the VIBE block.
127
127
  4. **CLI substitution for `AGENTS.md`** (Codex): `Claude Code` → `Codex` · `~/.claude/` → `~/.codex/` · `.claude/` → `.codex/` · `CLAUDE.md` → `AGENTS.md`. `CLAUDE.md` itself gets no substitution.
128
128
  5. **CLI substitution for `GEMINI.md`** (Antigravity): `Claude Code` → `Antigravity CLI` · `~/.claude/` → `~/.gemini/` · `.claude/` → `.gemini/` · `CLAUDE.md` → `GEMINI.md`.
129
- 6. **Validate every touched file (whether newly created or modified)** via the `claude-md-guide` → `agents-md` skill chain — see validation block below. **Never write or save without running this step.**
129
+ 6. **Validate every touched file (whether newly created or modified)** via the `agents-md` skill — see validation block below. **Never write or save without running this step.**
130
130
  7. Report per file: created / updated / skipped / validation warnings.
131
131
 
132
132
  **Idempotent:** Re-running re-syncs the behavioral block and re-applies substitutions without duplication.
133
133
 
134
- **Mandatory validation (every create & every update) — invoke `claude-md-guide` `agents-md`:**
134
+ **Mandatory validation (every create & every update) — Load skill `agents-md`:**
135
135
 
136
- 1. **`claude-md-guide`**:
137
- - Size target 60–150 lines (Optimal). Warn at 200+, force split/trim at 300+.
138
- - 4-question check per line (outside `VIBE-BEHAVIORAL` block):
139
- - Would the agent make a mistake without this? (No → delete)
140
- - Needed every session? (No → move to SPEC/plan)
141
- - Can a linter/hook replace it? (Yes → move)
142
- - Discoverable from code? (Yes delete)
143
- - Lost-in-the-Middle: critical rules at top, frequently-violated rules at bottom.
144
- 2. **`agents-md`**:
145
- - Addy Osmani test: "Can the agent discover this by reading the code?" → Yes = delete.
146
- - Strip tech-stack name-drops already stated in `package.json`.
136
+ - Size target 60–150 lines (Optimal). Warn at 200+, force split/trim at 300+.
137
+ - 4-question check per line (outside `VIBE-BEHAVIORAL` block):
138
+ - Would the agent make a mistake without this? (No delete)
139
+ - Needed every session? (No → move to SPEC/plan)
140
+ - Can a linter/hook replace it? (Yes → move)
141
+ - Discoverable from code? (Yes → delete)
142
+ - Lost-in-the-Middle: critical rules at top, frequently-violated rules at bottom.
143
+ - Addy Osmani test: "Can the agent discover this by reading the code?" → Yes = delete.
144
+ - Strip tech-stack name-drops already stated in `package.json`.
147
145
 
148
146
  Report line ranges to trim per file. Do not auto-delete; surface findings for user approval before finalizing.
149
147
 
@@ -204,10 +202,10 @@ When `/vibe.trace` completes with all scenarios passing, suggest:
204
202
  - Preserve existing documentation that's still accurate
205
203
  - Include concrete code examples from the actual project
206
204
  - Keep language consistent with project (Korean/English based on CLAUDE.md)
207
- - Use changelog-writer agent for `/vibe.docs release`
208
- - Use api-documenter agent for API-heavy projects
205
+ - Use documenter agent (changelog mode) for `/vibe.docs release`
206
+ - Use documenter agent (api-docs mode) for API-heavy projects
209
207
  - Use diagrammer agent for `/vibe.docs arch` Mermaid generation
210
- - Use `claude-md-guide` `agents-md` chain for `/vibe.docs agent` — applies equally to CLAUDE.md and AGENTS.md
208
+ - Use the `agents-md` skill for `/vibe.docs agent` — applies equally to CLAUDE.md and AGENTS.md
211
209
 
212
210
  ### DON'T
213
211
  - Don't generate placeholder text ("Lorem ipsum", "TODO: fill in")
@@ -4,7 +4,7 @@ invocation: [auto]
4
4
  tier: core
5
5
  description: "E2E test scenarios for commerce checkout and payment flows. Provides ready-made Playwright test templates for cart→checkout→payment→confirmation flows, including PG sandbox testing (Toss/Stripe), error scenarios (payment failure, timeout, stock exhaustion), and idempotency verification. Use when writing E2E tests for any e-commerce feature — checkout, payment, order status, or refund flows."
6
6
  triggers: [e2e commerce, checkout test, payment test, order flow test]
7
- priority: 65
7
+ priority: 60
8
8
  ---
9
9
 
10
10
  # E2E Commerce Test Scenarios
@@ -4,7 +4,7 @@ invocation: [auto]
4
4
  tier: standard
5
5
  description: "Event communication automation — SMS via Aligo, email via Gmail OAuth, SNS posts for LinkedIn/Threads. Handles templates, BCC rules, and confirmation protocol."
6
6
  triggers: [sms, aligo, gmail, event email, event sms, 문자 발송, 메일 발송, SNS 홍보]
7
- priority: 65
7
+ priority: 60
8
8
  ---
9
9
  # Event Communications
10
10
 
@@ -3,8 +3,8 @@ name: event-ops
3
3
  invocation: [auto]
4
4
  tier: standard
5
5
  description: "Event operations — nametags, checklists, operational slides, Slido plans, image generation specs, settlement reports."
6
- triggers: [nametag, checklist, event slide, slido, 이름표, 체크리스트, 운영 슬라이드, 정산]
7
- priority: 65
6
+ triggers: [nametag, event checklist, event slide, slido, 이름표, 행사 체크리스트, 운영 슬라이드, 정산]
7
+ priority: 60
8
8
  ---
9
9
  # Event Operations
10
10
 
@@ -4,7 +4,7 @@ invocation: [auto]
4
4
  tier: standard
5
5
  description: "Community event automation — D-Day timeline, community patterns, proactive task execution. Auto-activates for event planning, meetup/webinar/conference management."
6
6
  triggers: [event planning, meetup, webinar, conference, 행사, 밋업, 웨비나, D-Day, 이벤트 준비]
7
- priority: 70
7
+ priority: 60
8
8
  ---
9
9
  # Event Planning
10
10
 
@@ -4,8 +4,8 @@ user-invocable: false
4
4
  invocation: [auto, chain]
5
5
  tier: core
6
6
  description: "Convert a SPEC (3+ phases or multi-file) into a self-contained execution plan — explicit file paths, interfaces, acceptance criteria — that agents can run autonomously."
7
- triggers: [exec plan, execution plan, autonomous plan, self-contained plan, long-running, execute this spec, run this plan, parallel implementation]
8
- priority: 70
7
+ triggers: [exec plan, execution plan, autonomous plan, self-contained plan, execute this spec, run this plan, parallel implementation]
8
+ priority: 60
9
9
  chain-next: [commit-push-pr]
10
10
  ---
11
11
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: figma
3
- description: Figma → 코드 본체 — tree 기반 구조적 코드 생성.
3
+ description: Figma → 코드 본체 — tree 기반 구조적 코드 생성 (extract/convert 모드 통합).
4
4
  when_to_use: /vibe.figma 진입점에서 체인 호출. 직접 호출 금지.
5
5
  user-invocable: false
6
6
  tier: standard
@@ -16,20 +16,16 @@ The Figma tree is the source of truth for code. Screenshots are for verification
16
16
  ✅ Figma Auto Layout → CSS Flexbox 1:1 mechanical mapping
17
17
  ✅ Figma CSS properties → SCSS direct conversion (no guessing)
18
18
  ✅ Claude handles semantic decisions only: tag selection, component splitting, interactions
19
- ✅ Screenshots are used for verification only, not generation
20
19
  ```
21
20
 
22
21
  ## Immutable Rules
23
22
 
24
23
  ```
25
- 1. Do NOT render content as images via screenshot
26
- BG rendering (backgrounds with no TEXT children), vector-text GROUPs, section screenshots (verification only)
27
- ❌ Frames with TEXT children, INSTANCE repetitions, buttons/prices, rendering entire sections
28
-
24
+ 1. Do NOT render content as images (frames with TEXT children, INSTANCEs, buttons/prices,
25
+ whole sections). Image rendering only for BG, vector-text GROUPs, verification screenshots.
29
26
  2. BG must use CSS background-image only. <img> tag is forbidden.
30
-
31
- 3. No new screenshot calls during Phase 4 code generation.
32
- Use only Phase 2 materials. No matter how complex — implement with HTML+CSS.
27
+ 3. No new screenshot calls during Phase 4. Use only Phase 2 materials —
28
+ no matter how complex, implement with HTML+CSS.
33
29
  ```
34
30
 
35
31
  ## Full Flow
@@ -42,20 +38,15 @@ Input: receive all URLs at once
42
38
 
43
39
  → Phase 0: Setup
44
40
  → Phase 1: Storyboard analysis → functional spec document
45
- → Phase 2: Gather materials (→ vibe.figma.extract)
41
+ → Phase 2: Gather materials (→ Extract Mode section below)
46
42
  → Phase 3: Remapping (MO↔PC matching → remapped.json)
47
- → Phase 4: Sequential code generation (→ vibe.figma.convert)
43
+ → Phase 4: Sequential code generation (→ Convert Mode section below)
48
44
  → Phase 5: Compile gate
49
45
  → Phase 6: Visual verification loop
50
46
 
51
- Working directory:
52
- /tmp/{feature}/
53
- ├── mo-main/tree.json, bg/, content/, sections/
54
- ├── pc-main/tree.json, bg/, content/, sections/
55
- └── remapped.json ← sole input for Phase 4
56
-
57
- Code output: placed directly in the project directory
58
- components/{feature}/, styles/{feature}/
47
+ Working directory: /tmp/{feature}/{mo,pc}-main/{tree.json, bg/, content/, sections/}
48
+ + remapped.json ← sole input for Phase 4
49
+ Code output: directly in the project — components/{feature}/, styles/{feature}/
59
50
  ```
60
51
 
61
52
  ---
@@ -66,11 +57,10 @@ Code output: placed directly in the project directory
66
57
  1. Stack detection: package.json → react/vue/svelte, next/nuxt, scss/tailwind
67
58
  2. Feature name: Figma filename → kebab-case
68
59
  3. Directories: components/{feature}/, public/images/{feature}/, styles/{feature}/
69
- 4. Component indexing → /tmp/{feature}/component-index.json
70
- (scan up to 50 components, extract props/slots/classes, within 2 minutes)
71
- 5. Hooks/Types/Constants/tmp/{feature}/context-index.json
72
- 6. Design token scan → /tmp/{feature}/project-tokens.json
73
- (SCSS > CSS Variables > Tailwind > CSS-in-JS)
60
+ 4. Component indexing → component-index.json (≤50 components, props/slots/classes, ≤2 min)
61
+ 5. Hooks/Types/Constants context-index.json
62
+ 6. Design token scan project-tokens.json (SCSS > CSS Variables > Tailwind > CSS-in-JS)
63
+ (all indexes under /tmp/{feature}/)
74
64
  ```
75
65
 
76
66
  ---
@@ -78,53 +68,41 @@ Code output: placed directly in the project directory
78
68
  ## Phase 1: Storyboard Analysis
79
69
 
80
70
  ```
81
- User input: enter URLs or PDF/images separated by newlines
82
-
83
- URL classification (automatic):
84
- Different fileKey → storyboard vs design
71
+ User input: URLs or PDF/images separated by newlines
72
+ URL classification (automatic): different fileKey → storyboard vs design;
85
73
  ROOT name contains "MO" → mobile, "PC" → desktop
86
74
 
87
- Storyboard analysis:
88
- Collect frames at depth=3 → classify by name pattern
75
+ Storyboard analysis: collect frames at depth=3 → classify by name pattern
89
76
  SPEC (functional definition) → CONFIG (resolution) → PAGE (main sections) → SHARED (common)
90
77
  PDF/images follow the same structural extraction
91
78
 
92
79
  ❌ No code file creation during Phase 1
93
80
 
94
- Output (text only):
95
- 1. Section list table (name, Figma name, height, description)
96
- 2. Functional definition per section ([Function] + [Interaction] + [State])
97
- 3. Common component list
98
- 4. TypeScript interface draft
81
+ Output (text only): section list table · per-section functional definition
82
+ ([Function] + [Interaction] + [State]) · common component list · TS interface draft
99
83
  ```
100
84
 
101
85
  ---
102
86
 
103
87
  ## Phase 2: Gather Materials ← Research (parallel)
104
88
 
105
- **→ Follow the rules of the vibe.figma.extract skill.**
89
+ **→ Follow the Extract Mode rules below.**
106
90
  **Coordinator pattern: run MO/PC extraction as parallel workers.**
107
91
 
108
92
  ```
109
93
  # [FIGMA_SCRIPT] = {{VIBE_PATH}}/hooks/scripts/figma-extract.js
110
94
 
111
- Simultaneous MO/PC extraction (each as an independent worker):
112
- Worker-MO: screenshottree images asset rendering sections/
113
- Worker-PC: screenshot → tree → images → asset rendering → sections/
114
- → Proceed to Phase 3 only after both workers have completed
115
-
95
+ Simultaneous MO/PC extraction each worker: screenshot tree → images →
96
+ asset renderingsections/. Proceed to Phase 3 only after both complete.
116
97
  Single BP: run sequentially with 1 worker
117
-
118
- Multi-frame (same BP, different pages):
119
- Sequential extraction (500ms interval), partial failure allowed
98
+ Multi-frame (same BP, different pages): sequential (500ms interval), partial failure allowed
120
99
  ```
121
100
 
122
101
  ---
123
102
 
124
103
  ## Phase 3: Data Refinement ← Synthesis (independent per BP)
125
104
 
126
- **Split and refine each BP's tree.json by section.**
127
- **MO↔PC matching (responsive) is NOT done at this stage.**
105
+ **Split and refine each BP's tree.json by section. MO↔PC matching is NOT done here.**
128
106
 
129
107
  ### BLOCKING Command — Writing custom refine scripts is strictly forbidden
130
108
 
@@ -145,76 +123,49 @@ node {{VIBE_PATH}}/hooks/scripts/figma-refine.js \
145
123
  ```
146
124
 
147
125
  ⛔ **Phase 4 is blocked until these commands are executed.**
148
- ⛔ **Do NOT write custom refine scripts** (refine-sections.mjs, refine.js, etc. all forbidden)
149
- **Do NOT parse tree.json directly with Python/Node to produce sections.json**
150
- ✅ Use only the output of figma-refine.js. If the output is unsatisfactory, modify figma-refine.js.
151
-
152
- ### Core Principles
126
+ ⛔ **No custom refine scripts, no parsing tree.json directly to produce sections.json.**
127
+ Use only figma-refine.js output. If unsatisfactory, modify figma-refine.js.
153
128
 
154
129
  ```
155
- ⛔ Refine each BP independently. Do NOT mix MO and PC.
156
- ⛔ The refined JSON is the sole input for Phase 4.
157
- ⛔ The full subtree (recursive children) for each section must be included.
130
+ ⛔ Refine each BP independently do NOT mix MO and PC.
131
+ ⛔ The refined JSON (full recursive subtree per section) is the sole input for Phase 4.
158
132
  ```
159
133
 
160
134
  ### Output
161
135
 
162
136
  ```
163
- /tmp/{feature}/
164
- mo-main/
165
- sections.json ← MO refinement result
166
- pc-main/
167
- sections.json ← PC refinement result
137
+ /tmp/{feature}/{mo,pc}-main/sections.json ← per-BP refinement result
168
138
 
169
139
  sections.json structure:
170
140
  {
171
- meta: { feature, designWidth, bp (the corresponding BP) },
172
- sections: [
173
- {
174
- name: "Hero",
175
- nodeId, name, type, size, css,
176
- text, // TEXT nodes only
177
- imageRef, // image fill
178
- fills, // multiple fills (2 or more)
179
- layoutSizingH, // HUG/FILL/FIXED
180
- layoutSizingV,
181
- children: [ // ⛔ full recursive subtree — down to leaf nodes
182
- { nodeId, name, type, size, css, children: [...] }
183
- ],
184
- images: {
185
- bg: "bg/hero-bg.webp",
186
- content: ["content/hero-title.webp"]
187
- }
188
- }
189
- ]
141
+ meta: { feature, designWidth, bp },
142
+ sections: [{
143
+ name: "Hero", nodeId, type, size, css,
144
+ text, imageRef, fills, layoutSizingH, layoutSizingV,
145
+ children: [ ... ], // ⛔ full recursive subtree — down to leaf nodes
146
+ images: { bg: "bg/hero-bg.webp", content: ["content/hero-title.webp"] }
147
+ }]
190
148
  }
191
149
  ```
192
150
 
193
- ### Node Refinement Rules
194
-
195
- ```
196
- Refinement applied when converting tree.json → sections.json:
197
- 1. Nodes with size 0px → remove
198
- 2. VECTOR decorative lines (w/h ≤ 2px) → remove
199
- 3. isMask nodes → remove
200
- 4. BG frames → separate from children, move to images.bg
201
- 5. Vector-text GROUPs → separate from children, add to images.content
202
- 6. Design text (TEXT with multiple/gradient fills or effects) → add to images.content
203
- 7. Remaining nodes → keep in children (with CSS, recursive)
204
- ```
205
-
206
- ### Multi-frame (same BP, different pages)
151
+ ### Node Refinement Rules (tree.json → sections.json)
207
152
 
208
153
  ```
209
- Identify common elements extract shared components
210
- Union of common tokens shared _tokens.scss
154
+ 1. size-0px nodes, VECTOR decorative lines (w/h ≤ 2px), isMask nodes → remove
155
+ 2. BG framesseparate from children, move to images.bg
156
+ 3. Vector-text GROUPs + design text (TEXT with multiple/gradient fills or effects)
157
+ → separate from children, add to images.content
158
+ 4. Remaining nodes → keep in children (with CSS, recursive)
159
+
160
+ Multi-frame (same BP, different pages): identify common elements → shared components;
161
+ union of common tokens → shared _tokens.scss
211
162
  ```
212
163
 
213
164
  ---
214
165
 
215
166
  ## Phase 4: Per-BP Static Implementation ← Implement (sequential per BP)
216
167
 
217
- **→ Follow the rules of the vibe.figma.convert skill.**
168
+ **→ Follow the Convert Mode rules below.**
218
169
  **⛔ Implement MO fully first → pass verification → then implement PC. No responsive conversion.**
219
170
  **⛔ CSS values must use Figma original px as-is. vw conversion, clamp, @media are forbidden.**
220
171
 
@@ -233,44 +184,32 @@ node {{VIBE_PATH}}/hooks/scripts/figma-validate.js \
233
184
  --section={SectionName}
234
185
  ```
235
186
 
236
- ⛔ **Writing SCSS files directly without calling figma-to-scss.js invalidates Phase 4.**
237
- ⛔ **Do NOT write custom SCSS generation scripts** (to-scss.mjs, generate-scss.js, etc. — all forbidden)
187
+ ⛔ **Writing SCSS directly (or via custom generation scripts) invalidates Phase 4.**
238
188
  ⛔ **Do NOT proceed to the next section without a figma-validate.js PASS.**
239
- ⛔ **Do NOT write CSS values directly inside scoped style blocks** — only @import of external SCSS files is allowed.
189
+ ⛔ **No CSS values inside scoped style blocks** — only @import/@use of external SCSS files.
240
190
  ✅ Use figma-to-scss.js output as-is. If unsatisfactory, modify figma-to-scss.js.
241
191
 
242
192
  ```
243
- Phase 4A: MO Static Implementation
244
- Input: /tmp/{feature}/mo-main/sections.json
193
+ Phase 4A: MO Static Implementation (input: mo-main/sections.json)
245
194
  ⛔ No parallelism. Process one section at a time:
246
195
  1. Read the target section from sections.json
247
- 2. Write an image vs HTML classification table (BLOCKING)
196
+ 2. Write an image vs HTML classification table (BLOCKING — see Convert Mode §C1)
248
197
  3. figma-to-scss.js → auto-generate SCSS skeleton (px as-is) — Step A once
249
198
  4. Claude: HTML structure + semantic tags + layout + interactions (Vue/React files only)
250
- No CSS written directly in <style> blocks only @import or @use allowed
251
- 5. figma-validate.js compare SCSS vs sections.json — Step B
252
- ├─ PASS → next section
253
- └─ FAIL → fix discrepancies → re-run step 5 (repeat until P1=0, no round cap)
199
+ 5. figma-validate.js Step B: PASS next section FAIL fix → re-run
200
+ (repeat until P1=0, no round cap)
254
201
  → Phase 5 (MO compile) → Phase 6 (MO visual verification)
255
202
 
256
- Phase 4B: PC Static Implementation
257
- Input: /tmp/{feature}/pc-main/sections.json
258
- Same process as MO
259
- → Phase 5 (PC compile) → Phase 6 (PC visual verification)
203
+ Phase 4B: PC Static Implementation (input: pc-main/sections.json)
204
+ Same process as MO → Phase 5 (PC compile) → Phase 6 (PC visual verification)
260
205
 
261
206
  Phase 4C: Responsive Integration (after both MO+PC pass verification)
262
207
  → Separate flow to be established (TODO)
263
208
 
264
- Claude's role (restricted):
265
- Image classification: BG / content / decoration / vector-text
266
- HTML semantics: section/h1/p/button tag selection
267
- Component splitting: v-for repetition, shared components
268
- ✅ Interactions: @click, state variables, conditional rendering
269
- ✅ Execute figma-to-scss.js / figma-validate.js commands
270
- ❌ Do NOT modify SCSS CSS values (use figma-to-scss.js output as-is)
271
- ❌ Do NOT write CSS directly in <style> blocks
272
- ❌ Do NOT use vw conversion, clamp, @media, or create custom functions/mixins
273
- ❌ Do NOT write custom refine/generate scripts (refine.mjs, to-scss.mjs, etc.)
209
+ Claude's role (restricted): semantic decisions only (Convert Mode §C3) + image classification
210
+ + executing figma-to-scss.js / figma-validate.js.
211
+ No modifying SCSS values, no CSS in <style> blocks, no vw/clamp/@media,
212
+ no custom functions/mixins, no custom refine/generate scripts.
274
213
 
275
214
  SCSS Setup (before the first section):
276
215
  index.scss, _tokens.scss, _base.scss
@@ -291,35 +230,29 @@ Multi-frame:
291
230
  ```
292
231
  No round cap. Loop until compile succeeds (or stuck → ask user).
293
232
 
294
- 0. Capture baseline (before Phase 4): record existing tsc + build errors
295
- → Phase 5 only fixes NEW errors
296
-
233
+ 0. Capture baseline (before Phase 4): record existing tsc + build errors → fix NEW errors only
297
234
  1. TypeScript: vue-tsc/svelte-check/tsc --noEmit
298
235
  2. Build: npm run build (120s timeout)
299
236
  3. Dev server: npm run dev → detect port → polling
300
237
 
301
238
  On error: parse → auto-fix → re-check
302
- Termination conditions:
239
+ Termination:
303
240
  ✅ Success: all checks pass → enter Phase 6
304
- ⚠️ Stuck: same errors as previous round → ask user
305
- 1. Provide direct fix instructions retry next round
306
- 2. "proceed" — record remaining errors as TODO, proceed to Phase 6
307
- 3. "abort" — halt workflow
308
- ultrawork mode: on stuck, record TODO without prompting and proceed to Phase 6
241
+ ⚠️ Stuck (same errors as previous round) → ask user: fix instructions │ "proceed"
242
+ (record TODO, go to Phase 6) "abort". ultrawork: record TODO + proceed silently.
309
243
 
310
244
  On completion: preserve dev server PID → used in Phase 6
311
245
 
312
- ⛔ After Phase 5 passes (or user proceeds), must enter Phase 6. Do NOT output a "completion summary".
313
- Do NOT declare work complete without Phase 6.
246
+ ⛔ After Phase 5 passes (or user proceeds), must enter Phase 6.
247
+ Do NOT output a "completion summary" or declare work complete without Phase 6.
314
248
  ```
315
249
 
316
250
  ---
317
251
 
318
252
  ## Phase 6: Visual Verification Loop ← Verify (parallel) MANDATORY
319
253
 
320
- **⛔ Phase 6 is mandatory, not optional. Enter automatically upon Phase 5 completion.**
321
- **⛔ If Phase 6 is skipped, the entire task is considered "incomplete".**
322
- **Coordinator pattern: independent per-section verification can be run as parallel workers.**
254
+ **⛔ Mandatory enter automatically upon Phase 5 completion; skipping = task "incomplete".**
255
+ **Coordinator pattern: independent per-section verification can run as parallel workers.**
323
256
 
324
257
  ```
325
258
  No round cap. Loop until P1=0 (or stuck → ask user).
@@ -332,18 +265,12 @@ Infrastructure: src/infra/lib/browser/ (Puppeteer + CDP)
332
265
  3. Check for missing images and text
333
266
  4. Fix P1 issues first (refer to tree.json, no guessing) → revalidate compile → reload
334
267
 
335
- Narrowing scope (noise reduction):
336
- Round 1: P1+P2+P3 all
337
- Round 2: P1+P2
338
- Round 3+: P1 only (continue until P1=0)
268
+ Narrowing scope: Round 1 P1+P2+P3 → Round 2 P1+P2 → Round 3+ P1 only (until P1=0)
339
269
 
340
- Termination conditions:
270
+ Termination:
341
271
  ✅ Success: P1 = 0 AND no new findings → complete
342
- ⚠️ Stuck: same findings as previous round → ask user
343
- 1. Provide direct resolution retry next round
344
- 2. "proceed" — record remaining issues as TODO, complete
345
- 3. "abort" — halt workflow
346
- ultrawork mode: on stuck, record TODO without prompting and complete
272
+ ⚠️ Stuck (same findings as previous round) → ask user: direct resolution │ "proceed"
273
+ (record TODO, complete) │ "abort". ultrawork: record TODO + complete silently.
347
274
 
348
275
  Responsive: after MO verification, change viewport → same loop against PC screenshots
349
276
  Cleanup: shut down browser + dev server
@@ -353,12 +280,177 @@ Cleanup: shut down browser + dev server
353
280
 
354
281
  ---
355
282
 
283
+ ## Extract Mode (Phase 2 body) — Acquire Code Generation Data
284
+
285
+ Uses the Figma REST API (`src/infra/lib/figma/`) to extract **all data needed for structural code generation**. Priority: 1st node tree + CSS (PRIMARY source) → 2nd image assets → 3rd screenshots (Phase 6 validation only, never for generation).
286
+
287
+ ### E1. Node Tree + CSS — Source of Truth
288
+
289
+ ```
290
+ Bash:
291
+ node "{{VIBE_PATH}}/hooks/scripts/figma-extract.js" tree {fileKey} {nodeId}
292
+
293
+ Returns (FigmaNode JSON):
294
+ { nodeId, name, type, size, css: { display, flexDirection, gap, ... },
295
+ text (TEXT only), imageRef, imageScaleMode (FILL/FIT/CROP/TILE),
296
+ layoutSizingH/V (FIXED/HUG/FILL), fills (only when 2+), isMask,
297
+ raw: { itemSpacing, padding*, cornerRadius, strokeWeight, strokeAlign, blendMode,
298
+ opacity, fontSize, lineHeightPx, letterSpacing, fontWeight, leadingTrim,
299
+ textBoxTrim }, ← Figma numbers for Phase 6 raw-vs-computed reconciliation
300
+ warnings: [{ property, value, severity: "P1"|"P2", reason }], ← translation-loss only
301
+ children: [...] }
302
+
303
+ Root node also carries:
304
+ auditSummary: { total, p1, p2, items: [{ nodeId, name, property, value, severity, reason }] }
305
+
306
+ → Save to /tmp/{feature}/tree.json
307
+
308
+ Figma property → CSS mapping (what the extractor auto-converts): rubrics/css-mapping.md
309
+ ```
310
+
311
+ ### E2. Translation-loss Audit (Figma → CSS Incompatibilities)
312
+
313
+ The extractor flags properties CSS cannot reproduce cleanly (per-node `warnings[]`, rolled up as root `auditSummary`).
314
+
315
+ **P1 (block Phase 3 until resolved or waived):** `strokeAlign` ≠ `CENTER` (CSS border only renders centered strokes) · `blendMode` ∈ { `LINEAR_BURN`, `LINEAR_DODGE`, `PLUS_DARKER`, `PLUS_LIGHTER` } (no CSS equivalent).
316
+
317
+ **P2 (record + proceed):** `leadingTrim`/`textBoxTrim` ≠ `NONE` (limited `text-box-trim` support) · `constraints` ∈ { `SCALE`, `CENTER` } (no direct CSS layout mapping) · `individualStrokeWeights` with `strokeAlign` ≠ `CENTER`.
318
+
319
+ **Gate rule:** if `auditSummary.p1 > 0`, resolve each item (replace layer in Figma, accept approximation with user sign-off, or mark as known deviation) before Phase 3. Log P2 items into feature notes for Phase 6 reviewer attention.
320
+
321
+ ### E3. Image Assets — Node Rendering Based
322
+
323
+ Full determination rules and real-world failure cases: `rubrics/image-rules.md`.
324
+
325
+ ```
326
+ Do NOT download imageRef individually (shared texture fill → multi-MB originals).
327
+ All images are rendered as nodes:
328
+ node "{{VIBE_PATH}}/hooks/scripts/figma-extract.js" screenshot {fileKey} {nodeId} --out=...
329
+
330
+ BG frames → bg/{section}-bg.webp
331
+ Identification: name contains "BG"/"bg", OR same size as parent (±10%) + 3+ child images
332
+ Content nodes → content/{name}.webp
333
+ Icons (VECTOR/GROUP ≤ 64px) · item/reward/token/coin thumbnails
334
+ · vector-text GROUPs (3+ VECTORs, each <60px)
335
+ · design text (TEXT with 2+ fills, effects, GRADIENT fill, or non-web-font fontFamily)
336
+ → must be rendered; placed as <img alt="text content">, never CSS text
337
+ · decorative panels (textured backgrounds) → render like BG frames
338
+
339
+ imageRef download is a fallback only (API failure, DOCUMENT level); >5MB → texture-fill warning.
340
+ Screenshots (validation only): full-screenshot.webp + per 1-depth child → sections/{name}.webp
341
+ ```
342
+
343
+ ### E4. Extraction Completion Validation (Required Before Phase 3)
344
+
345
+ ```
346
+ If any item is missing → re-extract (do NOT proceed to Phase 3)
347
+
348
+ 1. tree.json exists + root children > 0 · 2. BG per section exists in bg/
349
+ 3. Every design-text TEXT node (2+ fills or effects) rendered in content/
350
+ 4. Every vector-text GROUP (3+ VECTORs) rendered in content/
351
+ 5. Per-section validation screenshots exist in sections/ · 6. All filenames kebab-case
352
+ ```
353
+
354
+ ---
355
+
356
+ ## Convert Mode (Phase 4 body) — Tree-Based Structured Code Generation
357
+
358
+ **Mechanically map sections.json to HTML. Do not guess.**
359
+ **Claude handles only semantic decisions (tag selection, component separation, interactions). SCSS comes from figma-to-scss.js (Phase 4 blocking commands).**
360
+
361
+ ### C0. Reuse Check (Before Writing Code)
362
+
363
+ ```
364
+ Matching component in component-index.json?
365
+ ✅ Import and customize via props — do not create a new one
366
+ ❌ Never modify an existing component's internals or duplicate a 90%-similar one
367
+ ```
368
+
369
+ ### C1. Image vs HTML Determination (BLOCKING)
370
+
371
+ ```
372
+ ⛔ Before writing code: write the determination table first.
373
+
374
+ YES on any one → HTML:
375
+ Q1. TEXT children? · Q2. repeating INSTANCE? (→ v-for, inner assets only as <img>)
376
+ Q3. interactive? (btn, CTA → <button>) · Q4. dynamic data? (price, quantity, duration)
377
+ All NO → image rendering is acceptable
378
+
379
+ ⛔ Design text (Q1 exception — must be image; D1–D5, same as Extract Mode E3):
380
+ D1. 2+ fills · D2. effects (DROP_SHADOW, stroke) · D3. GRADIENT fill
381
+ D4. parent GROUP/FRAME has 3+ VECTORs · D5. fontFamily not in project web fonts
382
+ → <img src="content/{section}-{name}.webp" alt="text content"> — no CSS text attempt
383
+
384
+ BG frames: ❌ no <img> tags — parent SCSS background-image only
385
+ .section { background-image: url('bg.webp'); background-size: cover; }
386
+ ```
387
+
388
+ ### C2. Node → HTML Mapping (Mechanical)
389
+
390
+ ```
391
+ FRAME + Auto Layout → <div> + flex (direction/gap/padding directly mapped)
392
+ FRAME + no Auto Layout → <div> + position:relative (children absolute)
393
+ TEXT → <span> (Claude promotes to h2/p/button)
394
+ IMAGE fill (passed determination) → <img>
395
+ VECTOR/GROUP ≤64px → icon <img>
396
+ INSTANCE repeated 2+ → v-for / .map()
397
+ Size 0px, VECTOR ≤2px → skip
398
+ ```
399
+
400
+ CSS property mapping reference (grounding for figma-to-scss.js output review, plus legacy vw/responsive rules): `rubrics/css-mapping.md` — Phase 4 forbids hand-writing these values.
401
+
402
+ ### C3. Claude Semantic Decisions (The Only Inference Area)
403
+
404
+ ```
405
+ 1. Tag promotion: <span> → <h2> (section title) / <p> (description) / <button> (clickable)
406
+ 2. Component separation: 1st-depth children = sections, INSTANCE repetition = shared
407
+ 3. Interactions: @click handlers, state variables, conditional rendering
408
+ 4. Accessibility: decorative → alt="" aria-hidden="true" · content → alt="description"
409
+ · interactive → role, aria-label
410
+ 5. Semantic HTML: top-level <section>, heading order h1~h6, lists <ul>/<ol>
411
+ ```
412
+
413
+ Component skeleton template: `templates/component.md`.
414
+
415
+ ### C4. SCSS File Structure
416
+
417
+ ```
418
+ layout/ → position, display, flex, width, height, padding, gap, overflow, z-index
419
+ components/ → font, color, border, shadow, opacity, background
420
+ _base.scss → .{feature} { width: 100%; max-width: 720px; margin: 0 auto; overflow-x: hidden; }
421
+ _tokens.scss → reference existing tokens (@use); if no mapping, create a new
422
+ feature-scoped token ($feature-color-xxx)
423
+ ```
424
+
425
+ ### C5. Self-Validation
426
+
427
+ ```
428
+ ⛔ Any failure → rewrite that section's code (do not proceed to the next section)
429
+
430
+ 1. All template classes defined in SCSS · 2. Image src files actually exist
431
+ 3. Auto Layout node → flex present in SCSS
432
+ 4. ⛔ No @function/@mixin defined in SCSS (existing token @use is allowed)
433
+ 5. ⛔ Every SCSS property grounded in sections.json css object
434
+ (aspect-ratio, container queries, etc. not in the tree → FAIL)
435
+ 6. ⛔ Image filenames kebab-case (hash filenames like 68ad470b.webp → FAIL)
436
+ ```
437
+
438
+ ---
439
+
356
440
  ## Error Recovery
357
441
 
358
442
  | Failure | Recovery |
359
443
  |---------|----------|
360
- | figma-extract.js script error | Check Node.js version (>=18 required). Verify Figma API token in config. Retry once. |
361
- | figma-to-scss.js parse failure | Validate input tree.json structure. If malformed, re-run extract phase. |
362
- | figma-validate.js comparison failure | Skip automated validation, present screenshot side-by-side for manual review |
363
- | Puppeteer/CDP not available | Skip visual verification phase, rely on manual browser check |
364
- | Figma API rate limit (429) | Wait 60s and retry. If persistent, reduce node scope. |
444
+ | figma-extract.js script error | Node.js >=18? API token in config? Retry once. |
445
+ | Figma API 401 | Prompt user to set FIGMA_ACCESS_TOKEN in env or ~/.vibe/config.json |
446
+ | Figma API 404 | Verify fileKey from URL; check file is shared/accessible |
447
+ | Figma API 429 (rate limit) | Wait 60s, retry with reduced node scope (single page) |
448
+ | API timeout on large file | Split request by page via nodeId parameter |
449
+ | Screenshot download failure | Proceed with tree.json only (visual verification → manual) |
450
+ | tree.json missing in Phase 4 | Run Extract Mode (Phase 2) first |
451
+ | component-index.json missing | Generate minimal index from tree.json section names |
452
+ | sections.json malformed | Regenerate from tree.json via figma-refine.js |
453
+ | SCSS output empty | Check sections.json for valid style nodes; else default reset styles |
454
+ | figma-to-scss.js parse failure | Validate tree.json structure; if malformed, re-run Extract Mode |
455
+ | figma-validate.js comparison failure | Skip automated validation; screenshot side-by-side manual review |
456
+ | Puppeteer/CDP not available | Skip visual verification; manual browser check |