@su-record/vibe 2.5.11 → 2.5.13

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 (341) hide show
  1. package/CLAUDE.md +243 -0
  2. package/LICENSE +21 -21
  3. package/README.md +262 -262
  4. package/agents/architect-low.md +41 -41
  5. package/agents/architect-medium.md +59 -59
  6. package/agents/architect.md +80 -80
  7. package/agents/build-error-resolver.md +115 -115
  8. package/agents/compounder.md +261 -261
  9. package/agents/diagrammer.md +178 -178
  10. package/agents/e2e-tester.md +266 -266
  11. package/agents/explorer-low.md +42 -42
  12. package/agents/explorer-medium.md +59 -59
  13. package/agents/explorer.md +48 -48
  14. package/agents/implementer-low.md +43 -43
  15. package/agents/implementer-medium.md +52 -52
  16. package/agents/implementer.md +54 -54
  17. package/agents/refactor-cleaner.md +143 -143
  18. package/agents/research/best-practices-agent.md +189 -189
  19. package/agents/research/codebase-patterns-agent.md +147 -147
  20. package/agents/research/framework-docs-agent.md +178 -178
  21. package/agents/research/security-advisory-agent.md +203 -203
  22. package/agents/review/architecture-reviewer.md +107 -107
  23. package/agents/review/complexity-reviewer.md +116 -116
  24. package/agents/review/data-integrity-reviewer.md +88 -88
  25. package/agents/review/git-history-reviewer.md +103 -103
  26. package/agents/review/performance-reviewer.md +86 -86
  27. package/agents/review/python-reviewer.md +150 -150
  28. package/agents/review/rails-reviewer.md +139 -139
  29. package/agents/review/react-reviewer.md +144 -144
  30. package/agents/review/security-reviewer.md +80 -80
  31. package/agents/review/simplicity-reviewer.md +140 -140
  32. package/agents/review/test-coverage-reviewer.md +116 -116
  33. package/agents/review/typescript-reviewer.md +127 -127
  34. package/agents/searcher.md +54 -54
  35. package/agents/simplifier.md +120 -120
  36. package/agents/tester.md +49 -49
  37. package/agents/ui-previewer.md +129 -129
  38. package/commands/vibe.analyze.md +356 -356
  39. package/commands/vibe.reason.md +329 -329
  40. package/commands/vibe.review.md +326 -326
  41. package/commands/vibe.run.md +1117 -1051
  42. package/commands/vibe.spec.md +1058 -1058
  43. package/commands/vibe.utils.md +353 -296
  44. package/commands/vibe.verify.md +375 -375
  45. package/dist/cli/collaborator.js +52 -52
  46. package/dist/cli/detect.js +32 -32
  47. package/dist/cli/index.js +102 -102
  48. package/dist/cli/llm.js +144 -144
  49. package/dist/cli/mcp.d.ts +49 -0
  50. package/dist/cli/mcp.d.ts.map +1 -0
  51. package/dist/cli/mcp.js +169 -0
  52. package/dist/cli/mcp.js.map +1 -0
  53. package/dist/cli/postinstall.js +180 -2
  54. package/dist/cli/postinstall.js.map +1 -1
  55. package/dist/cli/setup/GlobalInstaller.d.ts +24 -0
  56. package/dist/cli/setup/GlobalInstaller.d.ts.map +1 -0
  57. package/dist/cli/setup/GlobalInstaller.js +130 -0
  58. package/dist/cli/setup/GlobalInstaller.js.map +1 -0
  59. package/dist/cli/setup/LanguageDetector.d.ts +16 -0
  60. package/dist/cli/setup/LanguageDetector.d.ts.map +1 -0
  61. package/dist/cli/setup/LanguageDetector.js +49 -0
  62. package/dist/cli/setup/LanguageDetector.js.map +1 -0
  63. package/dist/cli/setup/LegacyMigration.d.ts +25 -0
  64. package/dist/cli/setup/LegacyMigration.d.ts.map +1 -0
  65. package/dist/cli/setup/LegacyMigration.js +162 -0
  66. package/dist/cli/setup/LegacyMigration.js.map +1 -0
  67. package/dist/cli/setup/ProjectSetup.d.ts +30 -0
  68. package/dist/cli/setup/ProjectSetup.d.ts.map +1 -0
  69. package/dist/cli/setup/ProjectSetup.js +238 -0
  70. package/dist/cli/setup/ProjectSetup.js.map +1 -0
  71. package/dist/cli/setup/index.d.ts +14 -0
  72. package/dist/cli/setup/index.d.ts.map +1 -0
  73. package/dist/cli/setup/index.js +18 -0
  74. package/dist/cli/setup/index.js.map +1 -0
  75. package/dist/cli/setup.d.ts +10 -77
  76. package/dist/cli/setup.d.ts.map +1 -1
  77. package/dist/cli/setup.js +15 -592
  78. package/dist/cli/setup.js.map +1 -1
  79. package/dist/lib/DeepInit.d.ts +0 -2
  80. package/dist/lib/DeepInit.d.ts.map +1 -1
  81. package/dist/lib/DeepInit.js +24 -26
  82. package/dist/lib/DeepInit.js.map +1 -1
  83. package/dist/lib/IterationTracker.d.ts +0 -2
  84. package/dist/lib/IterationTracker.d.ts.map +1 -1
  85. package/dist/lib/IterationTracker.js +11 -13
  86. package/dist/lib/IterationTracker.js.map +1 -1
  87. package/dist/lib/ModelRouter.d.ts +0 -2
  88. package/dist/lib/ModelRouter.d.ts.map +1 -1
  89. package/dist/lib/ModelRouter.js +0 -2
  90. package/dist/lib/ModelRouter.js.map +1 -1
  91. package/dist/lib/OrchestrateWorkflow.d.ts +1 -3
  92. package/dist/lib/OrchestrateWorkflow.d.ts.map +1 -1
  93. package/dist/lib/OrchestrateWorkflow.js +1 -3
  94. package/dist/lib/OrchestrateWorkflow.js.map +1 -1
  95. package/dist/lib/PythonParser.js +108 -108
  96. package/dist/lib/SkillFrontmatter.d.ts +0 -2
  97. package/dist/lib/SkillFrontmatter.d.ts.map +1 -1
  98. package/dist/lib/SkillFrontmatter.js +28 -30
  99. package/dist/lib/SkillFrontmatter.js.map +1 -1
  100. package/dist/lib/SkillQualityGate.d.ts +0 -2
  101. package/dist/lib/SkillQualityGate.d.ts.map +1 -1
  102. package/dist/lib/SkillQualityGate.js +9 -11
  103. package/dist/lib/SkillQualityGate.js.map +1 -1
  104. package/dist/lib/SkillRepository.d.ts +117 -0
  105. package/dist/lib/SkillRepository.d.ts.map +1 -0
  106. package/dist/lib/SkillRepository.js +477 -0
  107. package/dist/lib/SkillRepository.js.map +1 -0
  108. package/dist/lib/UltraQA.d.ts +0 -2
  109. package/dist/lib/UltraQA.d.ts.map +1 -1
  110. package/dist/lib/UltraQA.js +77 -79
  111. package/dist/lib/UltraQA.js.map +1 -1
  112. package/dist/lib/gemini-mcp.d.ts +10 -0
  113. package/dist/lib/gemini-mcp.d.ts.map +1 -0
  114. package/dist/lib/gemini-mcp.js +353 -0
  115. package/dist/lib/gemini-mcp.js.map +1 -0
  116. package/dist/lib/gpt-api.js +4 -4
  117. package/dist/lib/gpt-mcp.d.ts +10 -0
  118. package/dist/lib/gpt-mcp.d.ts.map +1 -0
  119. package/dist/lib/gpt-mcp.js +352 -0
  120. package/dist/lib/gpt-mcp.js.map +1 -0
  121. package/dist/lib/llm/auth/ApiKeyManager.d.ts +21 -0
  122. package/dist/lib/llm/auth/ApiKeyManager.d.ts.map +1 -0
  123. package/dist/lib/llm/auth/ApiKeyManager.js +43 -0
  124. package/dist/lib/llm/auth/ApiKeyManager.js.map +1 -0
  125. package/dist/lib/llm/auth/ConfigManager.d.ts +29 -0
  126. package/dist/lib/llm/auth/ConfigManager.d.ts.map +1 -0
  127. package/dist/lib/llm/auth/ConfigManager.js +67 -0
  128. package/dist/lib/llm/auth/ConfigManager.js.map +1 -0
  129. package/dist/lib/llm/auth/index.d.ts +25 -0
  130. package/dist/lib/llm/auth/index.d.ts.map +1 -0
  131. package/dist/lib/llm/auth/index.js +83 -0
  132. package/dist/lib/llm/auth/index.js.map +1 -0
  133. package/dist/lib/llm/index.d.ts +10 -0
  134. package/dist/lib/llm/index.d.ts.map +1 -0
  135. package/dist/lib/llm/index.js +12 -0
  136. package/dist/lib/llm/index.js.map +1 -0
  137. package/dist/lib/llm/types.d.ts +96 -0
  138. package/dist/lib/llm/types.d.ts.map +1 -0
  139. package/dist/lib/llm/types.js +17 -0
  140. package/dist/lib/llm/types.js.map +1 -0
  141. package/dist/lib/llm/utils/index.d.ts +6 -0
  142. package/dist/lib/llm/utils/index.d.ts.map +1 -0
  143. package/dist/lib/llm/utils/index.js +6 -0
  144. package/dist/lib/llm/utils/index.js.map +1 -0
  145. package/dist/lib/llm/utils/retry.d.ts +25 -0
  146. package/dist/lib/llm/utils/retry.d.ts.map +1 -0
  147. package/dist/lib/llm/utils/retry.js +72 -0
  148. package/dist/lib/llm/utils/retry.js.map +1 -0
  149. package/dist/lib/llm/utils/stream.d.ts +13 -0
  150. package/dist/lib/llm/utils/stream.d.ts.map +1 -0
  151. package/dist/lib/llm/utils/stream.js +110 -0
  152. package/dist/lib/llm/utils/stream.js.map +1 -0
  153. package/dist/lib/memory/KnowledgeGraph.js +4 -4
  154. package/dist/lib/memory/MemorySearch.js +20 -20
  155. package/dist/lib/memory/MemoryStorage.js +64 -64
  156. package/dist/orchestrator/AgentExecutor.d.ts +23 -0
  157. package/dist/orchestrator/AgentExecutor.d.ts.map +1 -0
  158. package/dist/orchestrator/AgentExecutor.js +231 -0
  159. package/dist/orchestrator/AgentExecutor.js.map +1 -0
  160. package/dist/orchestrator/AgentManager.d.ts +73 -0
  161. package/dist/orchestrator/AgentManager.d.ts.map +1 -0
  162. package/dist/orchestrator/AgentManager.js +184 -0
  163. package/dist/orchestrator/AgentManager.js.map +1 -0
  164. package/dist/orchestrator/LLMCluster.d.ts +70 -0
  165. package/dist/orchestrator/LLMCluster.d.ts.map +1 -0
  166. package/dist/orchestrator/LLMCluster.js +91 -0
  167. package/dist/orchestrator/LLMCluster.js.map +1 -0
  168. package/dist/orchestrator/MultiLlmResearch.d.ts +27 -0
  169. package/dist/orchestrator/MultiLlmResearch.d.ts.map +1 -0
  170. package/dist/orchestrator/MultiLlmResearch.js +145 -0
  171. package/dist/orchestrator/MultiLlmResearch.js.map +1 -0
  172. package/dist/orchestrator/SessionStore.d.ts +41 -0
  173. package/dist/orchestrator/SessionStore.d.ts.map +1 -0
  174. package/dist/orchestrator/SessionStore.js +117 -0
  175. package/dist/orchestrator/SessionStore.js.map +1 -0
  176. package/dist/orchestrator/SmartRouter.d.ts +68 -0
  177. package/dist/orchestrator/SmartRouter.d.ts.map +1 -0
  178. package/dist/orchestrator/SmartRouter.js +256 -0
  179. package/dist/orchestrator/SmartRouter.js.map +1 -0
  180. package/dist/orchestrator/backgroundAgent.d.ts +10 -28
  181. package/dist/orchestrator/backgroundAgent.d.ts.map +1 -1
  182. package/dist/orchestrator/backgroundAgent.js +11 -346
  183. package/dist/orchestrator/backgroundAgent.js.map +1 -1
  184. package/dist/orchestrator/index.d.ts +3 -0
  185. package/dist/orchestrator/index.d.ts.map +1 -1
  186. package/dist/orchestrator/index.js +4 -0
  187. package/dist/orchestrator/index.js.map +1 -1
  188. package/dist/orchestrator/orchestrator.d.ts +19 -154
  189. package/dist/orchestrator/orchestrator.d.ts.map +1 -1
  190. package/dist/orchestrator/orchestrator.js +90 -514
  191. package/dist/orchestrator/orchestrator.js.map +1 -1
  192. package/dist/orchestrator/parallelResearch.d.ts +5 -12
  193. package/dist/orchestrator/parallelResearch.d.ts.map +1 -1
  194. package/dist/orchestrator/parallelResearch.js +10 -193
  195. package/dist/orchestrator/parallelResearch.js.map +1 -1
  196. package/dist/tools/analytics/getUsageAnalytics.d.ts +10 -0
  197. package/dist/tools/analytics/getUsageAnalytics.d.ts.map +1 -0
  198. package/dist/tools/analytics/getUsageAnalytics.js +246 -0
  199. package/dist/tools/analytics/getUsageAnalytics.js.map +1 -0
  200. package/dist/tools/analytics/index.d.ts +5 -0
  201. package/dist/tools/analytics/index.d.ts.map +1 -0
  202. package/dist/tools/analytics/index.js +5 -0
  203. package/dist/tools/analytics/index.js.map +1 -0
  204. package/dist/tools/convention/analyzeComplexity.test.js +115 -115
  205. package/dist/tools/convention/getCodingGuide.d.ts +7 -0
  206. package/dist/tools/convention/getCodingGuide.d.ts.map +1 -0
  207. package/dist/tools/convention/getCodingGuide.js +69 -0
  208. package/dist/tools/convention/getCodingGuide.js.map +1 -0
  209. package/dist/tools/convention/validateCodeQuality.test.js +104 -104
  210. package/dist/tools/index.d.ts +2 -0
  211. package/dist/tools/index.d.ts.map +1 -1
  212. package/dist/tools/index.js +2 -0
  213. package/dist/tools/index.js.map +1 -1
  214. package/dist/tools/planning/analyzeRequirements.d.ts +9 -0
  215. package/dist/tools/planning/analyzeRequirements.d.ts.map +1 -0
  216. package/dist/tools/planning/analyzeRequirements.js +171 -0
  217. package/dist/tools/planning/analyzeRequirements.js.map +1 -0
  218. package/dist/tools/planning/createUserStories.d.ts +9 -0
  219. package/dist/tools/planning/createUserStories.d.ts.map +1 -0
  220. package/dist/tools/planning/createUserStories.js +124 -0
  221. package/dist/tools/planning/createUserStories.js.map +1 -0
  222. package/dist/tools/planning/featureRoadmap.d.ts +10 -0
  223. package/dist/tools/planning/featureRoadmap.d.ts.map +1 -0
  224. package/dist/tools/planning/featureRoadmap.js +207 -0
  225. package/dist/tools/planning/featureRoadmap.js.map +1 -0
  226. package/dist/tools/planning/generatePrd.d.ts +11 -0
  227. package/dist/tools/planning/generatePrd.d.ts.map +1 -0
  228. package/dist/tools/planning/generatePrd.js +161 -0
  229. package/dist/tools/planning/generatePrd.js.map +1 -0
  230. package/dist/tools/planning/index.d.ts +8 -0
  231. package/dist/tools/planning/index.d.ts.map +1 -0
  232. package/dist/tools/planning/index.js +8 -0
  233. package/dist/tools/planning/index.js.map +1 -0
  234. package/dist/tools/prompt/analyzePrompt.d.ts +7 -0
  235. package/dist/tools/prompt/analyzePrompt.d.ts.map +1 -0
  236. package/dist/tools/prompt/analyzePrompt.js +150 -0
  237. package/dist/tools/prompt/analyzePrompt.js.map +1 -0
  238. package/dist/tools/prompt/enhancePrompt.d.ts +8 -0
  239. package/dist/tools/prompt/enhancePrompt.d.ts.map +1 -0
  240. package/dist/tools/prompt/enhancePrompt.js +110 -0
  241. package/dist/tools/prompt/enhancePrompt.js.map +1 -0
  242. package/dist/tools/prompt/enhancePromptGemini.d.ts +8 -0
  243. package/dist/tools/prompt/enhancePromptGemini.d.ts.map +1 -0
  244. package/dist/tools/prompt/enhancePromptGemini.js +332 -0
  245. package/dist/tools/prompt/enhancePromptGemini.js.map +1 -0
  246. package/dist/tools/prompt/index.d.ts +7 -0
  247. package/dist/tools/prompt/index.d.ts.map +1 -0
  248. package/dist/tools/prompt/index.js +7 -0
  249. package/dist/tools/prompt/index.js.map +1 -0
  250. package/dist/tools/reasoning/applyReasoningFramework.d.ts +8 -0
  251. package/dist/tools/reasoning/applyReasoningFramework.d.ts.map +1 -0
  252. package/dist/tools/reasoning/applyReasoningFramework.js +266 -0
  253. package/dist/tools/reasoning/applyReasoningFramework.js.map +1 -0
  254. package/dist/tools/reasoning/index.d.ts +5 -0
  255. package/dist/tools/reasoning/index.d.ts.map +1 -0
  256. package/dist/tools/reasoning/index.js +5 -0
  257. package/dist/tools/reasoning/index.js.map +1 -0
  258. package/dist/tools/thinking/analyzeProblem.d.ts +7 -0
  259. package/dist/tools/thinking/analyzeProblem.d.ts.map +1 -0
  260. package/dist/tools/thinking/analyzeProblem.js +55 -0
  261. package/dist/tools/thinking/analyzeProblem.js.map +1 -0
  262. package/dist/tools/thinking/breakDownProblem.d.ts +8 -0
  263. package/dist/tools/thinking/breakDownProblem.d.ts.map +1 -0
  264. package/dist/tools/thinking/breakDownProblem.js +145 -0
  265. package/dist/tools/thinking/breakDownProblem.js.map +1 -0
  266. package/dist/tools/thinking/createThinkingChain.d.ts +7 -0
  267. package/dist/tools/thinking/createThinkingChain.d.ts.map +1 -0
  268. package/dist/tools/thinking/createThinkingChain.js +44 -0
  269. package/dist/tools/thinking/createThinkingChain.js.map +1 -0
  270. package/dist/tools/thinking/formatAsPlan.d.ts +9 -0
  271. package/dist/tools/thinking/formatAsPlan.d.ts.map +1 -0
  272. package/dist/tools/thinking/formatAsPlan.js +78 -0
  273. package/dist/tools/thinking/formatAsPlan.js.map +1 -0
  274. package/dist/tools/thinking/index.d.ts +10 -0
  275. package/dist/tools/thinking/index.d.ts.map +1 -0
  276. package/dist/tools/thinking/index.js +10 -0
  277. package/dist/tools/thinking/index.js.map +1 -0
  278. package/dist/tools/thinking/stepByStepAnalysis.d.ts +8 -0
  279. package/dist/tools/thinking/stepByStepAnalysis.d.ts.map +1 -0
  280. package/dist/tools/thinking/stepByStepAnalysis.js +63 -0
  281. package/dist/tools/thinking/stepByStepAnalysis.js.map +1 -0
  282. package/dist/tools/thinking/thinkAloudProcess.d.ts +8 -0
  283. package/dist/tools/thinking/thinkAloudProcess.d.ts.map +1 -0
  284. package/dist/tools/thinking/thinkAloudProcess.js +80 -0
  285. package/dist/tools/thinking/thinkAloudProcess.js.map +1 -0
  286. package/hooks/hooks.json +222 -222
  287. package/hooks/scripts/code-check.js +22 -22
  288. package/hooks/scripts/code-review.js +22 -22
  289. package/hooks/scripts/complexity.js +22 -22
  290. package/hooks/scripts/compound.js +23 -23
  291. package/hooks/scripts/context-save.js +33 -33
  292. package/hooks/scripts/generate-brand-assets.js +472 -0
  293. package/hooks/scripts/hud-multiline.js +262 -264
  294. package/hooks/scripts/hud-status.js +291 -293
  295. package/hooks/scripts/keyword-detector.js +214 -216
  296. package/hooks/scripts/llm-orchestrate.js +171 -171
  297. package/hooks/scripts/post-edit.js +97 -97
  298. package/hooks/scripts/post-tool-verify.js +210 -212
  299. package/hooks/scripts/pre-tool-guard.js +125 -127
  300. package/hooks/scripts/recall.js +22 -22
  301. package/hooks/scripts/session-start.js +30 -30
  302. package/hooks/scripts/skill-injector.js +191 -193
  303. package/hooks/scripts/utils.js +97 -97
  304. package/languages/csharp-unity.md +515 -515
  305. package/languages/gdscript-godot.md +470 -470
  306. package/languages/ruby-rails.md +489 -489
  307. package/languages/typescript-angular.md +433 -433
  308. package/languages/typescript-astro.md +416 -416
  309. package/languages/typescript-electron.md +406 -406
  310. package/languages/typescript-nestjs.md +524 -524
  311. package/languages/typescript-svelte.md +407 -407
  312. package/languages/typescript-tauri.md +365 -365
  313. package/package.json +83 -83
  314. package/skills/brand-assets.md +141 -0
  315. package/skills/commerce-patterns.md +361 -0
  316. package/skills/context7-usage.md +102 -102
  317. package/skills/e2e-commerce.md +304 -0
  318. package/skills/frontend-design.md +92 -0
  319. package/skills/git-worktree.md +181 -181
  320. package/skills/parallel-research.md +77 -77
  321. package/skills/priority-todos.md +239 -239
  322. package/skills/seo-checklist.md +244 -0
  323. package/skills/tool-fallback.md +190 -190
  324. package/skills/vibe-capabilities.md +161 -161
  325. package/vibe/constitution.md +227 -227
  326. package/vibe/rules/core/communication-guide.md +98 -98
  327. package/vibe/rules/core/development-philosophy.md +52 -52
  328. package/vibe/rules/core/quick-start.md +102 -102
  329. package/vibe/rules/quality/bdd-contract-testing.md +393 -393
  330. package/vibe/rules/quality/checklist.md +276 -276
  331. package/vibe/rules/quality/testing-strategy.md +440 -440
  332. package/vibe/rules/standards/anti-patterns.md +541 -541
  333. package/vibe/rules/standards/code-structure.md +291 -291
  334. package/vibe/rules/standards/complexity-metrics.md +313 -313
  335. package/vibe/rules/standards/naming-conventions.md +198 -198
  336. package/vibe/setup.sh +31 -31
  337. package/vibe/templates/constitution-template.md +252 -252
  338. package/vibe/templates/contract-backend-template.md +526 -526
  339. package/vibe/templates/contract-frontend-template.md +599 -599
  340. package/vibe/templates/feature-template.md +96 -96
  341. package/vibe/templates/spec-template.md +221 -221
