@su-record/vibe 2.16.3 → 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 (353) hide show
  1. package/.env.example +15 -0
  2. package/CLAUDE.md +8 -8
  3. package/README.en.md +46 -29
  4. package/README.md +41 -24
  5. package/agents/acceptance-tester.md +56 -0
  6. package/agents/architect.md +25 -67
  7. package/agents/build-error-resolver.md +28 -97
  8. package/agents/code-reviewer.md +89 -0
  9. package/agents/diagrammer.md +34 -165
  10. package/agents/documenter.md +43 -0
  11. package/agents/e2e-tester.md +46 -277
  12. package/agents/event/event-ops.md +54 -77
  13. package/agents/event/event-planner.md +63 -0
  14. package/agents/figma/figma-engineer.md +76 -0
  15. package/agents/implementer.md +26 -41
  16. package/agents/security-reviewer.md +56 -0
  17. package/agents/tester.md +37 -33
  18. package/agents/ui/design-reviewer.md +62 -0
  19. package/agents/ui/design-system-gen.md +63 -0
  20. package/dist/__tests__/agent-model-sync.test.d.ts +2 -0
  21. package/dist/__tests__/agent-model-sync.test.d.ts.map +1 -0
  22. package/dist/__tests__/agent-model-sync.test.js +71 -0
  23. package/dist/__tests__/agent-model-sync.test.js.map +1 -0
  24. package/dist/cli/auth.d.ts.map +1 -1
  25. package/dist/cli/auth.js +8 -1
  26. package/dist/cli/auth.js.map +1 -1
  27. package/dist/cli/commands/index.d.ts +1 -0
  28. package/dist/cli/commands/index.d.ts.map +1 -1
  29. package/dist/cli/commands/index.js +1 -0
  30. package/dist/cli/commands/index.js.map +1 -1
  31. package/dist/cli/commands/info.d.ts.map +1 -1
  32. package/dist/cli/commands/info.js +2 -0
  33. package/dist/cli/commands/info.js.map +1 -1
  34. package/dist/cli/commands/llm.d.ts +11 -0
  35. package/dist/cli/commands/llm.d.ts.map +1 -0
  36. package/dist/cli/commands/llm.js +62 -0
  37. package/dist/cli/commands/llm.js.map +1 -0
  38. package/dist/cli/commands/remove.d.ts.map +1 -1
  39. package/dist/cli/commands/remove.js +8 -10
  40. package/dist/cli/commands/remove.js.map +1 -1
  41. package/dist/cli/commands/setup.d.ts.map +1 -1
  42. package/dist/cli/commands/setup.js +35 -1
  43. package/dist/cli/commands/setup.js.map +1 -1
  44. package/dist/cli/index.d.ts +0 -4
  45. package/dist/cli/index.d.ts.map +1 -1
  46. package/dist/cli/index.js +59 -6
  47. package/dist/cli/index.js.map +1 -1
  48. package/dist/cli/llm/config.d.ts.map +1 -1
  49. package/dist/cli/llm/config.js +7 -0
  50. package/dist/cli/llm/config.js.map +1 -1
  51. package/dist/cli/llm/index.d.ts +1 -0
  52. package/dist/cli/llm/index.d.ts.map +1 -1
  53. package/dist/cli/llm/index.js +1 -0
  54. package/dist/cli/llm/index.js.map +1 -1
  55. package/dist/cli/llm/model-refresh.d.ts +29 -0
  56. package/dist/cli/llm/model-refresh.d.ts.map +1 -0
  57. package/dist/cli/llm/model-refresh.js +139 -0
  58. package/dist/cli/llm/model-refresh.js.map +1 -0
  59. package/dist/cli/llm/zai-commands.d.ts +15 -0
  60. package/dist/cli/llm/zai-commands.d.ts.map +1 -0
  61. package/dist/cli/llm/zai-commands.js +64 -0
  62. package/dist/cli/llm/zai-commands.js.map +1 -0
  63. package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
  64. package/dist/cli/postinstall/claude-agents.js +16 -77
  65. package/dist/cli/postinstall/claude-agents.js.map +1 -1
  66. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  67. package/dist/cli/postinstall/constants.js +81 -296
  68. package/dist/cli/postinstall/constants.js.map +1 -1
  69. package/dist/cli/postinstall/cursor-agents.d.ts +5 -0
  70. package/dist/cli/postinstall/cursor-agents.d.ts.map +1 -1
  71. package/dist/cli/postinstall/cursor-agents.js +26 -68
  72. package/dist/cli/postinstall/cursor-agents.js.map +1 -1
  73. package/dist/cli/postinstall/cursor-skills.d.ts.map +1 -1
  74. package/dist/cli/postinstall/cursor-skills.js +26 -30
  75. package/dist/cli/postinstall/cursor-skills.js.map +1 -1
  76. package/dist/cli/postinstall/main.d.ts.map +1 -1
  77. package/dist/cli/postinstall/main.js +0 -2
  78. package/dist/cli/postinstall/main.js.map +1 -1
  79. package/dist/cli/setup/Provisioner.d.ts.map +1 -1
  80. package/dist/cli/setup/Provisioner.js +19 -21
  81. package/dist/cli/setup/Provisioner.js.map +1 -1
  82. package/dist/cli/types.d.ts +15 -0
  83. package/dist/cli/types.d.ts.map +1 -1
  84. package/dist/cli/utils.d.ts +4 -1
  85. package/dist/cli/utils.d.ts.map +1 -1
  86. package/dist/cli/utils.js +4 -1
  87. package/dist/cli/utils.js.map +1 -1
  88. package/dist/infra/lib/FrameworkDetector.js +4 -4
  89. package/dist/infra/lib/FrameworkDetector.js.map +1 -1
  90. package/dist/infra/lib/OrchestrateWorkflow.js +2 -2
  91. package/dist/infra/lib/OrchestrateWorkflow.js.map +1 -1
  92. package/dist/infra/lib/browser/launch.js +1 -1
  93. package/dist/infra/lib/browser/launch.js.map +1 -1
  94. package/dist/infra/lib/browser/types.d.ts +1 -1
  95. package/dist/infra/lib/browser/types.js +1 -1
  96. package/dist/infra/lib/config/GlobalConfigManager.d.ts +2 -0
  97. package/dist/infra/lib/config/GlobalConfigManager.d.ts.map +1 -1
  98. package/dist/infra/lib/config/GlobalConfigManager.js +6 -0
  99. package/dist/infra/lib/config/GlobalConfigManager.js.map +1 -1
  100. package/dist/infra/lib/constants.d.ts +1 -1
  101. package/dist/infra/lib/constants.d.ts.map +1 -1
  102. package/dist/infra/lib/constants.js +4 -5
  103. package/dist/infra/lib/constants.js.map +1 -1
  104. package/dist/infra/lib/evolution/__tests__/integration.test.js +7 -7
  105. package/dist/infra/lib/evolution/__tests__/integration.test.js.map +1 -1
  106. package/dist/infra/lib/llm-availability.d.ts +4 -0
  107. package/dist/infra/lib/llm-availability.d.ts.map +1 -1
  108. package/dist/infra/lib/llm-availability.js +9 -1
  109. package/dist/infra/lib/llm-availability.js.map +1 -1
  110. package/dist/infra/lib/memory/index.d.ts +0 -2
  111. package/dist/infra/lib/memory/index.d.ts.map +1 -1
  112. package/dist/infra/lib/memory/index.js +0 -2
  113. package/dist/infra/lib/memory/index.js.map +1 -1
  114. package/dist/infra/lib/telemetry/SkillTelemetry.test.js +1 -1
  115. package/dist/infra/lib/telemetry/SkillTelemetry.test.js.map +1 -1
  116. package/dist/infra/lib/zai/client.d.ts +30 -0
  117. package/dist/infra/lib/zai/client.d.ts.map +1 -0
  118. package/dist/infra/lib/zai/client.js +124 -0
  119. package/dist/infra/lib/zai/client.js.map +1 -0
  120. package/dist/infra/lib/zai/index.d.ts +11 -0
  121. package/dist/infra/lib/zai/index.d.ts.map +1 -0
  122. package/dist/infra/lib/zai/index.js +10 -0
  123. package/dist/infra/lib/zai/index.js.map +1 -0
  124. package/dist/infra/lib/zai/orchestration.d.ts +15 -0
  125. package/dist/infra/lib/zai/orchestration.d.ts.map +1 -0
  126. package/dist/infra/lib/zai/orchestration.js +54 -0
  127. package/dist/infra/lib/zai/orchestration.js.map +1 -0
  128. package/dist/infra/lib/zai/types.d.ts +40 -0
  129. package/dist/infra/lib/zai/types.d.ts.map +1 -0
  130. package/dist/infra/lib/zai/types.js +5 -0
  131. package/dist/infra/lib/zai/types.js.map +1 -0
  132. package/dist/infra/orchestrator/SmartRouter.d.ts.map +1 -1
  133. package/dist/infra/orchestrator/SmartRouter.js +16 -34
  134. package/dist/infra/orchestrator/SmartRouter.js.map +1 -1
  135. package/dist/infra/orchestrator/index.d.ts +1 -0
  136. package/dist/infra/orchestrator/index.d.ts.map +1 -1
  137. package/dist/infra/orchestrator/index.js +11 -9
  138. package/dist/infra/orchestrator/index.js.map +1 -1
  139. package/dist/infra/orchestrator/types.d.ts +32 -9
  140. package/dist/infra/orchestrator/types.d.ts.map +1 -1
  141. package/dist/infra/orchestrator/types.js +68 -37
  142. package/dist/infra/orchestrator/types.js.map +1 -1
  143. package/dist/infra/orchestrator/types.test.d.ts +2 -0
  144. package/dist/infra/orchestrator/types.test.d.ts.map +1 -0
  145. package/dist/infra/orchestrator/types.test.js +57 -0
  146. package/dist/infra/orchestrator/types.test.js.map +1 -0
  147. package/dist/tools/index.d.ts +0 -4
  148. package/dist/tools/index.d.ts.map +1 -1
  149. package/dist/tools/index.js +0 -4
  150. package/dist/tools/index.js.map +1 -1
  151. package/dist/tools/memory/autoSaveContext.d.ts +0 -1
  152. package/dist/tools/memory/autoSaveContext.d.ts.map +1 -1
  153. package/dist/tools/memory/autoSaveContext.js +13 -27
  154. package/dist/tools/memory/autoSaveContext.js.map +1 -1
  155. package/hooks/scripts/__tests__/code-check-detectors.test.js +2 -2
  156. package/hooks/scripts/__tests__/run-ledger.test.js +1 -1
  157. package/hooks/scripts/__tests__/scope-from-spec.test.js +12 -12
  158. package/hooks/scripts/__tests__/step-counter.test.js +1 -1
  159. package/hooks/scripts/code-check.js +16 -203
  160. package/hooks/scripts/context-save.js +0 -11
  161. package/hooks/scripts/lib/scope-from-spec.js +9 -6
  162. package/hooks/scripts/llm-orchestrate.js +49 -0
  163. package/hooks/scripts/post-edit-dispatcher.js +1 -1
  164. package/hooks/scripts/prompt-dispatcher.js +7 -18
  165. package/hooks/scripts/session-start.js +25 -35
  166. package/package.json +4 -4
  167. package/skills/agents-md/SKILL.md +62 -15
  168. package/skills/arch-guard/SKILL.md +1 -1
  169. package/skills/brand-assets/SKILL.md +2 -2
  170. package/skills/capability-loop/SKILL.md +1 -1
  171. package/skills/chub-usage/SKILL.md +1 -1
  172. package/skills/commerce-patterns/SKILL.md +2 -2
  173. package/skills/commit-push-pr/SKILL.md +0 -1
  174. package/skills/context7-usage/SKILL.md +1 -1
  175. package/skills/create-prd/agents/edge-case-finder.md +4 -4
  176. package/skills/create-prd/agents/prioritizer.md +4 -4
  177. package/skills/create-prd/agents/requirements-writer.md +3 -3
  178. package/skills/create-prd/agents/researcher.md +3 -3
  179. package/skills/create-prd/agents/reviewer.md +3 -3
  180. package/skills/create-prd/orchestrator.md +2 -0
  181. package/skills/design-refine/SKILL.md +140 -0
  182. package/skills/{design-polish → design-refine}/templates/polish-report.md +1 -1
  183. package/skills/{design-normalize → design-refine}/templates/token-audit.md +3 -3
  184. package/skills/design-review/SKILL.md +143 -0
  185. package/skills/{design-audit → design-review}/agents/a11y-auditor.md +1 -1
  186. package/skills/{design-audit → design-review}/agents/performance-auditor.md +1 -1
  187. package/skills/{design-audit → design-review}/agents/responsive-auditor.md +1 -1
  188. package/skills/{design-audit → design-review}/agents/slop-detector.md +1 -1
  189. package/skills/{design-audit → design-review}/frameworks/core-web-vitals.md +1 -1
  190. package/skills/{design-audit → design-review}/frameworks/wcag-checklist.md +1 -1
  191. package/skills/{design-audit → design-review}/orchestrator.md +5 -3
  192. package/skills/{design-critique → design-review}/templates/critique-report.md +3 -3
  193. package/skills/{design-audit → design-review}/templates/report.md +3 -3
  194. package/skills/design-teach/SKILL.md +11 -11
  195. package/skills/docs/SKILL.md +14 -16
  196. package/skills/e2e-commerce/SKILL.md +1 -1
  197. package/skills/event-comms/SKILL.md +1 -1
  198. package/skills/event-ops/SKILL.md +2 -2
  199. package/skills/event-planning/SKILL.md +1 -1
  200. package/skills/exec-plan/SKILL.md +2 -2
  201. package/skills/exec-plan/orchestrator.md +2 -0
  202. package/skills/figma/SKILL.md +240 -148
  203. package/skills/figma/rubrics/css-mapping.md +125 -0
  204. package/skills/git-worktree/SKILL.md +1 -1
  205. package/skills/handoff/SKILL.md +1 -1
  206. package/skills/parallel-research/SKILL.md +14 -28
  207. package/skills/parallel-research/orchestrator.md +2 -0
  208. package/skills/priority-todos/SKILL.md +1 -1
  209. package/skills/regress/SKILL.md +11 -0
  210. package/skills/restraint/SKILL.md +72 -0
  211. package/skills/seo-checklist/SKILL.md +2 -2
  212. package/skills/spec/SKILL.md +65 -836
  213. package/skills/test/SKILL.md +3 -3
  214. package/skills/tool-fallback/SKILL.md +2 -2
  215. package/skills/vercel-react-best-practices/SKILL.md +1 -1
  216. package/skills/vibe/SKILL.md +20 -35
  217. package/skills/vibe.analyze/SKILL.md +7 -9
  218. package/skills/vibe.docs/SKILL.md +1 -1
  219. package/skills/vibe.event/SKILL.md +27 -27
  220. package/skills/vibe.figma/SKILL.md +14 -18
  221. package/skills/vibe.harness/SKILL.md +5 -5
  222. package/skills/vibe.llm/SKILL.md +50 -0
  223. package/skills/vibe.reason/SKILL.md +0 -2
  224. package/skills/vibe.review/SKILL.md +45 -49
  225. package/skills/vibe.run/SKILL.md +2 -5
  226. package/skills/vibe.run/references/parallel-agents.md +33 -98
  227. package/skills/vibe.spec/SKILL.md +38 -535
  228. package/skills/vibe.utils/SKILL.md +3 -3
  229. package/skills/vibe.verify/SKILL.md +70 -542
  230. package/skills/video-production/SKILL.md +1 -1
  231. package/vibe/rules/orchestrator-contract.md +57 -0
  232. package/vibe/rules/quality/performance.md +1 -1
  233. package/vibe/templates/claudemd-template.md +1 -1
  234. package/vibe/templates/spec-template.md +35 -185
  235. package/agents/architect-low.md +0 -41
  236. package/agents/architect-medium.md +0 -59
  237. package/agents/compounder.md +0 -261
  238. package/agents/docs/api-documenter.md +0 -99
  239. package/agents/docs/changelog-writer.md +0 -93
  240. package/agents/event/event-comms.md +0 -78
  241. package/agents/event/event-content.md +0 -68
  242. package/agents/event/event-image.md +0 -95
  243. package/agents/event/event-scheduler.md +0 -69
  244. package/agents/event/event-speaker.md +0 -86
  245. package/agents/explorer-low.md +0 -42
  246. package/agents/explorer-medium.md +0 -59
  247. package/agents/explorer.md +0 -48
  248. package/agents/figma/figma-analyst.md +0 -52
  249. package/agents/figma/figma-architect.md +0 -112
  250. package/agents/figma/figma-auditor.md +0 -82
  251. package/agents/figma/figma-builder.md +0 -100
  252. package/agents/implementer-low.md +0 -43
  253. package/agents/implementer-medium.md +0 -52
  254. package/agents/junior-mentor.md +0 -141
  255. package/agents/planning/requirements-analyst.md +0 -84
  256. package/agents/planning/ux-advisor.md +0 -83
  257. package/agents/qa/acceptance-tester.md +0 -86
  258. package/agents/qa/edge-case-finder.md +0 -93
  259. package/agents/qa/qa-coordinator.md +0 -131
  260. package/agents/refactor-cleaner.md +0 -143
  261. package/agents/research/best-practices.md +0 -199
  262. package/agents/research/codebase-patterns.md +0 -157
  263. package/agents/research/framework-docs.md +0 -188
  264. package/agents/research/security-advisory.md +0 -213
  265. package/agents/review/architecture-reviewer.md +0 -107
  266. package/agents/review/complexity-reviewer.md +0 -116
  267. package/agents/review/data-integrity-reviewer.md +0 -88
  268. package/agents/review/git-history-reviewer.md +0 -103
  269. package/agents/review/performance-reviewer.md +0 -86
  270. package/agents/review/python-reviewer.md +0 -150
  271. package/agents/review/rails-reviewer.md +0 -139
  272. package/agents/review/react-reviewer.md +0 -144
  273. package/agents/review/security-reviewer.md +0 -80
  274. package/agents/review/simplicity-reviewer.md +0 -140
  275. package/agents/review/test-coverage-reviewer.md +0 -116
  276. package/agents/review/typescript-reviewer.md +0 -127
  277. package/agents/searcher.md +0 -54
  278. package/agents/simplifier.md +0 -120
  279. package/agents/teams/debug-team.md +0 -70
  280. package/agents/teams/dev-team.md +0 -88
  281. package/agents/teams/docs-team.md +0 -80
  282. package/agents/teams/figma-team.md +0 -85
  283. package/agents/teams/fullstack-team.md +0 -83
  284. package/agents/teams/lite-team.md +0 -69
  285. package/agents/teams/migration-team.md +0 -78
  286. package/agents/teams/refactor-team.md +0 -94
  287. package/agents/teams/research-team.md +0 -86
  288. package/agents/teams/review-debate-team.md +0 -125
  289. package/agents/teams/security-team.md +0 -81
  290. package/agents/ui/ui-a11y-auditor.md +0 -93
  291. package/agents/ui/ui-antipattern-detector.md +0 -102
  292. package/agents/ui/ui-dataviz-advisor.md +0 -69
  293. package/agents/ui/ui-design-system-gen.md +0 -57
  294. package/agents/ui/ui-industry-analyzer.md +0 -49
  295. package/agents/ui/ui-layout-architect.md +0 -65
  296. package/agents/ui/ui-stack-implementer.md +0 -68
  297. package/agents/ui/ux-compliance-reviewer.md +0 -81
  298. package/agents/ui-previewer.md +0 -258
  299. package/hooks/scripts/__tests__/keyword-detector.test.js +0 -242
  300. package/hooks/scripts/keyword-detector.js +0 -226
  301. package/skills/characterization-test/SKILL.md +0 -209
  302. package/skills/characterization-test/agents/behavior-capturer.md +0 -50
  303. package/skills/characterization-test/agents/coverage-checker.md +0 -54
  304. package/skills/characterization-test/agents/reporter.md +0 -50
  305. package/skills/characterization-test/agents/test-writer.md +0 -49
  306. package/skills/characterization-test/rubrics/coverage-criteria.md +0 -53
  307. package/skills/characterization-test/templates/test-template.ts +0 -101
  308. package/skills/claude-md-guide/SKILL.md +0 -353
  309. package/skills/claude-md-guide/rubrics/anti-patterns.md +0 -88
  310. package/skills/design-audit/SKILL.md +0 -154
  311. package/skills/design-critique/SKILL.md +0 -140
  312. package/skills/design-distill/SKILL.md +0 -131
  313. package/skills/design-normalize/SKILL.md +0 -135
  314. package/skills/design-polish/SKILL.md +0 -132
  315. package/skills/figma-convert/SKILL.md +0 -236
  316. package/skills/figma-extract/SKILL.md +0 -242
  317. package/skills/interview/SKILL.md +0 -358
  318. package/skills/interview/checklists/api.md +0 -101
  319. package/skills/interview/checklists/feature.md +0 -88
  320. package/skills/interview/checklists/library.md +0 -95
  321. package/skills/interview/checklists/mobile.md +0 -89
  322. package/skills/interview/checklists/webapp.md +0 -97
  323. package/skills/interview/checklists/website.md +0 -99
  324. package/skills/plan/SKILL.md +0 -254
  325. package/skills/rob-pike/SKILL.md +0 -66
  326. package/skills/spec/references/askuser-examples.md +0 -57
  327. package/skills/spec/references/example-session.md +0 -87
  328. package/skills/spec/references/templates.md +0 -194
  329. package/skills/spec-review/SKILL.md +0 -725
  330. package/skills/systematic-debugging/SKILL.md +0 -142
  331. package/skills/techdebt/SKILL.md +0 -126
  332. package/skills/techdebt/agents/analyzer.md +0 -50
  333. package/skills/techdebt/agents/fixer.md +0 -41
  334. package/skills/techdebt/agents/reviewer.md +0 -47
  335. package/skills/techdebt/agents/scanner.md +0 -44
  336. package/skills/techdebt/orchestrator.md +0 -70
  337. package/skills/techdebt/rubrics/severity.md +0 -51
  338. package/skills/techdebt/scripts/scan.js +0 -90
  339. package/skills/techdebt/templates/report.md +0 -86
  340. package/skills/typescript-advanced-types/SKILL.md +0 -68
  341. package/skills/typescript-advanced-types/rubrics/type-patterns.md +0 -109
  342. package/skills/yagni-ladder/SKILL.md +0 -90
  343. /package/skills/{claude-md-guide → agents-md}/templates/claude-md.md +0 -0
  344. /package/skills/{design-polish → design-refine}/rubrics/polish-checklist.md +0 -0
  345. /package/skills/{design-normalize → design-refine}/rubrics/token-naming.md +0 -0
  346. /package/skills/{design-distill → design-refine}/templates/design-system.md +0 -0
  347. /package/skills/{design-audit → design-review}/agents/scorer.md +0 -0
  348. /package/skills/{design-audit → design-review}/rubrics/ai-slop-patterns.md +0 -0
  349. /package/skills/{design-audit → design-review}/rubrics/scoring.md +0 -0
  350. /package/skills/{design-critique → design-review}/rubrics/ux-heuristics.md +0 -0
  351. /package/skills/{figma-convert → figma}/rubrics/conversion-rules.md +0 -0
  352. /package/skills/{figma-extract → figma}/rubrics/image-rules.md +0 -0
  353. /package/skills/{figma-convert → figma}/templates/component.md +0 -0
@@ -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 |