@su-record/vibe 3.1.0 → 3.2.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 (123) hide show
  1. package/CLAUDE.md +2 -2
  2. package/README.en.md +6 -4
  3. package/README.md +5 -3
  4. package/dist/__tests__/wiring-integrity.test.d.ts +2 -0
  5. package/dist/__tests__/wiring-integrity.test.d.ts.map +1 -0
  6. package/dist/__tests__/wiring-integrity.test.js +160 -0
  7. package/dist/__tests__/wiring-integrity.test.js.map +1 -0
  8. package/dist/cli/commands/info.d.ts.map +1 -1
  9. package/dist/cli/commands/info.js +2 -1
  10. package/dist/cli/commands/info.js.map +1 -1
  11. package/dist/cli/commands/init.d.ts.map +1 -1
  12. package/dist/cli/commands/init.js +4 -2
  13. package/dist/cli/commands/init.js.map +1 -1
  14. package/dist/cli/index.js +102 -128
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
  17. package/dist/cli/postinstall/claude-agents.js +0 -5
  18. package/dist/cli/postinstall/claude-agents.js.map +1 -1
  19. package/dist/cli/postinstall/constants.d.ts +6 -0
  20. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  21. package/dist/cli/postinstall/constants.js +42 -60
  22. package/dist/cli/postinstall/constants.js.map +1 -1
  23. package/dist/cli/postinstall/inline-skills.js +2 -2
  24. package/dist/cli/postinstall/inline-skills.js.map +1 -1
  25. package/dist/cli/postinstall/main.d.ts.map +1 -1
  26. package/dist/cli/postinstall/main.js +2 -0
  27. package/dist/cli/postinstall/main.js.map +1 -1
  28. package/dist/cli/postinstall.d.ts +6 -1
  29. package/dist/cli/postinstall.d.ts.map +1 -1
  30. package/dist/cli/postinstall.js +6 -1
  31. package/dist/cli/postinstall.js.map +1 -1
  32. package/dist/cli/setup/GlobalInstaller.d.ts +1 -15
  33. package/dist/cli/setup/GlobalInstaller.d.ts.map +1 -1
  34. package/dist/cli/setup/GlobalInstaller.js +16 -115
  35. package/dist/cli/setup/GlobalInstaller.js.map +1 -1
  36. package/dist/cli/setup/GlobalInstaller.test.d.ts +2 -0
  37. package/dist/cli/setup/GlobalInstaller.test.d.ts.map +1 -0
  38. package/dist/cli/setup/GlobalInstaller.test.js +16 -0
  39. package/dist/cli/setup/GlobalInstaller.test.js.map +1 -0
  40. package/dist/cli/setup/ProjectSetup.js +2 -2
  41. package/dist/cli/setup/ProjectSetup.js.map +1 -1
  42. package/dist/cli/setup.d.ts +1 -1
  43. package/dist/cli/setup.d.ts.map +1 -1
  44. package/dist/cli/setup.js +1 -1
  45. package/dist/cli/setup.js.map +1 -1
  46. package/dist/infra/lib/SkillRepository.js +1 -1
  47. package/dist/infra/lib/evolution/__tests__/integration.test.js +0 -42
  48. package/dist/infra/lib/evolution/__tests__/integration.test.js.map +1 -1
  49. package/hooks/scripts/__tests__/.vibe/command-log.txt +3 -3
  50. package/hooks/scripts/__tests__/clone-behaviors.test.js +33 -1
  51. package/hooks/scripts/__tests__/code-check-memory-write.test.js +81 -0
  52. package/hooks/scripts/__tests__/step-counter.test.js +21 -0
  53. package/hooks/scripts/auto-format.js +2 -11
  54. package/hooks/scripts/auto-test.js +2 -11
  55. package/hooks/scripts/clone-extract.js +146 -10
  56. package/hooks/scripts/code-check.js +27 -55
  57. package/hooks/scripts/lib/glob.js +32 -0
  58. package/hooks/scripts/lib/hook-context.js +19 -2
  59. package/hooks/scripts/post-edit.js +2 -3
  60. package/hooks/scripts/prompt-dispatcher.js +1 -1
  61. package/hooks/scripts/scope-guard.js +3 -42
  62. package/hooks/scripts/sentinel-guard.js +5 -20
  63. package/hooks/scripts/session-start.js +2 -2
  64. package/hooks/scripts/step-counter.js +35 -57
  65. package/package.json +2 -3
  66. package/skills/clone/SKILL.md +10 -216
  67. package/skills/clone/references/capture-rules.md +48 -0
  68. package/skills/clone/references/legal-and-error-recovery.md +40 -0
  69. package/skills/clone/references/refine-rules.md +61 -0
  70. package/skills/clone/references/scaffold-phases.md +59 -0
  71. package/skills/clone/references/setup-and-layout.md +30 -0
  72. package/skills/docs/SKILL.md +39 -4
  73. package/skills/docs/references/api-docs-changelog.md +34 -0
  74. package/skills/docs/references/codemaps-output.md +23 -0
  75. package/{agents/diagrammer.md → skills/docs/references/diagram-spec.md} +2 -15
  76. package/skills/exec-plan/SKILL.md +1 -1
  77. package/skills/exec-plan/templates/plan.md +1 -1
  78. package/skills/handoff/SKILL.md +3 -3
  79. package/skills/handoff/templates/handoff.md +1 -1
  80. package/skills/vibe/SKILL.md +3 -2
  81. package/skills/vibe.analyze/SKILL.md +12 -249
  82. package/skills/vibe.analyze/references/output-templates.md +188 -0
  83. package/skills/vibe.analyze/references/quality-gate.md +93 -0
  84. package/skills/vibe.clone/SKILL.md +14 -1
  85. package/skills/vibe.continue/SKILL.md +32 -0
  86. package/skills/vibe.design/SKILL.md +23 -1
  87. package/skills/vibe.design/references/ui-preview.md +20 -0
  88. package/skills/vibe.docs/SKILL.md +4 -2
  89. package/skills/vibe.figma/SKILL.md +33 -260
  90. package/skills/vibe.figma/references/branch-phases.md +113 -0
  91. package/skills/vibe.figma/references/state-schema.md +42 -0
  92. package/skills/vibe.figma/references/step-algorithms.md +204 -0
  93. package/skills/vibe.image/SKILL.md +62 -0
  94. package/skills/vibe.image/references/image-generation-examples.md +39 -0
  95. package/skills/vibe.reason/SKILL.md +3 -183
  96. package/skills/vibe.reason/references/output-format-template.md +57 -0
  97. package/skills/vibe.reason/references/quality-rubrics.md +94 -0
  98. package/skills/vibe.reason/references/worked-example.md +45 -0
  99. package/skills/vibe.review/SKILL.md +13 -348
  100. package/skills/vibe.review/references/boundary-check.md +25 -0
  101. package/skills/vibe.review/references/output-template.md +74 -0
  102. package/skills/vibe.review/references/quality-gate.md +84 -0
  103. package/skills/vibe.review/references/race-mode.md +117 -0
  104. package/skills/vibe.review/references/worked-examples.md +94 -0
  105. package/vibe/templates/claudemd-template.md +1 -1
  106. package/agents/acceptance-tester.md +0 -56
  107. package/agents/documenter.md +0 -43
  108. package/agents/figma/figma-engineer.md +0 -76
  109. package/dist/cli/postinstall/index.d.ts +0 -23
  110. package/dist/cli/postinstall/index.d.ts.map +0 -1
  111. package/dist/cli/postinstall/index.js +0 -23
  112. package/dist/cli/postinstall/index.js.map +0 -1
  113. package/dist/cli/setup/index.d.ts +0 -9
  114. package/dist/cli/setup/index.d.ts.map +0 -1
  115. package/dist/cli/setup/index.js +0 -12
  116. package/dist/cli/setup/index.js.map +0 -1
  117. package/hooks/scripts/__tests__/.vibe/memories/memories.db +0 -0
  118. package/hooks/scripts/__tests__/.vibe/memories/memories.db-shm +0 -0
  119. package/hooks/scripts/__tests__/.vibe/memories/memories.db-wal +0 -0
  120. package/hooks/scripts/evolution-engine.js +0 -91
  121. package/hooks/scripts/hud-status.js +0 -321
  122. package/hooks/scripts/skill-injector.js +0 -83
  123. package/skills/vibe.utils/SKILL.md +0 -415
