@su-record/vibe 2.7.14 → 2.7.15

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 (229) hide show
  1. package/.env.example +37 -37
  2. package/CLAUDE.md +134 -126
  3. package/LICENSE +21 -21
  4. package/README.md +449 -449
  5. package/agents/architect-low.md +41 -41
  6. package/agents/architect-medium.md +59 -59
  7. package/agents/architect.md +80 -80
  8. package/agents/build-error-resolver.md +115 -115
  9. package/agents/compounder.md +261 -261
  10. package/agents/diagrammer.md +178 -178
  11. package/agents/docs/api-documenter.md +99 -99
  12. package/agents/docs/changelog-writer.md +93 -93
  13. package/agents/e2e-tester.md +294 -294
  14. package/agents/explorer-low.md +42 -42
  15. package/agents/explorer-medium.md +59 -59
  16. package/agents/explorer.md +48 -48
  17. package/agents/implementer-low.md +43 -43
  18. package/agents/implementer-medium.md +52 -52
  19. package/agents/implementer.md +54 -54
  20. package/agents/junior-mentor.md +141 -141
  21. package/agents/planning/requirements-analyst.md +84 -84
  22. package/agents/planning/ux-advisor.md +83 -83
  23. package/agents/qa/acceptance-tester.md +86 -86
  24. package/agents/qa/edge-case-finder.md +93 -93
  25. package/agents/refactor-cleaner.md +143 -143
  26. package/agents/research/best-practices-agent.md +199 -199
  27. package/agents/research/codebase-patterns-agent.md +157 -157
  28. package/agents/research/framework-docs-agent.md +188 -188
  29. package/agents/research/security-advisory-agent.md +213 -213
  30. package/agents/review/architecture-reviewer.md +107 -107
  31. package/agents/review/complexity-reviewer.md +116 -116
  32. package/agents/review/data-integrity-reviewer.md +88 -88
  33. package/agents/review/git-history-reviewer.md +103 -103
  34. package/agents/review/performance-reviewer.md +86 -86
  35. package/agents/review/python-reviewer.md +150 -150
  36. package/agents/review/rails-reviewer.md +139 -139
  37. package/agents/review/react-reviewer.md +144 -144
  38. package/agents/review/security-reviewer.md +80 -80
  39. package/agents/review/simplicity-reviewer.md +140 -140
  40. package/agents/review/test-coverage-reviewer.md +116 -116
  41. package/agents/review/typescript-reviewer.md +127 -127
  42. package/agents/searcher.md +54 -54
  43. package/agents/simplifier.md +120 -120
  44. package/agents/tester.md +49 -49
  45. package/agents/ui/ui-a11y-auditor.md +93 -93
  46. package/agents/ui/ui-antipattern-detector.md +94 -94
  47. package/agents/ui/ui-dataviz-advisor.md +69 -69
  48. package/agents/ui/ui-design-system-gen.md +57 -57
  49. package/agents/ui/ui-industry-analyzer.md +49 -49
  50. package/agents/ui/ui-layout-architect.md +65 -65
  51. package/agents/ui/ui-stack-implementer.md +68 -68
  52. package/agents/ui/ux-compliance-reviewer.md +81 -81
  53. package/agents/ui-previewer.md +258 -258
  54. package/commands/vibe.analyze.md +11 -13
  55. package/commands/vibe.review.md +43 -1
  56. package/commands/vibe.run.md +2124 -2078
  57. package/commands/vibe.spec.md +9 -4
  58. package/commands/vibe.spec.review.md +569 -565
  59. package/commands/vibe.utils.md +413 -413
  60. package/commands/vibe.verify.md +33 -8
  61. package/dist/cli/collaborator.js +52 -52
  62. package/dist/cli/commands/evolution.js +12 -12
  63. package/dist/cli/commands/info.js +54 -54
  64. package/dist/cli/commands/init.js +5 -5
  65. package/dist/cli/commands/remove.js +14 -14
  66. package/dist/cli/commands/sentinel.js +27 -27
  67. package/dist/cli/commands/skills.js +5 -5
  68. package/dist/cli/commands/slack.js +10 -10
  69. package/dist/cli/commands/telegram.js +12 -12
  70. package/dist/cli/detect.js +32 -32
  71. package/dist/cli/index.js +51 -51
  72. package/dist/cli/llm/claude-commands.js +16 -16
  73. package/dist/cli/llm/config.js +18 -18
  74. package/dist/cli/llm/gemini-commands.js +16 -16
  75. package/dist/cli/llm/gpt-commands.js +19 -19
  76. package/dist/cli/llm/help.js +21 -21
  77. package/dist/cli/postinstall/cursor-agents.js +32 -32
  78. package/dist/cli/postinstall/cursor-rules.js +83 -83
  79. package/dist/cli/postinstall/cursor-skills.js +743 -743
  80. package/dist/cli/setup/Provisioner.js +42 -42
  81. package/dist/infra/lib/DeepInit.js +24 -24
  82. package/dist/infra/lib/IterationTracker.js +11 -11
  83. package/dist/infra/lib/PythonParser.js +108 -108
  84. package/dist/infra/lib/ReviewRace.js +96 -96
  85. package/dist/infra/lib/SkillFrontmatter.js +28 -28
  86. package/dist/infra/lib/SkillQualityGate.js +9 -9
  87. package/dist/infra/lib/SkillRepository.js +159 -159
  88. package/dist/infra/lib/UltraQA.js +99 -99
  89. package/dist/infra/lib/autonomy/AuditStore.js +41 -41
  90. package/dist/infra/lib/autonomy/ConfirmationStore.js +30 -30
  91. package/dist/infra/lib/autonomy/EventOutbox.js +38 -38
  92. package/dist/infra/lib/autonomy/PolicyEngine.js +18 -18
  93. package/dist/infra/lib/autonomy/SecuritySentinel.js +1 -1
  94. package/dist/infra/lib/autonomy/SuggestionStore.js +33 -33
  95. package/dist/infra/lib/embedding/VectorStore.js +22 -22
  96. package/dist/infra/lib/evolution/AgentAnalyzer.js +10 -10
  97. package/dist/infra/lib/evolution/DescriptionOptimizer.js +21 -21
  98. package/dist/infra/lib/evolution/GenerationRegistry.js +36 -36
  99. package/dist/infra/lib/evolution/InsightStore.js +90 -90
  100. package/dist/infra/lib/evolution/RollbackManager.js +5 -5
  101. package/dist/infra/lib/evolution/SkillBenchmark.js +23 -23
  102. package/dist/infra/lib/evolution/SkillEvalRunner.js +50 -50
  103. package/dist/infra/lib/evolution/SkillGapDetector.js +10 -10
  104. package/dist/infra/lib/evolution/UsageTracker.js +28 -28
  105. package/dist/infra/lib/gemini/orchestration.js +5 -5
  106. package/dist/infra/lib/gpt/orchestration.js +4 -4
  107. package/dist/infra/lib/memory/KnowledgeGraph.js +4 -4
  108. package/dist/infra/lib/memory/MemorySearch.js +57 -57
  109. package/dist/infra/lib/memory/MemoryStorage.js +181 -181
  110. package/dist/infra/lib/memory/ObservationStore.js +28 -28
  111. package/dist/infra/lib/memory/ReflectionStore.js +30 -30
  112. package/dist/infra/lib/memory/SessionRAGRetriever.js +7 -7
  113. package/dist/infra/lib/memory/SessionRAGStore.js +225 -225
  114. package/dist/infra/lib/memory/SessionSummarizer.js +9 -9
  115. package/dist/infra/orchestrator/AgentManager.js +12 -12
  116. package/dist/infra/orchestrator/AgentRegistry.js +65 -65
  117. package/dist/infra/orchestrator/MultiLlmResearch.js +8 -8
  118. package/dist/infra/orchestrator/SwarmOrchestrator.test.js +16 -16
  119. package/dist/infra/orchestrator/parallelResearch.js +24 -24
  120. package/dist/tools/convention/analyzeComplexity.test.js +115 -115
  121. package/dist/tools/convention/validateCodeQuality.test.js +104 -104
  122. package/dist/tools/memory/createMemoryTimeline.js +10 -10
  123. package/dist/tools/memory/getMemoryGraph.js +12 -12
  124. package/dist/tools/memory/getSessionContext.js +9 -9
  125. package/dist/tools/memory/linkMemories.js +14 -14
  126. package/dist/tools/memory/listMemories.js +4 -4
  127. package/dist/tools/memory/recallMemory.js +4 -4
  128. package/dist/tools/memory/saveMemory.js +4 -4
  129. package/dist/tools/memory/searchMemoriesAdvanced.js +23 -23
  130. package/dist/tools/semantic/analyzeDependencyGraph.js +12 -12
  131. package/dist/tools/semantic/astGrep.test.js +6 -6
  132. package/dist/tools/spec/prdParser.test.js +171 -171
  133. package/dist/tools/spec/specGenerator.js +169 -169
  134. package/dist/tools/spec/traceabilityMatrix.js +64 -64
  135. package/dist/tools/spec/traceabilityMatrix.test.js +28 -28
  136. package/hooks/gemini-hooks.json +73 -73
  137. package/hooks/hooks.json +137 -137
  138. package/hooks/scripts/code-check.js +77 -70
  139. package/hooks/scripts/context-save.js +212 -212
  140. package/hooks/scripts/hud-status.js +291 -291
  141. package/hooks/scripts/keyword-detector.js +214 -214
  142. package/hooks/scripts/llm-orchestrate.js +475 -475
  143. package/hooks/scripts/post-edit.js +32 -32
  144. package/hooks/scripts/pre-tool-guard.js +125 -125
  145. package/hooks/scripts/prompt-dispatcher.js +185 -185
  146. package/hooks/scripts/sentinel-guard.js +104 -104
  147. package/hooks/scripts/session-start.js +106 -106
  148. package/hooks/scripts/stop-notify.js +209 -209
  149. package/hooks/scripts/utils.js +100 -100
  150. package/languages/csharp-unity.md +515 -515
  151. package/languages/gdscript-godot.md +470 -470
  152. package/languages/ruby-rails.md +489 -489
  153. package/languages/typescript-angular.md +433 -433
  154. package/languages/typescript-astro.md +416 -416
  155. package/languages/typescript-electron.md +406 -406
  156. package/languages/typescript-nestjs.md +524 -524
  157. package/languages/typescript-svelte.md +407 -407
  158. package/languages/typescript-tauri.md +365 -365
  159. package/package.json +121 -121
  160. package/skills/agents-md/SKILL.md +120 -120
  161. package/skills/arch-guard/SKILL.md +180 -180
  162. package/skills/brand-assets/SKILL.md +146 -146
  163. package/skills/capability-loop/SKILL.md +167 -167
  164. package/skills/characterization-test/SKILL.md +206 -206
  165. package/skills/commerce-patterns/SKILL.md +59 -59
  166. package/skills/commit-push-pr/SKILL.md +75 -75
  167. package/skills/context7-usage/SKILL.md +105 -105
  168. package/skills/core-capabilities/SKILL.md +48 -48
  169. package/skills/e2e-commerce/SKILL.md +57 -57
  170. package/skills/exec-plan/SKILL.md +147 -147
  171. package/skills/frontend-design/SKILL.md +73 -73
  172. package/skills/git-worktree/SKILL.md +72 -72
  173. package/skills/handoff/SKILL.md +109 -109
  174. package/skills/parallel-research/SKILL.md +87 -87
  175. package/skills/priority-todos/SKILL.md +63 -63
  176. package/skills/seo-checklist/SKILL.md +57 -57
  177. package/skills/techdebt/SKILL.md +122 -122
  178. package/skills/tool-fallback/SKILL.md +103 -103
  179. package/skills/typescript-advanced-types/SKILL.md +66 -66
  180. package/skills/ui-ux-pro-max/SKILL.md +206 -206
  181. package/skills/vercel-react-best-practices/SKILL.md +59 -59
  182. package/skills/video-production/SKILL.md +51 -51
  183. package/vibe/config.json +29 -29
  184. package/vibe/constitution.md +227 -227
  185. package/vibe/rules/principles/communication-guide.md +98 -98
  186. package/vibe/rules/principles/development-philosophy.md +52 -52
  187. package/vibe/rules/principles/quick-start.md +102 -102
  188. package/vibe/rules/quality/bdd-contract-testing.md +393 -393
  189. package/vibe/rules/quality/checklist.md +276 -276
  190. package/vibe/rules/quality/performance.md +236 -236
  191. package/vibe/rules/quality/testing-strategy.md +440 -440
  192. package/vibe/rules/standards/anti-patterns.md +541 -541
  193. package/vibe/rules/standards/code-structure.md +291 -291
  194. package/vibe/rules/standards/complexity-metrics.md +313 -313
  195. package/vibe/rules/standards/git-workflow.md +237 -237
  196. package/vibe/rules/standards/naming-conventions.md +198 -198
  197. package/vibe/rules/standards/security.md +305 -305
  198. package/vibe/rules/writing/document-style.md +74 -74
  199. package/vibe/setup.sh +31 -31
  200. package/vibe/templates/constitution-template.md +252 -252
  201. package/vibe/templates/contract-backend-template.md +526 -526
  202. package/vibe/templates/contract-frontend-template.md +599 -599
  203. package/vibe/templates/feature-template.md +96 -96
  204. package/vibe/templates/spec-template.md +221 -221
  205. package/vibe/ui-ux-data/charts.csv +26 -26
  206. package/vibe/ui-ux-data/colors.csv +97 -97
  207. package/vibe/ui-ux-data/icons.csv +101 -101
  208. package/vibe/ui-ux-data/landing.csv +31 -31
  209. package/vibe/ui-ux-data/products.csv +96 -96
  210. package/vibe/ui-ux-data/react-performance.csv +45 -45
  211. package/vibe/ui-ux-data/stacks/astro.csv +54 -54
  212. package/vibe/ui-ux-data/stacks/flutter.csv +53 -53
  213. package/vibe/ui-ux-data/stacks/html-tailwind.csv +56 -56
  214. package/vibe/ui-ux-data/stacks/jetpack-compose.csv +53 -53
  215. package/vibe/ui-ux-data/stacks/nextjs.csv +53 -53
  216. package/vibe/ui-ux-data/stacks/nuxt-ui.csv +51 -51
  217. package/vibe/ui-ux-data/stacks/nuxtjs.csv +59 -59
  218. package/vibe/ui-ux-data/stacks/react-native.csv +52 -52
  219. package/vibe/ui-ux-data/stacks/react.csv +54 -54
  220. package/vibe/ui-ux-data/stacks/shadcn.csv +61 -61
  221. package/vibe/ui-ux-data/stacks/svelte.csv +54 -54
  222. package/vibe/ui-ux-data/stacks/swiftui.csv +51 -51
  223. package/vibe/ui-ux-data/stacks/vue.csv +50 -50
  224. package/vibe/ui-ux-data/styles.csv +68 -68
  225. package/vibe/ui-ux-data/typography.csv +57 -57
  226. package/vibe/ui-ux-data/ui-reasoning.csv +101 -101
  227. package/vibe/ui-ux-data/ux-guidelines.csv +99 -99
  228. package/vibe/ui-ux-data/version.json +31 -31
  229. package/vibe/ui-ux-data/web-interface.csv +31 -31