@@ -1,1058 +1,1058 @@
1
- ---
2
- description: Create SPEC document with Specification Agent
3
- argument-hint: "feature name"
4
- ---
5
-
6
- # /vibe.spec
7
-
8
- Create a SPEC document (Specification Agent).
9
-
10
- ## Usage
11
-
12
- ```
13
- /vibe.spec "feature-name" # Conversation mode (requirements gathering)
14
- /vibe.spec "docs/login-prd.md" # File path input (auto-detected)
15
- /vibe.spec + 📎 file attachment # Use attached file
16
- ```
17
-
18
- ## Input Mode Detection (Auto-detect)
19
-
20
- **Input priority:**
21
-
22
- ```
23
- 1. Attachment exists? → Use attached file
24
- 2. Argument is file path? (existence check) → Read file
25
- 3. Otherwise → Conversation mode (start with feature name)
26
- ```
27
-
28
- | Input | Result |
29
- |-------|--------|
30
- | 📎 Attached file | → Analyze attached file |
31
- | File path (exists) | → Read file (Read tool) |
32
- | Feature name | → Start conversation mode |
33
-
34
- **All supported files:**
35
- - Text: `.md`, `.txt`, `.rst`, `.html`, `.json`, `.yaml`, etc.
36
- - Documents: `.pdf` (page-by-page analysis)
37
- - Images: `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.svg`, etc.
38
- - Notebooks: `.ipynb` (Jupyter)
39
- - **All formats Claude can read**
40
-
41
- **File input mode flow:**
42
-
43
- ```
44
- /vibe.spec "docs/login-prd.md"
45
-
46
- 📄 File loaded: docs/login-prd.md (2.3KB)
47
-
48
- 📋 Parsed requirements:
49
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
50
- Feature: Login
51
- - Email/password login
52
- - Social login (Google, Apple)
53
- - Password recovery
54
- - Auto login persistence
55
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
56
-
57
- ❓ Additional confirmation needed:
58
- 1. Session expiration time? (default: 24 hours)
59
- 2. Allow concurrent login?
60
- 3. Confirm tech stack? (current: React + Supabase)
61
-
62
- User: 1 hour, disallow, confirm
63
-
64
- ✅ Requirements confirmed → Run research → Generate SPEC → Review
65
- ```
66
-
67
- **Supported file formats:**
68
-
69
- | Format | Extension | Purpose |
70
- |--------|-----------|---------|
71
- | Markdown | `.md` | PRD, planning docs, README |
72
- | Text | `.txt` | Requirements list |
73
- | PDF | `.pdf` | Planning docs, design documents |
74
- | Image | `.png`, `.jpg`, `.jpeg`, `.webp` | Wireframes, UI design, screenshots |
75
-
76
- **Image input example:**
77
- ```
78
- /vibe.spec "designs/login-wireframe.png"
79
-
80
- 🖼️ Image analysis: designs/login-wireframe.png
81
-
82
- 📋 Detected UI elements:
83
- - Email input field
84
- - Password input field
85
- - "Login" button
86
- - "Forgot password" link
87
- - Social login buttons (Google, Apple)
88
-
89
- ❓ Confirmation needed:
90
- 1. Feature name? (e.g., "login")
91
- 2. Additional requirements?
92
-
93
- → Generate SPEC
94
- ```
95
-
96
- ## Rules Reference
97
-
98
- **Must follow `~/.claude/vibe/rules/` (global):**
99
- - `core/development-philosophy.md` - Surgical precision, simplicity
100
- - `core/quick-start.md` - Korean first, DRY, SRP
101
- - `core/communication-guide.md` - Communication principles
102
-
103
- ## Description
104
-
105
- Collect requirements through conversation with the user and create an **AI-executable PTCF structured SPEC document**.
106
-
107
- > **PTCF**: Persona, Task, Context, Format - Google Gemini prompt optimization framework
108
-
109
- ## External LLM Integration (GPT/Gemini)
110
-
111
- When GPT/Gemini are enabled, they are automatically utilized during SPEC creation:
112
-
113
- ```
114
- /vibe.spec "feature"
115
-
116
- [Claude] Draft SPEC
117
-
118
- [Parallel Research] GPT + Gemini + Claude agents (8 parallel)
119
-
120
- [SPEC Review] GPT + Gemini parallel review
121
-
122
- [Claude] Finalize SPEC
123
- ```
124
-
125
- **Setup:**
126
- ```bash
127
- vibe gpt auth # Enable GPT (OAuth)
128
- vibe gemini auth # Enable Gemini (OAuth)
129
- vibe status # Check current settings
130
- ```
131
-
132
- ## Process
133
-
134
- ### 0. Git Branch Setup (Automatic)
135
-
136
- **CRITICAL: Always create feature branch before starting SPEC**
137
-
138
- ```bash
139
- # Check current branch
140
- current=$(git branch --show-current 2>/dev/null || echo "main")
141
-
142
- # Sanitize feature name (spaces → hyphens, lowercase)
143
- branch_name="feature/$(echo "{feature-name}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')"
144
-
145
- # Create feature branch if on main/master
146
- if [[ "$current" == "main" || "$current" == "master" ]]; then
147
- git checkout -b "$branch_name"
148
- echo "✅ Created and switched to: $branch_name"
149
- else
150
- echo "ℹ️ Already on feature branch: $current"
151
- echo " Continue on this branch? (Y/n)"
152
- # If user says no, create new branch
153
- fi
154
- ```
155
-
156
- **Rules:**
157
- - If on `main`/`master` → **Always** create `feature/{feature-name}` branch
158
- - If already on feature branch → Ask user to confirm or create new branch
159
- - Branch naming: `feature/passkey-auth`, `feature/dark-mode`, etc.
160
- - Git check BEFORE starting requirements gathering
161
-
162
- ### 1. Project Analysis
163
-
164
- **Existing project** (`vibe init`):
165
- - Source code analysis: `package.json`, `pyproject.toml`, `pubspec.yaml`, `go.mod`, etc.
166
- - Reference `CLAUDE.md` file (tech stack)
167
- - Infer framework from file structure
168
- - **Use `findSymbol` tool** to locate relevant existing implementations
169
-
170
- **New project** (`vibe init <project-name>`):
171
- - Suggest tech stack (2-3 options)
172
-
173
- ### 2. Collect Requirements via Conversation
174
-
175
- **Principles:**
176
- - Ask **one question at a time**
177
- - Present options **with numbers** + "Feel free to describe in your own words"
178
- - **Natural conversation** without fixed order
179
-
180
- **Required confirmations:**
181
- - Purpose (Why): Why is it needed?
182
- - User (Who): Who will use it?
183
- - Feature scope (What): What features are needed?
184
- - Tech stack: Confirm existing stack or suggest new
185
- - Design reference: UI/UX to reference
186
-
187
- ### 2.5. Reference Documents via config.json (MANDATORY after tech stack confirmed)
188
-
189
- **🚨 CRITICAL: Read config.json references IMMEDIATELY after tech stack is confirmed**
190
-
191
- Reference documents are automatically generated in `config.json` based on the stack detected during `vibe init`:
192
-
193
- ```json
194
- // .claude/vibe/config.json
195
- {
196
- "language": "ko",
197
- "stacks": [
198
- { "type": "typescript-react", "path": "package.json" }
199
- ],
200
- "references": {
201
- "rules": [
202
- "~/.claude/vibe/rules/code-quality.md",
203
- "~/.claude/vibe/rules/error-handling.md",
204
- "~/.claude/vibe/rules/security.md"
205
- ],
206
- "languages": [
207
- "~/.claude/vibe/languages/typescript-react.md"
208
- ],
209
- "templates": [
210
- "~/.claude/vibe/templates/spec-template.md",
211
- "~/.claude/vibe/templates/feature-template.md",
212
- "~/.claude/vibe/templates/constitution-template.md"
213
- ]
214
- }
215
- }
216
- ```
217
-
218
- **Workflow:**
219
-
220
- 1. Read `.claude/vibe/config.json`
221
- 2. Extract `references.languages[]` paths
222
- 3. Read each language document for stack-specific guidelines
223
-
224
- **Example:**
225
- ```bash
226
- # 1. Check references in config.json
227
- Read .claude/vibe/config.json
228
-
229
- # 2. Reference documents specified in references.languages
230
- Read ~/.claude/vibe/languages/typescript-react.md
231
- ```
232
-
233
- **Important:**
234
-
235
- - No manual mapping needed - config.json contains all reference paths
236
- - `config.json.references` is automatically referenced when running `/vibe.run`
237
- - Not copied to project (referenced from global package)
238
-
239
- ### 3. Parallel Research (v2.5.0) - MANDATORY AFTER requirements confirmed
240
-
241
- **🚨🚨🚨 ABSOLUTE RULE: YOU MUST USE BASH TOOL FOR RESEARCH 🚨🚨🚨**
242
-
243
- **STOP! Before doing ANY research, read this carefully:**
244
-
245
- 1. **DO NOT** use Task tool to spawn research agents
246
- 2. **DO NOT** use context7 MCP directly for research
247
- 3. **DO NOT** use WebSearch tool directly for research
248
- 4. **YOU MUST** use Bash tool to call llm-orchestrate.js directly
249
-
250
- **When to trigger:**
251
- 1. ✅ Feature type decided (e.g., "passkey authentication")
252
- 2. ✅ Tech stack confirmed (e.g., "React + Supabase")
253
- 3. ✅ Language guide copied (step 2.5)
254
- 4. ✅ Core requirements collected
255
-
256
- **→ IMMEDIATELY run these 4 Bash commands IN PARALLEL (all at once):**
257
-
258
- ```bash
259
- # Cross-platform path (works on Windows/macOS/Linux)
260
- VIBE_SCRIPTS="$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts"
261
-
262
- # 1. GPT: Best practices
263
- node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "Best practices for [FEATURE] with [STACK]. Focus: architecture patterns, code conventions. Return JSON: {patterns: [], antiPatterns: [], libraries: []}"
264
-
265
- # 2. GPT: Security
266
- node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "Security vulnerabilities for [FEATURE] with [STACK]. Focus: CVE database, known exploits. Return JSON: {vulnerabilities: [], mitigations: [], checklist: []}"
267
-
268
- # 3. Gemini: Best practices
269
- node "$VIBE_SCRIPTS/llm-orchestrate.js" gemini orchestrate-json "Best practices for [FEATURE] with [STACK]. Focus: latest trends, framework updates. Return JSON: {patterns: [], antiPatterns: [], libraries: []}"
270
-
271
- # 4. Gemini: Security
272
- node "$VIBE_SCRIPTS/llm-orchestrate.js" gemini orchestrate-json "Security advisories for [FEATURE] with [STACK]. Focus: latest patches, recent incidents. Return JSON: {advisories: [], patches: [], incidents: []}"
273
- ```
274
-
275
- **Concrete example - run all 4 in parallel:**
276
- ```bash
277
- # GPT best practices
278
- node "$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts/llm-orchestrate.js" gpt orchestrate-json "Best practices for passkey authentication with React, Supabase. Focus: architecture patterns, code conventions. Return JSON: {patterns: [], antiPatterns: [], libraries: []}"
279
-
280
- # GPT security
281
- node "$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts/llm-orchestrate.js" gpt orchestrate-json "Security vulnerabilities for passkey authentication with React, Supabase. Focus: CVE database, known exploits. Return JSON: {vulnerabilities: [], mitigations: [], checklist: []}"
282
-
283
- # Gemini best practices
284
- node "$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts/llm-orchestrate.js" gemini orchestrate-json "Best practices for passkey authentication with React, Supabase. Focus: latest trends, framework updates. Return JSON: {patterns: [], antiPatterns: [], libraries: []}"
285
-
286
- # Gemini security
287
- node "$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts/llm-orchestrate.js" gemini orchestrate-json "Security advisories for passkey authentication with React, Supabase. Focus: latest patches, recent incidents. Return JSON: {advisories: [], patches: [], incidents: []}"
288
- ```
289
-
290
- **ALSO run Claude research agents in parallel using Task tool:**
291
-
292
- | Claude Agent | Role | Source |
293
- |--------------|------|--------|
294
- | `best-practices-agent` | Best practices for [feature] + [stack] | WebSearch |
295
- | `framework-docs-agent` | Latest docs via context7 | context7 MCP |
296
- | `codebase-patterns-agent` | Similar patterns in existing codebase | Glob, Grep |
297
- | `security-advisory-agent` | Security advisories for [feature] | WebSearch |
298
-
299
- **Total: 4 GPT/Gemini calls (Bash) + 4 Claude agents (Task) = 8 parallel research tasks**
300
-
301
- **🚨 GPT/Gemini MUST be called via Bash with llm-orchestrate.js! 🚨**
302
-
303
- #### 3.1 Result Merge Rules
304
-
305
- | Area | Merge Strategy |
306
- |------|----------------|
307
- | Best Practices | Deduplicate, keep most detailed |
308
- | Security | ALL included (no dedup for safety) |
309
- | Libraries | Consensus recommendations |
310
-
311
- **IMPORTANT:**
312
- - ❌ DO NOT skip research step
313
- - ❌ DO NOT ask user "should I run research?"
314
- - ✅ ALWAYS run after requirements confirmed
315
- - ✅ Show "Running parallel research (Claude + GPT + Gemini)..." message
316
- - ✅ Include all agent + LLM results in SPEC Context
317
- - ✅ Run all 4 Bash LLM calls in parallel + 4 Task agents in parallel
318
-
319
- **Research results are reflected in SPEC's Context section.**
320
-
321
- ### 4. Write SPEC Document (PTCF Structure)
322
-
323
- #### 4.0 Large Scope Detection & Auto-Split (MANDATORY)
324
-
325
- **🚨 CRITICAL: Automatically split SPEC when scope is large**
326
-
327
- **❌ DO NOT ask user for confirmation - auto-split silently**
328
-
329
- **Detection criteria (ANY triggers split):**
330
-
331
- | Criteria | Threshold |
332
- |----------|-----------|
333
- | Phases | 5+ phases |
334
- | Files to create | 15+ files |
335
- | Platforms | 2+ platforms |
336
- | Major features | 4+ distinct features |
337
-
338
- **Auto-split output (SPEC + Feature files must match):**
339
-
340
- ```
341
- .claude/vibe/specs/{feature-name}/
342
- ├── _index.md # Master SPEC
343
- ├── phase-1-setup.md
344
- ├── phase-2-core.md
345
- └── ...
346
-
347
- .claude/vibe/features/{feature-name}/
348
- ├── _index.feature # Master Feature
349
- ├── phase-1-setup.feature
350
- ├── phase-2-core.feature
351
- └── ...
352
- ```
353
-
354
- **🚨 CRITICAL: Each SPEC phase file MUST have a matching Feature file**
355
-
356
- **Master SPEC (`_index.md`):**
357
-
358
- ```markdown
359
- # SPEC: {feature-name} (Master)
360
-
361
- ## Overview
362
- - Total phases: N
363
- - Dependencies: [list]
364
-
365
- ## Sub-SPECs
366
-
367
- | Order | SPEC File | Feature File | Status |
368
- |-------|-----------|--------------|--------|
369
- | 1 | phase-1-setup.md | phase-1-setup.feature | ⬜ |
370
- | 2 | phase-2-core.md | phase-2-core.feature | ⬜ |
371
-
372
- ## Shared Context
373
- - Tech Stack: [all phases]
374
- - Constraints: [all phases]
375
- ```
376
-
377
- **Master Feature (`_index.feature`):**
378
-
379
- ```markdown
380
- # Feature: {feature-name} (Master)
381
-
382
- **Master SPEC**: `.claude/vibe/specs/{feature-name}/_index.md`
383
-
384
- ## Sub-Features
385
-
386
- | Order | Feature File | SPEC File | Status |
387
- |-------|--------------|-----------|--------|
388
- | 1 | phase-1-setup.feature | phase-1-setup.md | ⬜ |
389
- | 2 | phase-2-core.feature | phase-2-core.md | ⬜ |
390
-
391
- ## Overall User Story
392
- **As a** {user}
393
- **I want** {complete feature}
394
- **So that** {value}
395
- ```
396
-
397
- **Small scope (default):**
398
-
399
- Create `.claude/vibe/specs/{feature-name}.md`:
400
-
401
- ```markdown
402
- # SPEC: {feature-name}
403
-
404
- ## Persona
405
- <role>
406
- Define AI role and expertise for implementation
407
- - Senior developer on the project
408
- - Follow existing code patterns
409
- - Write testable code
410
- </role>
411
-
412
- ## Context
413
- <context>
414
- ### Background
415
- - Why this feature is needed
416
- - Who will use it
417
-
418
- ### Tech Stack
419
- - Backend: {technology}
420
- - Frontend: {technology}
421
- - Database: {technology}
422
-
423
- ### Related Code
424
- - `src/xxx/`: Existing implementation to reference
425
- - `src/yyy/`: Files to modify
426
-
427
- ### Design Reference
428
- - {Reference app/service}
429
- </context>
430
-
431
- ## Task
432
- <task>
433
- ### Phase 1: {phase-name}
434
- 1. [ ] {specific task}
435
- - File: `path/to/file`
436
- - Verify: `command`
437
- 2. [ ] {specific task}
438
-
439
- ### Phase 2: {phase-name}
440
- 1. [ ] {specific task}
441
- 2. [ ] {specific task}
442
-
443
- ### Phase 3: Testing and Verification
444
- 1. [ ] Unit Tests
445
- 2. [ ] Integration Tests
446
- </task>
447
-
448
- ## Constraints
449
- <constraints>
450
- - Follow existing code patterns
451
- - Localize error messages
452
- - Separate configuration via environment variables
453
- - {other constraints}
454
- </constraints>
455
-
456
- ## Output Format
457
- <output_format>
458
- ### Files to Create
459
- - `path/to/new/file.ts`
460
- - `path/to/new/file.test.ts`
461
-
462
- ### Files to Modify
463
- - `path/to/existing/file.ts`
464
-
465
- ### Verification Commands
466
- - `npm test`
467
- - `npm run build`
468
- </output_format>
469
-
470
- ## Acceptance Criteria
471
- <acceptance>
472
- - [ ] {verifiable criterion 1}
473
- - [ ] {verifiable criterion 2}
474
- - [ ] All tests pass
475
- - [ ] Build succeeds
476
- </acceptance>
477
- ```
478
-
479
- ### 5. Create Feature File (BDD) - Required
480
-
481
- **🚨 CRITICAL: Feature files MUST match SPEC file structure**
482
-
483
- | SPEC Structure | Feature Structure |
484
- |----------------|-------------------|
485
- | Single file (`{feature}.md`) | Single file (`{feature}.feature`) |
486
- | Split (`{feature}/_index.md` + phases) | Split (`{feature}/_index.feature` + phases) |
487
-
488
- #### 5.1 Single File (Small Scope)
489
-
490
- Create `.claude/vibe/features/{feature-name}.feature`:
491
-
492
- **Creation rules:**
493
- 1. Convert each SPEC Acceptance Criteria → one Scenario
494
- 2. Include Happy Path (normal case) + Edge Case (exception case)
495
- 3. Follow Given-When-Then format
496
-
497
- ```markdown
498
- # Feature: {feature-name}
499
-
500
- **SPEC**: `.claude/vibe/specs/{feature-name}.md`
501
-
502
- ## User Story
503
- **As a** {user}
504
- **I want** {feature}
505
- **So that** {value}
506
-
507
- ## Scenarios
508
-
509
- ### Scenario 1: {Happy Path}
510
- \`\`\`gherkin
511
- Scenario: {title}
512
- Given {precondition}
513
- When {action}
514
- Then {result}
515
- \`\`\`
516
- **Verification**: SPEC AC #1
517
-
518
- ### Scenario 2: {Edge Case}
519
- ...
520
-
521
- ## Coverage
522
- | Scenario | SPEC AC | Status |
523
- |----------|---------|--------|
524
- | 1 | AC-1 | ⬜ |
525
- ```
526
-
527
- #### 5.2 Split Files (Large Scope)
528
-
529
- When SPEC is split into phases, Feature files MUST also be split:
530
-
531
- ```
532
- .claude/vibe/features/{feature-name}/
533
- ├── _index.feature # Master: links to all phase features
534
- ├── phase-1-setup.feature # Scenarios for phase-1-setup.md
535
- ├── phase-2-core.feature # Scenarios for phase-2-core.md
536
- └── ...
537
- ```
538
-
539
- **Phase Feature file structure:**
540
-
541
- ```markdown
542
- # Feature: {feature-name} - Phase {N}: {phase-name}
543
-
544
- **SPEC**: `.claude/vibe/specs/{feature-name}/phase-{N}-{name}.md`
545
- **Master Feature**: `.claude/vibe/features/{feature-name}/_index.feature`
546
-
547
- ## User Story (Phase Scope)
548
- **As a** {user}
549
- **I want** {phase-specific feature}
550
- **So that** {phase-specific value}
551
-
552
- ## Scenarios
553
-
554
- ### Scenario 1: {Phase Happy Path}
555
- ...
556
-
557
- ## Coverage
558
- | Scenario | SPEC AC | Status |
559
- |----------|---------|--------|
560
- | 1 | Phase {N} AC-1 | ⬜ |
561
- ```
562
-
563
- ### 6. Ambiguity Scan - Required
564
-
565
- After creating SPEC draft, **must perform systematic ambiguity check**.
566
-
567
- #### 6.1 Mandatory Check Categories
568
-
569
- | Category | Check Items | Red Flags |
570
- |----------|-------------|-----------|
571
- | **Functional Scope** | Missing features, unclear behavior | "etc.", "other", "if needed" |
572
- | **Data Model** | Undefined entities, relationships | Undefined types, missing fields |
573
- | **Non-Functional** | Performance, security requirements | Performance requirements without numbers |
574
- | **Edge Cases** | Boundary conditions, errors | 0 failure scenarios |
575
- | **Integration Points** | External APIs, contracts | API version/endpoint undefined |
576
- | **User Input** | Validation rules, limits | Input limits not specified |
577
- | **State Management** | State transitions, persistence | Missing state diagram |
578
-
579
- #### 6.2 Forbidden Ambiguous Terms
580
-
581
- If the following terms exist in SPEC, **clarification is mandatory**:
582
-
583
- | Forbidden Term | Replacement Method |
584
- |----------------|-------------------|
585
- | "appropriately", "properly" | Provide specific criteria (e.g., "within 3 seconds") |
586
- | "quickly", "rapidly" | Specify with numbers (e.g., "under 100ms") |
587
- | "various", "multiple" | List specific items |
588
- | "etc.", "other" | Specify complete list or limit scope |
589
- | "if needed", "depending on situation" | Specify conditions (e.g., "when credits < 10") |
590
- | "later", "in the future" | Explicitly exclude from current scope |
591
-
592
- #### 6.3 Check Process
593
-
594
- ```
595
- 1. Write SPEC draft
596
-
597
- 2. Auto-scan for forbidden terms
598
-
599
- 3. Review checklist by category
600
-
601
- 4. List discovered ambiguities
602
-
603
- 5. Auto-fixable items → Fix immediately
604
- Needs user confirmation → Ask question
605
-
606
- 6. Re-verify (repeat until 0 ambiguities)
607
- ```
608
-
609
- #### 6.4 Auto-Fix for Common Ambiguities
610
-
611
- | Ambiguity Type | Auto-Fix Method |
612
- |----------------|-----------------|
613
- | Timeout undefined | Apply default 30 seconds |
614
- | Retry count undefined | Apply default 3 retries |
615
- | Pagination undefined | Apply default 20 items/page |
616
- | Input length undefined | Text 500 chars, password 8-64 chars |
617
- | File size undefined | Image 5MB, video 100MB |
618
-
619
- #### 6.5 Ambiguity Output Format
620
-
621
- ```markdown
622
- ## 🔍 Ambiguity Scan Results
623
-
624
- ### Found Issues: 3
625
-
626
- #### 1. Functional Scope
627
- - ⚠️ "Login failure behavior" not defined
628
- → **Auto-fix**: Apply 5-minute lockout after 3 failures
629
- - ⚠️ "Session expiration handling" unclear
630
- → **Question**: Session expiration time? (30min/1hour/24hours)
631
-
632
- #### 2. Edge Cases
633
- - ⚠️ Concurrent login permission undefined
634
- → **Question**: Allow concurrent login? (Y/N)
635
-
636
- ### Auto-fixed: 1
637
- ### Needs clarification: 2
638
- ```
639
-
640
- ### 7. Quality Validation (Self-Check)
641
-
642
- **Must perform self-quality check after SPEC completion**
643
-
644
- #### 7.1 Quality Checklist (Required Items)
645
-
646
- | Category | Check Item | Weight |
647
- |----------|------------|--------|
648
- | **Completeness** | All user flows included in Task | 15% |
649
- | **Completeness** | All ACs converted to Feature scenarios | 10% |
650
- | **Clarity** | No ambiguous terms (e.g., "appropriately", "quickly") | 10% |
651
- | **Clarity** | All numbers/limits specified (e.g., "max 500 chars") | 10% |
652
- | **Testability** | All ACs are auto-testable | 10% |
653
- | **Security** | Authentication/authorization requirements defined | 10% |
654
- | **Security** | Sensitive data handling method specified | 5% |
655
- | **Error Handling** | Major failure scenarios defined | 10% |
656
- | **Error Handling** | User error messages specified | 5% |
657
- | **Performance** | Response time/throughput targets specified | 5% |
658
- | **Edge Cases** | Boundary condition handling defined | 5% |
659
- | **Dependencies** | External systems/APIs specified | 5% |
660
-
661
- #### 7.2 Quality Score Calculation
662
-
663
- ```
664
- Score = Σ(Check item met × Weight) / 100
665
-
666
- Grades:
667
- - 95-100: ✅ EXCELLENT - Ready to start implementation
668
- - 85-94: GOOD - Implementation possible (minor improvements recommended)
669
- - 70-84: ⚠️ FAIR - Improve before implementation
670
- - 0-69: ❌ POOR - Rewrite required
671
- ```
672
-
673
- #### 7.3 Quality Gate (Auto-verification)
674
-
675
- **Minimum 85 points required to proceed to next step (GPT+Gemini review)**
676
-
677
- ```
678
- SPEC writing complete
679
-
680
- [Calculate Quality Score]
681
-
682
- Score < 85? → Show missing items → Attempt auto-fix
683
-
684
- Score ≥ 85 → Proceed to GPT + Gemini review
685
- ```
686
-
687
- #### 7.4 Auto-Fix for Low Score
688
-
689
- If score is below 85, attempt automatic fixes:
690
-
691
- | Missing Item | Auto-Fix Method |
692
- |--------------|-----------------|
693
- | Missing AC | Auto-generate AC based on Task |
694
- | Numbers not specified | Apply project defaults (e.g., timeout 30s) |
695
- | Missing error handling | Add common error scenarios |
696
- | Missing performance targets | Apply industry standard criteria |
697
-
698
- ### 8. SPEC Review (GPT/Gemini) - 3-Round Mandatory Review
699
-
700
- **🚨 CRITICAL: YOU MUST EXECUTE ALL 3 ROUNDS. DO NOT SKIP.**
701
-
702
- ```bash
703
- /vibe.spec "feature" # Default: 3 rounds (MANDATORY)
704
- /vibe.spec "feature" --quick # Quick mode: 1 round only
705
- ```
706
-
707
- **3-Round Review Process (MANDATORY):**
708
-
709
- ```
710
- round_count = 0
711
-
712
- WHILE round_count < 3:
713
- round_count += 1
714
-
715
- print(f"━━━ Round {round_count}/3 ━━━")
716
-
717
- # 1. Call GPT + Gemini in parallel (Bash)
718
- gpt_result = Bash("node llm-orchestrate.js gpt ...")
719
- gemini_result = Bash("node llm-orchestrate.js gemini ...")
720
-
721
- # 2. Merge and apply feedback
722
- apply_feedback(gpt_result, gemini_result)
723
- update_spec()
724
-
725
- # 3. Show progress
726
- print(f"✅ Round {round_count}/3 complete")
727
-
728
- # 4. Early exit ONLY if BOTH models say "no issues"
729
- IF gpt_result.no_issues AND gemini_result.no_issues:
730
- print("Both models: no issues found. Stopping early.")
731
- BREAK
732
-
733
- print(f"🎉 Review complete! Total rounds: {round_count}")
734
- ```
735
-
736
- **🚨 RULES:**
737
- 1. **ALWAYS start Round 1** - never skip
738
- 2. **ALWAYS continue to Round 2** unless both models return "no issues"
739
- 3. **ALWAYS continue to Round 3** unless both models return "no issues" in Round 2
740
- 4. **MUST show "Round X/3"** in output for each round
741
- 5. **Early exit ONLY when BOTH GPT AND Gemini say "no issues"**
742
-
743
- **Output format for each round:**
744
-
745
- ```
746
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
747
- 🔍 SPEC REVIEW - Round 1/3
748
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
749
- [GPT] 3 issues found: ...
750
- [Gemini] 2 issues found: ...
751
- ✅ Applied 5 improvements
752
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
753
-
754
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
755
- 🔍 SPEC REVIEW - Round 2/3
756
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
757
- [GPT] 1 issue found: ...
758
- [Gemini] 0 issues found
759
- ✅ Applied 1 improvement
760
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
761
-
762
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
763
- 🔍 SPEC REVIEW - Round 3/3
764
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
765
- [GPT] 0 issues found
766
- [Gemini] 0 issues found
767
- ✅ No changes needed
768
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
769
-
770
- 🎉 SPEC Review complete! 3 rounds, 6 total improvements
771
- ```
772
-
773
- **After SPEC draft, execute review loop:**
774
-
775
- ```
776
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
777
- 🔍 SPEC REVIEW
778
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
779
-
780
- [Step 1] Sending SPEC to Gemini/GPT...
781
- - Full SPEC content
782
- - Feature file (scenarios)
783
- - Project context
784
-
785
- [Step 2] Review feedback:
786
- ┌─────────────────────────────────────────┐
787
- │ 📝 SPEC Review Feedback │
788
- │ │
789
- │ 1. [Missing] Error handling scenarios │
790
- │ → Recommend adding "retry on network │
791
- │ error" │
792
- │ │
793
- │ 2. [Security] Auth token expiry │
794
- │ handling undefined │
795
- │ → Recommend adding refresh token │
796
- │ flow │
797
- │ │
798
- │ 3. [Edge] Concurrent login policy │
799
- │ undefined │
800
- │ → Need to specify existing session │
801
- │ handling method │
802
- └─────────────────────────────────────────┘
803
-
804
- [Step 3] Auto-applying...
805
- ✅ Added error handling Phase to SPEC Task
806
- ✅ Added token expiry scenario to Feature
807
- ✅ Added concurrent login policy to Constraints
808
-
809
- [Step 4] Re-verifying...
810
- ✅ Ambiguity Scan: 0 issues
811
- ✅ Quality Score: 95/100
812
-
813
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
814
- ✅ SPEC Review complete! 3 improvements applied
815
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
816
- ```
817
-
818
- **MUST: SPEC Review (Required) - GPT + Gemini Parallel Execution**
819
-
820
- 🚨 **Run GPT and Gemini in parallel for cross-validation to ensure quality**
821
-
822
- **Parallel execution (2 Bash calls simultaneously):**
823
-
824
- ```bash
825
- # Cross-platform path (works on Windows/macOS/Linux)
826
- VIBE_SCRIPTS="$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts"
827
-
828
- # GPT review (code patterns, architecture perspective)
829
- node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "Review SPEC for [feature-name]. Stack: [stack]. Summary: [summary]. Check: completeness, error handling, security, edge cases."
830
-
831
- # Gemini review (latest docs, best practices perspective)
832
- node "$VIBE_SCRIPTS/llm-orchestrate.js" gemini orchestrate-json "Review SPEC for [feature-name]. Stack: [stack]. Summary: [summary]. Check: completeness, error handling, security, edge cases."
833
- ```
834
-
835
- **Important:**
836
-
837
- - **Must call both GPT and Gemini** (parallel execution)
838
- - Merge feedback from both models and apply to SPEC
839
- - If one model fails, apply only the remaining result
840
- - Don't send full SPEC, send only **key summary** (save tokens)
841
- - Parse JSON response and auto-apply to SPEC
842
-
843
- **Why parallel execution:**
844
-
845
- | Model | Strengths |
846
- |-------|-----------|
847
- | GPT | Code patterns, architecture, logic validation |
848
- | Gemini | Latest web info, doc search, best practices |
849
-
850
- **Result merge:** Combine feedback from both models for more thorough review
851
-
852
- **Review items:**
853
-
854
- | Category | Check Point |
855
- |----------|-------------|
856
- | Completeness | All user flows covered? |
857
- | Error Handling | Failure scenarios defined? |
858
- | Security | Auth/authorization/data protection? |
859
- | Edge Cases | Boundary conditions handled? |
860
- | Testability | ACs verifiable? |
861
-
862
- **Auto-apply rules:**
863
-
864
- | Feedback Type | Action |
865
- |---------------|--------|
866
- | Missing scenario | Auto-add to Feature |
867
- | Security considerations | Auto-add to Constraints |
868
- | Edge cases | Auto-add to Task Phase |
869
- | Lack of clarity | Supplement the section |
870
-
871
- **Fallback handling:**
872
- - On `"status": "fallback"` response → Skip and proceed to next step
873
- - On network error → Retry once then skip
874
-
875
- ## Output (MANDATORY File Creation)
876
-
877
- **🚨 CRITICAL: Files MUST be created in these EXACT paths. NO exceptions.**
878
-
879
- ### Small Scope (Single File)
880
-
881
- | File | Path | When |
882
- |------|------|------|
883
- | SPEC | `.claude/vibe/specs/{feature-name}.md` | After quality validation (Step 7) |
884
- | Feature | `.claude/vibe/features/{feature-name}.feature` | Immediately after SPEC |
885
-
886
- ### Large Scope (Split Files)
887
-
888
- | File | Path | When |
889
- |------|------|------|
890
- | Master SPEC | `.claude/vibe/specs/{feature-name}/_index.md` | After quality validation |
891
- | Phase SPEC | `.claude/vibe/specs/{feature-name}/phase-{N}-{name}.md` | Per phase |
892
- | Master Feature | `.claude/vibe/features/{feature-name}/_index.feature` | After Master SPEC |
893
- | Phase Feature | `.claude/vibe/features/{feature-name}/phase-{N}-{name}.feature` | Per phase SPEC |
894
-
895
- **❌ FORBIDDEN:**
896
-
897
- - Creating files in project root (e.g., `feature-name.md`)
898
- - Creating files outside `.claude/vibe/` directory
899
- - Skipping file creation
900
- - Using different file names than feature-name
901
- - Creating split SPEC without matching split Feature files
902
-
903
- **✅ REQUIRED:**
904
-
905
- - Use Write tool to create files
906
- - Verify directories exist (create if needed)
907
- - Confirm file creation in response
908
- - **Each SPEC file must have a matching Feature file**
909
-
910
- ### File Creation Template
911
-
912
- **Single file:**
913
- ```
914
- 1. Write .claude/vibe/specs/{feature-name}.md
915
- 2. Write .claude/vibe/features/{feature-name}.feature
916
- 3. Confirm: "✅ Created: specs/{feature-name}.md + features/{feature-name}.feature"
917
- ```
918
-
919
- **Split files:**
920
- ```
921
- 1. Write .claude/vibe/specs/{feature-name}/_index.md
922
- 2. Write .claude/vibe/specs/{feature-name}/phase-1-setup.md
923
- 3. Write .claude/vibe/specs/{feature-name}/phase-2-core.md
924
- 4. Write .claude/vibe/features/{feature-name}/_index.feature
925
- 5. Write .claude/vibe/features/{feature-name}/phase-1-setup.feature
926
- 6. Write .claude/vibe/features/{feature-name}/phase-2-core.feature
927
- 7. Confirm: "✅ Created: {N} SPEC files + {N} Feature files"
928
- ```
929
-
930
- ## Example
931
-
932
- ```
933
- User: /vibe.spec "brick-game"
934
-
935
- Claude:
936
- You're making a brick game! What style are you thinking of?
937
-
938
- 1. Classic Breakout style
939
- 2. Arkanoid (with power-up items)
940
- 3. Custom style with special gameplay
941
-
942
- Feel free to describe in your own words.
943
-
944
- User: 1
945
-
946
- Claude: What platform will it run on?
947
-
948
- 1. Web (browser)
949
- 2. Mobile (iOS/Android)
950
- 3. Desktop
951
-
952
- User: 1
953
-
954
- Claude:
955
- Here are tech stack suggestions for web game development:
956
-
957
- 1. **Phaser.js** (Recommended) - Game framework with built-in physics engine
958
- 2. **Canvas + JavaScript** - Lightweight with fine control
959
- 3. **PixiJS + Matter.js** - High-performance rendering
960
-
961
- User: 1
962
-
963
- Claude: What design style?
964
-
965
- 1. Retro pixel (Atari Breakout)
966
- 2. Neon graphics (Arkanoid)
967
- 3. Modern 3D effects
968
-
969
- User: 2
970
-
971
- [Conversation continues...]
972
-
973
- Claude: SPEC draft created. Running ambiguity scan.
974
-
975
- ## 🔍 Ambiguity Scan Results
976
-
977
- ### Functional Scope
978
- - ⚠️ Game over condition not defined (ball drop vs lives system)
979
- - ⚠️ Stage clear condition unclear
980
-
981
- ### Edge Cases
982
- - ⚠️ Ball reflection angle when hitting paddle edge
983
- - ⚠️ Multiple brick collision handling
984
-
985
- Please clarify the above items.
986
-
987
- User: 3 lives, clear when all bricks destroyed, edge reflects at 45 degrees
988
-
989
- Claude: Thank you. SPEC has been refined.
990
-
991
- 🔍 Re-check result: 0 ambiguities
992
- 📊 Quality score: 92/100 (A)
993
-
994
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
995
- 🔍 SPEC REVIEW (Gemini)
996
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
997
-
998
- 📤 Sending SPEC...
999
- 📝 Gemini feedback:
1000
- 1. [Edge] Ball speed increase logic undefined
1001
- 2. [Security] Need score manipulation prevention
1002
-
1003
- ✅ 2 improvements auto-applied
1004
- 🔍 Re-verifying... ✅ Passed
1005
-
1006
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1007
- ✅ SPEC Complete!
1008
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1009
-
1010
- 📄 .claude/vibe/specs/brick-game.md (PTCF structure)
1011
- 📄 .claude/vibe/features/brick-game.feature
1012
- 📊 Quality score: 95/100 (A) ← Improved after review
1013
- ```
1014
-
1015
- ## Vibe Tools (Semantic Analysis & Memory)
1016
-
1017
- ### Tool Invocation
1018
- All tools are called via:
1019
- ```bash
1020
- node -e "import('@su-record/vibe/tools').then(t => t.TOOL_NAME({...args}).then(r => console.log(r.content[0].text)))"
1021
- ```
1022
-
1023
- ### Recommended Tools for SPEC Creation
1024
-
1025
- | Tool | Purpose | When to Use |
1026
- |------|---------|-------------|
1027
- | `findSymbol` | Find symbol definitions | Locate existing implementations to reference |
1028
- | `findReferences` | Find all references | Understand how existing code is used |
1029
- | `analyzeComplexity` | Code complexity analysis | Evaluate complexity of code to modify |
1030
- | `saveMemory` | Save important decisions | Store confirmed requirements, design decisions |
1031
- | `recallMemory` | Recall saved memory | Retrieve previous project decisions |
1032
-
1033
- ### Example Tool Usage in SPEC Creation
1034
-
1035
- **1. Find existing auth implementation:**
1036
- ```bash
1037
- node -e "import('@su-record/vibe/tools').then(t => t.findSymbol({symbolName: 'login', searchPath: 'src/'}).then(r => console.log(r.content[0].text)))"
1038
- ```
1039
-
1040
- **2. Save confirmed requirements:**
1041
- ```bash
1042
- node -e "import('@su-record/vibe/tools').then(t => t.saveMemory({key: 'brick-game-requirements', value: 'Platform: Web, Stack: Phaser.js, Style: Neon', category: 'spec', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
1043
- ```
1044
-
1045
- **3. Recall previous decisions:**
1046
- ```bash
1047
- node -e "import('@su-record/vibe/tools').then(t => t.recallMemory({key: 'brick-game-requirements', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
1048
- ```
1049
-
1050
- ## Next Step
1051
-
1052
- ```
1053
- /vibe.run "brick-game"
1054
- ```
1055
-
1056
- ---
1057
-
1058
- ARGUMENTS: $ARGUMENTS
1
+ ---
2
+ description: Create SPEC document with Specification Agent
3
+ argument-hint: "feature name"
4
+ ---
5
+
6
+ # /vibe.spec
7
+
8
+ Create a SPEC document (Specification Agent).
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /vibe.spec "feature-name" # Conversation mode (requirements gathering)
14
+ /vibe.spec "docs/login-prd.md" # File path input (auto-detected)
15
+ /vibe.spec + 📎 file attachment # Use attached file
16
+ ```
17
+
18
+ ## Input Mode Detection (Auto-detect)
19
+
20
+ **Input priority:**
21
+
22
+ ```
23
+ 1. Attachment exists? → Use attached file
24
+ 2. Argument is file path? (existence check) → Read file
25
+ 3. Otherwise → Conversation mode (start with feature name)
26
+ ```
27
+
28
+ | Input | Result |
29
+ |-------|--------|
30
+ | 📎 Attached file | → Analyze attached file |
31
+ | File path (exists) | → Read file (Read tool) |
32
+ | Feature name | → Start conversation mode |
33
+
34
+ **All supported files:**
35
+ - Text: `.md`, `.txt`, `.rst`, `.html`, `.json`, `.yaml`, etc.
36
+ - Documents: `.pdf` (page-by-page analysis)
37
+ - Images: `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.svg`, etc.
38
+ - Notebooks: `.ipynb` (Jupyter)
39
+ - **All formats Claude can read**
40
+
41
+ **File input mode flow:**
42
+
43
+ ```
44
+ /vibe.spec "docs/login-prd.md"
45
+
46
+ 📄 File loaded: docs/login-prd.md (2.3KB)
47
+
48
+ 📋 Parsed requirements:
49
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
50
+ Feature: Login
51
+ - Email/password login
52
+ - Social login (Google, Apple)
53
+ - Password recovery
54
+ - Auto login persistence
55
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
56
+
57
+ ❓ Additional confirmation needed:
58
+ 1. Session expiration time? (default: 24 hours)
59
+ 2. Allow concurrent login?
60
+ 3. Confirm tech stack? (current: React + Supabase)
61
+
62
+ User: 1 hour, disallow, confirm
63
+
64
+ ✅ Requirements confirmed → Run research → Generate SPEC → Review
65
+ ```
66
+
67
+ **Supported file formats:**
68
+
69
+ | Format | Extension | Purpose |
70
+ |--------|-----------|---------|
71
+ | Markdown | `.md` | PRD, planning docs, README |
72
+ | Text | `.txt` | Requirements list |
73
+ | PDF | `.pdf` | Planning docs, design documents |
74
+ | Image | `.png`, `.jpg`, `.jpeg`, `.webp` | Wireframes, UI design, screenshots |
75
+
76
+ **Image input example:**
77
+ ```
78
+ /vibe.spec "designs/login-wireframe.png"
79
+
80
+ 🖼️ Image analysis: designs/login-wireframe.png
81
+
82
+ 📋 Detected UI elements:
83
+ - Email input field
84
+ - Password input field
85
+ - "Login" button
86
+ - "Forgot password" link
87
+ - Social login buttons (Google, Apple)
88
+
89
+ ❓ Confirmation needed:
90
+ 1. Feature name? (e.g., "login")
91
+ 2. Additional requirements?
92
+
93
+ → Generate SPEC
94
+ ```
95
+
96
+ ## Rules Reference
97
+
98
+ **Must follow `~/.claude/vibe/rules/` (global):**
99
+ - `core/development-philosophy.md` - Surgical precision, simplicity
100
+ - `core/quick-start.md` - Korean first, DRY, SRP
101
+ - `core/communication-guide.md` - Communication principles
102
+
103
+ ## Description
104
+
105
+ Collect requirements through conversation with the user and create an **AI-executable PTCF structured SPEC document**.
106
+
107
+ > **PTCF**: Persona, Task, Context, Format - Google Gemini prompt optimization framework
108
+
109
+ ## External LLM Integration (GPT/Gemini)
110
+
111
+ When GPT/Gemini are enabled, they are automatically utilized during SPEC creation:
112
+
113
+ ```
114
+ /vibe.spec "feature"
115
+
116
+ [Claude] Draft SPEC
117
+
118
+ [Parallel Research] GPT + Gemini + Claude agents (8 parallel)
119
+
120
+ [SPEC Review] GPT + Gemini parallel review
121
+
122
+ [Claude] Finalize SPEC
123
+ ```
124
+
125
+ **Setup:**
126
+ ```bash
127
+ vibe gpt auth # Enable GPT (OAuth)
128
+ vibe gemini auth # Enable Gemini (OAuth)
129
+ vibe status # Check current settings
130
+ ```
131
+
132
+ ## Process
133
+
134
+ ### 0. Git Branch Setup (Automatic)
135
+
136
+ **CRITICAL: Always create feature branch before starting SPEC**
137
+
138
+ ```bash
139
+ # Check current branch
140
+ current=$(git branch --show-current 2>/dev/null || echo "main")
141
+
142
+ # Sanitize feature name (spaces → hyphens, lowercase)
143
+ branch_name="feature/$(echo "{feature-name}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')"
144
+
145
+ # Create feature branch if on main/master
146
+ if [[ "$current" == "main" || "$current" == "master" ]]; then
147
+ git checkout -b "$branch_name"
148
+ echo "✅ Created and switched to: $branch_name"
149
+ else
150
+ echo "ℹ️ Already on feature branch: $current"
151
+ echo " Continue on this branch? (Y/n)"
152
+ # If user says no, create new branch
153
+ fi
154
+ ```
155
+
156
+ **Rules:**
157
+ - If on `main`/`master` → **Always** create `feature/{feature-name}` branch
158
+ - If already on feature branch → Ask user to confirm or create new branch
159
+ - Branch naming: `feature/passkey-auth`, `feature/dark-mode`, etc.
160
+ - Git check BEFORE starting requirements gathering
161
+
162
+ ### 1. Project Analysis
163
+
164
+ **Existing project** (`vibe init`):
165
+ - Source code analysis: `package.json`, `pyproject.toml`, `pubspec.yaml`, `go.mod`, etc.
166
+ - Reference `CLAUDE.md` file (tech stack)
167
+ - Infer framework from file structure
168
+ - **Use `findSymbol` tool** to locate relevant existing implementations
169
+
170
+ **New project** (`vibe init <project-name>`):
171
+ - Suggest tech stack (2-3 options)
172
+
173
+ ### 2. Collect Requirements via Conversation
174
+
175
+ **Principles:**
176
+ - Ask **one question at a time**
177
+ - Present options **with numbers** + "Feel free to describe in your own words"
178
+ - **Natural conversation** without fixed order
179
+
180
+ **Required confirmations:**
181
+ - Purpose (Why): Why is it needed?
182
+ - User (Who): Who will use it?
183
+ - Feature scope (What): What features are needed?
184
+ - Tech stack: Confirm existing stack or suggest new
185
+ - Design reference: UI/UX to reference
186
+
187
+ ### 2.5. Reference Documents via config.json (MANDATORY after tech stack confirmed)
188
+
189
+ **🚨 CRITICAL: Read config.json references IMMEDIATELY after tech stack is confirmed**
190
+
191
+ Reference documents are automatically generated in `config.json` based on the stack detected during `vibe init`:
192
+
193
+ ```json
194
+ // .claude/vibe/config.json
195
+ {
196
+ "language": "ko",
197
+ "stacks": [
198
+ { "type": "typescript-react", "path": "package.json" }
199
+ ],
200
+ "references": {
201
+ "rules": [
202
+ "~/.claude/vibe/rules/code-quality.md",
203
+ "~/.claude/vibe/rules/error-handling.md",
204
+ "~/.claude/vibe/rules/security.md"
205
+ ],
206
+ "languages": [
207
+ "~/.claude/vibe/languages/typescript-react.md"
208
+ ],
209
+ "templates": [
210
+ "~/.claude/vibe/templates/spec-template.md",
211
+ "~/.claude/vibe/templates/feature-template.md",
212
+ "~/.claude/vibe/templates/constitution-template.md"
213
+ ]
214
+ }
215
+ }
216
+ ```
217
+
218
+ **Workflow:**
219
+
220
+ 1. Read `.claude/vibe/config.json`
221
+ 2. Extract `references.languages[]` paths
222
+ 3. Read each language document for stack-specific guidelines
223
+
224
+ **Example:**
225
+ ```bash
226
+ # 1. Check references in config.json
227
+ Read .claude/vibe/config.json
228
+
229
+ # 2. Reference documents specified in references.languages
230
+ Read ~/.claude/vibe/languages/typescript-react.md
231
+ ```
232
+
233
+ **Important:**
234
+
235
+ - No manual mapping needed - config.json contains all reference paths
236
+ - `config.json.references` is automatically referenced when running `/vibe.run`
237
+ - Not copied to project (referenced from global package)
238
+
239
+ ### 3. Parallel Research (v2.5.0) - MANDATORY AFTER requirements confirmed
240
+
241
+ **🚨🚨🚨 ABSOLUTE RULE: YOU MUST USE BASH TOOL FOR RESEARCH 🚨🚨🚨**
242
+
243
+ **STOP! Before doing ANY research, read this carefully:**
244
+
245
+ 1. **DO NOT** use Task tool to spawn research agents
246
+ 2. **DO NOT** use context7 MCP directly for research
247
+ 3. **DO NOT** use WebSearch tool directly for research
248
+ 4. **YOU MUST** use Bash tool to call llm-orchestrate.js directly
249
+
250
+ **When to trigger:**
251
+ 1. ✅ Feature type decided (e.g., "passkey authentication")
252
+ 2. ✅ Tech stack confirmed (e.g., "React + Supabase")
253
+ 3. ✅ Language guide copied (step 2.5)
254
+ 4. ✅ Core requirements collected
255
+
256
+ **→ IMMEDIATELY run these 4 Bash commands IN PARALLEL (all at once):**
257
+
258
+ ```bash
259
+ # Cross-platform path (works on Windows/macOS/Linux)
260
+ VIBE_SCRIPTS="$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts"
261
+
262
+ # 1. GPT: Best practices
263
+ node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "Best practices for [FEATURE] with [STACK]. Focus: architecture patterns, code conventions. Return JSON: {patterns: [], antiPatterns: [], libraries: []}"
264
+
265
+ # 2. GPT: Security
266
+ node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "Security vulnerabilities for [FEATURE] with [STACK]. Focus: CVE database, known exploits. Return JSON: {vulnerabilities: [], mitigations: [], checklist: []}"
267
+
268
+ # 3. Gemini: Best practices
269
+ node "$VIBE_SCRIPTS/llm-orchestrate.js" gemini orchestrate-json "Best practices for [FEATURE] with [STACK]. Focus: latest trends, framework updates. Return JSON: {patterns: [], antiPatterns: [], libraries: []}"
270
+
271
+ # 4. Gemini: Security
272
+ node "$VIBE_SCRIPTS/llm-orchestrate.js" gemini orchestrate-json "Security advisories for [FEATURE] with [STACK]. Focus: latest patches, recent incidents. Return JSON: {advisories: [], patches: [], incidents: []}"
273
+ ```
274
+
275
+ **Concrete example - run all 4 in parallel:**
276
+ ```bash
277
+ # GPT best practices
278
+ node "$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts/llm-orchestrate.js" gpt orchestrate-json "Best practices for passkey authentication with React, Supabase. Focus: architecture patterns, code conventions. Return JSON: {patterns: [], antiPatterns: [], libraries: []}"
279
+
280
+ # GPT security
281
+ node "$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts/llm-orchestrate.js" gpt orchestrate-json "Security vulnerabilities for passkey authentication with React, Supabase. Focus: CVE database, known exploits. Return JSON: {vulnerabilities: [], mitigations: [], checklist: []}"
282
+
283
+ # Gemini best practices
284
+ node "$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts/llm-orchestrate.js" gemini orchestrate-json "Best practices for passkey authentication with React, Supabase. Focus: latest trends, framework updates. Return JSON: {patterns: [], antiPatterns: [], libraries: []}"
285
+
286
+ # Gemini security
287
+ node "$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts/llm-orchestrate.js" gemini orchestrate-json "Security advisories for passkey authentication with React, Supabase. Focus: latest patches, recent incidents. Return JSON: {advisories: [], patches: [], incidents: []}"
288
+ ```
289
+
290
+ **ALSO run Claude research agents in parallel using Task tool:**
291
+
292
+ | Claude Agent | Role | Source |
293
+ |--------------|------|--------|
294
+ | `best-practices-agent` | Best practices for [feature] + [stack] | WebSearch |
295
+ | `framework-docs-agent` | Latest docs via context7 | context7 MCP |
296
+ | `codebase-patterns-agent` | Similar patterns in existing codebase | Glob, Grep |
297
+ | `security-advisory-agent` | Security advisories for [feature] | WebSearch |
298
+
299
+ **Total: 4 GPT/Gemini calls (Bash) + 4 Claude agents (Task) = 8 parallel research tasks**
300
+
301
+ **🚨 GPT/Gemini MUST be called via Bash with llm-orchestrate.js! 🚨**
302
+
303
+ #### 3.1 Result Merge Rules
304
+
305
+ | Area | Merge Strategy |
306
+ |------|----------------|
307
+ | Best Practices | Deduplicate, keep most detailed |
308
+ | Security | ALL included (no dedup for safety) |
309
+ | Libraries | Consensus recommendations |
310
+
311
+ **IMPORTANT:**
312
+ - ❌ DO NOT skip research step
313
+ - ❌ DO NOT ask user "should I run research?"
314
+ - ✅ ALWAYS run after requirements confirmed
315
+ - ✅ Show "Running parallel research (Claude + GPT + Gemini)..." message
316
+ - ✅ Include all agent + LLM results in SPEC Context
317
+ - ✅ Run all 4 Bash LLM calls in parallel + 4 Task agents in parallel
318
+
319
+ **Research results are reflected in SPEC's Context section.**
320
+
321
+ ### 4. Write SPEC Document (PTCF Structure)
322
+
323
+ #### 4.0 Large Scope Detection & Auto-Split (MANDATORY)
324
+
325
+ **🚨 CRITICAL: Automatically split SPEC when scope is large**
326
+
327
+ **❌ DO NOT ask user for confirmation - auto-split silently**
328
+
329
+ **Detection criteria (ANY triggers split):**
330
+
331
+ | Criteria | Threshold |
332
+ |----------|-----------|
333
+ | Phases | 5+ phases |
334
+ | Files to create | 15+ files |
335
+ | Platforms | 2+ platforms |
336
+ | Major features | 4+ distinct features |
337
+
338
+ **Auto-split output (SPEC + Feature files must match):**
339
+
340
+ ```
341
+ .claude/vibe/specs/{feature-name}/
342
+ ├── _index.md # Master SPEC
343
+ ├── phase-1-setup.md
344
+ ├── phase-2-core.md
345
+ └── ...
346
+
347
+ .claude/vibe/features/{feature-name}/
348
+ ├── _index.feature # Master Feature
349
+ ├── phase-1-setup.feature
350
+ ├── phase-2-core.feature
351
+ └── ...
352
+ ```
353
+
354
+ **🚨 CRITICAL: Each SPEC phase file MUST have a matching Feature file**
355
+
356
+ **Master SPEC (`_index.md`):**
357
+
358
+ ```markdown
359
+ # SPEC: {feature-name} (Master)
360
+
361
+ ## Overview
362
+ - Total phases: N
363
+ - Dependencies: [list]
364
+
365
+ ## Sub-SPECs
366
+
367
+ | Order | SPEC File | Feature File | Status |
368
+ |-------|-----------|--------------|--------|
369
+ | 1 | phase-1-setup.md | phase-1-setup.feature | ⬜ |
370
+ | 2 | phase-2-core.md | phase-2-core.feature | ⬜ |
371
+
372
+ ## Shared Context
373
+ - Tech Stack: [all phases]
374
+ - Constraints: [all phases]
375
+ ```
376
+
377
+ **Master Feature (`_index.feature`):**
378
+
379
+ ```markdown
380
+ # Feature: {feature-name} (Master)
381
+
382
+ **Master SPEC**: `.claude/vibe/specs/{feature-name}/_index.md`
383
+
384
+ ## Sub-Features
385
+
386
+ | Order | Feature File | SPEC File | Status |
387
+ |-------|--------------|-----------|--------|
388
+ | 1 | phase-1-setup.feature | phase-1-setup.md | ⬜ |
389
+ | 2 | phase-2-core.feature | phase-2-core.md | ⬜ |
390
+
391
+ ## Overall User Story
392
+ **As a** {user}
393
+ **I want** {complete feature}
394
+ **So that** {value}
395
+ ```
396
+
397
+ **Small scope (default):**
398
+
399
+ Create `.claude/vibe/specs/{feature-name}.md`:
400
+
401
+ ```markdown
402
+ # SPEC: {feature-name}
403
+
404
+ ## Persona
405
+ <role>
406
+ Define AI role and expertise for implementation
407
+ - Senior developer on the project
408
+ - Follow existing code patterns
409
+ - Write testable code
410
+ </role>
411
+
412
+ ## Context
413
+ <context>
414
+ ### Background
415
+ - Why this feature is needed
416
+ - Who will use it
417
+
418
+ ### Tech Stack
419
+ - Backend: {technology}
420
+ - Frontend: {technology}
421
+ - Database: {technology}
422
+
423
+ ### Related Code
424
+ - `src/xxx/`: Existing implementation to reference
425
+ - `src/yyy/`: Files to modify
426
+
427
+ ### Design Reference
428
+ - {Reference app/service}
429
+ </context>
430
+
431
+ ## Task
432
+ <task>
433
+ ### Phase 1: {phase-name}
434
+ 1. [ ] {specific task}
435
+ - File: `path/to/file`
436
+ - Verify: `command`
437
+ 2. [ ] {specific task}
438
+
439
+ ### Phase 2: {phase-name}
440
+ 1. [ ] {specific task}
441
+ 2. [ ] {specific task}
442
+
443
+ ### Phase 3: Testing and Verification
444
+ 1. [ ] Unit Tests
445
+ 2. [ ] Integration Tests
446
+ </task>
447
+
448
+ ## Constraints
449
+ <constraints>
450
+ - Follow existing code patterns
451
+ - Localize error messages
452
+ - Separate configuration via environment variables
453
+ - {other constraints}
454
+ </constraints>
455
+
456
+ ## Output Format
457
+ <output_format>
458
+ ### Files to Create
459
+ - `path/to/new/file.ts`
460
+ - `path/to/new/file.test.ts`
461
+
462
+ ### Files to Modify
463
+ - `path/to/existing/file.ts`
464
+
465
+ ### Verification Commands
466
+ - `npm test`
467
+ - `npm run build`
468
+ </output_format>
469
+
470
+ ## Acceptance Criteria
471
+ <acceptance>
472
+ - [ ] {verifiable criterion 1}
473
+ - [ ] {verifiable criterion 2}
474
+ - [ ] All tests pass
475
+ - [ ] Build succeeds
476
+ </acceptance>
477
+ ```
478
+
479
+ ### 5. Create Feature File (BDD) - Required
480
+
481
+ **🚨 CRITICAL: Feature files MUST match SPEC file structure**
482
+
483
+ | SPEC Structure | Feature Structure |
484
+ |----------------|-------------------|
485
+ | Single file (`{feature}.md`) | Single file (`{feature}.feature`) |
486
+ | Split (`{feature}/_index.md` + phases) | Split (`{feature}/_index.feature` + phases) |
487
+
488
+ #### 5.1 Single File (Small Scope)
489
+
490
+ Create `.claude/vibe/features/{feature-name}.feature`:
491
+
492
+ **Creation rules:**
493
+ 1. Convert each SPEC Acceptance Criteria → one Scenario
494
+ 2. Include Happy Path (normal case) + Edge Case (exception case)
495
+ 3. Follow Given-When-Then format
496
+
497
+ ```markdown
498
+ # Feature: {feature-name}
499
+
500
+ **SPEC**: `.claude/vibe/specs/{feature-name}.md`
501
+
502
+ ## User Story
503
+ **As a** {user}
504
+ **I want** {feature}
505
+ **So that** {value}
506
+
507
+ ## Scenarios
508
+
509
+ ### Scenario 1: {Happy Path}
510
+ \`\`\`gherkin
511
+ Scenario: {title}
512
+ Given {precondition}
513
+ When {action}
514
+ Then {result}
515
+ \`\`\`
516
+ **Verification**: SPEC AC #1
517
+
518
+ ### Scenario 2: {Edge Case}
519
+ ...
520
+
521
+ ## Coverage
522
+ | Scenario | SPEC AC | Status |
523
+ |----------|---------|--------|
524
+ | 1 | AC-1 | ⬜ |
525
+ ```
526
+
527
+ #### 5.2 Split Files (Large Scope)
528
+
529
+ When SPEC is split into phases, Feature files MUST also be split:
530
+
531
+ ```
532
+ .claude/vibe/features/{feature-name}/
533
+ ├── _index.feature # Master: links to all phase features
534
+ ├── phase-1-setup.feature # Scenarios for phase-1-setup.md
535
+ ├── phase-2-core.feature # Scenarios for phase-2-core.md
536
+ └── ...
537
+ ```
538
+
539
+ **Phase Feature file structure:**
540
+
541
+ ```markdown
542
+ # Feature: {feature-name} - Phase {N}: {phase-name}
543
+
544
+ **SPEC**: `.claude/vibe/specs/{feature-name}/phase-{N}-{name}.md`
545
+ **Master Feature**: `.claude/vibe/features/{feature-name}/_index.feature`
546
+
547
+ ## User Story (Phase Scope)
548
+ **As a** {user}
549
+ **I want** {phase-specific feature}
550
+ **So that** {phase-specific value}
551
+
552
+ ## Scenarios
553
+
554
+ ### Scenario 1: {Phase Happy Path}
555
+ ...
556
+
557
+ ## Coverage
558
+ | Scenario | SPEC AC | Status |
559
+ |----------|---------|--------|
560
+ | 1 | Phase {N} AC-1 | ⬜ |
561
+ ```
562
+
563
+ ### 6. Ambiguity Scan - Required
564
+
565
+ After creating SPEC draft, **must perform systematic ambiguity check**.
566
+
567
+ #### 6.1 Mandatory Check Categories
568
+
569
+ | Category | Check Items | Red Flags |
570
+ |----------|-------------|-----------|
571
+ | **Functional Scope** | Missing features, unclear behavior | "etc.", "other", "if needed" |
572
+ | **Data Model** | Undefined entities, relationships | Undefined types, missing fields |
573
+ | **Non-Functional** | Performance, security requirements | Performance requirements without numbers |
574
+ | **Edge Cases** | Boundary conditions, errors | 0 failure scenarios |
575
+ | **Integration Points** | External APIs, contracts | API version/endpoint undefined |
576
+ | **User Input** | Validation rules, limits | Input limits not specified |
577
+ | **State Management** | State transitions, persistence | Missing state diagram |
578
+
579
+ #### 6.2 Forbidden Ambiguous Terms
580
+
581
+ If the following terms exist in SPEC, **clarification is mandatory**:
582
+
583
+ | Forbidden Term | Replacement Method |
584
+ |----------------|-------------------|
585
+ | "appropriately", "properly" | Provide specific criteria (e.g., "within 3 seconds") |
586
+ | "quickly", "rapidly" | Specify with numbers (e.g., "under 100ms") |
587
+ | "various", "multiple" | List specific items |
588
+ | "etc.", "other" | Specify complete list or limit scope |
589
+ | "if needed", "depending on situation" | Specify conditions (e.g., "when credits < 10") |
590
+ | "later", "in the future" | Explicitly exclude from current scope |
591
+
592
+ #### 6.3 Check Process
593
+
594
+ ```
595
+ 1. Write SPEC draft
596
+
597
+ 2. Auto-scan for forbidden terms
598
+
599
+ 3. Review checklist by category
600
+
601
+ 4. List discovered ambiguities
602
+
603
+ 5. Auto-fixable items → Fix immediately
604
+ Needs user confirmation → Ask question
605
+
606
+ 6. Re-verify (repeat until 0 ambiguities)
607
+ ```
608
+
609
+ #### 6.4 Auto-Fix for Common Ambiguities
610
+
611
+ | Ambiguity Type | Auto-Fix Method |
612
+ |----------------|-----------------|
613
+ | Timeout undefined | Apply default 30 seconds |
614
+ | Retry count undefined | Apply default 3 retries |
615
+ | Pagination undefined | Apply default 20 items/page |
616
+ | Input length undefined | Text 500 chars, password 8-64 chars |
617
+ | File size undefined | Image 5MB, video 100MB |
618
+
619
+ #### 6.5 Ambiguity Output Format
620
+
621
+ ```markdown
622
+ ## 🔍 Ambiguity Scan Results
623
+
624
+ ### Found Issues: 3
625
+
626
+ #### 1. Functional Scope
627
+ - ⚠️ "Login failure behavior" not defined
628
+ → **Auto-fix**: Apply 5-minute lockout after 3 failures
629
+ - ⚠️ "Session expiration handling" unclear
630
+ → **Question**: Session expiration time? (30min/1hour/24hours)
631
+
632
+ #### 2. Edge Cases
633
+ - ⚠️ Concurrent login permission undefined
634
+ → **Question**: Allow concurrent login? (Y/N)
635
+
636
+ ### Auto-fixed: 1
637
+ ### Needs clarification: 2
638
+ ```
639
+
640
+ ### 7. Quality Validation (Self-Check)
641
+
642
+ **Must perform self-quality check after SPEC completion**
643
+
644
+ #### 7.1 Quality Checklist (Required Items)
645
+
646
+ | Category | Check Item | Weight |
647
+ |----------|------------|--------|
648
+ | **Completeness** | All user flows included in Task | 15% |
649
+ | **Completeness** | All ACs converted to Feature scenarios | 10% |
650
+ | **Clarity** | No ambiguous terms (e.g., "appropriately", "quickly") | 10% |
651
+ | **Clarity** | All numbers/limits specified (e.g., "max 500 chars") | 10% |
652
+ | **Testability** | All ACs are auto-testable | 10% |
653
+ | **Security** | Authentication/authorization requirements defined | 10% |
654
+ | **Security** | Sensitive data handling method specified | 5% |
655
+ | **Error Handling** | Major failure scenarios defined | 10% |
656
+ | **Error Handling** | User error messages specified | 5% |
657
+ | **Performance** | Response time/throughput targets specified | 5% |
658
+ | **Edge Cases** | Boundary condition handling defined | 5% |
659
+ | **Dependencies** | External systems/APIs specified | 5% |
660
+
661
+ #### 7.2 Quality Score Calculation
662
+
663
+ ```
664
+ Score = Σ(Check item met × Weight) / 100
665
+
666
+ Grades:
667
+ - 95-100: ✅ EXCELLENT - Ready to start implementation
668
+ - 90-94: ⚠️ GOOD - Minor improvements required before implementation
669
+ - 80-89: ⚠️ FAIR - Significant improvements required
670
+ - 0-79: ❌ POOR - Rewrite required
671
+ ```
672
+
673
+ #### 7.3 Quality Gate (Auto-verification)
674
+
675
+ **Minimum 95 points required to proceed to next step (GPT+Gemini review)**
676
+
677
+ ```
678
+ SPEC writing complete
679
+
680
+ [Calculate Quality Score]
681
+
682
+ Score < 95? → Show missing items → Attempt auto-fix → Re-evaluate
683
+
684
+ Score ≥ 95 → Proceed to GPT + Gemini review
685
+ ```
686
+
687
+ #### 7.4 Auto-Fix for Low Score
688
+
689
+ If score is below 95, attempt automatic fixes:
690
+
691
+ | Missing Item | Auto-Fix Method |
692
+ |--------------|-----------------|
693
+ | Missing AC | Auto-generate AC based on Task |
694
+ | Numbers not specified | Apply project defaults (e.g., timeout 30s) |
695
+ | Missing error handling | Add common error scenarios |
696
+ | Missing performance targets | Apply industry standard criteria |
697
+
698
+ ### 8. SPEC Review (GPT/Gemini) - 3-Round Mandatory Review
699
+
700
+ **🚨 CRITICAL: YOU MUST EXECUTE ALL 3 ROUNDS. DO NOT SKIP.**
701
+
702
+ ```bash
703
+ /vibe.spec "feature" # Default: 3 rounds (MANDATORY)
704
+ /vibe.spec "feature" --quick # Quick mode: 1 round only
705
+ ```
706
+
707
+ **3-Round Review Process (MANDATORY):**
708
+
709
+ ```
710
+ round_count = 0
711
+
712
+ WHILE round_count < 3:
713
+ round_count += 1
714
+
715
+ print(f"━━━ Round {round_count}/3 ━━━")
716
+
717
+ # 1. Call GPT + Gemini in parallel (Bash)
718
+ gpt_result = Bash("node llm-orchestrate.js gpt ...")
719
+ gemini_result = Bash("node llm-orchestrate.js gemini ...")
720
+
721
+ # 2. Merge and apply feedback
722
+ apply_feedback(gpt_result, gemini_result)
723
+ update_spec()
724
+
725
+ # 3. Show progress
726
+ print(f"✅ Round {round_count}/3 complete")
727
+
728
+ # 4. Early exit ONLY if BOTH models say "no issues"
729
+ IF gpt_result.no_issues AND gemini_result.no_issues:
730
+ print("Both models: no issues found. Stopping early.")
731
+ BREAK
732
+
733
+ print(f"🎉 Review complete! Total rounds: {round_count}")
734
+ ```
735
+
736
+ **🚨 RULES:**
737
+ 1. **ALWAYS start Round 1** - never skip
738
+ 2. **ALWAYS continue to Round 2** unless both models return "no issues"
739
+ 3. **ALWAYS continue to Round 3** unless both models return "no issues" in Round 2
740
+ 4. **MUST show "Round X/3"** in output for each round
741
+ 5. **Early exit ONLY when BOTH GPT AND Gemini say "no issues"**
742
+
743
+ **Output format for each round:**
744
+
745
+ ```
746
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
747
+ 🔍 SPEC REVIEW - Round 1/3
748
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
749
+ [GPT] 3 issues found: ...
750
+ [Gemini] 2 issues found: ...
751
+ ✅ Applied 5 improvements
752
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
753
+
754
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
755
+ 🔍 SPEC REVIEW - Round 2/3
756
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
757
+ [GPT] 1 issue found: ...
758
+ [Gemini] 0 issues found
759
+ ✅ Applied 1 improvement
760
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
761
+
762
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
763
+ 🔍 SPEC REVIEW - Round 3/3
764
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
765
+ [GPT] 0 issues found
766
+ [Gemini] 0 issues found
767
+ ✅ No changes needed
768
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
769
+
770
+ 🎉 SPEC Review complete! 3 rounds, 6 total improvements
771
+ ```
772
+
773
+ **After SPEC draft, execute review loop:**
774
+
775
+ ```
776
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
777
+ 🔍 SPEC REVIEW
778
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
779
+
780
+ [Step 1] Sending SPEC to Gemini/GPT...
781
+ - Full SPEC content
782
+ - Feature file (scenarios)
783
+ - Project context
784
+
785
+ [Step 2] Review feedback:
786
+ ┌─────────────────────────────────────────┐
787
+ │ 📝 SPEC Review Feedback │
788
+ │ │
789
+ │ 1. [Missing] Error handling scenarios │
790
+ │ → Recommend adding "retry on network │
791
+ │ error" │
792
+ │ │
793
+ │ 2. [Security] Auth token expiry │
794
+ │ handling undefined │
795
+ │ → Recommend adding refresh token │
796
+ │ flow │
797
+ │ │
798
+ │ 3. [Edge] Concurrent login policy │
799
+ │ undefined │
800
+ │ → Need to specify existing session │
801
+ │ handling method │
802
+ └─────────────────────────────────────────┘
803
+
804
+ [Step 3] Auto-applying...
805
+ ✅ Added error handling Phase to SPEC Task
806
+ ✅ Added token expiry scenario to Feature
807
+ ✅ Added concurrent login policy to Constraints
808
+
809
+ [Step 4] Re-verifying...
810
+ ✅ Ambiguity Scan: 0 issues
811
+ ✅ Quality Score: 95/100
812
+
813
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
814
+ ✅ SPEC Review complete! 3 improvements applied
815
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
816
+ ```
817
+
818
+ **MUST: SPEC Review (Required) - GPT + Gemini Parallel Execution**
819
+
820
+ 🚨 **Run GPT and Gemini in parallel for cross-validation to ensure quality**
821
+
822
+ **Parallel execution (2 Bash calls simultaneously):**
823
+
824
+ ```bash
825
+ # Cross-platform path (works on Windows/macOS/Linux)
826
+ VIBE_SCRIPTS="$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts"
827
+
828
+ # GPT review (code patterns, architecture perspective)
829
+ node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "Review SPEC for [feature-name]. Stack: [stack]. Summary: [summary]. Check: completeness, error handling, security, edge cases."
830
+
831
+ # Gemini review (latest docs, best practices perspective)
832
+ node "$VIBE_SCRIPTS/llm-orchestrate.js" gemini orchestrate-json "Review SPEC for [feature-name]. Stack: [stack]. Summary: [summary]. Check: completeness, error handling, security, edge cases."
833
+ ```
834
+
835
+ **Important:**
836
+
837
+ - **Must call both GPT and Gemini** (parallel execution)
838
+ - Merge feedback from both models and apply to SPEC
839
+ - If one model fails, apply only the remaining result
840
+ - Don't send full SPEC, send only **key summary** (save tokens)
841
+ - Parse JSON response and auto-apply to SPEC
842
+
843
+ **Why parallel execution:**
844
+
845
+ | Model | Strengths |
846
+ |-------|-----------|
847
+ | GPT | Code patterns, architecture, logic validation |
848
+ | Gemini | Latest web info, doc search, best practices |
849
+
850
+ **Result merge:** Combine feedback from both models for more thorough review
851
+
852
+ **Review items:**
853
+
854
+ | Category | Check Point |
855
+ |----------|-------------|
856
+ | Completeness | All user flows covered? |
857
+ | Error Handling | Failure scenarios defined? |
858
+ | Security | Auth/authorization/data protection? |
859
+ | Edge Cases | Boundary conditions handled? |
860
+ | Testability | ACs verifiable? |
861
+
862
+ **Auto-apply rules:**
863
+
864
+ | Feedback Type | Action |
865
+ |---------------|--------|
866
+ | Missing scenario | Auto-add to Feature |
867
+ | Security considerations | Auto-add to Constraints |
868
+ | Edge cases | Auto-add to Task Phase |
869
+ | Lack of clarity | Supplement the section |
870
+
871
+ **Fallback handling:**
872
+ - On `"status": "fallback"` response → Skip and proceed to next step
873
+ - On network error → Retry once then skip
874
+
875
+ ## Output (MANDATORY File Creation)
876
+
877
+ **🚨 CRITICAL: Files MUST be created in these EXACT paths. NO exceptions.**
878
+
879
+ ### Small Scope (Single File)
880
+
881
+ | File | Path | When |
882
+ |------|------|------|
883
+ | SPEC | `.claude/vibe/specs/{feature-name}.md` | After quality validation (Step 7) |
884
+ | Feature | `.claude/vibe/features/{feature-name}.feature` | Immediately after SPEC |
885
+
886
+ ### Large Scope (Split Files)
887
+
888
+ | File | Path | When |
889
+ |------|------|------|
890
+ | Master SPEC | `.claude/vibe/specs/{feature-name}/_index.md` | After quality validation |
891
+ | Phase SPEC | `.claude/vibe/specs/{feature-name}/phase-{N}-{name}.md` | Per phase |
892
+ | Master Feature | `.claude/vibe/features/{feature-name}/_index.feature` | After Master SPEC |
893
+ | Phase Feature | `.claude/vibe/features/{feature-name}/phase-{N}-{name}.feature` | Per phase SPEC |
894
+
895
+ **❌ FORBIDDEN:**
896
+
897
+ - Creating files in project root (e.g., `feature-name.md`)
898
+ - Creating files outside `.claude/vibe/` directory
899
+ - Skipping file creation
900
+ - Using different file names than feature-name
901
+ - Creating split SPEC without matching split Feature files
902
+
903
+ **✅ REQUIRED:**
904
+
905
+ - Use Write tool to create files
906
+ - Verify directories exist (create if needed)
907
+ - Confirm file creation in response
908
+ - **Each SPEC file must have a matching Feature file**
909
+
910
+ ### File Creation Template
911
+
912
+ **Single file:**
913
+ ```
914
+ 1. Write .claude/vibe/specs/{feature-name}.md
915
+ 2. Write .claude/vibe/features/{feature-name}.feature
916
+ 3. Confirm: "✅ Created: specs/{feature-name}.md + features/{feature-name}.feature"
917
+ ```
918
+
919
+ **Split files:**
920
+ ```
921
+ 1. Write .claude/vibe/specs/{feature-name}/_index.md
922
+ 2. Write .claude/vibe/specs/{feature-name}/phase-1-setup.md
923
+ 3. Write .claude/vibe/specs/{feature-name}/phase-2-core.md
924
+ 4. Write .claude/vibe/features/{feature-name}/_index.feature
925
+ 5. Write .claude/vibe/features/{feature-name}/phase-1-setup.feature
926
+ 6. Write .claude/vibe/features/{feature-name}/phase-2-core.feature
927
+ 7. Confirm: "✅ Created: {N} SPEC files + {N} Feature files"
928
+ ```
929
+
930
+ ## Example
931
+
932
+ ```
933
+ User: /vibe.spec "brick-game"
934
+
935
+ Claude:
936
+ You're making a brick game! What style are you thinking of?
937
+
938
+ 1. Classic Breakout style
939
+ 2. Arkanoid (with power-up items)
940
+ 3. Custom style with special gameplay
941
+
942
+ Feel free to describe in your own words.
943
+
944
+ User: 1
945
+
946
+ Claude: What platform will it run on?
947
+
948
+ 1. Web (browser)
949
+ 2. Mobile (iOS/Android)
950
+ 3. Desktop
951
+
952
+ User: 1
953
+
954
+ Claude:
955
+ Here are tech stack suggestions for web game development:
956
+
957
+ 1. **Phaser.js** (Recommended) - Game framework with built-in physics engine
958
+ 2. **Canvas + JavaScript** - Lightweight with fine control
959
+ 3. **PixiJS + Matter.js** - High-performance rendering
960
+
961
+ User: 1
962
+
963
+ Claude: What design style?
964
+
965
+ 1. Retro pixel (Atari Breakout)
966
+ 2. Neon graphics (Arkanoid)
967
+ 3. Modern 3D effects
968
+
969
+ User: 2
970
+
971
+ [Conversation continues...]
972
+
973
+ Claude: SPEC draft created. Running ambiguity scan.
974
+
975
+ ## 🔍 Ambiguity Scan Results
976
+
977
+ ### Functional Scope
978
+ - ⚠️ Game over condition not defined (ball drop vs lives system)
979
+ - ⚠️ Stage clear condition unclear
980
+
981
+ ### Edge Cases
982
+ - ⚠️ Ball reflection angle when hitting paddle edge
983
+ - ⚠️ Multiple brick collision handling
984
+
985
+ Please clarify the above items.
986
+
987
+ User: 3 lives, clear when all bricks destroyed, edge reflects at 45 degrees
988
+
989
+ Claude: Thank you. SPEC has been refined.
990
+
991
+ 🔍 Re-check result: 0 ambiguities
992
+ 📊 Quality score: 92/100 (A)
993
+
994
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
995
+ 🔍 SPEC REVIEW (Gemini)
996
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
997
+
998
+ 📤 Sending SPEC...
999
+ 📝 Gemini feedback:
1000
+ 1. [Edge] Ball speed increase logic undefined
1001
+ 2. [Security] Need score manipulation prevention
1002
+
1003
+ ✅ 2 improvements auto-applied
1004
+ 🔍 Re-verifying... ✅ Passed
1005
+
1006
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1007
+ ✅ SPEC Complete!
1008
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1009
+
1010
+ 📄 .claude/vibe/specs/brick-game.md (PTCF structure)
1011
+ 📄 .claude/vibe/features/brick-game.feature
1012
+ 📊 Quality score: 95/100 (A) ← Improved after review
1013
+ ```
1014
+
1015
+ ## Vibe Tools (Semantic Analysis & Memory)
1016
+
1017
+ ### Tool Invocation
1018
+ All tools are called via:
1019
+ ```bash
1020
+ node -e "import('@su-record/vibe/tools').then(t => t.TOOL_NAME({...args}).then(r => console.log(r.content[0].text)))"
1021
+ ```
1022
+
1023
+ ### Recommended Tools for SPEC Creation
1024
+
1025
+ | Tool | Purpose | When to Use |
1026
+ |------|---------|-------------|
1027
+ | `findSymbol` | Find symbol definitions | Locate existing implementations to reference |
1028
+ | `findReferences` | Find all references | Understand how existing code is used |
1029
+ | `analyzeComplexity` | Code complexity analysis | Evaluate complexity of code to modify |
1030
+ | `saveMemory` | Save important decisions | Store confirmed requirements, design decisions |
1031
+ | `recallMemory` | Recall saved memory | Retrieve previous project decisions |
1032
+
1033
+ ### Example Tool Usage in SPEC Creation
1034
+
1035
+ **1. Find existing auth implementation:**
1036
+ ```bash
1037
+ node -e "import('@su-record/vibe/tools').then(t => t.findSymbol({symbolName: 'login', searchPath: 'src/'}).then(r => console.log(r.content[0].text)))"
1038
+ ```
1039
+
1040
+ **2. Save confirmed requirements:**
1041
+ ```bash
1042
+ node -e "import('@su-record/vibe/tools').then(t => t.saveMemory({key: 'brick-game-requirements', value: 'Platform: Web, Stack: Phaser.js, Style: Neon', category: 'spec', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
1043
+ ```
1044
+
1045
+ **3. Recall previous decisions:**
1046
+ ```bash
1047
+ node -e "import('@su-record/vibe/tools').then(t => t.recallMemory({key: 'brick-game-requirements', projectPath: process.cwd()}).then(r => console.log(r.content[0].text)))"
1048
+ ```
1049
+
1050
+ ## Next Step
1051
+
1052
+ ```
1053
+ /vibe.run "brick-game"
1054
+ ```
1055
+
1056
+ ---
1057
+
1058
+ ARGUMENTS: $ARGUMENTS