@@ -0,0 +1,113 @@
1
+ # Branch 1 / Branch 2 Phase Detail — Full Reference
2
+
3
+ > Loaded by vibe.figma SKILL.md Branch 1 (READ + 컨벤션) and Branch 2 (READ + 독립) phase bodies for the full elaboration beyond the `Load skill` call itself.
4
+
5
+ ## Branch 1 Phase 0 — URL 수집 + Design Context 로드
6
+
7
+ ```
8
+ 1. URL 수집 (스킬 진입 전)
9
+ - urlArgs.length > 0 → 그대로 figma 스킬에 전달 (인터랙티브 질문 생략)
10
+ - urlArgs.length == 0 → figma 스킬이 인터랙티브로 줄바꿈 입력 받음
11
+ ⚠ URL 분류(storyboard vs design, MO vs PC)는 스킬이 자동 처리 — router는 개입하지 않음
12
+ · fileKey 다름 → storyboard vs design
13
+ · ROOT 노드 name에 "MO"/"PC" → 디바이스 구분
14
+ ```
15
+
16
+ ```
17
+ 3. Design context 로드 (non-interactive 기본)
18
+ ⛔ design-teach 스킬을 자동으로 로드하지 말 것 (인터랙티브라 흐름이 끊김)
19
+
20
+ 알고리즘:
21
+ - Read .vibe/design-context.json
22
+ - 존재 → 메모리에 binding 후 계속
23
+ - 없음 → 다음 한 줄만 출력하고 계속:
24
+ "💡 design-context.json 없음 — 기본값으로 진행합니다.
25
+ 톤/팔레트/타이포 가이드를 적용하려면 /design-teach 또는
26
+ /vibe.figma --teach 로 다시 실행하세요."
27
+ ```
28
+
29
+ ## Branch 1 Phase 1 — Storyboard 분석 상세
30
+
31
+ ```
32
+ Phase 0에서 수집한 URL 중 "storyboard"로 자동 분류된 항목이 있으면 분석.
33
+ 없으면 이 Phase는 자동 SKIP (스킬 내부 처리).
34
+
35
+ → 섹션 목록 + 기능 정의 + TypeScript 인터페이스 초안
36
+ ❌ 코드 파일 생성 금지
37
+ ```
38
+
39
+ ## Branch 1 Phase 2 — Audit Gate
40
+
41
+ ```
42
+ Phase 0에서 수집한 URL 중 "design"으로 자동 분류된 항목 (MO/PC)을 사용.
43
+ → tree.json + bg/ + content/ + sections/ (검증용)
44
+
45
+ 🚦 Audit gate (tree.json 루트 `auditSummary` 사용):
46
+ - `auditSummary.p1 > 0` → Phase 3 진입 금지. 각 항목을 해결(디자인 레이어 교체,
47
+ 근사치 수용 승인, 알려진 편차로 기록) 후 재추출.
48
+ - P2 항목은 피처 노트에 기록 → Phase 6 리뷰 대상.
49
+ ```
50
+
51
+ ## Branch 1 Phase 4 — 재사용 매칭 (BLOCKING)
52
+
53
+ ```
54
+ 재사용 매칭 (BLOCKING):
55
+ ① component-index.json 매칭 → import (새로 만들지 않음)
56
+ ② project-tokens.json 매칭 → @use (새 토큰 생성 최소화)
57
+
58
+ ⛔ figma-to-scss.js 강제 / figma-validate.js PASS 없이 다음 섹션 금지
59
+ ```
60
+
61
+ ## Branch 1 Phase 6 — Raw-vs-Computed 재조정 + Phase 6.5
62
+
63
+ ```
64
+ Raw-vs-computed 재조정:
65
+ - tree.json 각 노드의 `raw` 필드(itemSpacing, padding*, fontSize, lineHeightPx,
66
+ letterSpacing, strokeWeight, cornerRadius 등 Figma 원본 수치)를
67
+ 브라우저 `getComputedStyle`과 비교한다.
68
+ - 허용 오차 초과 시 P1 issue (gap/padding 0.5px, fontSize 0.25px, lineHeight 0.5px).
69
+ - Figma MCP/변환기가 삼킨 값이 여기서 드러난다.
70
+ ```
71
+
72
+ ```
73
+ ⤵ Phase 6.5 (hasEmitDesignMd == true 시)
74
+ → resolved tokens (Color/Typography/Spacing) + design-review(audit) 산출물을
75
+ DESIGN.md (Stitch 9 섹션) 으로 정제해 프로젝트 루트에 저장
76
+ → 첫 줄: `<!-- design-md-version: 1 -->`
77
+ → `vibe.design lint` 자동 통과 확인
78
+ ```
79
+
80
+ ## Branch 2 Phase 0 — Setup (Lite)
81
+
82
+ ```
83
+ 1. URL 수집 — Branch 1 Phase 0와 동일 (urlArgs 있으면 전달, 없으면 인터랙티브)
84
+
85
+ 2. Load skill `figma` — Phase 0 Setup
86
+ → 스택만 감지. 디렉토리 생성.
87
+ ⛔ component-index.json 인덱싱 SKIP
88
+ ⛔ project-tokens.json 스캔 SKIP
89
+ (재사용 매칭을 강제하지 않으므로 인덱스 불필요)
90
+ ```
91
+
92
+ ## Branch 2 Phase 4 — Standalone 모드 세부
93
+
94
+ ```
95
+ ⛔ 재사용 매칭 SKIP — 새 컴포넌트 자유 생성
96
+ ✅ 새 토큰 자유 생성 (피처 스코프 네이밍: $feature-color-xxx)
97
+ ✅ figma-to-scss.js / figma-validate.js는 그대로 강제
98
+
99
+ ❌ design-refine(normalize) 호출 금지 (이 Branch는 토큰 alignment 대상이 아님)
100
+ ```
101
+
102
+ ## Branch 2 Phase 6 — 시각 검증 + a11y 세부
103
+
104
+ ```
105
+ Raw-vs-computed 재조정: Branch 1과 동일 — tree.json `raw` ↔ getComputedStyle 비교.
106
+ ```
107
+
108
+ ```
109
+ ⤵ Phase 6.5 (hasEmitDesignMd == true 시)
110
+ → resolved tokens + design-review(audit) 산출물을
111
+ DESIGN.md (Stitch 9 섹션) 으로 정제해 프로젝트 루트에 저장
112
+ → 첫 줄: `<!-- design-md-version: 1 -->`
113
+ ```
@@ -0,0 +1,42 @@
1
+ # Figma Create State — Full Reference
2
+
3
+ > Loaded by vibe.figma SKILL.md Branch 3 Step B for the full state JSON schema, wireHash/designHash rationale, and reuse/reject algorithm.
4
+
5
+ ```
6
+ 스키마:
7
+ {
8
+ "feature": "<feature>",
9
+ "fileKey": "<figma fileKey>",
10
+ "createdAt": "<ISO-8601>",
11
+ "updatedAt": "<ISO-8601>",
12
+ "planHash": "<sha256 of plan.md content>",
13
+ "sections": [
14
+ {
15
+ "name": "<섹션 이름 (plan.md 8번 표 기준)>",
16
+ "bp": "mo" | "pc",
17
+ "wireNodeId": "<figma nodeId of wireframe frame>", // Step D 결과
18
+ "designNodeId": "<figma nodeId of styled frame>", // Step E 결과 (없으면 null)
19
+ "wireHash": "<sha256 of plan.md 8번 row — 레이아웃 키>",
20
+ "designHash": "<sha256 of plan.md 7번+8번+9번 row — 비주얼 키>",
21
+ "createdAt": "<ISO-8601>",
22
+ "updatedAt": "<ISO-8601>"
23
+ }
24
+ ]
25
+ }
26
+
27
+ ⚠ wireHash와 designHash를 분리하는 이유:
28
+ - plan.md 8번(레이아웃)만 변경 → wire 재생성 + design 재생성
29
+ - plan.md 7번(Look & Feel)만 변경 → wire SKIP + design만 재생성
30
+ - 둘 다 변경 안 됨 → 둘 다 cached
31
+
32
+ 알고리즘:
33
+ - hasNewState == true → 기존 state 무시, 빈 state로 시작 (이전 nodeId 참조 안 함)
34
+ - 파일 없음 → 빈 state 생성 (sections: []), Step D부터 모두 신규 생성
35
+ - 존재 + state.fileKey != 입력 fileKey → ❌ 거부:
36
+ "이 plan.md는 다른 Figma 파일({state.fileKey})에 매핑돼 있습니다.
37
+ 다른 파일에 새로 그리려면 --new-state 플래그를 추가하거나
38
+ /tmp/{feature}/figma-create-state.json 을 삭제하세요."
39
+ - 존재 + state.fileKey == 입력 fileKey → reuse 모드:
40
+ · planHash 비교: 다르면 "plan.md가 수정됐습니다. 변경된 섹션만 update 진행" 안내
41
+ · sections 매칭은 Step D(wireHash) / Step E(designHash)에서 각각 결정
42
+ ```
@@ -0,0 +1,204 @@
1
+ # Branch 3 (WRITE) Step Algorithms — Full Reference
2
+
3
+ > Loaded by vibe.figma SKILL.md Branch 3 (`--create*`) Step A/B/C/D/D↔E gate/E/F bodies for the full incremental/idempotent algorithms, message templates, and checklists.
4
+
5
+ ## createMode별 실행 매트릭스
6
+
7
+ | Step | full | storyboard | design |
8
+ |---|---|---|---|
9
+ | A. plan.md 파싱 | ✅ | ✅ | ✅ |
10
+ | B. target file + state 로드 | ✅ | ✅ | ✅ |
11
+ | C. 디자인 시스템 발견 | ✅ | ⛔ SKIP (와이어는 컴포넌트 불필요) | ✅ |
12
+ | D. 와이어프레임 생성 | ✅ | ✅ | ⛔ SKIP |
13
+ | 🚪 Step D ↔ E 검토 게이트 | ✅ | ⛔ (Step E 없음) | ⛔ (Step D 없음) |
14
+ | E. 본 디자인 적용 | ✅ | ⛔ SKIP | ✅ (분기 동작, 아래 참조) |
15
+ | F. 시각 검증 | ✅ (full) | ✅ (wire 대상, 구조 체크만) | ✅ (design 대상) |
16
+
17
+ ## createMode Matrix — `design` mode Step E branching (summary)
18
+
19
+ **`createMode == design`의 Step E 동작 (결함 없는 실행을 위한 분기)**:
20
+
21
+ - state.sections 가 **완전히 비어있음** (hasNewState 또는 첫 실행)
22
+ → 각 섹션별로 새 frame 생성 후 **곧바로** 컴포넌트 배치 (와이어 placeholder 단계 통째로 생략)
23
+ → 이 경로에서는 wireNodeId == designNodeId 가 됨 (같은 노드, 한 번에 완성)
24
+ - state.sections 에 **일부 섹션의 wireNodeId 가 존재**
25
+ → 존재하는 섹션: 기존 wireNodeId 위에 덮어쓰기 (full 모드의 E와 동일)
26
+ → 없는 섹션: ❌ reject "이 섹션({섹션명})은 와이어가 없습니다.
27
+ `--create-storyboard` 로 먼저 와이어를 만들거나, `--create` (full)로 호출하세요.
28
+ 빈 state에서 처음부터 design 모드로 그리려면 `--new-state` 를 추가하세요."
29
+
30
+ ## Step A — plan.md 파싱 (Read {mdArg} 필수 추출 섹션)
31
+
32
+ ```
33
+ 1. Read {mdArg}
34
+ 필수 추출 섹션:
35
+ - "## 1. 개요" → 페이지 이름/목적
36
+ - "## 7. Look & Feel" → 분위기, 컬러, 타이포, 레퍼런스, 인터랙션
37
+ - "## 8. 레이아웃/섹션 구성" → 섹션 순서, 목적, 핵심 콘텐츠
38
+ - "## 9. 반응형 전략" → 디바이스 우선순위, 브레이크포인트
39
+
40
+ ⛔ 위 섹션 중 7/8 누락 시: 사용자에게 "plan.md에 UI 섹션이 비어있습니다.
41
+ /vibe.spec를 먼저 돌려 기획서를 보강할까요?" 라고 묻고 중단.
42
+
43
+ ✅ 피처명 결정: mdArg 파일명에서 .md 제거한 값을 {feature}로 사용
44
+
45
+ 2. Design context 로드 (non-interactive 기본)
46
+ - hasReadDesignMd == true (프로젝트 루트에 DESIGN.md 존재):
47
+ · §1 Visual Theme / §2 Color Palette / §3 Typography 를 톤·팔레트의
48
+ **1 차 입력**으로 사용 (`design-context.json` · plan.md 보다 우선)
49
+ - Read .vibe/design-context.json
50
+ · 존재 → 톤/팔레트 보강용으로 binding (DESIGN.md 가 있으면 보조)
51
+ · 없음 → plan.md의 "## 7. Look & Feel" 값으로 임시 컨텍스트 구성
52
+ ```
53
+
54
+ ## Step B — Figma 타겟 파일 확보 + State 파일 위치
55
+
56
+ ```
57
+ 1. AskUserQuestion (자유 텍스트):
58
+ "디자인을 생성할 target Figma 파일 URL을 입력해주세요.
59
+ (figma.com/design/{fileKey}/...)"
60
+
61
+ 2. URL → fileKey 추출
62
+
63
+ 3. State 파일 로드 (idempotency, 재실행 시 중복 생성 방지)
64
+ 경로: /tmp/{feature}/figma-create-state.json
65
+ ```
66
+
67
+ ## Step C — 디자인 시스템 발견 세부
68
+
69
+ ```
70
+ 2a. 컴포넌트: search_design_system 또는 기존 스크린 instance walk
71
+ 2b. 변수(토큰): get_variable_defs로 색/간격/radius 수집
72
+ 2c. 텍스트/이펙트 스타일: 발견된 토큰을 plan.md Look & Feel과 매칭
73
+ 매칭 안 되면 "이 plan.md는 기존 디자인 시스템에 없는 토큰을 요구합니다.
74
+ 새로 만들까요? (figma:figma-generate-library 권장) 또는 가까운 토큰으로 진행할까요?"
75
+ ```
76
+
77
+ ## Step D — 와이어프레임 생성 알고리즘 (incremental + idempotent)
78
+
79
+ ```
80
+ plan.md "## 8. 레이아웃/섹션 구성" 표를 순회:
81
+ for each 섹션 in plan.md:
82
+ 1. 섹션 row 직렬화 → wireHash 계산 (8번 row만 해시)
83
+ 2. state.sections에서 같은 name 매칭:
84
+ ├─ 매칭 없음 (신규):
85
+ │ a. use_figma 호출로 wire 프레임 생성 (Auto Layout만)
86
+ │ - 배경: #F5F5F5 (회색)
87
+ │ - 자식: 핵심 콘텐츠 컬럼의 항목마다 회색 박스 + 텍스트 라벨
88
+ │ - 컴포넌트 instance 배치 금지 (Step E에서 채움)
89
+ │ - 변수 바인딩 금지 (Step E에서 채움)
90
+ │ b. 반환된 wireNodeId를 state.sections에 entry append
91
+ │ (designNodeId = null 로 초기화)
92
+ ├─ 매칭 + wireHash 동일 (구조 변화 없음):
93
+ │ SKIP, "✓ {섹션명} wire (cached)" 출력
94
+ └─ 매칭 + wireHash 다름 (구조 변경됨):
95
+ a. use_figma로 기존 wireNodeId 내부 정리 (children 삭제)
96
+ b. 신규 케이스 a 재실행 (wireNodeId 재사용)
97
+ c. state entry의 wireHash + updatedAt 갱신
98
+ d. designNodeId가 있으면 → null로 리셋 (구조 바뀌었으니 본 디자인도 다시 그려야 함)
99
+
100
+ ⛔ 한 번의 use_figma 호출에 모든 섹션을 몰아넣지 말 것.
101
+ 섹션 단위로 incremental 호출 → 검증 → 다음 섹션.
102
+
103
+ 반응형 처리:
104
+ plan.md "## 9. 반응형 전략"의 브레이크포인트별로 별도 wire 프레임 생성
105
+ state.sections에는 bp 필드로 mo/pc 구분하여 각각 entry 저장
106
+
107
+ Step D 종료 직전:
108
+ state.updatedAt = now
109
+ Write /tmp/{feature}/figma-create-state.json
110
+ ```
111
+
112
+ ## Step D ↔ Step E 사용자 검토 게이트 — 메시지 템플릿
113
+
114
+ ```
115
+ 2. 사용자에게 제시:
116
+ "📐 와이어프레임이 생성되었습니다.
117
+ figma URL: https://figma.com/design/{fileKey}/...?node-id={firstWireNodeId}
118
+ 섹션 요약: 신규 N / 갱신 M / 캐시 K
119
+
120
+ 구조가 plan.md와 일치합니까?
121
+ yes → Step E (본 디자인) 진행
122
+ <자유 텍스트> → 수정 요청 (해당 섹션의 wireHash 강제 무효화 후 Step D 재실행)
123
+ abort → 워크플로 중단"
124
+
125
+ 3. ralph/ultrawork 모드:
126
+ 사용자 질문 SKIP, 자동 yes로 Step E 진행
127
+ (단, 섹션이 0개면 abort)
128
+ ```
129
+
130
+ ## Step E — 본 디자인 적용 알고리즘 (incremental + idempotent)
131
+
132
+ ```
133
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
134
+ 분기 A) createMode == "full":
135
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
136
+ state.sections를 순회 (Step D에서 채워진 상태):
137
+ for each section in state.sections:
138
+ 1. 섹션 row 직렬화 → designHash 계산 (7번+8번+9번 row 해시)
139
+ 2. designNodeId == null 이거나 designHash 변경됨:
140
+ a. use_figma로 wireNodeId 내부의 자식 정리 (placeholder 삭제)
141
+ ⚠ wireNodeId 자체는 삭제 금지 (Auto Layout 골격 보존)
142
+ b. 같은 wireNodeId 안에 컴포넌트 instance 배치 + 변수 바인딩
143
+ c. 텍스트는 plan.md "핵심 콘텐츠" 컬럼의 실제 값 사용
144
+ d. designNodeId = wireNodeId 로 set (같은 노드가 2단계로 진화)
145
+ e. state entry의 designHash + updatedAt 갱신
146
+ 3. designHash 동일: SKIP, "✓ {섹션명} design (cached)" 출력
147
+
148
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
149
+ 분기 B) createMode == "design":
150
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
151
+ plan.md "## 8. 레이아웃/섹션 구성" 표를 순회 (state가 없을 수 있음):
152
+ for each 섹션 in plan.md:
153
+ 1. 섹션 row 직렬화 → designHash 계산
154
+ 2. state.sections에서 같은 name 매칭:
155
+ ├─ 매칭 있음 + wireNodeId 존재 → 분기 A의 update 경로 실행 (wireNodeId 재사용)
156
+ ├─ 매칭 있음 + wireNodeId null → ❌ "이 섹션({섹션명})은 이전에 design 모드로 그려졌지만
157
+ │ state가 깨졌습니다. --new-state 로 리셋하세요."
158
+ └─ 매칭 없음:
159
+ ⚠ state.sections 가 완전히 비어있음 (첫 실행 또는 hasNewState)이면 허용:
160
+ a. use_figma 호출로 frame 생성 (Auto Layout + 컴포넌트 + 텍스트 한 번에)
161
+ b. wireNodeId = designNodeId = 반환된 frameNodeId
162
+ c. state.sections에 entry append (wireHash/designHash 둘 다 계산)
163
+ ⛔ state.sections 가 일부 비어있지 않으면 reject:
164
+ "이 섹션({섹션명})은 와이어가 없습니다. --create-storyboard 로 먼저 만들거나
165
+ --create (full)로 호출하세요."
166
+
167
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
168
+ 공통 규칙:
169
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
170
+ ⛔ 한 번의 use_figma 호출에 모든 섹션을 몰아넣지 말 것.
171
+ ⛔ 분기 A에서 wireNodeId를 삭제하고 새 노드를 만들지 말 것 (state 무효화됨).
172
+
173
+ Step E 종료 직전:
174
+ state.planHash = sha256(plan.md 전체)
175
+ state.updatedAt = now
176
+ Write /tmp/{feature}/figma-create-state.json
177
+ ```
178
+
179
+ ## Step F — LLM 셀프 체크 + 최종 사용자 확인 템플릿
180
+
181
+ ```
182
+ 2. LLM 셀프 체크 (createMode에 따라 항목 narrow):
183
+
184
+ createMode == "storyboard" (구조 체크만 — 컬러 판단 불가):
185
+ - 섹션 순서가 plan.md 표와 일치하는가?
186
+ - 핵심 CTA 위치가 plan.md와 일치하는가?
187
+ ⛔ 컬러/분위기 체크 SKIP (와이어는 회색)
188
+
189
+ createMode == "design" 또는 "full":
190
+ - 섹션 순서가 plan.md 표와 일치하는가?
191
+ - 분위기/컬러 키워드가 시각적으로 반영됐는가?
192
+ - 핵심 CTA가 Hero에 존재하는가?
193
+
194
+ 3. 사용자에게 다음을 제시:
195
+ - createMode 표시 ("mode: full" / "mode: storyboard only" / "mode: design only")
196
+ - figma URL (fileKey + 첫 nodeId 딥링크)
197
+ - 섹션별 결과 요약:
198
+ · full: wire 신규 N / 갱신 M / 캐시 K + design 신규 N / 갱신 M / 캐시 K
199
+ · storyboard: wire 신규 N / 갱신 M / 캐시 K
200
+ · design: design 신규 N / 갱신 M / 캐시 K
201
+ - state 파일 경로
202
+ - (storyboard 모드) "다음 단계: 같은 plan.md로 `--create-design` 또는 `--create` 를 호출하면
203
+ 이 와이어 위에 본 디자인이 입혀집니다."
204
+ ```
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: vibe.image
3
+ description: Generate images (icons, banners, mockups) using the Antigravity image backend.
4
+ argument-hint: '"description" [--pro] [--icon "AppName"] [--size WxH]'
5
+ user-invocable: true
6
+ ---
7
+
8
+ # /vibe.image
9
+
10
+ Generate images using the Antigravity image backend.
11
+
12
+ - **Default**: Antigravity fast image - 빠르고 가벼운 이미지 생성
13
+ - **--pro**: Antigravity pro image - 고품질 이미지 생성
14
+
15
+ ## Usage
16
+
17
+ ```
18
+ /vibe.image "description" # Generate image with Antigravity (icon, banner, etc.)
19
+ /vibe.image --pro "description" # High-quality generation
20
+ /vibe.image --icon "AppName" # Generate app icon/favicon
21
+ ```
22
+
23
+ ## MANDATORY Tool Invocation
24
+
25
+ **CRITICAL: You MUST use the following command to generate images. Do NOT search for scripts, do NOT use gcloud, do NOT use any other method.**
26
+
27
+ **Step 0: Script path:**
28
+ - `[LLM_SCRIPT]` = `{{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js`
29
+
30
+ **General image generation (Antigravity fast image):**
31
+ ```bash
32
+ node "[LLM_SCRIPT]" antigravity image "IMAGE_DESCRIPTION" --output "OUTPUT_PATH"
33
+ ```
34
+
35
+ **Pro quality (Antigravity pro image):**
36
+ ```bash
37
+ node "[LLM_SCRIPT]" antigravity image "IMAGE_DESCRIPTION" --pro --output "OUTPUT_PATH"
38
+ ```
39
+
40
+ **With size option:**
41
+ ```bash
42
+ node "[LLM_SCRIPT]" antigravity image "IMAGE_DESCRIPTION" --size "1920x1080" --output "OUTPUT_PATH"
43
+ ```
44
+
45
+ ## How to Parse User Request
46
+
47
+ 1. Extract the **image description** from the user's message (what to generate)
48
+ 2. Extract the **output path** from the user's message (where to save)
49
+ - If user specifies a path, use that path
50
+ - Default: `--output "./generated-image.png"`
51
+ 3. Extract **size** if specified, otherwise default 1024x1024
52
+ 4. If user requests **high quality / pro / 고품질**, add `--pro` flag
53
+
54
+ > Read `references/image-generation-examples.md` for full worked examples, the JSON output format, and the --icon prompt template + example commands.
55
+
56
+ ## Prerequisites
57
+
58
+ - Antigravity API key configured (`vibe antigravity key <key>`)
59
+
60
+ ---
61
+
62
+ ARGUMENTS: $ARGUMENTS
@@ -0,0 +1,39 @@
1
+ # vibe.image — Image Generation: Examples, Output Format, Icon Generation
2
+
3
+ > Loaded by vibe.image SKILL.md — full worked examples, the JSON output format (success/error), and the --icon prompt template + example commands.
4
+
5
+ ### Examples
6
+
7
+ ```bash
8
+ node "[LLM_SCRIPT]" antigravity image "A friendly AI character mascot, colorful, approachable" --output "./ai-character.png"
9
+
10
+ node "[LLM_SCRIPT]" antigravity image "Professional website banner, modern design" --pro --size "1920x400" --output "./banner.png"
11
+
12
+ node "[LLM_SCRIPT]" antigravity image "Modern minimal logo design" --output "./public/logo.png"
13
+ ```
14
+
15
+ ### Output Format
16
+
17
+ The command outputs JSON to stdout:
18
+ ```json
19
+ { "success": true, "path": "/absolute/path/to/image.png", "size": 123456, "sizeKB": "120.5 KB" }
20
+ ```
21
+
22
+ On error:
23
+ ```json
24
+ { "success": false, "error": "Error message" }
25
+ ```
26
+
27
+ ### Icon Generation (--icon)
28
+
29
+ Use the same command with a pre-built icon prompt template:
30
+
31
+ **Prompt template:** `"App icon for {APP_NAME}, primary color {COLOR}, square format 1:1, simple recognizable design, works well at small sizes, no text or letters, solid or gradient background, modern minimalist"`
32
+
33
+ ```bash
34
+ # --icon "MyApp"
35
+ node "[LLM_SCRIPT]" antigravity image "App icon for MyApp, square format 1:1, simple recognizable design, works well at small sizes, no text or letters, solid or gradient background, modern minimalist" --output "./public/app-icon.png"
36
+
37
+ # --icon "MyApp" --color "#2F6BFF"
38
+ node "[LLM_SCRIPT]" antigravity image "App icon for MyApp, primary color #2F6BFF, square format 1:1, simple recognizable design, works well at small sizes, no text or letters, solid or gradient background, modern minimalist" --output "./public/app-icon.png"
39
+ ```
@@ -73,101 +73,9 @@ Apply 9-step reasoning framework to complex problems.
73
73
  - Document reasoning process for complex decisions