@@ -1,565 +1,569 @@
1
- # /vibe.spec.review - SPEC Quality Review
2
-
3
- Review and enhance SPEC with GPT/Gemini cross-validation.
4
-
5
- **Purpose:** Run this command in a NEW session after `/vibe.spec` to ensure accurate review execution.
6
-
7
- ---
8
-
9
- ## Usage
10
-
11
- ```bash
12
- /vibe.spec.review "feature-name"
13
- ```
14
-
15
- **Prerequisites:**
16
- - SPEC file exists: `.claude/vibe/specs/{feature-name}.md` (single) or `.claude/vibe/specs/{feature-name}/_index.md` (split)
17
- - Feature file exists: `.claude/vibe/features/{feature-name}.feature` (single) or `.claude/vibe/features/{feature-name}/_index.feature` (split)
18
-
19
- ---
20
-
21
- > **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
22
-
23
- ## Workflow
24
-
25
- ```
26
- /vibe.spec "feature" → SPEC created
27
-
28
- /new (new session)
29
-
30
- /vibe.spec.review "feature" → Quality validation + GPT/Gemini review
31
-
32
- /vibe.run "feature"
33
- ```
34
-
35
- ---
36
-
37
- ## File Reading Policy (Mandatory)
38
-
39
- - **SPEC/Feature 파일**: 반드시 `Read` 도구로 전체 파일을 읽을 (Grep 금지)
40
- - **Split 구조의 경우**: `_index` 파일과 모든 `phase-*` 파일을 각각 `Read`로 전체 읽을 것
41
- - **Grep 사용 제한**: 파일 위치 탐색(어떤 파일에 있는지 찾기)에만 사용. 파일 내용 파악에는 반드시 Read 사용
42
- - **부분 읽기 금지**: Grep 결과의 주변 줄만 보고 리뷰하지 것. 전체 맥락을 파악해야 정확한 품질 검증 가능
43
-
44
- ## Step 1: Load SPEC Files
45
-
46
- Detect SPEC structure (single file or split folder) and read files:
47
-
48
- **Single file structure:**
49
- ```
50
- .claude/vibe/specs/{feature-name}.md
51
- .claude/vibe/features/{feature-name}.feature
52
- ```
53
-
54
- **Split folder structure:**
55
- ```
56
- .claude/vibe/specs/{feature-name}/_index.md (+ phase files)
57
- .claude/vibe/specs/{feature-name}/phase-*.md (phase-1-xxx.md, phase-2-xxx.md, ...)
58
- .claude/vibe/features/{feature-name}/_index.feature (+ phase files)
59
- .claude/vibe/features/{feature-name}/phase-*.feature
60
- ```
61
-
62
- **Detection logic:**
63
- 1. Check if `.claude/vibe/specs/{feature-name}/` directory exists → Split mode
64
- 2. Otherwise check `.claude/vibe/specs/{feature-name}.md`Single mode
65
- 3. If neither existsError
66
-
67
- **Split mode file loading:**
68
- 1. Read `_index.md` for master SPEC overview
69
- 2. Glob `phase-*.md` files and read all phase SPECs
70
- 3. Read corresponding `_index.feature` and `phase-*.feature` files
71
-
72
- **Output:**
73
- ```
74
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75
- 📋 SPEC REVIEW: {feature-name}
76
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
77
-
78
- Loading files...
79
- Mode: {single|split}
80
- ✅ SPEC: .claude/vibe/specs/{feature-name}.md (or _index.md + N phase files)
81
- Feature: .claude/vibe/features/{feature-name}.feature (or _index.feature + N phase files)
82
-
83
- Extracted info:
84
- - Feature: {feature description}
85
- - Stack: {tech stack}
86
- - Phases: {number of phases}
87
- - Scenarios: {number of scenarios}
88
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
89
- ```
90
-
91
- ---
92
-
93
- ## Step 2: Quality Validation (95-Point Gate)
94
-
95
- **🚨 MANDATORY: Score must be ≥ 95 to proceed**
96
-
97
- ### 2.1 Quality Checklist
98
-
99
- | Category | Check Item | Weight |
100
- |----------|------------|--------|
101
- | **Completeness** | All user flows included in Task | 15% |
102
- | **Completeness** | All ACs converted to Feature scenarios | 10% |
103
- | **Completeness** | Error handling scenarios defined | 10% |
104
- | **Specificity** | All numbers specified (timeout, limits, etc.) | 15% |
105
- | **Specificity** | No ambiguous terms ("appropriate", "proper", etc.) | 10% |
106
- | **Testability** | Each AC is verifiable | 10% |
107
- | **Testability** | Feature scenarios have concrete Given/When/Then | 10% |
108
- | **Security** | Auth/permission requirements specified | 10% |
109
- | **Performance** | Response time/load requirements specified | 10% |
110
-
111
- ### 2.2 Quality Gate Loop
112
-
113
- ```python
114
- max_iterations = 3
115
- iteration = 0
116
-
117
- while iteration < max_iterations:
118
- iteration += 1
119
- score = calculate_quality_score(spec, feature)
120
-
121
- print(f"━━━ Quality Check [{iteration}/{max_iterations}] ━━━")
122
- print(f"Score: {score}/100")
123
-
124
- if score >= 95:
125
- print("✅ Quality Gate PASSED")
126
- break
127
-
128
- # Auto-fix missing items
129
- missing_items = identify_missing_items(spec)
130
- for item in missing_items:
131
- auto_fix(item)
132
- update_spec()
133
- update_feature()
134
-
135
- print(f"✅ Applied {len(missing_items)} fixes - Re-evaluating...")
136
-
137
- if score < 95:
138
- print(f"❌ BLOCKED: Score {score} < 95 after {max_iterations} iterations")
139
- print("Manual intervention required.")
140
- ```
141
-
142
- **Output format:**
143
- ```
144
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145
- 📊 QUALITY GATE [1/3]
146
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
147
- Score: 87/100 ⚠️ BELOW THRESHOLD (95)
148
-
149
- Missing items:
150
- Error handling scenarios (10%)
151
- Performance targets (5%)
152
-
153
- Auto-fixing...
154
- ✅ Added network error handling scenario
155
- ✅ Added response time targets (<500ms)
156
-
157
- Re-evaluating...
158
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
159
-
160
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
161
- 📊 QUALITY GATE [2/3]
162
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
163
- Score: 96/100 ✅ PASSED
164
-
165
- ✅ Quality Gate PASSED - proceeding to GPT/Gemini review
166
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
167
- ```
168
-
169
- ### 2.3 Auto-Fix Rules
170
-
171
- | Missing Item | Auto-Fix Method |
172
- |--------------|-----------------|
173
- | Missing AC | Auto-generate AC based on Task |
174
- | Numbers not specified | Apply project defaults (timeout 30s, etc.) |
175
- | Missing error handling | Add common error scenarios |
176
- | Missing performance targets | Apply industry standard criteria |
177
- | Missing security | Add auth/data protection requirements |
178
- | Ambiguous terms | Replace with specific values |
179
-
180
- ---
181
-
182
- ## Step 3: Race Review (GPT + Gemini Cross-Validation) - 3 Rounds (v2.6.9)
183
-
184
- **🚨🚨🚨 CRITICAL: YOU MUST EXECUTE ALL 3 ROUNDS. DO NOT SKIP THIS STEP. 🚨🚨🚨**
185
-
186
- **🚨 ABSOLUTE RULES FOR RACE REVIEW:**
187
-
188
- 1. **YOU MUST** use the Bash tool to call `llm-orchestrate.js` directly
189
- 2. **DO NOT** skip GPT/Gemini calls
190
- 3. **DO NOT** simulate or fake review results
191
- 4. **YOU MUST** run all 3 rounds sequentially (each round uses updated SPEC)
192
-
193
- > Race Mode reviews SPEC with GPT and Gemini in parallel, then cross-validates findings for higher confidence.
194
-
195
- ### 3.1 Review Loop (3 Rounds)
196
-
197
- **For EACH round (1, 2, 3), run GPT + Gemini in PARALLEL via Bash tool.**
198
-
199
- **🚨 IMPORTANT: SPEC content is too large for CLI arguments. Use --input file method (no pipe needed).**
200
-
201
- **Procedure for each round:**
202
-
203
- **Step A: Save SPEC content + prompt as JSON to scratchpad temp file (using Write tool):**
204
- - Write JSON to `[SCRATCHPAD]/spec-review-input.json` with content:
205
- ```json
206
- {"prompt": "Review this SPEC for completeness, specificity, testability, security, and performance. Round [N]/3. Find issues and improvements. Return JSON: {issues: [{id, title, description, severity, suggestion}]}. SPEC content: [SPEC_CONTENT]"}
207
- ```
208
- - Where `[SPEC_CONTENT]` is the full SPEC text (properly JSON-escaped inside the prompt string)
209
-
210
- **Step B: Script path:**
211
- - `[LLM_SCRIPT]` = `{{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js`
212
-
213
- **Step C: Run GPT + Gemini in PARALLEL (two separate Bash tool calls at once):**
214
-
215
- ```bash
216
- # GPT review (Bash tool call 1)
217
- node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/spec-review-input.json"
218
- ```
219
-
220
- ```bash
221
- # Gemini review (Bash tool call 2 - run in parallel with GPT)
222
- node "[LLM_SCRIPT]" gemini orchestrate-json --input "[SCRATCHPAD]/spec-review-input.json"
223
- ```
224
-
225
- **🚨 MANDATORY: Replace `[SCRATCHPAD]` with the actual scratchpad directory path.**
226
- **🚨 Replace `[N]` with the current round number (1, 2, or 3).**
227
- **🚨 Replace `[LLM_SCRIPT]` with the resolved absolute path from Step B.**
228
- **🚨 Run GPT and Gemini calls in PARALLEL (two separate Bash tool calls at once).**
229
-
230
- - Round 1: Write SPEC Run GPT + Gemini in parallel → Cross-validate → Apply fixes → Update SPEC file
231
- - Round 2: Write updated SPEC Run Cross-validate → Apply fixes → Update SPEC file
232
- - Round 3: Write final SPEC Run Cross-validate Confirm no issues remain
233
-
234
- ### 3.2 Cross-Validation Rules
235
-
236
- | Agreement | Priority | Action |
237
- |-----------|----------|--------|
238
- | Both models agree (100%) | P1 | Auto-apply immediately |
239
- | 1 model only (50%) | P2 | Auto-apply with note |
240
-
241
- **After each round:**
242
-
243
- 1. Cross-validate findings (issues found by 2+ models P1, single model → P2)
244
- 2. Merge feedback with confidence scores
245
- 3. Auto-apply P1/P2 improvements to SPEC and Feature files (use Edit tool)
246
- 4. Continue to next round with updated SPEC content
247
-
248
- ### 3.3 User Decision Checkpoint (Round 3 이후)
249
-
250
- **🚨 MANDATORY: 3라운드 완료 사용자 판단 체크포인트 실행**
251
-
252
- > Type 6 (Iterative-Reasoning) 패턴: AI가 혼자 결정하지 않고, 사용자와 함께 판단
253
-
254
- ```
255
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
256
- 🔍 USER CHECKPOINT: 리뷰 결과 검토
257
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
258
-
259
- 3라운드 리뷰에서 발견된 주요 변경사항:
260
-
261
- | # | 변경 내용 | 출처 | 신뢰도 |
262
- |---|----------|------|--------|
263
- | 1 | {변경1} | GPT+Gemini | 100% |
264
- | 2 | {변경2} | GPT only | 50% |
265
- | ... | ... | ... | ... |
266
-
267
- 질문:
268
- 1. 변경사항 제외하고 싶은 항목이 있나요?
269
- 2. 추가로 명시해야 요구사항이 있나요?
270
- 3. 기술적 접근 방식에 동의하시나요?
271
-
272
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
273
- ```
274
-
275
- **Checkpoint 행동 규칙:**
276
-
277
- | 상황 | 행동 |
278
- |------|------|
279
- | `ultrawork` 모드 | 체크포인트 스킵, 자동 진행 |
280
- | 일반 모드 | 반드시 사용자 응답 대기 |
281
- | 사용자가 변경 요청 | 수정 후 다시 체크포인트 |
282
- | 사용자가 승인 | Step 4로 진행 |
283
-
284
- **Output format:**
285
- ```
286
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
287
- 🏁 SPEC RACE REVIEW - Round 1/3
288
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
289
-
290
- Model Results:
291
- | Model | Issues | Duration |
292
- |--------|--------|----------|
293
- | GPT | 2 | 1823ms |
294
- | Gemini | 2 | 2156ms |
295
-
296
- Cross-Validated Issues:
297
- | Issue | GPT | Gemini | Confidence |
298
- |--------------------------|-----|--------|------------|
299
- | Missing retry logic | ✅ | ✅ | 100% → P1 |
300
- | Missing rate limiting | ✅ | ✅ | 100% → P1 |
301
- | Token refresh unclear | ✅ | | 50% → P2 |
302
-
303
- Auto-applying...
304
- [P1] Added retry logic (3 attempts, exponential backoff)
305
- [P1] Added rate limiting (100 req/min)
306
- ✅ [P2] Added token refresh flow
307
-
308
- Round 1 complete - 3 improvements (2 P1, 1 P2)
309
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
310
-
311
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
312
- 🏁 SPEC RACE REVIEW - Round 2/3
313
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
314
-
315
- Cross-Validated Issues:
316
- | Issue | GPT | Gemini | Confidence |
317
- |-----------------------------|-----|--------|------------|
318
- | Concurrent session unclear | ✅ | ❌ | 50% → P2 |
319
-
320
- Auto-applying...
321
- ✅ [P2] Added concurrent session policy
322
-
323
- ✅ Round 2 complete - 1 improvement
324
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
325
-
326
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
327
- 🏁 SPEC RACE REVIEW - Round 3/3
328
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
329
-
330
- Cross-Validated Issues: None
331
-
332
- ✅ No changes needed - SPEC is complete
333
- ✅ Consensus Rate: 100%
334
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
335
- ```
336
-
337
- ---
338
-
339
- ## Step 3.5: Review Debate Team (Agent Teams)
340
-
341
- > **조건**: Agent Teams 활성화 + 3라운드 완료 후 P1/P2 이슈 2개 이상 발견 시
342
- > 여러 관점에서 교차 검증하여 오탐 제거 및 우선순위 조정
343
-
344
- **팀 구성:**
345
-
346
- | 팀원 | 역할 |
347
- |------|------|
348
- | security-reviewer (리더) | 보안 관점 우선순위 결정, 교차 검증 주도 |
349
- | architecture-reviewer | 구조적 영향 평가, 설계 일관성 확인 |
350
- | performance-reviewer | 성능 영향 평가, 불필요한 최적화 식별 |
351
- | simplicity-reviewer | 과잉 설계 여부, YAGNI 위반 식별 |
352
-
353
- **활성화 조건:**
354
-
355
- | 상황 | 행동 |
356
- |------|------|
357
- | P1/P2 이슈 2개 이상 | 자동 활성화 |
358
- | P1/P2 이슈 1개 이하 | 스킵 → Step 4로 진행 |
359
- | Agent Teams 비활성화 | 스킵 → Step 4로 진행 |
360
-
361
- **spawn 패턴:**
362
-
363
- ```text
364
- TeamCreate(team_name="spec-debate-{feature}", description="SPEC review debate for {feature}")
365
-
366
- Task(team_name="spec-debate-{feature}", name="security-reviewer", subagent_type="security-reviewer",
367
- mode="bypassPermissions",
368
- prompt="SPEC 리뷰 리더. GPT/Gemini가 발견한 P1/P2 이슈를 교차 검증하세요.
369
- SPEC: {spec_content}
370
- 발견된 이슈: {p1_p2_issues}
371
- 역할: 각 이슈가 진짜인지(오탐 아닌지) 검증. 실제 영향도 기준으로 우선순위 조정.
372
- 분쟁이 있는 이슈는 해당 리뷰어에게 SendMessage로 확인 요청하세요.")
373
-
374
- Task(team_name="spec-debate-{feature}", name="architecture-reviewer", subagent_type="architecture-reviewer",
375
- mode="bypassPermissions",
376
- prompt="SPEC 리뷰 아키텍처 전문가. 아키텍처 관련 이슈를 검증하세요.
377
- SPEC: {spec_content}
378
- 역할: 구조적 일관성, SOLID 원칙, 레이어 경계 검증.
379
- 우선순위 변경 필요 시 security-reviewer에게 SendMessage로 알리세요.")
380
-
381
- Task(team_name="spec-debate-{feature}", name="performance-reviewer", subagent_type="performance-reviewer",
382
- mode="bypassPermissions",
383
- prompt="SPEC 리뷰 성능 전문가. 성능 관련 이슈를 검증하세요.
384
- SPEC: {spec_content}
385
- 역할: 성능 요구사항 현실성 평가, 불필요한 최적화 식별.
386
- P2→P1 승격이 필요하면 security-reviewer에게 SendMessage로 알리세요.")
387
-
388
- Task(team_name="spec-debate-{feature}", name="simplicity-reviewer", subagent_type="simplicity-reviewer",
389
- mode="bypassPermissions",
390
- prompt="SPEC 리뷰 단순성 전문가. 과잉 설계 여부를 검증하세요.
391
- SPEC: {spec_content}
392
- 역할: YAGNI 위반, 불필요한 복잡성 식별.
393
- P1→P2 강등이 필요하면 security-reviewer에게 SendMessage로 알리세요.")
394
- ```
395
-
396
- **결과 통합:**
397
- - 팀 합의 결과를 SPEC에 반영 (P1 즉시 적용, P2 노트 추가)
398
- - 팀원 shutdown_request → TeamDelete로 정리
399
- - Step 4 (Final Summary)로 진행
400
-
401
- ---
402
-
403
- ## Step 4: Final Summary
404
-
405
- ```
406
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
407
- SPEC REVIEW COMPLETE: {feature-name}
408
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
409
-
410
- Quality Score: 96/100 ✅
411
- Review Rounds: 3/3 ✅
412
- Total Improvements: 4
413
- ⏱️ Started: {start_time}
414
- ⏱️ Completed: {getCurrentTime 결과}
415
-
416
- Updated files:
417
- 📋 .claude/vibe/specs/{feature-name}.md (or split folder)
418
- 📋 .claude/vibe/features/{feature-name}.feature (or split folder)
419
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
420
- ```
421
-
422
- ---
423
-
424
- ## Step 5: SPEC Summary for User Review
425
-
426
- **🚨 MANDATORY: Always output this summary before proceeding to `/vibe.run`.**
427
-
428
- After all review rounds, present the finalized SPEC to the user in a readable format:
429
-
430
- ```
431
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
432
- 📋 SPEC SUMMARY: {feature-name}
433
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
434
-
435
- ## Feature Overview
436
- {1-2 line summary of feature purpose from SPEC's <role> and <context>}
437
-
438
- ## Tech Stack
439
- {Tech stack list extracted from <context>}
440
-
441
- ## Implementation Phases
442
- | Phase | Name | Key Tasks |
443
- |-------|------|-----------|
444
- | 1 | {phase name} | {1-line summary of core task} |
445
- | 2 | {phase name} | {1-line summary of core task} |
446
- | ... | ... | ... |
447
-
448
- ## Key Scenarios ({N} total)
449
- {Scenario name list from Feature file}
450
- - Scenario: {name1}
451
- - Scenario: {name2}
452
- - ...
453
-
454
- ## Key Constraints
455
- {3-5 key items from <constraints>}
456
-
457
- ## Acceptance Criteria
458
- {Summary of key items from <acceptance>}
459
-
460
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
461
- If anything above is incorrect, please request changes.
462
- If no issues, proceed with /vibe.run "{feature-name}".
463
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
464
- ```
465
-
466
- **Important:**
467
-
468
- - List ALL Phases, Scenarios, and Constraints from SPEC without omission
469
- - Keep it concise for quick user review
470
- - Wait for user confirmation after review (unless ultrawork mode)
471
- - In ultrawork mode: output summary then auto-proceed to `/vibe.run`
472
-
473
- ### 5.1 Final User Checkpoint
474
-
475
- **🚨 MANDATORY: `/vibe.run` 진행 전 최종 사용자 확인**
476
-
477
- ```
478
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
479
- SPEC 리뷰 완료 - 최종 확인
480
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
481
-
482
- 다음 질문에 답변해 주세요:
483
-
484
- 1. **요구사항 정확성**: 위 SPEC이 원래 의도한 기능을 정확히 설명하고 있나요?
485
- 2. **범위 적절성**: 구현 범위가 너무 크거나 작지 않나요?
486
- 3. **기술 스택**: 선택된 기술 스택에 동의하시나요?
487
- 4. **우선순위**: Phase 순서와 우선순위가 맞나요?
488
-
489
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
490
- 💡 "ok" 또는 "진행"으로 승인 / 수정 사항이 있으면 말씀해 주세요
491
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
492
- ```
493
-
494
- **Why This Checkpoint Matters:**
495
-
496
- > AI가 더 많이 해준다고 좋은 게 아닙니다.
497
- > 사용자가 AI와 함께 생각하고 판단할 때 최고의 결과가 나옵니다.
498
- > 체크포인트는 Type 6 (Iterative-Reasoning) 패턴을 유도합니다.
499
-
500
- ---
501
-
502
- ## Next Step
503
-
504
- ```
505
- /vibe.run "{feature-name}"
506
- ```
507
-
508
- ---
509
-
510
- ## Error Handling
511
-
512
- ### SPEC Not Found
513
- ```
514
- ERROR: SPEC file not found
515
-
516
- Expected (single): .claude/vibe/specs/{feature-name}.md
517
- Expected (split): .claude/vibe/specs/{feature-name}/_index.md
518
-
519
- Please run /vibe.spec "{feature-name}" first to create the SPEC.
520
- ```
521
-
522
- ### Feature Not Found
523
- ```
524
- ❌ ERROR: Feature file not found
525
-
526
- Expected (single): .claude/vibe/features/{feature-name}.feature
527
- Expected (split): .claude/vibe/features/{feature-name}/_index.feature
528
-
529
- Please run /vibe.spec "{feature-name}" first to create the Feature file.
530
- ```
531
-
532
- ### GPT/Gemini Call Failed
533
- ```
534
- ⚠️ WARNING: {GPT|Gemini} call failed
535
-
536
- Error: {error message}
537
-
538
- Continuing with {other model} results only...
539
- ```
540
-
541
- ---
542
-
543
- ## Quick Mode
544
-
545
- For faster iteration (1 round only):
546
-
547
- ```bash
548
- /vibe.spec.review "feature-name" --quick
549
- ```
550
-
551
- ---
552
-
553
- ARGUMENTS: $ARGUMENTS
554
-
555
- **File Detection (execute before Step 1):**
556
-
557
- ```
558
- Feature name: $ARGUMENTS
559
-
560
- 1. Check split folder: .claude/vibe/specs/$ARGUMENTS/_index.md
561
- - If exists → Split mode (read all files in folder)
562
- 2. Check single file: .claude/vibe/specs/$ARGUMENTS.md
563
- - If exists → Single mode
564
- 3. Neither exists Show error with both expected paths
565
- ```
1
+ # /vibe.spec.review - SPEC Quality Review
2
+
3
+ Review and enhance SPEC with GPT/Gemini cross-validation.
4
+
5
+ **Purpose:** Run this command in a NEW session after `/vibe.spec` to ensure accurate review execution.
6
+
7
+ ---
8
+
9
+ ## Usage
10
+
11
+ ```bash
12
+ /vibe.spec.review "feature-name"
13
+ ```
14
+
15
+ **Prerequisites:**
16
+ - SPEC file exists: `.claude/vibe/specs/{feature-name}.md` (single) or `.claude/vibe/specs/{feature-name}/_index.md` (split)
17
+ - Feature file exists: `.claude/vibe/features/{feature-name}.feature` (single) or `.claude/vibe/features/{feature-name}/_index.feature` (split)
18
+
19
+ ---
20
+
21
+ > **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
22
+
23
+ ## Workflow
24
+
25
+ ```
26
+ /vibe.spec "feature" → SPEC created
27
+
28
+ /new (new session)
29
+
30
+ /vibe.spec.review "feature" → Quality validation + GPT/Gemini review
31
+
32
+ /vibe.run "feature"
33
+ ```
34
+
35
+ ---
36
+
37
+ ## File Reading Policy (Mandatory)
38
+
39
+ - **Delegate SPEC reading to sub-agents** Do NOT read all SPEC/Feature files in main session
40
+ - **Split structure (3+ phases)**: Use `Task(subagent_type="explorer-medium")` to read and summarize
41
+ - **Single file structure**: Main session may Read directly (small enough)
42
+ - **Never use Grep** for content analysis Grep is for file location only
43
+ - **Agent spawn rule**: Include "Read target files FULLY with Read tool" in agent prompts
44
+
45
+ ## Step 1: Load SPEC Files
46
+
47
+ Detect SPEC structure (single file or split folder) and read files:
48
+
49
+ **Single file structure:**
50
+ ```
51
+ .claude/vibe/specs/{feature-name}.md
52
+ .claude/vibe/features/{feature-name}.feature
53
+ ```
54
+
55
+ **Split folder structure:**
56
+ ```
57
+ .claude/vibe/specs/{feature-name}/_index.md (+ phase files)
58
+ .claude/vibe/specs/{feature-name}/phase-*.md (phase-1-xxx.md, phase-2-xxx.md, ...)
59
+ .claude/vibe/features/{feature-name}/_index.feature (+ phase files)
60
+ .claude/vibe/features/{feature-name}/phase-*.feature
61
+ ```
62
+
63
+ **Detection logic:**
64
+ 1. Check if `.claude/vibe/specs/{feature-name}/` directory exists Split mode
65
+ 2. Otherwise check `.claude/vibe/specs/{feature-name}.md`Single mode
66
+ 3. If neither exists → Error
67
+
68
+ **Split mode file loading:**
69
+ 1. Read `_index.md` for master SPEC overview
70
+ 2. Glob `phase-*.md` files and read all phase SPECs
71
+ 3. Read corresponding `_index.feature` and `phase-*.feature` files
72
+
73
+ **Output:**
74
+ ```
75
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
76
+ 📋 SPEC REVIEW: {feature-name}
77
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
78
+
79
+ Loading files...
80
+ Mode: {single|split}
81
+ SPEC: .claude/vibe/specs/{feature-name}.md (or _index.md + N phase files)
82
+ ✅ Feature: .claude/vibe/features/{feature-name}.feature (or _index.feature + N phase files)
83
+
84
+ Extracted info:
85
+ - Feature: {feature description}
86
+ - Stack: {tech stack}
87
+ - Phases: {number of phases}
88
+ - Scenarios: {number of scenarios}
89
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Step 2: Quality Validation (95-Point Gate)
95
+
96
+ **🚨 MANDATORY: Score must be ≥ 95 to proceed**
97
+
98
+ ### 2.1 Quality Checklist
99
+
100
+ | Category | Check Item | Weight |
101
+ |----------|------------|--------|
102
+ | **Completeness** | All user flows included in Task | 15% |
103
+ | **Completeness** | All ACs converted to Feature scenarios | 10% |
104
+ | **Completeness** | Error handling scenarios defined | 10% |
105
+ | **Specificity** | All numbers specified (timeout, limits, etc.) | 15% |
106
+ | **Specificity** | No ambiguous terms ("appropriate", "proper", etc.) | 10% |
107
+ | **Testability** | Each AC is verifiable | 10% |
108
+ | **Testability** | Feature scenarios have concrete Given/When/Then | 10% |
109
+ | **Security** | Auth/permission requirements specified | 10% |
110
+ | **Performance** | Response time/load requirements specified | 10% |
111
+
112
+ ### 2.2 Quality Gate Loop
113
+
114
+ ```python
115
+ max_iterations = 3
116
+ iteration = 0
117
+
118
+ while iteration < max_iterations:
119
+ iteration += 1
120
+ score = calculate_quality_score(spec, feature)
121
+
122
+ print(f"━━━ Quality Check [{iteration}/{max_iterations}] ━━━")
123
+ print(f"Score: {score}/100")
124
+
125
+ if score >= 95:
126
+ print("✅ Quality Gate PASSED")
127
+ break
128
+
129
+ # Auto-fix missing items
130
+ missing_items = identify_missing_items(spec)
131
+ for item in missing_items:
132
+ auto_fix(item)
133
+ update_spec()
134
+ update_feature()
135
+
136
+ print(f"✅ Applied {len(missing_items)} fixes - Re-evaluating...")
137
+
138
+ if score < 95:
139
+ print(f"⚠️ Score {score} < 95 after {max_iterations} iterations")
140
+ print("Remaining gaps added to TODO. Proceeding with current quality.")
141
+ ```
142
+
143
+ **Output format:**
144
+ ```
145
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
146
+ 📊 QUALITY GATE [1/3]
147
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
148
+ Score: 87/100 ⚠️ BELOW THRESHOLD (95)
149
+
150
+ Missing items:
151
+ Error handling scenarios (10%)
152
+ ❌ Performance targets (5%)
153
+
154
+ Auto-fixing...
155
+ ✅ Added network error handling scenario
156
+ ✅ Added response time targets (<500ms)
157
+
158
+ Re-evaluating...
159
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
160
+
161
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
162
+ 📊 QUALITY GATE [2/3]
163
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
164
+ Score: 96/100 ✅ PASSED
165
+
166
+ ✅ Quality Gate PASSED - proceeding to GPT/Gemini review
167
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
168
+ ```
169
+
170
+ ### 2.3 Auto-Fix Rules
171
+
172
+ | Missing Item | Auto-Fix Method |
173
+ |--------------|-----------------|
174
+ | Missing AC | Auto-generate AC based on Task |
175
+ | Numbers not specified | Apply project defaults (timeout 30s, etc.) |
176
+ | Missing error handling | Add common error scenarios |
177
+ | Missing performance targets | Apply industry standard criteria |
178
+ | Missing security | Add auth/data protection requirements |
179
+ | Ambiguous terms | Replace with specific values |
180
+
181
+ ---
182
+
183
+ ## Step 3: Race Review (GPT + Gemini Cross-Validation) - Max 3 Rounds (v2.6.9)
184
+
185
+ **RULES FOR RACE REVIEW:**
186
+
187
+ 1. **YOU MUST** use the Bash tool to call `llm-orchestrate.js` directly
188
+ 2. **DO NOT** simulate or fake review results
189
+ 3. Run rounds sequentially (each round uses updated SPEC)
190
+
191
+ > Race Mode reviews SPEC with GPT and Gemini in parallel, then cross-validates findings for higher confidence.
192
+
193
+ ### Convergence Rule (Early Exit)
194
+
195
+ - **Round N findings == Round N-1 findings** converged, stop immediately (no need to reach Round 3)
196
+ - **Round 1 with P1 = 0** → skip Round 2 and stop
197
+ - **Max 3 rounds** if new P1s still appear after 3 rounds, record as TODO and stop
198
+
199
+ ### 3.1 Review Loop (Max 3 Rounds)
200
+
201
+ **For EACH round (1, 2, 3), run GPT + Gemini in PARALLEL via Bash tool. Stop early if converged.**
202
+
203
+ **🚨 IMPORTANT: SPEC content is too large for CLI arguments. Use --input file method (no pipe needed).**
204
+
205
+ **Procedure for each round:**
206
+
207
+ **Step A: Save SPEC content + prompt as JSON to scratchpad temp file (using Write tool):**
208
+ - Write JSON to `[SCRATCHPAD]/spec-review-input.json` with content:
209
+ ```json
210
+ {"prompt": "Review this SPEC for completeness, specificity, testability, security, and performance. Round [N]/3. Find issues and improvements. Return JSON: {issues: [{id, title, description, severity, suggestion}]}. SPEC content: [SPEC_CONTENT]"}
211
+ ```
212
+ - Where `[SPEC_CONTENT]` is the full SPEC text (properly JSON-escaped inside the prompt string)
213
+
214
+ **Step B: Script path:**
215
+ - `[LLM_SCRIPT]` = `{{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js`
216
+
217
+ **Step C: Run GPT + Gemini in PARALLEL (two separate Bash tool calls at once):**
218
+
219
+ ```bash
220
+ # GPT review (Bash tool call 1)
221
+ node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/spec-review-input.json"
222
+ ```
223
+
224
+ ```bash
225
+ # Gemini review (Bash tool call 2 - run in parallel with GPT)
226
+ node "[LLM_SCRIPT]" gemini orchestrate-json --input "[SCRATCHPAD]/spec-review-input.json"
227
+ ```
228
+
229
+ **🚨 MANDATORY: Replace `[SCRATCHPAD]` with the actual scratchpad directory path.**
230
+ **🚨 Replace `[N]` with the current round number (1, 2, or 3).**
231
+ **🚨 Replace `[LLM_SCRIPT]` with the resolved absolute path from Step B.**
232
+ **🚨 Run GPT and Gemini calls in PARALLEL (two separate Bash tool calls at once).**
233
+
234
+ - Round 1: Write SPEC → Run GPT + Gemini in parallel → Cross-validate → Apply fixes → Update SPEC file
235
+ - Round 2: Write updated SPEC → Run → Cross-validate → Apply fixes → Update SPEC file
236
+ - Round 3: Write final SPEC → Run → Cross-validate → Confirm no issues remain
237
+
238
+ ### 3.2 Cross-Validation Rules
239
+
240
+ | Agreement | Priority | Action |
241
+ |-----------|----------|--------|
242
+ | Both models agree (100%) | P1 | Auto-apply immediately |
243
+ | 1 model only (50%) | P2 | Auto-apply with note |
244
+
245
+ **After each round:**
246
+
247
+ 1. Cross-validate findings (issues found by 2+ models → P1, single model → P2)
248
+ 2. Merge feedback with confidence scores
249
+ 3. Auto-apply P1/P2 improvements to SPEC and Feature files (use Edit tool)
250
+ 4. Continue to next round with updated SPEC content
251
+
252
+ ### 3.3 User Decision Checkpoint (Round 3 이후)
253
+
254
+ **🚨 MANDATORY: 3라운드 완료 후 사용자 판단 체크포인트 실행**
255
+
256
+ > Type 6 (Iterative-Reasoning) 패턴: AI가 혼자 결정하지 않고, 사용자와 함께 판단
257
+
258
+ ```
259
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
260
+ 🔍 USER CHECKPOINT: 리뷰 결과 검토
261
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
262
+
263
+ 3라운드 리뷰에서 발견된 주요 변경사항:
264
+
265
+ | # | 변경 내용 | 출처 | 신뢰도 |
266
+ |---|----------|------|--------|
267
+ | 1 | {변경1} | GPT+Gemini | 100% |
268
+ | 2 | {변경2} | GPT only | 50% |
269
+ | ... | ... | ... | ... |
270
+
271
+ 질문:
272
+ 1. 위 변경사항 중 제외하고 싶은 항목이 있나요?
273
+ 2. 추가로 명시해야 할 요구사항이 있나요?
274
+ 3. 기술적 접근 방식에 동의하시나요?
275
+
276
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
277
+ ```
278
+
279
+ **Checkpoint 행동 규칙:**
280
+
281
+ | 상황 | 행동 |
282
+ |------|------|
283
+ | `ultrawork` 모드 | 체크포인트 스킵, 자동 진행 |
284
+ | 일반 모드 | 반드시 사용자 응답 대기 |
285
+ | 사용자가 변경 요청 | 수정 후 다시 체크포인트 |
286
+ | 사용자가 승인 | Step 4로 진행 |
287
+
288
+ **Output format:**
289
+ ```
290
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
291
+ 🏁 SPEC RACE REVIEW - Round 1/3
292
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
293
+
294
+ Model Results:
295
+ | Model | Issues | Duration |
296
+ |--------|--------|----------|
297
+ | GPT | 2 | 1823ms |
298
+ | Gemini | 2 | 2156ms |
299
+
300
+ Cross-Validated Issues:
301
+ | Issue | GPT | Gemini | Confidence |
302
+ |--------------------------|-----|--------|------------|
303
+ | Missing retry logic | ✅ | ✅ | 100% → P1 |
304
+ | Missing rate limiting | ✅ | ✅ | 100% P1 |
305
+ | Token refresh unclear | ✅ | ❌ | 50% → P2 |
306
+
307
+ Auto-applying...
308
+ [P1] Added retry logic (3 attempts, exponential backoff)
309
+ ✅ [P1] Added rate limiting (100 req/min)
310
+ ✅ [P2] Added token refresh flow
311
+
312
+ Round 1 complete - 3 improvements (2 P1, 1 P2)
313
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
314
+
315
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
316
+ 🏁 SPEC RACE REVIEW - Round 2/3
317
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
318
+
319
+ Cross-Validated Issues:
320
+ | Issue | GPT | Gemini | Confidence |
321
+ |-----------------------------|-----|--------|------------|
322
+ | Concurrent session unclear | ✅ | ❌ | 50% → P2 |
323
+
324
+ Auto-applying...
325
+ ✅ [P2] Added concurrent session policy
326
+
327
+ Round 2 complete - 1 improvement
328
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
329
+
330
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
331
+ 🏁 SPEC RACE REVIEW - Round 3/3
332
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
333
+
334
+ Cross-Validated Issues: None
335
+
336
+ ✅ No changes needed - SPEC is complete
337
+ ✅ Consensus Rate: 100%
338
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
339
+ ```
340
+
341
+ ---
342
+
343
+ ## Step 3.5: Review Debate Team (Agent Teams)
344
+
345
+ > **조건**: Agent Teams 활성화 + 3라운드 완료 후 P1/P2 이슈 2개 이상 발견 시
346
+ > 여러 관점에서 교차 검증하여 오탐 제거 및 우선순위 조정
347
+
348
+ **팀 구성:**
349
+
350
+ | 팀원 | 역할 |
351
+ |------|------|
352
+ | security-reviewer (리더) | 보안 관점 우선순위 결정, 교차 검증 주도 |
353
+ | architecture-reviewer | 구조적 영향 평가, 설계 일관성 확인 |
354
+ | performance-reviewer | 성능 영향 평가, 불필요한 최적화 식별 |
355
+ | simplicity-reviewer | 과잉 설계 여부, YAGNI 위반 식별 |
356
+
357
+ **활성화 조건:**
358
+
359
+ | 상황 | 행동 |
360
+ |------|------|
361
+ | P1/P2 이슈 2개 이상 | 자동 활성화 |
362
+ | P1/P2 이슈 1개 이하 | 스킵 → Step 4로 진행 |
363
+ | Agent Teams 비활성화 | 스킵 → Step 4로 진행 |
364
+
365
+ **spawn 패턴:**
366
+
367
+ ```text
368
+ TeamCreate(team_name="spec-debate-{feature}", description="SPEC review debate for {feature}")
369
+
370
+ Task(team_name="spec-debate-{feature}", name="security-reviewer", subagent_type="security-reviewer",
371
+ mode="bypassPermissions",
372
+ prompt="SPEC 리뷰 리더. GPT/Gemini가 발견한 P1/P2 이슈를 교차 검증하세요.
373
+ SPEC: {spec_content}
374
+ 발견된 이슈: {p1_p2_issues}
375
+ 역할: 각 이슈가 진짜인지(오탐 아닌지) 검증. 실제 영향도 기준으로 우선순위 조정.
376
+ 분쟁이 있는 이슈는 해당 리뷰어에게 SendMessage로 확인 요청하세요.")
377
+
378
+ Task(team_name="spec-debate-{feature}", name="architecture-reviewer", subagent_type="architecture-reviewer",
379
+ mode="bypassPermissions",
380
+ prompt="SPEC 리뷰 팀 아키텍처 전문가. 아키텍처 관련 이슈를 검증하세요.
381
+ SPEC: {spec_content}
382
+ 역할: 구조적 일관성, SOLID 원칙, 레이어 경계 검증.
383
+ 우선순위 변경 필요 security-reviewer에게 SendMessage로 알리세요.")
384
+
385
+ Task(team_name="spec-debate-{feature}", name="performance-reviewer", subagent_type="performance-reviewer",
386
+ mode="bypassPermissions",
387
+ prompt="SPEC 리뷰 팀 성능 전문가. 성능 관련 이슈를 검증하세요.
388
+ SPEC: {spec_content}
389
+ 역할: 성능 요구사항 현실성 평가, 불필요한 최적화 식별.
390
+ P2→P1 승격이 필요하면 security-reviewer에게 SendMessage로 알리세요.")
391
+
392
+ Task(team_name="spec-debate-{feature}", name="simplicity-reviewer", subagent_type="simplicity-reviewer",
393
+ mode="bypassPermissions",
394
+ prompt="SPEC 리뷰 팀 단순성 전문가. 과잉 설계 여부를 검증하세요.
395
+ SPEC: {spec_content}
396
+ 역할: YAGNI 위반, 불필요한 복잡성 식별.
397
+ P1→P2 강등이 필요하면 security-reviewer에게 SendMessage로 알리세요.")
398
+ ```
399
+
400
+ **결과 통합:**
401
+ - 팀 합의 결과를 SPEC에 반영 (P1 즉시 적용, P2 노트 추가)
402
+ - 팀원 shutdown_request → TeamDelete로 정리
403
+ - Step 4 (Final Summary)로 진행
404
+
405
+ ---
406
+
407
+ ## Step 4: Final Summary
408
+
409
+ ```
410
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
411
+ SPEC REVIEW COMPLETE: {feature-name}
412
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
413
+
414
+ Quality Score: 96/100
415
+ Review Rounds: 3/3 ✅
416
+ Total Improvements: 4
417
+ ⏱️ Started: {start_time}
418
+ ⏱️ Completed: {getCurrentTime 결과}
419
+
420
+ Updated files:
421
+ 📋 .claude/vibe/specs/{feature-name}.md (or split folder)
422
+ 📋 .claude/vibe/features/{feature-name}.feature (or split folder)
423
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
424
+ ```
425
+
426
+ ---
427
+
428
+ ## Step 5: SPEC Summary for User Review
429
+
430
+ **🚨 MANDATORY: Always output this summary before proceeding to `/vibe.run`.**
431
+
432
+ After all review rounds, present the finalized SPEC to the user in a readable format:
433
+
434
+ ```
435
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
436
+ 📋 SPEC SUMMARY: {feature-name}
437
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
438
+
439
+ ## Feature Overview
440
+ {1-2 line summary of feature purpose from SPEC's <role> and <context>}
441
+
442
+ ## Tech Stack
443
+ {Tech stack list extracted from <context>}
444
+
445
+ ## Implementation Phases
446
+ | Phase | Name | Key Tasks |
447
+ |-------|------|-----------|
448
+ | 1 | {phase name} | {1-line summary of core task} |
449
+ | 2 | {phase name} | {1-line summary of core task} |
450
+ | ... | ... | ... |
451
+
452
+ ## Key Scenarios ({N} total)
453
+ {Scenario name list from Feature file}
454
+ - Scenario: {name1}
455
+ - Scenario: {name2}
456
+ - ...
457
+
458
+ ## Key Constraints
459
+ {3-5 key items from <constraints>}
460
+
461
+ ## Acceptance Criteria
462
+ {Summary of key items from <acceptance>}
463
+
464
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
465
+ If anything above is incorrect, please request changes.
466
+ If no issues, proceed with /vibe.run "{feature-name}".
467
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
468
+ ```
469
+
470
+ **Important:**
471
+
472
+ - List ALL Phases, Scenarios, and Constraints from SPEC without omission
473
+ - Keep it concise for quick user review
474
+ - Wait for user confirmation after review (unless ultrawork mode)
475
+ - In ultrawork mode: output summary then auto-proceed to `/vibe.run`
476
+
477
+ ### 5.1 Final User Checkpoint
478
+
479
+ **🚨 MANDATORY: `/vibe.run` 진행 최종 사용자 확인**
480
+
481
+ ```
482
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
483
+ ✅ SPEC 리뷰 완료 - 최종 확인
484
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
485
+
486
+ 다음 질문에 답변해 주세요:
487
+
488
+ 1. **요구사항 정확성**: 위 SPEC이 원래 의도한 기능을 정확히 설명하고 있나요?
489
+ 2. **범위 적절성**: 구현 범위가 너무 크거나 작지 않나요?
490
+ 3. **기술 스택**: 선택된 기술 스택에 동의하시나요?
491
+ 4. **우선순위**: Phase 순서와 우선순위가 맞나요?
492
+
493
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
494
+ 💡 "ok" 또는 "진행"으로 승인 / 수정 사항이 있으면 말씀해 주세요
495
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
496
+ ```
497
+
498
+ **Why This Checkpoint Matters:**
499
+
500
+ > AI가 더 많이 해준다고 좋은 게 아닙니다.
501
+ > 사용자가 AI와 함께 생각하고 판단할 때 최고의 결과가 나옵니다.
502
+ > 체크포인트는 Type 6 (Iterative-Reasoning) 패턴을 유도합니다.
503
+
504
+ ---
505
+
506
+ ## Next Step
507
+
508
+ ```
509
+ /vibe.run "{feature-name}"
510
+ ```
511
+
512
+ ---
513
+
514
+ ## Error Handling
515
+
516
+ ### SPEC Not Found
517
+ ```
518
+ ❌ ERROR: SPEC file not found
519
+
520
+ Expected (single): .claude/vibe/specs/{feature-name}.md
521
+ Expected (split): .claude/vibe/specs/{feature-name}/_index.md
522
+
523
+ Please run /vibe.spec "{feature-name}" first to create the SPEC.
524
+ ```
525
+
526
+ ### Feature Not Found
527
+ ```
528
+ ❌ ERROR: Feature file not found
529
+
530
+ Expected (single): .claude/vibe/features/{feature-name}.feature
531
+ Expected (split): .claude/vibe/features/{feature-name}/_index.feature
532
+
533
+ Please run /vibe.spec "{feature-name}" first to create the Feature file.
534
+ ```
535
+
536
+ ### GPT/Gemini Call Failed
537
+ ```
538
+ ⚠️ WARNING: {GPT|Gemini} call failed
539
+
540
+ Error: {error message}
541
+
542
+ Continuing with {other model} results only...
543
+ ```
544
+
545
+ ---
546
+
547
+ ## Quick Mode
548
+
549
+ For faster iteration (1 round only):
550
+
551
+ ```bash
552
+ /vibe.spec.review "feature-name" --quick
553
+ ```
554
+
555
+ ---
556
+
557
+ ARGUMENTS: $ARGUMENTS
558
+
559
+ **File Detection (execute before Step 1):**
560
+
561
+ ```
562
+ Feature name: $ARGUMENTS
563
+
564
+ 1. Check split folder: .claude/vibe/specs/$ARGUMENTS/_index.md
565
+ - If exists → Split mode (read all files in folder)
566
+ 2. Check single file: .claude/vibe/specs/$ARGUMENTS.md
567
+ - If exists → Single mode
568
+ 3. Neither exists → Show error with both expected paths
569
+ ```