@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
@@ -1,236 +0,0 @@
1
- ---
2
- name: figma-convert
3
- description: Figma tree → 구조적 코드 변환 + 스크린샷 검증 본체.
4
- when_to_use: figma 체인에서 호출. 직접 호출 금지.
5
- user-invocable: false
6
- tier: standard
7
- ---
8
-
9
- # vibe.figma.convert — Tree-Based Structured Code Generation
10
-
11
- **Mechanically map tree.json to HTML+CSS. Do not guess.**
12
- **Claude handles only semantic decisions (tag selection, component separation, interactions).**
13
-
14
- ---
15
-
16
- ## 0. Reuse Check (Before Writing Code)
17
-
18
- ```
19
- If there is a matching component in component-index.json:
20
- ✅ Import and use it (do not create a new one)
21
- ✅ Customize via props
22
- ❌ Modify the internals of an existing component
23
- ❌ Create a new one when 90% similar already exists
24
- ```
25
-
26
- ---
27
-
28
- ## 1. Image vs HTML Determination (BLOCKING)
29
-
30
- ```
31
- ⛔ Before writing code: write the determination table first.
32
-
33
- Determination rules (YES on any one → HTML):
34
- Q1. Does it have TEXT children? → HTML
35
- Q2. Is it a repeating INSTANCE pattern? → HTML v-for (inner assets only as <img>)
36
- Q3. Is it an interactive element? (btn, CTA) → HTML <button>
37
- Q4. Is it dynamic data? (price, quantity, duration) → HTML text
38
- All NO → image rendering is acceptable
39
-
40
- ⛔ Design text determination (Q1 exception — text that must be rendered as image):
41
- If any of the following conditions are met → image rendering (HTML text forbidden):
42
- D1. TEXT node has 2 or more fills (gradient + solid overlap)
43
- D2. TEXT node has effects (DROP_SHADOW, stroke, etc.)
44
- D3. TEXT node fills contain a GRADIENT type
45
- D4. Parent GROUP/FRAME has 3 or more VECTORs (vector text)
46
- D5. TEXT node fontFamily is not in the project's web fonts
47
-
48
- → Render node as content/{section}-{name}.webp
49
- → Place in HTML as <img src="..." alt="text content">
50
- → Do not attempt CSS text implementation (visual quality cannot be guaranteed)
51
-
52
- BG frames:
53
- ❌ No <img> tags
54
- ✅ Parent SCSS background-image only:
55
- .section { background-image: url('bg.webp'); background-size: cover; }
56
- ```
57
-
58
- ---
59
-
60
- ## 2. Node → HTML Mapping (Mechanical)
61
-
62
- ```
63
- FRAME + Auto Layout → <div> + flex (direction/gap/padding directly mapped)
64
- FRAME + no Auto Layout → <div> + position:relative (children absolute)
65
- TEXT → <span> (Claude promotes to h2/p/button)
66
- IMAGE fill (passed determination) → <img>
67
- VECTOR/GROUP ≤64px → icon <img>
68
- INSTANCE repeated 2+ → v-for / .map()
69
- Size 0px, VECTOR ≤2px → skip
70
- ```
71
-
72
- ---
73
-
74
- ## 3. CSS Property Direct Mapping
75
-
76
- ```
77
- ⛔ Immutable rule: do not create CSS properties not present in tree.json.
78
- ⛔ No custom functions/mixins: no self-defined abstractions like wp-fluid(), wp-bg-layer, etc.
79
- ⛔ No CSS properties not in tree.json such as aspect-ratio, container query, etc.
80
- ✅ Only direct 1:1 mapping from tree.json css object → SCSS is allowed.
81
- ✅ The only transformation: px → vw (mechanically, using the formula).
82
-
83
- Layout (layout/ files):
84
- display, flex-direction, justify-content, align-items, gap,
85
- flex-grow, padding, width, height, overflow, position, top, left, transform
86
-
87
- Visual (components/ files):
88
- background-color, background-image, background-blend-mode, color,
89
- font-family, font-size, font-weight, line-height, letter-spacing,
90
- text-align, text-transform, text-overflow,
91
- border-radius, border, outline, box-sizing, box-shadow,
92
- opacity, mix-blend-mode, filter, backdrop-filter
93
-
94
- If a value is absent → omit that property (no guessing)
95
-
96
- ❌ Forbidden patterns:
97
- aspect-ratio: 720 / 1280; → ❌ (tree.json has width+height)
98
- @function wp-fluid(...) { ... } → ❌ (custom function)
99
- @include wp-bg-layer; → ❌ (custom mixin)
100
- clamp(12px, 2.5vw, 18px); → ❌ (guessing values not in tree.json)
101
-
102
- ✅ Correct patterns:
103
- width: 100vw; height: 177.78vw; → ✅ (720px/720×100, 1280px/720×100)
104
- background-image: url('hero-bg.webp'); background-size: cover; → ✅
105
- font-size: 5.56vw; → ✅ (40px/720×100)
106
- ```
107
-
108
- ### Responsive Unit Conversion
109
-
110
- ```
111
- vw conversion (use only the mechanical formula):
112
- width, height, padding, gap, border-radius, box-shadow, top, left, border-width
113
- vw value = (Figma px / designWidth) × 100
114
- ⛔ clamp, min(), max() etc. are allowed only for font-size
115
-
116
- Font → clamp(min, vw, max):
117
- | Role | Min | Determination Basis |
118
- |---------|-------|-----------------------------|
119
- | h1~h2 | 16px | name contains "title" |
120
- | h3~h4 | 14px | medium size |
121
- | Body | 12px | long text |
122
- | Caption | 10px | small fontSize |
123
- | Button | 12px | name contains "btn" |
124
- max value = original Figma px as-is
125
-
126
- Properties not converted:
127
- color, opacity, font-weight, font-family, z-index, text-align,
128
- mix-blend-mode, transform(rotate), background-blend-mode,
129
- flex-grow, box-sizing, grayscale/saturate, background-image(gradient)
130
-
131
- layoutSizing handling:
132
- HUG → omit width/height (auto)
133
- FILL → check parent direction:
134
- FILL in same direction → flex: 1 0 0
135
- FILL on cross axis → align-self: stretch
136
- FIXED → vw conversion
137
-
138
- imageScaleMode:
139
- FILL → background-size: cover
140
- FIT → background-size: contain
141
- CROP → background-size: cover; background-position: center
142
- TILE → background-size: auto; background-repeat: repeat
143
- ```
144
-
145
- ---
146
-
147
- ## 4. Claude Semantic Decisions (The Only Inference Area)
148
-
149
- ```
150
- 1. HTML tag promotion:
151
- <span> → <h2> (section title), <p> (description), <button> (clickable)
152
-
153
- 2. Component separation:
154
- 1st-depth children = section components, INSTANCE repetition = shared components
155
-
156
- 3. Interactions: @click handlers, state variables, conditional rendering
157
-
158
- 4. Accessibility:
159
- Background/decorative → alt="" aria-hidden="true"
160
- Content → alt="description"
161
- Interactive → role, aria-label
162
-
163
- 5. Semantic HTML:
164
- Top-level <section>, heading order h1~h6, lists <ul>/<ol>
165
- ```
166
-
167
- ---
168
-
169
- ## 5. SCSS File Structure
170
-
171
- ```
172
- layout/ → position, display, flex, width, height, padding, gap, overflow, z-index
173
- components/ → font, color, border, shadow, opacity, background
174
-
175
- _base.scss:
176
- .{feature} { width: 100%; max-width: 720px; margin: 0 auto; overflow-x: hidden; }
177
-
178
- _tokens.scss:
179
- Reference existing tokens (@use) → if no mapping, create a new token
180
- Feature-scoped naming ($feature-color-xxx)
181
- ```
182
-
183
- ---
184
-
185
- ## 6. Responsive (MO↔PC)
186
-
187
- ```
188
- Use remapped.json's pcDiff to add @media overrides.
189
- Do not delete the base MO code.
190
-
191
- .section {
192
- // MO base (vw = px / 720 × 100)
193
- height: 177.78vw;
194
-
195
- @media (min-width: #{$bp-desktop}) {
196
- // PC diff only (vw = px / 2560 × 100)
197
- height: 32.66vw;
198
- }
199
- }
200
-
201
- diff handling:
202
- Same value → keep MO only
203
- Different px → @media { PC vw }
204
- Different layout → @media { flex-direction: row }
205
- Different image → @media { background-image: url(pc-xxx.webp) }
206
- layoutSizing diff → @media { flex/width change }
207
- ```
208
-
209
- ---
210
-
211
- ## 7. Self-Validation
212
-
213
- ```
214
- ⛔ Any failure → rewrite that section's code (do not proceed to the next section)
215
-
216
- 1. Class names: all classes in template are defined in SCSS → OK
217
- 2. Image paths: src file actually exists → OK
218
- 3. Tree mapping: Auto Layout node → flex present in SCSS → OK
219
- 4. ⛔ No abstractions: no @function or @mixin defined in SCSS → OK
220
- (project existing token @use is allowed; creating new functions/mixins is forbidden)
221
- 5. ⛔ Property mapping: all SCSS properties are grounded in tree.json css object → OK
222
- (aspect-ratio, container, custom properties etc. not in tree.json → FAIL)
223
- 6. ⛔ Image filenames: kebab-case naming → OK
224
- (hash filenames like 68ad470b.webp etc. → FAIL)
225
- ```
226
-
227
- ---
228
-
229
- ## Error Recovery
230
-
231
- | Failure | Recovery |
232
- |---------|----------|
233
- | tree.json missing | Prompt user to run extract phase first: load `vibe.figma.extract` skill |
234
- | component-index.json missing | Generate minimal index from tree.json section names |
235
- | sections.json malformed | Re-read tree.json and regenerate sections.json from scratch |
236
- | SCSS output empty | Check tree.json for valid style nodes. If none found, use default reset styles. |
@@ -1,242 +0,0 @@
1
- ---
2
- name: figma-extract
3
- description: Figma REST API로 코드 생성 데이터 수집 — tree(주) + 이미지 + 스크린샷(검증).
4
- when_to_use: figma 체인에서 호출. 직접 호출 금지.
5
- user-invocable: false
6
- tier: standard
7
- ---
8
-
9
- # vibe.figma.extract — Acquire Code Generation Data
10
-
11
- Uses the Figma REST API (`src/infra/lib/figma/`) to extract **all data needed for structural code generation**.
12
-
13
- ```
14
- Extraction priority:
15
- 1st: Node tree + CSS (PRIMARY source for code generation)
16
- 2nd: Image assets (fill images + item node rendering)
17
- 3rd: Screenshots (for Phase 6 visual validation — not used for code generation)
18
- ```
19
-
20
- ---
21
-
22
- ## 1. Node Tree + CSS — Source of Truth for Code Generation
23
-
24
- ```
25
- Bash:
26
- node "{{VIBE_PATH}}/hooks/scripts/figma-extract.js" tree {fileKey} {nodeId}
27
-
28
- Returns (FigmaNode JSON):
29
- {
30
- nodeId, name, type, size: { width, height },
31
- css: { display, flexDirection, gap, ... },
32
- text: "text content" (TEXT nodes only),
33
- imageRef: "abc123" (image fill),
34
- imageScaleMode: "FILL" (FILL/FIT/CROP/TILE),
35
- layoutSizingH: "HUG" (FIXED/HUG/FILL),
36
- layoutSizingV: "FILL",
37
- fills: [...] (only when 2 or more),
38
- isMask: true (mask nodes only),
39
- raw: { itemSpacing, paddingTop/..., cornerRadius, strokeWeight, strokeAlign,
40
- blendMode, opacity, fontSize, lineHeightPx, letterSpacing, fontWeight,
41
- leadingTrim, textBoxTrim }, ← numeric Figma values for Phase 6 raw-vs-computed reconciliation
42
- warnings: [ { property, value, severity: "P1"|"P2", reason } ], ← translation-loss only
43
- children: [...]
44
- }
45
-
46
- Root node also carries:
47
- auditSummary: { total, p1, p2, items: [{ nodeId, name, property, value, severity, reason }] }
48
-
49
- → Save to /tmp/{feature}/tree.json
50
- ```
51
-
52
- ### Translation-loss Audit (Figma → CSS Incompatibilities)
53
-
54
- The extractor flags properties Figma's native renderer supports but CSS cannot reproduce cleanly. These appear in each node's `warnings[]` and are rolled up at the root as `auditSummary`.
55
-
56
- **P1 (block Phase 3 until resolved or waived):**
57
- - `strokeAlign` ≠ `CENTER` — CSS border only renders centered strokes; INSIDE/OUTSIDE cannot match without box-sizing trade-offs.
58
- - `blendMode` ∈ { `LINEAR_BURN`, `LINEAR_DODGE`, `PLUS_DARKER`, `PLUS_LIGHTER` } — no CSS equivalent for `mix-blend-mode` / `background-blend-mode`.
59
-
60
- **P2 (record + proceed):**
61
- - `leadingTrim` / `textBoxTrim` ≠ `NONE` — `text-box-trim` has limited browser support (Firefox lacks it).
62
- - `constraints.horizontal|vertical` ∈ { `SCALE`, `CENTER` } — no direct CSS layout mapping; responsive behavior diverges.
63
- - `individualStrokeWeights` with `strokeAlign` ≠ `CENTER` — per-side border widths only align cleanly when stroke is centered.
64
-
65
- **Phase 2 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. P2 items should be logged into the feature notes for Phase 6 reviewer attention.
66
-
67
- ### Figma Property → CSS Direct Mapping Table
68
-
69
- Properties automatically converted by the tree extraction tool. **These values map directly to SCSS:**
70
-
71
- **Layout:**
72
-
73
- | Figma Property | CSS | vw conversion |
74
- |-----------|-----|---------|
75
- | `layoutMode=VERTICAL` | `display:flex; flex-direction:column` | No |
76
- | `layoutMode=HORIZONTAL` | `display:flex; flex-direction:row` | No |
77
- | `primaryAxisAlignItems` | `justify-content` | No |
78
- | `counterAxisAlignItems` | `align-items` | No |
79
- | `itemSpacing` | `gap` | Yes |
80
- | `layoutGrow=1` | `flex-grow: 1` | No |
81
- | `padding*` | `padding` | Yes |
82
- | `absoluteBoundingBox.width/height` | `width/height` | Yes |
83
- | `layoutPositioning=ABSOLUTE` | `position: absolute` + `top/left` (relative to parent) | Yes |
84
- | `layoutSizingHorizontal=HUG` | remove width (auto) | — |
85
- | `layoutSizingHorizontal=FILL` | metadata `layoutSizingH` (converter decides flex:1/100%) | — |
86
- | `layoutSizingVertical=HUG` | remove height (auto) | — |
87
- | `layoutSizingVertical=FILL` | metadata `layoutSizingV` (converter decides) | — |
88
- | `clipsContent` | `overflow: hidden` | No |
89
-
90
- **Visual:**
91
-
92
- | Figma Property | CSS | vw conversion |
93
- |-----------|-----|---------|
94
- | `fills[].SOLID` | `background-color` | No |
95
- | `fills[].IMAGE` | `imageRef` + `imageScaleMode` (FILL/FIT/CROP/TILE) | — |
96
- | `fills[].GRADIENT_LINEAR` | `background-image: linear-gradient(...)` | No |
97
- | `fills[].GRADIENT_RADIAL` | `background-image: radial-gradient(...)` | No |
98
- | `fills[] (2 or more)` | `fills` array (type, color, imageRef, gradient, blendMode, filters) | — |
99
- | `fills[].blendMode` | `background-blend-mode` | No |
100
- | `fills[].filters.saturation` | `filter: grayscale(X%)` / `saturate(X%)` | No |
101
- | `fills[].color` (TEXT) | `color` | No |
102
- | `strokes[] + strokeAlign=INSIDE` | `border` + `box-sizing: border-box` | Yes (width only) |
103
- | `strokes[] + strokeAlign=OUTSIDE` | `outline` | Yes (width only) |
104
- | `individualStrokeWeights` | `border-top/right/bottom/left` individually | Yes (width only) |
105
- | `strokeDashes` | `border-style: dashed` | No |
106
- | `effects[].DROP_SHADOW` | `box-shadow` | Yes (px only) |
107
- | `effects[].INNER_SHADOW` | `box-shadow` (inset) | Yes (px only) |
108
- | `effects[].LAYER_BLUR` | `filter: blur()` (accumulated) | Yes |
109
- | `effects[].BACKGROUND_BLUR` | `backdrop-filter: blur()` | Yes |
110
- | `cornerRadius` | `border-radius` | Yes |
111
- | `opacity` | `opacity` | No |
112
- | `rotation` | `transform: rotate(Xdeg)` | No |
113
- | `blendMode` (node level) | `mix-blend-mode` | No |
114
-
115
- **Text:**
116
-
117
- | Figma Property | CSS | vw conversion |
118
- |-----------|-----|---------|
119
- | `style.fontFamily` | `font-family` | No |
120
- | `style.fontSize` | `font-size` | Yes |
121
- | `style.fontWeight` | `font-weight` | No |
122
- | `style.lineHeightPx` | `line-height` | No |
123
- | `style.letterSpacing` | `letter-spacing` | Yes |
124
- | `style.textAlignHorizontal` | `text-align` | No |
125
- | `style.textCase` | `text-transform` | No |
126
- | `style.textTruncation` | `overflow: hidden; text-overflow: ellipsis` | No |
127
- | `style.paragraphSpacing` | `margin-bottom` | Yes |
128
- | `characters` | text content | — |
129
-
130
- ---
131
-
132
- ## 2. Image Assets — Node Rendering Based
133
-
134
- ```
135
- Do NOT download imageRef individually
136
- → If a texture fill is shared, the original texture (22.7MB) will be downloaded
137
- → Rendering the node produces the final result as applied to that node (364KB)
138
-
139
- All images must be rendered as nodes via the Figma screenshot API
140
- ```
141
-
142
- ### 2-1. BG Frame Rendering
143
-
144
- ```
145
- BG frame identification criteria:
146
- - name contains "BG" or "bg"
147
- - OR same size as parent (±10%) + 3 or more child images
148
-
149
- Rendering:
150
- node "{{VIBE_PATH}}/hooks/scripts/figma-extract.js" screenshot {fileKey} {bg.nodeId} --out=/tmp/{feature}/bg/{section}-bg.webp
151
- ```
152
-
153
- ### 2-2. Content Node Rendering
154
-
155
- ```
156
- Targets (identified from tree.json):
157
- - Icons (VECTOR/GROUP size ≤ 64px)
158
- - Item/reward thumbnails (name contains "item", "reward", "token", "coin")
159
- - Vector text GROUPs (3 or more VECTORs under parent, each <60px)
160
- - Design text (any of the following):
161
- · TEXT node with 2 or more fills (gradient + solid overlap)
162
- · TEXT node has effects (DROP_SHADOW, stroke)
163
- · TEXT node fills contain GRADIENT type
164
- · fontFamily not in project web fonts
165
- → Must be included in rendering targets
166
- - Decorative panels (wooden signs, metal plates, and other textured backgrounds)
167
- → Render the same way as BG frames
168
-
169
- Rendering:
170
- node "{{VIBE_PATH}}/hooks/scripts/figma-extract.js" screenshot {fileKey} {node.nodeId} --out=/tmp/{feature}/content/{name}.webp
171
- ```
172
-
173
- ### 2-3. imageRef Download (Fallback)
174
-
175
- ```
176
- Only when node rendering is not possible (API failure, DOCUMENT level):
177
- File size exceeds 5MB → texture fill warning
178
- ```
179
-
180
- ---
181
-
182
- ## 3. Screenshots — Reference for Phase 6 Validation
183
-
184
- ```
185
- Not used for code generation.
186
-
187
- Full: screenshot → /tmp/{feature}/full-screenshot.webp
188
- Per section: each 1-depth child → /tmp/{feature}/sections/{name}.webp
189
- ```
190
-
191
- ---
192
-
193
- ## 4. Extracted Data Summary
194
-
195
- ```
196
- /tmp/{feature}/
197
- ├── tree.json ← PRIMARY source
198
- ├── bg/ ← BG frame rendering
199
- ├── content/ ← Content node rendering
200
- ├── full-screenshot.webp ← For validation
201
- └── sections/ ← Per-section validation
202
-
203
- Image classification summary:
204
- | Category | Handling |
205
- |------|------|
206
- | BG frames | Frame rendering → bg/ |
207
- | Design text | Node rendering → content/ |
208
- | Vector text | GROUP rendering → content/ |
209
- | Content | Node rendering → content/ |
210
- | Decorative panels | Frame rendering → content/ |
211
- | Decorations | Included in BG rendering |
212
- ```
213
-
214
- ---
215
-
216
- ## 5. Extraction Completion Validation (Required Before Entering Phase 3)
217
-
218
- ```
219
- If any item is missing → re-extract (do NOT proceed to Phase 3)
220
-
221
- 1. tree.json exists + root node children > 0
222
- 2. BG for each section → file exists in bg/
223
- 3. Design text check:
224
- Traverse tree.json → generate list of TEXT nodes with 2 or more fills or effects
225
- → All such nodes must have rendering files in content/
226
- 4. Vector text check:
227
- GROUP with 3 or more VECTORs → rendering file exists in content/
228
- 5. Per-section validation screenshots → files exist in sections/
229
- 6. File naming convention: all kebab-case (no hash filenames)
230
- ```
231
-
232
- ---
233
-
234
- ## Error Recovery
235
-
236
- | Failure | Recovery |
237
- |---------|----------|
238
- | Figma API 401 (unauthorized) | Prompt user to set FIGMA_ACCESS_TOKEN in environment or ~/.vibe/config.json |
239
- | Figma API 404 (file not found) | Verify fileKey extracted from URL. Check if file is shared/accessible. |
240
- | Figma API 429 (rate limit) | Wait 60s, retry with reduced node scope (single page instead of full file) |
241
- | API timeout on large file | Split request by page — fetch one page at a time via nodeId parameter |
242
- | Screenshot download failure | Skip screenshot, proceed with tree.json only (mark visual verification as manual) |