74
74
  - Ensure safety through step-by-step execution
75
75
 
76
- ## Output Format
76
+ > Read `references/output-format-template.md` for the full markdown report template.
77
77
 
78
- ```markdown
79
- # Reasoning Framework Analysis
80
-
81
- **Problem**: [problem description]
82
- **Context**: [relevant information]
83
- **Steps Applied**: 9/9
84
- **⏱️ Started**: {start_time}
85
- **⏱️ Completed**: {getCurrentTime 결과}
86
-
87
- ---
88
-
89
- ## 1. Logical Dependencies and Constraints
90
-
91
- **Constraint Analysis**:
92
- [analysis content]
93
-
94
- ---
95
-
96
- ## 2. Risk Assessment
97
-
98
- **Risk Assessment**:
99
- - Task type: [risk level]
100
- - Rollback possibility: [assessment]
101
- - Compatibility/Security/Performance risks
102
-
103
- ---
104
-
105
- ## 3. Inductive Reasoning and Hypothesis Exploration
106
-
107
- **Hypothesis Generation**:
108
- 1. **Hypothesis 1**: [description] (Likelihood: High/Medium/Low)
109
- - Evidence: [supporting evidence]
110
- - Verification: [how to verify]
111
-
112
- 2. **Hypothesis 2**: ...
113
-
114
- ---
115
-
116
- [Steps 4-9...]
117
-
118
- ---
119
-
120
- ## Summary
121
-
122
- [Overall reasoning results summary and recommendations]
123
-
124
- **Recommended Actions**:
125
- 1. Immediate: [low risk action]
126
- 2. Short-term: [medium priority]
127
- 3. Medium-term: [long-term fix]
128
- ```
129
-
130
- ## Example
131
-
132
- ```
133
- User: /vibe.reason "After user login, profile page intermittently returns 500 error"
134
-
135
- AI: Analyzing with 9-step reasoning framework...
136
-
137
- # Reasoning Framework Analysis
138
-
139
- **Problem**: Intermittent 500 error on profile page after login
140
- **Context**: Intermittent occurrence, happens after successful login
141
-
142
- ## 1. Logical Dependencies and Constraints
143
-
144
- **Constraint Analysis**:
145
- - Policy/Rules: Need to check auth/authz system policies
146
- - Task Order: Verify login -> session creation -> profile fetch order
147
- - Prerequisites: Need to identify error reproduction conditions
148
-
149
- ## 3. Inductive Reasoning and Hypothesis Exploration
150
-
151
- **Hypothesis Generation**:
152
- 1. **Hypothesis 1: Incomplete session data** (Likelihood: High)
153
- - Evidence: Intermittent = timing issue or data consistency problem
154
- - Verification: Add logging to session save logic
155
-
156
- 2. **Hypothesis 2: Async processing order issue** (Likelihood: Medium)
157
- - Evidence: undefined = accessing data before load
158
- - Verification: Check Promise chain, missing await
159
-
160
- ## Summary
161
-
162
- **Key Findings**:
163
- - Most likely cause: Incomplete session data
164
- - Verification priority: 1) Session logging -> 2) Async review -> 3) DB check
165
-
166
- **Recommended Actions**:
167
- 1. Immediate: Add detailed logging to session save/fetch
168
- 2. Short-term: Code review async processing
169
- 3. Medium-term: Strengthen session store monitoring
170
- ```
78
+ > Read `references/worked-example.md` for a full worked example applying the 9-step framework to a debugging scenario.
171
79
 
172
80
  ## Best Practices
173
81
 
@@ -226,21 +134,7 @@ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index
226
134
 
227
135
  ## Quality Gate (Mandatory)
228
136
 
229
- ### Reasoning Quality Checklist
230
-
231
- Before completing reasoning analysis, ALL steps must be verified:
232
-
233
- | Step | Check Item | Weight |
234
- |------|------------|--------|
235
- | **Step 1** | Logical dependencies and constraints identified | 10% |
236
- | **Step 2** | Risk assessment completed with rollback plan | 10% |
237
- | **Step 3** | At least 3 hypotheses generated with likelihood | 15% |
238
- | **Step 4** | Verification method defined for each hypothesis | 10% |
239
- | **Step 5** | All available tools and resources listed | 10% |
240
- | **Step 6** | Evidence cited with exact sources | 15% |
241
- | **Step 7** | All alternatives explored | 10% |
242
- | **Step 8** | Error handling strategy defined | 10% |
243
- | **Step 9** | Action plan documented before execution | 10% |
137
+ > Read `references/quality-rubrics.md` for the full reasoning quality checklist, hypothesis quality standards, minimum hypothesis count, evidence standards, risk assessment matrix, forbidden reasoning patterns, and reasoning output requirements.
244
138
 
245
139
  ### Reasoning Score Calculation
246
140
 
@@ -254,80 +148,6 @@ Grades:
254
148
  - <5/9 (<56%): ❌ INSUFFICIENT - Start over
255
149
  ```
256
150
 
257
- ### Hypothesis Quality Standards
258
-
259
- Each hypothesis MUST include:
260
-
261
- | Component | Requirement | Example |
262
- |-----------|-------------|---------|
263
- | **Description** | Clear, testable statement | "Session data is incomplete due to race condition" |
264
- | **Likelihood** | High/Medium/Low with justification | "High - intermittent = timing issue" |
265
- | **Evidence** | Supporting observations | "Error only on concurrent logins" |
266
- | **Verification** | Specific test method | "Add logging to session.save()" |
267
- | **Disproof criteria** | What would rule it out | "Logs show complete data every time" |
268
-
269
- ### Minimum Hypothesis Count
270
-
271
- | Problem Complexity | Minimum Hypotheses |
272
- |--------------------|-------------------|
273
- | Simple (single component) | 2 |
274
- | Medium (cross-component) | 3 |
275
- | Complex (system-wide) | 5 |
276
-
277
- ### Evidence Standards
278
-
279
- All claims MUST include:
280
-
281
- | Evidence Type | Required Format |
282
- |---------------|-----------------|
283
- | Code reference | `filename.ts:L42` |
284
- | Log/metric | Exact value with timestamp |
285
- | Documentation | Document name + section |
286
- | Prior knowledge | Memory key or conversation reference |
287
-
288
- ### Risk Assessment Matrix
289
-
290
- | Risk Level | Rollback Required | Approval Required |
291
- |------------|-------------------|-------------------|
292
- | **Low** | Optional | No |
293
- | **Medium** | Yes, automated | No |
294
- | **High** | Yes, tested | User confirmation |
295
- | **Critical** | Yes, verified | User + backup plan |
296
-
297
- ### Forbidden Reasoning Patterns
298
-
299
- | Pattern | Issue | Required Fix |
300
- |---------|-------|--------------|
301
- | "Probably X" without evidence | Unsubstantiated claim | Add supporting evidence |
302
- | Single hypothesis | Tunnel vision | Generate alternatives |
303
- | Skipping risk assessment | Dangerous changes | Always assess risk |
304
- | "I think" without verification | Assumption | Verify before claiming |
305
- | Acting before reasoning complete | Premature action | Complete all 9 steps |
306
-
307
- ### Reasoning Output Requirements
308
-
309
- Every reasoning analysis MUST include:
310
-
311
- 1. **Problem Statement**
312
- - Clear description
313
- - Context and constraints
314
- - Steps applied count (X/9)
315
-
316
- 2. **Hypothesis Table**
317
- - Ranked by likelihood
318
- - All 5 components per hypothesis
319
- - Verification status
320
-
321
- 3. **Risk Assessment**
322
- - Risk level classification
323
- - Rollback possibility
324
- - Approval requirements
325
-
326
- 4. **Recommended Actions**
327
- - Immediate (low risk, high confidence)
328
- - Short-term (medium priority)
329
- - Long-term (systemic fix)
330
-
331
151
  ---
332
152
 
333
153
  ARGUMENTS: $ARGUMENTS