@su-record/vibe 2.9.17 β†’ 2.9.19

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 (449) hide show
  1. package/.env.example +37 -37
  2. package/LICENSE +21 -21
  3. package/agents/architect-low.md +41 -41
  4. package/agents/architect-medium.md +59 -59
  5. package/agents/architect.md +80 -80
  6. package/agents/build-error-resolver.md +115 -115
  7. package/agents/compounder.md +261 -261
  8. package/agents/diagrammer.md +178 -178
  9. package/agents/docs/api-documenter.md +99 -99
  10. package/agents/docs/changelog-writer.md +93 -93
  11. package/agents/e2e-tester.md +294 -294
  12. package/agents/event/event-comms.md +78 -78
  13. package/agents/event/event-content.md +68 -68
  14. package/agents/event/event-image.md +95 -95
  15. package/agents/event/event-ops.md +84 -84
  16. package/agents/event/event-scheduler.md +69 -69
  17. package/agents/event/event-speaker.md +86 -86
  18. package/agents/explorer-low.md +42 -42
  19. package/agents/explorer-medium.md +59 -59
  20. package/agents/explorer.md +48 -48
  21. package/agents/implementer-low.md +43 -43
  22. package/agents/implementer-medium.md +52 -52
  23. package/agents/implementer.md +54 -54
  24. package/agents/junior-mentor.md +141 -141
  25. package/agents/planning/requirements-analyst.md +84 -84
  26. package/agents/planning/ux-advisor.md +83 -83
  27. package/agents/qa/acceptance-tester.md +86 -86
  28. package/agents/qa/edge-case-finder.md +93 -93
  29. package/agents/qa/qa-coordinator.md +131 -131
  30. package/agents/refactor-cleaner.md +143 -143
  31. package/agents/research/best-practices-agent.md +199 -199
  32. package/agents/research/codebase-patterns-agent.md +157 -157
  33. package/agents/research/framework-docs-agent.md +188 -188
  34. package/agents/research/security-advisory-agent.md +213 -213
  35. package/agents/review/architecture-reviewer.md +107 -107
  36. package/agents/review/complexity-reviewer.md +116 -116
  37. package/agents/review/data-integrity-reviewer.md +88 -88
  38. package/agents/review/git-history-reviewer.md +103 -103
  39. package/agents/review/performance-reviewer.md +86 -86
  40. package/agents/review/python-reviewer.md +150 -150
  41. package/agents/review/rails-reviewer.md +139 -139
  42. package/agents/review/react-reviewer.md +144 -144
  43. package/agents/review/security-reviewer.md +80 -80
  44. package/agents/review/simplicity-reviewer.md +140 -140
  45. package/agents/review/test-coverage-reviewer.md +116 -116
  46. package/agents/review/typescript-reviewer.md +127 -127
  47. package/agents/searcher.md +54 -54
  48. package/agents/simplifier.md +120 -120
  49. package/agents/teams/debug-team.md +70 -70
  50. package/agents/teams/dev-team.md +88 -88
  51. package/agents/teams/docs-team.md +80 -80
  52. package/agents/teams/figma/figma-analyst.md +52 -52
  53. package/agents/teams/figma/figma-architect.md +112 -112
  54. package/agents/teams/figma/figma-auditor.md +82 -82
  55. package/agents/teams/figma/figma-builder.md +100 -100
  56. package/agents/teams/figma-team.md +85 -85
  57. package/agents/teams/fullstack-team.md +83 -83
  58. package/agents/teams/lite-team.md +69 -69
  59. package/agents/teams/migration-team.md +78 -78
  60. package/agents/teams/refactor-team.md +94 -94
  61. package/agents/teams/research-team.md +86 -86
  62. package/agents/teams/review-debate-team.md +125 -125
  63. package/agents/teams/security-team.md +81 -81
  64. package/agents/tester.md +49 -49
  65. package/agents/ui/ui-a11y-auditor.md +93 -93
  66. package/agents/ui/ui-antipattern-detector.md +102 -102
  67. package/agents/ui/ui-dataviz-advisor.md +69 -69
  68. package/agents/ui/ui-design-system-gen.md +57 -57
  69. package/agents/ui/ui-industry-analyzer.md +49 -49
  70. package/agents/ui/ui-layout-architect.md +65 -65
  71. package/agents/ui/ui-stack-implementer.md +68 -68
  72. package/agents/ui/ux-compliance-reviewer.md +81 -81
  73. package/agents/ui-previewer.md +258 -258
  74. package/commands/vibe.analyze.md +533 -533
  75. package/commands/vibe.docs.md +33 -33
  76. package/commands/vibe.event.md +163 -163
  77. package/commands/vibe.figma.md +584 -584
  78. package/commands/vibe.harness.md +177 -177
  79. package/commands/vibe.review.md +624 -624
  80. package/commands/vibe.run.md +1925 -1925
  81. package/commands/vibe.scaffold.md +195 -195
  82. package/commands/vibe.spec.md +565 -565
  83. package/commands/vibe.trace.md +276 -276
  84. package/commands/vibe.utils.md +413 -413
  85. package/commands/vibe.verify.md +519 -519
  86. package/dist/cli/collaborator.js +52 -52
  87. package/dist/cli/commands/codex-proxy.js +15 -15
  88. package/dist/cli/commands/config.js +9 -9
  89. package/dist/cli/commands/evolution.js +12 -12
  90. package/dist/cli/commands/figma.js +20 -20
  91. package/dist/cli/commands/info.js +52 -52
  92. package/dist/cli/commands/init.js +5 -5
  93. package/dist/cli/commands/remove.js +14 -14
  94. package/dist/cli/commands/sentinel.js +27 -27
  95. package/dist/cli/commands/skills.js +5 -5
  96. package/dist/cli/commands/slack.js +10 -10
  97. package/dist/cli/commands/stats.js +6 -6
  98. package/dist/cli/commands/telegram.js +12 -12
  99. package/dist/cli/detect.js +32 -32
  100. package/dist/cli/index.js +33 -33
  101. package/dist/cli/llm/claude-commands.js +16 -16
  102. package/dist/cli/llm/config.js +18 -18
  103. package/dist/cli/llm/gemini-commands.js +16 -16
  104. package/dist/cli/llm/gpt-commands.js +19 -19
  105. package/dist/cli/llm/help.js +21 -21
  106. package/dist/cli/postinstall/cursor-agents.js +32 -32
  107. package/dist/cli/postinstall/cursor-rules.js +83 -83
  108. package/dist/cli/postinstall/cursor-skills.js +743 -743
  109. package/dist/cli/setup/GlobalInstaller.d.ts.map +1 -1
  110. package/dist/cli/setup/GlobalInstaller.js +9 -0
  111. package/dist/cli/setup/GlobalInstaller.js.map +1 -1
  112. package/dist/cli/setup/Provisioner.js +42 -42
  113. package/dist/infra/lib/DeepInit.js +24 -24
  114. package/dist/infra/lib/IterationTracker.js +11 -11
  115. package/dist/infra/lib/PythonParser.js +108 -108
  116. package/dist/infra/lib/ReviewRace.js +96 -96
  117. package/dist/infra/lib/SkillFrontmatter.js +28 -28
  118. package/dist/infra/lib/SkillQualityGate.js +9 -9
  119. package/dist/infra/lib/SkillRepository.js +159 -159
  120. package/dist/infra/lib/UltraQA.js +99 -99
  121. package/dist/infra/lib/autonomy/AuditStore.js +41 -41
  122. package/dist/infra/lib/autonomy/ConfirmationStore.js +30 -30
  123. package/dist/infra/lib/autonomy/EventOutbox.js +38 -38
  124. package/dist/infra/lib/autonomy/PolicyEngine.d.ts +3 -3
  125. package/dist/infra/lib/autonomy/PolicyEngine.js +18 -18
  126. package/dist/infra/lib/autonomy/SecuritySentinel.js +1 -1
  127. package/dist/infra/lib/autonomy/SuggestionStore.js +33 -33
  128. package/dist/infra/lib/embedding/VectorStore.js +22 -22
  129. package/dist/infra/lib/evolution/AgentAnalyzer.js +10 -10
  130. package/dist/infra/lib/evolution/DescriptionOptimizer.js +21 -21
  131. package/dist/infra/lib/evolution/GenerationRegistry.js +36 -36
  132. package/dist/infra/lib/evolution/InsightStore.js +90 -90
  133. package/dist/infra/lib/evolution/ParityTester.js +57 -57
  134. package/dist/infra/lib/evolution/RollbackManager.js +5 -5
  135. package/dist/infra/lib/evolution/SkillBenchmark.js +23 -23
  136. package/dist/infra/lib/evolution/SkillEvalRunner.js +50 -50
  137. package/dist/infra/lib/evolution/SkillGapDetector.js +10 -10
  138. package/dist/infra/lib/evolution/UsageTracker.js +28 -28
  139. package/dist/infra/lib/gemini/orchestration.js +5 -5
  140. package/dist/infra/lib/gpt/orchestration.js +4 -4
  141. package/dist/infra/lib/memory/KnowledgeGraph.js +4 -4
  142. package/dist/infra/lib/memory/MemorySearch.js +57 -57
  143. package/dist/infra/lib/memory/MemoryStorage.js +181 -181
  144. package/dist/infra/lib/memory/ObservationStore.js +28 -28
  145. package/dist/infra/lib/memory/ReflectionStore.js +30 -30
  146. package/dist/infra/lib/memory/SessionRAGRetriever.js +7 -7
  147. package/dist/infra/lib/memory/SessionRAGStore.js +225 -225
  148. package/dist/infra/lib/memory/SessionSummarizer.js +9 -9
  149. package/dist/infra/orchestrator/AgentManager.js +12 -12
  150. package/dist/infra/orchestrator/AgentRegistry.js +65 -65
  151. package/dist/infra/orchestrator/MultiLlmResearch.js +8 -8
  152. package/dist/infra/orchestrator/SwarmOrchestrator.test.js +16 -16
  153. package/dist/infra/orchestrator/parallelResearch.js +24 -24
  154. package/dist/tools/convention/analyzeComplexity.test.js +115 -115
  155. package/dist/tools/convention/validateCodeQuality.test.js +104 -104
  156. package/dist/tools/memory/createMemoryTimeline.js +10 -10
  157. package/dist/tools/memory/getMemoryGraph.js +12 -12
  158. package/dist/tools/memory/getSessionContext.js +9 -9
  159. package/dist/tools/memory/linkMemories.js +14 -14
  160. package/dist/tools/memory/listMemories.js +4 -4
  161. package/dist/tools/memory/recallMemory.js +4 -4
  162. package/dist/tools/memory/saveMemory.js +4 -4
  163. package/dist/tools/memory/searchMemoriesAdvanced.js +23 -23
  164. package/dist/tools/semantic/analyzeDependencyGraph.js +12 -12
  165. package/dist/tools/semantic/astGrep.test.js +6 -6
  166. package/dist/tools/spec/prdParser.test.js +171 -171
  167. package/dist/tools/spec/specGenerator.js +169 -169
  168. package/dist/tools/spec/traceabilityMatrix.js +64 -64
  169. package/dist/tools/spec/traceabilityMatrix.test.js +28 -28
  170. package/hooks/gemini-hooks.json +73 -73
  171. package/hooks/hooks.json +126 -126
  172. package/hooks/scripts/__tests__/keyword-detector.test.js +199 -199
  173. package/hooks/scripts/__tests__/pre-tool-guard.test.js +287 -287
  174. package/hooks/scripts/__tests__/sentinel-guard.test.js +208 -208
  175. package/hooks/scripts/auto-commit.js +97 -97
  176. package/hooks/scripts/auto-format.js +64 -64
  177. package/hooks/scripts/auto-test.js +81 -81
  178. package/hooks/scripts/code-check.js +268 -268
  179. package/hooks/scripts/codex-detect.js +46 -46
  180. package/hooks/scripts/codex-review-gate.js +80 -80
  181. package/hooks/scripts/command-log.js +32 -32
  182. package/hooks/scripts/context-save.js +353 -353
  183. package/hooks/scripts/evolution-engine.js +91 -91
  184. package/hooks/scripts/figma-extract.js +635 -635
  185. package/hooks/scripts/figma-guard.js +219 -219
  186. package/hooks/scripts/figma-refine.js +315 -315
  187. package/hooks/scripts/figma-to-scss.js +394 -394
  188. package/hooks/scripts/figma-validate.js +353 -353
  189. package/hooks/scripts/hud-status.js +321 -321
  190. package/hooks/scripts/keyword-detector.js +214 -214
  191. package/hooks/scripts/llm-orchestrate.js +645 -645
  192. package/hooks/scripts/post-edit.js +32 -32
  193. package/hooks/scripts/pr-test-gate.js +52 -52
  194. package/hooks/scripts/pre-tool-guard.js +213 -213
  195. package/hooks/scripts/prompt-dispatcher.js +190 -190
  196. package/hooks/scripts/sentinel-guard.js +130 -130
  197. package/hooks/scripts/session-start.js +177 -177
  198. package/hooks/scripts/skill-injector.js +83 -83
  199. package/hooks/scripts/stop-notify.js +209 -209
  200. package/hooks/scripts/utils.js +257 -243
  201. package/languages/csharp-unity.md +515 -515
  202. package/languages/gdscript-godot.md +470 -470
  203. package/languages/ruby-rails.md +489 -489
  204. package/languages/typescript-angular.md +433 -433
  205. package/languages/typescript-astro.md +416 -416
  206. package/languages/typescript-electron.md +406 -406
  207. package/languages/typescript-nestjs.md +524 -524
  208. package/languages/typescript-svelte.md +407 -407
  209. package/languages/typescript-tauri.md +365 -365
  210. package/package.json +101 -101
  211. package/skills/agents-md/SKILL.md +121 -121
  212. package/skills/agents-md/rubrics/what-to-keep.md +49 -49
  213. package/skills/agents-md/templates/agents-md.md +36 -36
  214. package/skills/arch-guard/SKILL.md +181 -181
  215. package/skills/arch-guard/agents/detector.md +48 -48
  216. package/skills/arch-guard/agents/reporter.md +48 -48
  217. package/skills/arch-guard/agents/rule-generator.md +49 -49
  218. package/skills/arch-guard/agents/violation-checker.md +51 -51
  219. package/skills/arch-guard/frameworks/clean-architecture.md +108 -108
  220. package/skills/arch-guard/frameworks/solid.md +102 -102
  221. package/skills/arch-guard/scripts/check-boundaries.js +90 -90
  222. package/skills/arch-guard/templates/arch-rules.json +47 -47
  223. package/skills/arch-guard/templates/violation-report.md +53 -53
  224. package/skills/brand-assets/SKILL.md +147 -147
  225. package/skills/brand-assets/rubrics/asset-checklist.md +98 -98
  226. package/skills/brand-assets/templates/brand-guide.md +161 -161
  227. package/skills/capability-loop/SKILL.md +272 -272
  228. package/skills/capability-loop/agents/capability-designer.md +61 -61
  229. package/skills/capability-loop/agents/failure-analyst.md +55 -55
  230. package/skills/capability-loop/agents/implementer.md +50 -50
  231. package/skills/capability-loop/agents/tester.md +53 -53
  232. package/skills/capability-loop/templates/capability-spec.md +118 -118
  233. package/skills/capability-loop/templates/failure-analysis.md +118 -118
  234. package/skills/characterization-test/SKILL.md +207 -207
  235. package/skills/characterization-test/agents/behavior-capturer.md +50 -50
  236. package/skills/characterization-test/agents/coverage-checker.md +54 -54
  237. package/skills/characterization-test/agents/reporter.md +50 -50
  238. package/skills/characterization-test/agents/test-writer.md +49 -49
  239. package/skills/characterization-test/rubrics/coverage-criteria.md +53 -53
  240. package/skills/characterization-test/templates/test-template.ts +101 -101
  241. package/skills/chub-usage/SKILL.md +139 -139
  242. package/skills/claude-md-guide/SKILL.md +351 -351
  243. package/skills/claude-md-guide/rubrics/anti-patterns.md +88 -88
  244. package/skills/claude-md-guide/templates/claude-md.md +54 -54
  245. package/skills/commerce-patterns/SKILL.md +64 -64
  246. package/skills/commerce-patterns/rubrics/checkout-flow.md +48 -48
  247. package/skills/commerce-patterns/templates/product-schema.md +85 -85
  248. package/skills/commit-push-pr/SKILL.md +77 -77
  249. package/skills/commit-push-pr/agents/change-analyzer.md +55 -55
  250. package/skills/commit-push-pr/agents/message-writer.md +50 -50
  251. package/skills/commit-push-pr/agents/pr-writer.md +58 -58
  252. package/skills/commit-push-pr/agents/reviewer.md +52 -52
  253. package/skills/commit-push-pr/rubrics/commit-message.md +73 -73
  254. package/skills/commit-push-pr/templates/pr-body.md +63 -63
  255. package/skills/context7-usage/SKILL.md +106 -106
  256. package/skills/context7-usage/rubrics/when-to-use.md +50 -50
  257. package/skills/create-prd/SKILL.md +90 -90
  258. package/skills/create-prd/agents/edge-case-finder.md +48 -48
  259. package/skills/create-prd/agents/prioritizer.md +60 -60
  260. package/skills/create-prd/agents/requirements-writer.md +48 -48
  261. package/skills/create-prd/agents/researcher.md +55 -55
  262. package/skills/create-prd/agents/reviewer.md +54 -54
  263. package/skills/create-prd/frameworks/jobs-to-be-done.md +96 -96
  264. package/skills/create-prd/frameworks/rice-scoring.md +97 -97
  265. package/skills/create-prd/orchestrator.md +70 -70
  266. package/skills/create-prd/rubrics/completeness.md +58 -58
  267. package/skills/create-prd/templates/prd.md +139 -139
  268. package/skills/design-audit/SKILL.md +152 -152
  269. package/skills/design-audit/agents/a11y-auditor.md +43 -43
  270. package/skills/design-audit/agents/performance-auditor.md +46 -46
  271. package/skills/design-audit/agents/responsive-auditor.md +46 -46
  272. package/skills/design-audit/agents/scorer.md +47 -47
  273. package/skills/design-audit/agents/slop-detector.md +47 -47
  274. package/skills/design-audit/frameworks/core-web-vitals.md +107 -107
  275. package/skills/design-audit/frameworks/wcag-checklist.md +64 -64
  276. package/skills/design-audit/orchestrator.md +64 -64
  277. package/skills/design-audit/rubrics/ai-slop-patterns.md +83 -83
  278. package/skills/design-audit/rubrics/scoring.md +63 -63
  279. package/skills/design-audit/templates/report.md +88 -88
  280. package/skills/design-critique/SKILL.md +139 -139
  281. package/skills/design-critique/rubrics/ux-heuristics.md +143 -143
  282. package/skills/design-critique/templates/critique-report.md +86 -86
  283. package/skills/design-distill/SKILL.md +130 -130
  284. package/skills/design-distill/templates/design-system.md +132 -132
  285. package/skills/design-normalize/SKILL.md +133 -133
  286. package/skills/design-normalize/rubrics/token-naming.md +117 -117
  287. package/skills/design-normalize/templates/token-audit.md +89 -89
  288. package/skills/design-polish/SKILL.md +131 -131
  289. package/skills/design-polish/rubrics/polish-checklist.md +68 -68
  290. package/skills/design-polish/templates/polish-report.md +64 -64
  291. package/skills/design-teach/SKILL.md +182 -182
  292. package/skills/design-teach/rubrics/brand-personality.md +73 -73
  293. package/skills/design-teach/templates/design-context.json +36 -36
  294. package/skills/devlog/SKILL.md +143 -143
  295. package/skills/e2e-commerce/SKILL.md +62 -62
  296. package/skills/e2e-commerce/templates/test-scenarios.md +170 -170
  297. package/skills/event-comms/SKILL.md +172 -172
  298. package/skills/event-comms/templates/email-invite.md +99 -99
  299. package/skills/event-comms/templates/sns-post.md +133 -133
  300. package/skills/event-ops/SKILL.md +207 -207
  301. package/skills/event-ops/rubrics/contingency.md +85 -85
  302. package/skills/event-ops/templates/d-day-checklist.md +65 -65
  303. package/skills/event-planning/SKILL.md +144 -144
  304. package/skills/event-planning/rubrics/timeline.md +70 -70
  305. package/skills/event-planning/templates/event-plan.md +91 -91
  306. package/skills/exec-plan/SKILL.md +149 -149
  307. package/skills/exec-plan/agents/decomposer.md +47 -47
  308. package/skills/exec-plan/agents/dependency-mapper.md +44 -44
  309. package/skills/exec-plan/agents/estimator.md +43 -43
  310. package/skills/exec-plan/agents/validator.md +55 -55
  311. package/skills/exec-plan/orchestrator.md +70 -70
  312. package/skills/exec-plan/rubrics/complexity-scoring.md +75 -75
  313. package/skills/exec-plan/templates/plan.md +147 -147
  314. package/skills/git-worktree/SKILL.md +73 -73
  315. package/skills/git-worktree/rubrics/when-to-use.md +55 -55
  316. package/skills/handoff/SKILL.md +110 -110
  317. package/skills/handoff/agents/context-summarizer.md +51 -51
  318. package/skills/handoff/agents/document-writer.md +63 -63
  319. package/skills/handoff/agents/state-collector.md +53 -53
  320. package/skills/handoff/agents/verifier.md +48 -48
  321. package/skills/handoff/rubrics/completeness.md +62 -62
  322. package/skills/handoff/templates/handoff.md +107 -107
  323. package/skills/parallel-research/SKILL.md +89 -89
  324. package/skills/parallel-research/agents/best-practices.md +43 -43
  325. package/skills/parallel-research/agents/codebase-patterns.md +46 -46
  326. package/skills/parallel-research/agents/framework-docs.md +45 -45
  327. package/skills/parallel-research/agents/security-advisory.md +46 -46
  328. package/skills/parallel-research/agents/synthesizer.md +52 -52
  329. package/skills/parallel-research/experts/best-practices.md +50 -50
  330. package/skills/parallel-research/experts/codebase-patterns.md +70 -70
  331. package/skills/parallel-research/experts/framework-docs.md +65 -65
  332. package/skills/parallel-research/experts/security-advisory.md +69 -69
  333. package/skills/parallel-research/orchestrator.md +65 -65
  334. package/skills/parallel-research/templates/synthesis.md +101 -101
  335. package/skills/prioritization-frameworks/SKILL.md +87 -87
  336. package/skills/prioritization-frameworks/rubrics/frameworks.md +79 -79
  337. package/skills/prioritization-frameworks/templates/scoring-matrix.md +69 -69
  338. package/skills/priority-todos/SKILL.md +64 -64
  339. package/skills/priority-todos/rubrics/prioritization.md +70 -70
  340. package/skills/priority-todos/templates/todo-board.md +59 -59
  341. package/skills/seo-checklist/SKILL.md +58 -58
  342. package/skills/seo-checklist/frameworks/structured-data.md +153 -153
  343. package/skills/seo-checklist/rubrics/content-seo.md +42 -42
  344. package/skills/seo-checklist/rubrics/technical-seo.md +48 -48
  345. package/skills/techdebt/SKILL.md +124 -124
  346. package/skills/techdebt/agents/analyzer.md +50 -50
  347. package/skills/techdebt/agents/fixer.md +41 -41
  348. package/skills/techdebt/agents/reviewer.md +47 -47
  349. package/skills/techdebt/agents/scanner.md +44 -44
  350. package/skills/techdebt/orchestrator.md +70 -70
  351. package/skills/techdebt/rubrics/severity.md +51 -51
  352. package/skills/techdebt/scripts/scan.js +90 -90
  353. package/skills/techdebt/templates/report.md +86 -86
  354. package/skills/tool-fallback/SKILL.md +104 -104
  355. package/skills/tool-fallback/rubrics/fallback-chain.md +58 -58
  356. package/skills/typescript-advanced-types/SKILL.md +67 -67
  357. package/skills/typescript-advanced-types/rubrics/type-patterns.md +109 -109
  358. package/skills/ui-ux-pro-max/SKILL.md +236 -236
  359. package/skills/ui-ux-pro-max/reference/color-and-contrast.md +517 -517
  360. package/skills/ui-ux-pro-max/reference/interaction-design.md +544 -544
  361. package/skills/ui-ux-pro-max/reference/motion-design.md +591 -591
  362. package/skills/ui-ux-pro-max/reference/responsive-design.md +463 -463
  363. package/skills/ui-ux-pro-max/reference/spatial-design.md +390 -390
  364. package/skills/ui-ux-pro-max/reference/typography.md +455 -455
  365. package/skills/ui-ux-pro-max/reference/ux-writing.md +469 -469
  366. package/skills/ui-ux-pro-max/rubrics/interaction-states.md +83 -83
  367. package/skills/ui-ux-pro-max/rubrics/responsive-breakpoints.md +99 -99
  368. package/skills/user-personas/SKILL.md +75 -75
  369. package/skills/user-personas/rubrics/research-methods.md +56 -56
  370. package/skills/user-personas/templates/persona.md +89 -89
  371. package/skills/vercel-react-best-practices/SKILL.md +60 -60
  372. package/skills/vercel-react-best-practices/rubrics/performance.md +82 -82
  373. package/skills/vercel-react-best-practices/rubrics/server-components.md +86 -86
  374. package/skills/vibe-docs/templates/architecture.md +80 -80
  375. package/skills/vibe-docs/templates/readme.md +84 -84
  376. package/skills/vibe-docs/templates/release-notes.md +74 -74
  377. package/skills/vibe-figma/SKILL.md +363 -363
  378. package/skills/vibe-figma/rubrics/extraction-checklist.md +51 -51
  379. package/skills/vibe-figma/templates/component-index.md +126 -126
  380. package/skills/vibe-figma/templates/component-spec.md +168 -168
  381. package/skills/vibe-figma/templates/figma-handoff.md +100 -100
  382. package/skills/vibe-figma/templates/remapped-tree.md +277 -277
  383. package/skills/vibe-figma-convert/SKILL.md +235 -235
  384. package/skills/vibe-figma-convert/rubrics/conversion-rules.md +141 -141
  385. package/skills/vibe-figma-convert/templates/component.md +140 -140
  386. package/skills/vibe-figma-extract/SKILL.md +219 -219
  387. package/skills/vibe-figma-extract/rubrics/image-rules.md +157 -157
  388. package/skills/vibe-interview/SKILL.md +358 -358
  389. package/skills/vibe-interview/checklists/api.md +101 -101
  390. package/skills/vibe-interview/checklists/feature.md +88 -88
  391. package/skills/vibe-interview/checklists/library.md +95 -95
  392. package/skills/vibe-interview/checklists/mobile.md +89 -89
  393. package/skills/vibe-interview/checklists/webapp.md +97 -97
  394. package/skills/vibe-interview/checklists/website.md +99 -99
  395. package/skills/vibe-plan/SKILL.md +254 -254
  396. package/skills/vibe-spec/SKILL.md +1155 -1155
  397. package/skills/vibe-spec-review/SKILL.md +726 -726
  398. package/skills/video-production/SKILL.md +52 -52
  399. package/skills/video-production/rubrics/quality-checklist.md +58 -58
  400. package/skills/video-production/templates/production-plan.md +104 -104
  401. package/vibe/config.json +29 -29
  402. package/vibe/constitution.md +227 -227
  403. package/vibe/rules/principles/communication-guide.md +98 -98
  404. package/vibe/rules/principles/development-philosophy.md +52 -52
  405. package/vibe/rules/principles/quick-start.md +102 -102
  406. package/vibe/rules/quality/bdd-contract-testing.md +393 -393
  407. package/vibe/rules/quality/checklist.md +276 -276
  408. package/vibe/rules/quality/performance.md +236 -236
  409. package/vibe/rules/quality/testing-strategy.md +440 -440
  410. package/vibe/rules/standards/anti-patterns.md +541 -541
  411. package/vibe/rules/standards/code-structure.md +291 -291
  412. package/vibe/rules/standards/complexity-metrics.md +313 -313
  413. package/vibe/rules/standards/git-workflow.md +237 -237
  414. package/vibe/rules/standards/naming-conventions.md +198 -198
  415. package/vibe/rules/standards/security.md +305 -305
  416. package/vibe/rules/writing/document-style.md +74 -74
  417. package/vibe/setup.sh +31 -31
  418. package/vibe/templates/claudemd-template.md +74 -74
  419. package/vibe/templates/constitution-template.md +267 -267
  420. package/vibe/templates/contract-backend-template.md +526 -526
  421. package/vibe/templates/contract-frontend-template.md +599 -599
  422. package/vibe/templates/feature-template.md +96 -96
  423. package/vibe/templates/plan-template.md +194 -194
  424. package/vibe/templates/spec-template.md +221 -221
  425. package/vibe/ui-ux-data/charts.csv +26 -26
  426. package/vibe/ui-ux-data/colors.csv +97 -97
  427. package/vibe/ui-ux-data/icons.csv +101 -101
  428. package/vibe/ui-ux-data/landing.csv +31 -31
  429. package/vibe/ui-ux-data/products.csv +96 -96
  430. package/vibe/ui-ux-data/react-performance.csv +45 -45
  431. package/vibe/ui-ux-data/stacks/astro.csv +54 -54
  432. package/vibe/ui-ux-data/stacks/flutter.csv +53 -53
  433. package/vibe/ui-ux-data/stacks/html-tailwind.csv +56 -56
  434. package/vibe/ui-ux-data/stacks/jetpack-compose.csv +53 -53
  435. package/vibe/ui-ux-data/stacks/nextjs.csv +53 -53
  436. package/vibe/ui-ux-data/stacks/nuxt-ui.csv +51 -51
  437. package/vibe/ui-ux-data/stacks/nuxtjs.csv +59 -59
  438. package/vibe/ui-ux-data/stacks/react-native.csv +52 -52
  439. package/vibe/ui-ux-data/stacks/react.csv +54 -54
  440. package/vibe/ui-ux-data/stacks/shadcn.csv +61 -61
  441. package/vibe/ui-ux-data/stacks/svelte.csv +54 -54
  442. package/vibe/ui-ux-data/stacks/swiftui.csv +51 -51
  443. package/vibe/ui-ux-data/stacks/vue.csv +50 -50
  444. package/vibe/ui-ux-data/styles.csv +68 -68
  445. package/vibe/ui-ux-data/typography.csv +57 -57
  446. package/vibe/ui-ux-data/ui-reasoning.csv +101 -101
  447. package/vibe/ui-ux-data/ux-guidelines.csv +99 -99
  448. package/vibe/ui-ux-data/version.json +31 -31
  449. package/vibe/ui-ux-data/web-interface.csv +31 -31
@@ -1,1925 +1,1925 @@
1
- ---
2
- description: Execute implementation from SPEC
3
- argument-hint: "feature name" or --phase N
4
- ---
5
-
6
- # /vibe.run
7
-
8
- Execute **Scenario-Driven Implementation** with automatic quality verification.
9
-
10
- > **Core Principle**: Scenarios are both the implementation unit and verification criteria. All scenarios passing = Quality guaranteed.
11
-
12
- ## Usage
13
-
14
- ```
15
- /vibe.run "feature-name" # Full implementation
16
- /vibe.run "feature-name" --phase 1 # Specific Phase only
17
- /vibe.run "feature-name" ultrawork # ULTRAWORK mode (recommended)
18
- /vibe.run "feature-name" ulw # Short alias for ultrawork
19
- ```
20
-
21
- ---
22
-
23
- ## Codex Plugin Integration
24
-
25
- > **Codex ν”ŒλŸ¬κ·ΈμΈ 감지**: μ›Œν¬ν”Œλ‘œμš° μ‹œμž‘ μ‹œ μ•„λž˜ λͺ…λ ΉμœΌλ‘œ μžλ™ 감지.
26
- >
27
- > ```bash
28
- > CODEX_AVAILABLE=$(node "{{VIBE_PATH}}/hooks/scripts/codex-detect.js" 2>/dev/null || echo "unavailable")
29
- > ```
30
- >
31
- > `available`이면 `/codex:rescue` (κ΅¬ν˜„ μœ„μž„), `/codex:review` (μ½”λ“œ 리뷰) μžλ™ 호좜. `unavailable`이면 κΈ°μ‘΄ μ›Œν¬ν”Œλ‘œμš°λ‘œ λ™μž‘.
32
-
33
- ---
34
-
35
- > **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
36
-
37
- ## File Reading Policy (Mandatory)
38
-
39
- - **SPEC/Feature 파일**: λ°˜λ“œμ‹œ `Read` λ„κ΅¬λ‘œ 전체 νŒŒμΌμ„ 읽을 것 (Grep κΈˆμ§€)
40
- - **μ†ŒμŠ€μ½”λ“œ 파일**: κ΅¬ν˜„/μˆ˜μ • λŒ€μƒ νŒŒμΌμ€ λ°˜λ“œμ‹œ `Read` λ„κ΅¬λ‘œ 전체 읽은 ν›„ μž‘μ—…ν•  것
41
- - **Grep μ‚¬μš© μ œν•œ**: 파일 μœ„μΉ˜ 탐색(μ–΄λ–€ νŒŒμΌμ— μžˆλŠ”μ§€ μ°ΎκΈ°)μ—λ§Œ μ‚¬μš©. 파일 λ‚΄μš© νŒŒμ•…μ—λŠ” λ°˜λ“œμ‹œ Read μ‚¬μš©
42
- - **μ—μ΄μ „νŠΈ spawn μ‹œ**: ν”„λ‘¬ν”„νŠΈμ— "λŒ€μƒ νŒŒμΌμ„ Read λ„κ΅¬λ‘œ 전체 읽은 ν›„ κ΅¬ν˜„ν•˜λΌ"λ₯Ό λ°˜λ“œμ‹œ 포함할 것
43
- - **λΆ€λΆ„ 읽기 κΈˆμ§€**: Grep 결과의 μ£Όλ³€ λͺ‡ μ€„λ§Œ 보고 μˆ˜μ •ν•˜μ§€ 말 것. 전체 λ§₯락을 νŒŒμ•…ν•΄μ•Ό κΈ°μ‘΄ μ½”λ“œμ™€ μΌκ΄€λœ κ΅¬ν˜„ κ°€λŠ₯
44
-
45
- ## **Scenario-Driven Development (SDD)**
46
-
47
- > Automate **Scenario = Implementation = Verification** so even non-developers can trust quality
48
-
49
- ### Core Flow
50
-
51
- ```
52
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
53
- β”‚ SCENARIO-DRIVEN IMPLEMENTATION β”‚
54
- β”‚ β”‚
55
- β”‚ Load Feature file β”‚
56
- β”‚ ↓ β”‚
57
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
58
- β”‚ β”‚ Scenario 1: Happy Path β”‚ β”‚
59
- β”‚ β”‚ Given β†’ When β†’ Then β”‚ β”‚
60
- β”‚ β”‚ ↓ β”‚ β”‚
61
- β”‚ β”‚ [Implement] β†’ [Verify immediately] β†’ βœ… Pass β”‚ β”‚
62
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
63
- β”‚ ↓ β”‚
64
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
65
- β”‚ β”‚ Scenario 2: Edge Case β”‚ β”‚
66
- β”‚ β”‚ Given β†’ When β†’ Then β”‚ β”‚
67
- β”‚ β”‚ ↓ β”‚ β”‚
68
- β”‚ β”‚ [Implement] β†’ [Verify] β†’ ❌ Fail β†’ [Fix] β†’ βœ… Pass β”‚ β”‚
69
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
70
- β”‚ ↓ β”‚
71
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
72
- β”‚ β”‚ Scenario N: ... β”‚ β”‚
73
- β”‚ β”‚ [Implement] β†’ [Verify immediately] β†’ βœ… Pass β”‚ β”‚
74
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
75
- β”‚ ↓ β”‚
76
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
77
- β”‚ β”‚ πŸ“Š QUALITY REPORT β”‚ β”‚
78
- β”‚ β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ β”‚
79
- β”‚ β”‚ Scenarios: 5/5 passed βœ… β”‚ β”‚
80
- β”‚ β”‚ Quality score: 94/100 β”‚ β”‚
81
- β”‚ β”‚ Build: βœ… | Tests: βœ… β”‚ β”‚
82
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
83
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
84
- ```
85
-
86
- ### Scenario = Implementation Unit
87
-
88
- **Traditional approach (Phase-based)**:
89
- ```
90
- Phase 1 β†’ Phase 2 β†’ Phase 3 β†’ ... β†’ Verify at the end
91
- ↓
92
- "Where did it go wrong?"
93
- ```
94
-
95
- **SDD approach (Scenario-based)**:
96
- ```
97
- Scenario 1 β†’ Implement β†’ Verify βœ…
98
- Scenario 2 β†’ Implement β†’ Verify βœ…
99
- Scenario 3 β†’ Implement β†’ Verify ❌ β†’ Fix β†’ βœ…
100
- ...
101
- All pass = Quality guaranteed
102
- ```
103
-
104
- ### Automated Verification (Closed Loop)
105
-
106
- **자율적 AI μ½”λ”© = κ΅¬ν˜„ + 검증 + 반볡. 검증을 AIμ—κ²Œ λ§‘κΈ°λŠ” μˆœκ°„ 루프가 λ‹«νžŒλ‹€.**
107
-
108
- After implementing each scenario, **automatic verification**:
109
-
110
- | Verification Item | Auto Check | Method |
111
- |-------------------|------------|--------|
112
- | Given (precondition) | State/data preparation confirmed | Code analysis |
113
- | When (action) | Feature execution possible | Code analysis + Build |
114
- | Then (result) | Expected result matches | Code analysis + Test |
115
- | Code quality | Complexity, style, security | Static analysis |
116
- | **UI behavior** | **μ‹€μ œ λΈŒλΌμš°μ €μ—μ„œ λ™μž‘ 확인** | **E2E Closed Loop** |
117
-
118
- ### E2E Closed Loop (UI Scenarios)
119
-
120
- **UI μ‹œλ‚˜λ¦¬μ˜€κ°€ ν¬ν•¨λœ Feature일 λ•Œ μžλ™ ν™œμ„±ν™”.**
121
-
122
- ```
123
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
124
- β”‚ CLOSED LOOP = κ΅¬ν˜„ + 검증 + 반볡 β”‚
125
- β”‚ β”‚
126
- β”‚ Scenario κ΅¬ν˜„ μ™„λ£Œ β”‚
127
- β”‚ ↓ β”‚
128
- β”‚ [E2E 검증] AIκ°€ 직접 λΈŒλΌμš°μ € μ‘°μž‘ β”‚
129
- β”‚ β”‚ (μ ‘κ·Όμ„± 트리 기반 β€” 토큰 효율적) β”‚
130
- β”‚ β”œβ”€ PASS β†’ Next scenario β”‚
131
- β”‚ └─ FAIL β†’ Root cause analysis β”‚
132
- β”‚ β†’ Fix code (Read full file first) β”‚
133
- β”‚ β†’ Re-run failed scenario only β”‚
134
- β”‚ β†’ PASS? β†’ Next scenario β”‚
135
- β”‚ β†’ FAIL (same as prev)? β†’ STUCK β†’ Ask user β”‚
136
- β”‚ β”‚
137
- β”‚ 핡심: 검증이 κ°€λ²ΌμšΈμˆ˜λ‘ λ£¨ν”„λŠ” 더 많이 λˆλ‹€ β”‚
138
- β”‚ - μ ‘κ·Όμ„± 트리: button "Sign In" = 15 chars β”‚
139
- β”‚ - DOM 트리: div class="nav-wrapper mx-4..." = 200+ chars β”‚
140
- β”‚ - μ „μžλ₯Ό 써야 ν•œ μ„Έμ…˜μ—μ„œ μˆ˜μ‹­ 개 μ‹œλ‚˜λ¦¬μ˜€ 검증 κ°€λŠ₯ β”‚
141
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
142
- ```
143
-
144
- **Browser Tool Priority:**
145
-
146
- | Priority | Tool | μš©λ„ |
147
- |----------|------|------|
148
- | 1st | Agent Browser (μ ‘κ·Όμ„± 트리) | AI 직접 μ‘°μž‘, μ΅œμ†Œ 토큰 |
149
- | 2nd | Playwright Test Runner | ν…ŒμŠ€νŠΈ μ½”λ“œ μ‹€ν–‰, pass/fail λ°˜ν™˜ |
150
- | 3rd | Playwright MCP (DOM) | μ΅œν›„ μˆ˜λ‹¨, 토큰 λΉ„νš¨μœ¨ |
151
-
152
- **ν™œμ„±ν™” 쑰건:**
153
- - Feature νŒŒμΌμ— UI κ΄€λ ¨ μ‹œλ‚˜λ¦¬μ˜€ 쑴재 (form, button, page, navigate λ“±)
154
- - `.claude/vibe/e2e/config.json`의 `closedLoop.enabled: true` (κΈ°λ³Έκ°’)
155
- - dev serverκ°€ μ‹€ν–‰ 쀑 (`baseURL` μ ‘κ·Ό κ°€λŠ₯)
156
-
157
- ### Auto-Fix on Failure
158
-
159
- ```
160
- Scenario verification failed (μ½”λ“œ 뢄석 λ˜λŠ” E2E)
161
- ↓
162
- [Collect evidence]
163
- - E2E: screenshot, console errors, accessibility tree snapshot
164
- - Code: build errors, test failures, type errors
165
- ↓
166
- [Root cause analysis] - Which Then condition failed?
167
- ↓
168
- [Read target file FULLY] - Grep으둜 ν›‘μ§€ 말 것
169
- ↓
170
- [Implement fix] - Fix only that part
171
- ↓
172
- [Re-verify] - Re-run ONLY failed scenario (save tokens)
173
- ↓
174
- Repeat until pass (λΌμš΄λ“œ 수 μΊ‘ μ—†μŒ β€” stuck κ°μ§€λ‘œ μ’…λ£Œ)
175
- ```
176
-
177
- **Termination conditions:**
178
- - βœ… PASS β†’ λ‹€μŒ scenario
179
- - ⚠️ Stuck (같은 failureκ°€ 이전 λΌμš΄λ“œμ™€ 동일) β†’ μ‚¬μš©μž 질문:
180
- 1. 직접 μˆ˜μ • 방법 제곡 (예: "LoginForm.tsx 42쀄 μˆ˜μ •") β†’ μž¬μ‹œλ„
181
- 2. "proceed" β€” 남은 μ‹€νŒ¨ TODO 기둝 ν›„ λ‹€μŒ scenario
182
- 3. "abort" β€” κ΅¬ν˜„ 쀑단
183
- - `ultrawork` λͺ¨λ“œ: stuck μ‹œ ν”„λ‘¬ν”„νŠΈ 없이 TODO 기둝 ν›„ λ‹€μŒ scenario
184
-
185
- ---
186
-
187
- ## **ULTRAWORK Mode** (ulw)
188
-
189
- > Include `ultrawork` or `ulw` in your command to activate **maximum performance mode**.
190
-
191
- ### What ULTRAWORK Enables
192
-
193
- When you include `ultrawork` (or `ulw`), ALL of these activate automatically:
194
-
195
- | Feature | Description |
196
- |---------|-------------|
197
- | **Parallel Exploration** | 3+ Task(haiku) agents run simultaneously |
198
- | **Boulder Loop** | Auto-continues until ALL phases complete |
199
- | **Context Compression** | Aggressive auto-save at 70%+ context |
200
- | **No Pause** | Doesn't wait for confirmation between phases |
201
- | **External LLMs** | Auto-consults GPT/Gemini if enabled |
202
- | **Error Recovery** | Loops until 100% or stuck; on stuck auto-records TODO and proceeds (no user prompt) |
203
- | **Race Review (v2.6.9)** | Multi-LLM review (GPT+Gemini) with cross-validation |
204
-
205
- ### Boulder Loop (Inspired by Sisyphus)
206
-
207
- Like Sisyphus rolling the boulder, ULTRAWORK **keeps going until done**:
208
-
209
- ```
210
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
211
- β”‚ BOULDER LOOP (ultrawork) β”‚
212
- β”‚ β”‚
213
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
214
- β”‚ β”‚ Phase 1 │───→│ Phase 2 │───→│ Phase 3 │───→│ Phase N β”‚ β”‚
215
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
216
- β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
217
- β”‚ ↓ ↓ ↓ ↓ β”‚
218
- β”‚ [Parallel] [Parallel] [Parallel] [Parallel] β”‚
219
- β”‚ [Implement] [Implement] [Implement] [Implement] β”‚
220
- β”‚ [Test] [Test] [Test] [Test] β”‚
221
- β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
222
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
223
- β”‚ β”‚ β”‚
224
- β”‚ ↓ β”‚
225
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
226
- β”‚ β”‚ ALL DONE? β”‚ β”‚
227
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
228
- β”‚ β”‚ β”‚ β”‚
229
- β”‚ NO YES β”‚
230
- β”‚ β”‚ β”‚ β”‚
231
- β”‚ ↓ ↓ β”‚
232
- β”‚ [Continue] [πŸŽ‰ Complete!] β”‚
233
- β”‚ β”‚
234
- β”‚ NO STOPPING until acceptance criteria met or error limit hit β”‚
235
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
236
- ```
237
-
238
- ### Ralph Loop (Completion Verification) - CRITICAL
239
-
240
- > **Inspired by [ghuntley.com/ralph](https://ghuntley.com/ralph)**: "Deterministically bad in an undeterministic world" - Keep iterating until TRULY complete.
241
-
242
- **Problem**: AI often claims "complete" when implementation is partial.
243
-
244
- **Solution**: RTM-based automated coverage verification with iteration tracking.
245
-
246
- ```
247
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
248
- β”‚ RALPH LOOP (Mandatory) β”‚
249
- β”‚ β”‚
250
- β”‚ After ALL phases complete: β”‚
251
- β”‚ β”‚
252
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
253
- β”‚ β”‚ RTM COVERAGE VERIFICATION [Iteration {{ITER}}/{{MAX}}] β”‚ β”‚
254
- β”‚ β”‚ β”‚ β”‚
255
- β”‚ β”‚ Generate RTM via core tools: β”‚ β”‚
256
- β”‚ β”‚ β†’ generateTraceabilityMatrix("{feature-name}") β”‚ β”‚
257
- β”‚ β”‚ β”‚ β”‚
258
- β”‚ β”‚ Coverage Metrics (automated): β”‚ β”‚
259
- β”‚ β”‚ β–‘ Requirements coverage: {coveragePercent}% β”‚ β”‚
260
- β”‚ β”‚ β–‘ SPEC β†’ Feature mapping: {featureCovered}/{total} β”‚ β”‚
261
- β”‚ β”‚ β–‘ Feature β†’ Test mapping: {testCovered}/{total} β”‚ β”‚
262
- β”‚ β”‚ β–‘ Build successful? β”‚ β”‚
263
- β”‚ β”‚ β–‘ Tests passing? β”‚ β”‚
264
- β”‚ β”‚ β”‚ β”‚
265
- β”‚ β”‚ UNCOVERED: {uncoveredRequirements[]} β”‚ β”‚
266
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
267
- β”‚ β”‚ β”‚
268
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
269
- β”‚ β”‚ Coverage == 100%? β”‚ β”‚
270
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
271
- β”‚ β”‚ β”‚ β”‚
272
- β”‚ NO YES β”‚
273
- β”‚ β”‚ β”‚ β”‚
274
- β”‚ ↓ ↓ β”‚
275
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
276
- β”‚ β”‚ IMPLEMENT β”‚ β”‚ βœ… TRULY DONE β”‚ β”‚
277
- β”‚ β”‚ UNCOVERED β”‚ β”‚ β”‚ β”‚
278
- β”‚ β”‚ REQUIREMENTS β”‚ β”‚ Report final β”‚ β”‚
279
- β”‚ β”‚ (auto-extract) β”‚ β”‚ RTM coverage β”‚ β”‚
280
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
281
- β”‚ β”‚ β”‚
282
- β”‚ └──────────→ [Re-generate RTM] β”‚
283
- β”‚ β”‚
284
- β”‚ β”‚ β”‚
285
- β”‚ ↓ β”‚
286
- β”‚ Stuck? (coverage unchanged from prev iteration) β”‚
287
- β”‚ β”‚ β”‚
288
- β”‚ β”œβ”€ Interactive: Ask user β”‚
289
- β”‚ β”‚ 1. Provide resolution β†’ retry β”‚
290
- β”‚ β”‚ 2. "proceed" β†’ TODO + done β”‚
291
- β”‚ β”‚ 3. "abort" β†’ stop β”‚
292
- β”‚ └─ ultrawork: TODO + done β”‚
293
- β”‚ β”‚
294
- β”‚ NO iteration cap β€” loop until 100% OR stuck β”‚
295
- β”‚ ZERO TOLERANCE for silent scope reduction β”‚
296
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
297
- ```
298
-
299
- **Ralph Loop with RTM:**
300
-
301
- ```bash
302
- # Generate RTM for coverage verification
303
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.generateTraceabilityMatrix('{feature-name}', {projectPath: process.cwd()}).then(r => console.log(JSON.stringify(r, null, 2))))"
304
- ```
305
-
306
- **RTM provides automated metrics:**
307
-
308
- | Metric | Description |
309
- |--------|-------------|
310
- | `totalRequirements` | Total REQ-* items in SPEC |
311
- | `specCovered` | Requirements with SPEC mapping |
312
- | `featureCovered` | Requirements with Feature scenarios |
313
- | `testCovered` | Requirements with test files |
314
- | `coveragePercent` | Overall coverage percentage |
315
- | `uncoveredRequirements` | List of missing REQ-* IDs |
316
-
317
- **Ralph Loop Rules:**
318
-
319
- | Rule | Description |
320
- |------|-------------|
321
- | **No Scope Reduction** | Never say "simplified" or "basic version" - implement FULL request |
322
- | **Iteration Tracking** | Display `[{{ITER}}]` to show progress (no max β€” loop until done) |
323
- | **RTM-Based Gap List** | Use `uncoveredRequirements` array - no manual comparison |
324
- | **Coverage Threshold** | Must reach 100% coverage to complete |
325
- | **No Iteration Cap** | Loop until 100% coverage OR stuck (convergence detected) |
326
- | **Stuck Handling** | If coverage % unchanged between iterations β†’ ask user (proceed/abort/fix), or ultrawork β†’ TODO + done |
327
- | **Diminishing Returns (Narrowing)** | Iteration 3+ β†’ focus on core requirements (REQ-*-001~003) first; P2/P3 requirements continue to loop but lower priority |
328
-
329
- **Ralph Loop Output Format:**
330
-
331
- ```
332
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
333
- πŸ”„ RALPH VERIFICATION [Iteration 1]
334
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
335
-
336
- πŸ“Š RTM Coverage Report: login
337
-
338
- Requirements Traceability:
339
- Total Requirements: 9
340
- SPEC Covered: 9/9 (100%)
341
- Feature Covered: 5/9 (55%)
342
- Test Covered: 4/9 (44%)
343
-
344
- βœ… REQ-login-001: Login form UI β†’ Scenario 1 β†’ login.test.ts
345
- βœ… REQ-login-002: Email validation β†’ Scenario 2 β†’ validation.test.ts
346
- βœ… REQ-login-003: Password validation β†’ Scenario 2 β†’ validation.test.ts
347
- ❌ REQ-login-004: Remember me checkbox β†’ NOT IMPLEMENTED
348
- ❌ REQ-login-005: Forgot password link β†’ NOT IMPLEMENTED
349
- βœ… REQ-login-006: API integration β†’ Scenario 3 β†’ api.test.ts
350
- ❌ REQ-login-007: Loading state β†’ NOT IMPLEMENTED
351
- ❌ REQ-login-008: Error toast β†’ NOT IMPLEMENTED
352
- βœ… REQ-login-009: Session storage β†’ Scenario 4 β†’ (no test)
353
-
354
- Overall Coverage: 55% ⚠️ BELOW 100% TARGET
355
-
356
- UNCOVERED REQUIREMENTS (auto-extracted from RTM):
357
- 1. REQ-login-004: Remember me checkbox
358
- 2. REQ-login-005: Forgot password link
359
- 3. REQ-login-007: Loading state
360
- 4. REQ-login-008: Error toast notifications
361
-
362
- ⚠️ NOT COMPLETE - Implementing uncovered requirements...
363
-
364
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
365
- πŸ”„ RALPH VERIFICATION [Iteration 2]
366
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
367
-
368
- πŸ“Š RTM Coverage Report: login
369
-
370
- Requirements Traceability:
371
- Total Requirements: 9
372
- SPEC Covered: 9/9 (100%)
373
- Feature Covered: 9/9 (100%)
374
- Test Covered: 9/9 (100%)
375
-
376
- Overall Coverage: 100% βœ… TARGET REACHED
377
-
378
- Build: βœ… Passed
379
- Tests: βœ… 12/12 Passed
380
- Type Check: βœ… No errors
381
-
382
- βœ… RALPH VERIFIED COMPLETE!
383
-
384
- πŸ“„ RTM saved: .claude/vibe/rtm/login-rtm.md
385
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
386
- ```
387
-
388
- **When to Trigger Ralph Loop:**
389
-
390
- 1. After all phases complete
391
- 2. Before final quality report
392
- 3. Whenever user says "ultrawork" or "ralph"
393
-
394
- **Forbidden Responses (VIOLATIONS):**
395
-
396
- | ❌ NEVER Say | βœ… Instead |
397
- |-------------|-----------|
398
- | "I've implemented a basic version" | Implement the FULL version |
399
- | "This is a simplified approach" | Implement as specified |
400
- | "You can add X later" | Add X now |
401
- | "For demonstration purposes" | Implement production-ready |
402
- | "The core functionality is done" | ALL functionality must be done |
403
-
404
- ### ULTRAWORK Example
405
-
406
- ```
407
- User: /vibe.run "brick-game" ultrawork
408
-
409
- Claude:
410
- πŸš€ ULTRAWORK MODE ACTIVATED
411
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
412
-
413
- πŸ“„ SPEC: .claude/vibe/specs/brick-game.md
414
- 🎯 4 Phases detected
415
- ⚑ Boulder Loop: ENABLED (will continue until all phases complete)
416
- πŸ”„ Auto-retry: ON (loop until 100% or stuck β†’ auto-TODO)
417
- πŸ’Ύ Context compression: AGGRESSIVE
418
-
419
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
420
- πŸ”οΈ BOULDER ROLLING... Phase 1/4
421
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
422
-
423
- ⚑ [PARALLEL] Launching 3 exploration agents...
424
- βœ… Exploration complete (7.2s)
425
- πŸ”¨ Implementing...
426
- βœ… Phase 1 complete
427
-
428
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
429
- πŸ”οΈ BOULDER ROLLING... Phase 2/4
430
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
431
-
432
- ⚑ [PARALLEL] Launching 3 exploration agents...
433
- βœ… Exploration complete (6.8s)
434
- πŸ”¨ Implementing...
435
- ❌ Test failed: collision detection
436
- πŸ”„ Auto-retry [iteration 1]...
437
- πŸ”¨ Fixing...
438
- βœ… Phase 2 complete
439
-
440
- [...continues automatically...]
441
-
442
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
443
- πŸŽ‰ BOULDER REACHED THE TOP!
444
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
445
-
446
- βœ… All 4 phases complete
447
- βœ… All acceptance criteria passed
448
- βœ… Build succeeded
449
- βœ… Tests passed
450
-
451
- ⏱️ Total: 8m 24s
452
- πŸ“Š Retries: 2
453
- πŸ’Ύ Context saved: 3 checkpoints
454
- ```
455
-
456
- ### Normal vs ULTRAWORK Comparison
457
-
458
- | Aspect | Normal | ULTRAWORK |
459
- |--------|--------|-----------|
460
- | Phase transition | May pause | Auto-continues |
461
- | On error | Reports and stops | Auto-retries (3x) |
462
- | Context 70%+ | Warning only | Auto-compress + save |
463
- | Exploration | Sequential possible | FORCED parallel |
464
- | Completion | Phase-by-phase | Until ALL done |
465
-
466
- ---
467
-
468
- ## Automation Level System
469
-
470
- Magic keywords in the user input automatically set the **AutomationLevel**, which controls how much the AI self-advances vs. pausing for confirmation.
471
-
472
- ### Level Definitions
473
-
474
- | Level | Name | Keyword(s) | Auto-advance | Auto-retry | Stuck Behavior | Parallel Agents | Checkpoints |
475
- |-------|------|------------|--------------|------------|----------------|-----------------|-------------|
476
- | L0 | Manual | `manual` | No | No | Ask user every step | No | All |
477
- | L1 | Guided | `guided`, `verify` | No | No | Ask user on stuck | No | All |
478
- | L2 | Semi-auto | `quick` (default) | Yes | Yes (low cap: 2) | Ask user after 2 retries | No | Key points |
479
- | L3 | Auto | `ultrawork`, `ulw` | Yes | Yes (no cap) | Auto-TODO + proceed | Yes | Checkpoint-only |
480
- | L4 | Full-auto | `ralph`, `ralplan` | Yes | Yes (no cap) | Auto-TODO + proceed | Yes | None |
481
-
482
- ### Detection Rule
483
-
484
- The AI detects automation level from word boundaries in the user's input:
485
-
486
- ```
487
- /vibe.run "login" β†’ L2 Semi-auto (default)
488
- /vibe.run "login" ultrawork β†’ L3 Auto
489
- /vibe.run "login" ralph β†’ L4 Full-auto
490
- /vibe.run "login" verify β†’ L1 Guided
491
- ```
492
-
493
- ### Confirmation Matrix
494
-
495
- Certain action types require user confirmation depending on the active level:
496
-
497
- | Action | L0 | L1 | L2 | L3 | L4 |
498
- |--------|----|----|----|----|-----|
499
- | `destructive` | confirm | confirm | confirm | confirm | auto |
500
- | `architecture_choice` | confirm | confirm | confirm | auto | auto |
501
- | `implementation_scope` | confirm | confirm | confirm | auto | auto |
502
- | `phase_advance` | confirm | confirm | auto | auto | auto |
503
- | `fix_strategy` | confirm | confirm | auto | auto | auto |
504
- | `retry` | confirm | auto | auto | auto | auto |
505
-
506
- **Rule**: When confirmation is required, pause and display a checkpoint before proceeding.
507
-
508
- ---
509
-
510
- ## Interactive Checkpoints
511
-
512
- Checkpoints are decision gates inserted at critical points in the workflow. At L3/L4, most checkpoints are **auto-resolved** using the default option.
513
-
514
- ### Checkpoint Types
515
-
516
- | Type | When It Fires | Default Option |
517
- |------|--------------|----------------|
518
- | `requirements_confirm` | Before starting Phase 1 | Confirm (a) |
519
- | `architecture_choice` | When architecture approach is ambiguous | Clean/balanced (b) |
520
- | `implementation_scope` | Before any large scope change (6+ files) | Approve (a) |
521
- | `verification_result` | After each VerificationLoop iteration below threshold | Continue fixing (a) |
522
- | `fix_strategy` | When critical issues are found during quality gate | Fix all (a) |
523
-
524
- ### Checkpoint Format
525
-
526
- When a checkpoint fires, display it in this format:
527
-
528
- ```
529
- ──────────────────────────────────────────────────
530
- CHECKPOINT: Requirements Confirmation
531
- ──────────────────────────────────────────────────
532
- Feature: login
533
-
534
- Requirements:
535
- 1. User can log in with email and password
536
- 2. Invalid credentials show an error message
537
- 3. Remember me persists session for 30 days
538
-
539
- Options:
540
- a) Confirm
541
- Proceed with these requirements as stated.
542
- b) Revise
543
- Modify or clarify requirements before proceeding.
544
- c) Abort
545
- Cancel this workflow.
546
-
547
- Default: a
548
- ──────────────────────────────────────────────────
549
- ```
550
-
551
- ### Auto-Resolution (L3/L4)
552
-
553
- At automation levels L3 and L4, checkpoints that do not require confirmation are auto-resolved:
554
-
555
- ```
556
- [AUTO] CHECKPOINT: implementation_scope β†’ option a (Approve) [auto-resolved]
557
- ```
558
-
559
- ---
560
-
561
- ## Rules Reference
562
-
563
- **Must follow `~/.claude/vibe/rules/` (global):**
564
-
565
- - `core/development-philosophy.md` - Surgical precision, modify only requested scope
566
- - `core/quick-start.md` - Korean, DRY, SRP, YAGNI
567
- - `standards/complexity-metrics.md` - Functions ≀20 lines, nesting ≀3 levels
568
- - `quality/checklist.md` - Code quality checklist
569
-
570
- **Language guide:** `~/.claude/vibe/languages/{stack}.md` (global reference)
571
-
572
- ---
573
-
574
- ## Coding Guidelines (Mandatory)
575
-
576
- ### Type Safety: Use Types Explicitly
577
-
578
- > **Core Principle**: Use types explicitly in every language that has a type system!
579
-
580
- Type definitions are not just language syntax β€” they are a **core engineering philosophy for simplifying and controlling complex software**.
581
-
582
- ### Applies to ALL Typed Languages
583
-
584
- | Category | Languages | Key Principle |
585
- |----------|-----------|---------------|
586
- | **Static Typed** | Java, C#, C++, Go, Rust, Swift, Kotlin, Scala | Types = compile-time contracts |
587
- | **Gradual Typed** | TypeScript, Python (typing), PHP (typed), Ruby (RBS) | Types = optional safety nets |
588
- | **Functional** | Haskell, OCaml, F#, Elm | Types = logical proofs |
589
-
590
- ### Universal Anti-Patterns (All Languages)
591
-
592
- | ❌ Forbidden Pattern | Why | βœ… Instead |
593
- |---------------------|-----|-----------|
594
- | Type escape hatches (`any`, `Any`, `Object`, `void*`, `interface{}`) | Loses type info, runtime errors | Concrete types or `unknown` + guards |
595
- | Type suppression (`@ts-ignore`, `# type: ignore`, `@SuppressWarnings`) | Hides errors | Fix actual type issues |
596
- | Raw generic types (`List`, `Map` without params) | Loses type safety | `List<User>`, `Map<String, Order>` |
597
- | Excessive casting (`as`, `(Type)`, `unsafe`) | Bypasses compiler | Type guards or pattern matching |
598
-
599
- ### Language-Specific Guidelines
600
-
601
- **TypeScript/JavaScript:**
602
- ```typescript
603
- // ❌ BAD
604
- function process(data: any): any { return data.foo; }
605
-
606
- // βœ… GOOD
607
- function process(data: unknown): Result {
608
- if (isValidData(data)) return data.foo;
609
- throw new Error('Invalid');
610
- }
611
- ```
612
-
613
- **Python:**
614
- ```python
615
- # ❌ BAD
616
- def process(data: Any) -> Any: return data["key"]
617
-
618
- # βœ… GOOD
619
- def process(data: UserData) -> str: return data["name"]
620
- ```
621
-
622
- **Java/Kotlin:**
623
- ```java
624
- // ❌ BAD
625
- List items = new ArrayList(); // Raw type
626
- Object data = getData(); // Lost type info
627
-
628
- // βœ… GOOD
629
- List<User> users = new ArrayList<>();
630
- User user = getUser();
631
- ```
632
-
633
- **Go:**
634
- ```go
635
- // ❌ BAD
636
- func process(data interface{}) interface{} { ... }
637
-
638
- // βœ… GOOD
639
- func process(data UserRequest) (UserResponse, error) { ... }
640
- ```
641
-
642
- **Rust:**
643
- ```rust
644
- // ❌ BAD (unnecessary unsafe or Box<dyn Any>)
645
- let data: Box<dyn Any> = get_data();
646
-
647
- // βœ… GOOD
648
- let data: UserData = get_data()?;
649
- ```
650
-
651
- **C#:**
652
- ```csharp
653
- // ❌ BAD
654
- object data = GetData();
655
- dynamic result = Process(data);
656
-
657
- // βœ… GOOD
658
- UserData data = GetData();
659
- Result result = Process(data);
660
- ```
661
-
662
- ### Type Safety Rules (Universal)
663
-
664
- | Rule | Description |
665
- |------|-------------|
666
- | **Boundary Validation** | Validate only at system boundaries (API, JSON, user input) |
667
- | **Internal Trust** | After validation, pass only precise types internally |
668
- | **No Type Escape** | Never use escape hatches to "fix" type errors |
669
- | **Explicit Signatures** | Specify types in function/method signatures |
670
- | **Generics with Params** | Always use generics with type parameters |
671
-
672
- ### Quality Gate: Type Violations Block Merge
673
-
674
- | Violation | Action |
675
- |-----------|--------|
676
- | Type escape hatches (`any`, `Any`, `Object`, `interface{}`, etc.) | ❌ Block |
677
- | Type suppression comments | ❌ Block |
678
- | Raw generic types | ❌ Block |
679
- | Missing function return types | ⚠️ Warning |
680
- | Excessive type casting | ⚠️ Warning |
681
-
682
- ## Description
683
-
684
- Read PTCF structured SPEC document and execute implementation immediately.
685
-
686
- > **PLAN, TASKS documents unnecessary** - SPEC is the executable prompt
687
-
688
- ## Model Orchestration (Intelligent Routing)
689
-
690
- Automatically select optimal model based on **task complexity analysis**.
691
-
692
- ### Complexity-Based Model Selection
693
-
694
- | Complexity Score | Model | When to Use |
695
- |------------------|-------|-------------|
696
- | 0-7 (Low) | **Haiku** | Simple fixes, searches, single file changes |
697
- | 8-19 (Medium) | **Sonnet** | Standard features, 3-5 files, integrations |
698
- | 20+ (High) | **Opus** | Architecture, security, multi-service, 6+ files |
699
-
700
- ### Complexity Signals
701
-
702
- The following signals increase complexity score:
703
-
704
- | Signal | Score |
705
- |--------|-------|
706
- | Architecture change | +15 |
707
- | Security implication | +12 |
708
- | Multi-service | +8 |
709
- | Refactoring | +12 |
710
- | 6+ files | +15 |
711
- | 3-5 files | +8 |
712
- | New feature | +5 |
713
- | Bug fix | -3 |
714
- | Documentation | -5 |
715
-
716
- ### Agent Tier System
717
-
718
- Each agent has tier variants for cost optimization:
719
-
720
- | Agent | Low (Haiku) | Medium (Sonnet) | High (Opus) |
721
- |-------|-------------|-----------------|-------------|
722
- | explorer | explorer-low | explorer-medium | explorer |
723
- | implementer | implementer-low | implementer-medium | implementer |
724
- | architect | architect-low | architect-medium | architect |
725
-
726
- ### Task Calls by Role
727
-
728
- | Task Type | Model | Task Parameter |
729
- |-----------|-------|----------------|
730
- | Simple search | Haiku | `model: "haiku"` |
731
- | Codebase exploration | Haiku/Sonnet | Auto-selected |
732
- | Core implementation | Sonnet | `model: "sonnet"` |
733
- | Test writing | Haiku | `model: "haiku"` |
734
- | Architecture decisions | Opus | Main session |
735
- | Final review | Opus | Main session |
736
-
737
- ### External LLM Usage (When Enabled)
738
-
739
- When external LLMs are enabled in `.claude/vibe/config.json`:
740
-
741
- | Role | Method | Condition |
742
- |------|--------|-----------|
743
- | User direct query | `gpt.question`, `gemini.question` | Hook auto-handles |
744
- | Internal orchestration | Call global script via Bash | Claude calls directly |
745
-
746
- **User questions (Hook auto-handles):**
747
- - `gpt.question` - GPT architecture consultation
748
- - `gemini.question` - Gemini Q&A/consultation
749
-
750
- **Claude internal calls (directly via Bash):**
751
- ```bash
752
- # Usage: node llm-orchestrate.js <provider> <mode> [systemPrompt] [prompt]
753
- # - If systemPrompt omitted, uses default
754
- # - If systemPrompt is "-", uses default and treats next argument as prompt
755
-
756
- # [LLM_SCRIPT] = {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js
757
-
758
- # GPT call (short prompt - CLI arg)
759
- node "[LLM_SCRIPT]" gpt orchestrate-json "[question content]"
760
-
761
- # Gemini call
762
- node "[LLM_SCRIPT]" gemini orchestrate-json "[question content]"
763
-
764
- # Custom system prompt usage
765
- node "[LLM_SCRIPT]" gpt orchestrate-json "You are a code reviewer" "[question content]"
766
-
767
- # Long prompt - use --input file (write JSON file first with Write tool)
768
- # JSON format: {"prompt": "your prompt here"}
769
- node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/input.json"
770
- ```
771
-
772
- ### External LLM Fallback
773
-
774
- **IMPORTANT**: When GPT/Gemini hook fails, Claude MUST handle the task directly:
775
-
776
- **Fallback behavior**:
777
- - Do NOT retry the external LLM call
778
- - Claude handles the task using its own capabilities
779
- - Continue with the implementation without interruption
780
- - Log the fallback but don't block progress
781
-
782
- ## Core Tools (Semantic Analysis & Memory)
783
-
784
- Use core tools for accurate codebase understanding and session continuity.
785
-
786
- ### Tool Invocation
787
-
788
- All tools are called via:
789
- ```bash
790
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.TOOL_NAME({...args}).then(r => console.log(r.content[0].text)))"
791
- ```
792
-
793
- ### Semantic Analysis Tools
794
-
795
- | Tool | Purpose | Usage |
796
- |------|---------|-------|
797
- | `findSymbol` | Find symbol definitions | `{symbolName: 'functionName', searchPath: '.'}` |
798
- | `findReferences` | Find all references | `{symbolName: 'functionName', searchPath: '.'}` |
799
- | `analyzeComplexity` | Analyze code complexity | `{filePath: 'src/file.ts'}` |
800
- | `validateCodeQuality` | Validate code quality | `{filePath: 'src/file.ts'}` |
801
-
802
- **Example - Find symbol:**
803
- ```bash
804
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.findSymbol({symbolName: 'login', searchPath: '.'}).then(r => console.log(r.content[0].text)))"
805
- ```
806
-
807
- ### Memory Tools
808
-
809
- | Tool | Purpose | Usage |
810
- |------|---------|-------|
811
- | `saveMemory` | Save important decisions | `{key: 'decision-name', value: 'content', category: 'project'}` |
812
- | `recallMemory` | Recall saved memory | `{key: 'decision-name'}` |
813
- | `listMemories` | List all memories | `{category: 'project'}` |
814
-
815
- **Example - Save important decision:**
816
- ```bash
817
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.saveMemory({key: 'auth-pattern', value: 'Using JWT with refresh tokens', category: 'project'}).then(r => console.log(r.content[0].text)))"
818
- ```
819
-
820
- ### Session Management (Auto via Hooks)
821
-
822
- - **Session start**: Hook auto-calls `startSession` to restore previous context
823
- - **Context 80%+**: Hook auto-calls `autoSaveContext` to preserve state
824
-
825
- ## Process
826
-
827
- ### 1. Load SPEC + Feature
828
-
829
- **Search order (check BOTH file AND folder):**
830
-
831
- ```
832
- Step 1: Check if SPLIT structure exists (folder)
833
- πŸ“ .claude/vibe/specs/{feature-name}/ β†’ Folder with _index.md + phase files
834
- πŸ“ .claude/vibe/features/{feature-name}/ β†’ Folder with _index.feature + phase files
835
-
836
- Step 2: If no folder, check single file
837
- πŸ“„ .claude/vibe/specs/{feature-name}.md β†’ Single SPEC file
838
- πŸ“„ .claude/vibe/features/{feature-name}.feature β†’ Single Feature file
839
-
840
- Step 3: If neither exists β†’ Error
841
- ```
842
-
843
- **Split structure (folder) detected:**
844
- ```
845
- πŸ“ .claude/vibe/specs/{feature-name}/
846
- β”œβ”€β”€ _index.md β†’ Master SPEC (read first for overview)
847
- β”œβ”€β”€ phase-1-{name}.md β†’ Phase 1 SPEC
848
- β”œβ”€β”€ phase-2-{name}.md β†’ Phase 2 SPEC
849
- └── ...
850
-
851
- πŸ“ .claude/vibe/features/{feature-name}/
852
- β”œβ”€β”€ _index.feature β†’ Master Feature (read first for scenario overview)
853
- β”œβ”€β”€ phase-1-{name}.feature β†’ Phase 1 scenarios
854
- β”œβ”€β”€ phase-2-{name}.feature β†’ Phase 2 scenarios
855
- └── ...
856
-
857
- β†’ Load _index.md first, then load phase files in order
858
- β†’ Execute phases sequentially (or per --phase flag)
859
- ```
860
-
861
- **Single file detected:**
862
- ```
863
- πŸ“„ .claude/vibe/specs/{feature-name}.md β†’ SPEC (structure, constraints, context)
864
- πŸ“„ .claude/vibe/features/{feature-name}.feature β†’ Feature (scenario = implementation unit)
865
- ```
866
-
867
- **Error if NEITHER file NOR folder found:**
868
- ```
869
- ❌ SPEC not found. Searched:
870
- - .claude/vibe/specs/{feature-name}/ (folder)
871
- - .claude/vibe/specs/{feature-name}.md (file)
872
-
873
- Run /vibe.spec "{feature-name}" first.
874
- ```
875
-
876
- ### 1-1. Phase Isolation Protocol (Large SPEC Guard)
877
-
878
- > **Problem**: Large SPECs (3+ phases, 5+ scenarios) overflow context β€” agent drifts from SPEC by Phase 3.
879
- > **Solution**: Load only the current phase's SPEC section. Re-anchor before each scenario.
880
-
881
- **Phase Isolation Rules (MANDATORY for 3+ phases):**
882
-
883
- ```
884
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
885
- β”‚ PHASE ISOLATION PROTOCOL β”‚
886
- β”‚ β”‚
887
- β”‚ ❌ WRONG: Load entire SPEC β†’ implement all phases β”‚
888
- β”‚ βœ… RIGHT: Load _index overview β†’ per-phase load β†’ implement β”‚
889
- β”‚ β”‚
890
- β”‚ Step A: Read _index.md (overview only β€” phase list, REQ IDs) β”‚
891
- β”‚ Step B: For each Phase N: β”‚
892
- β”‚ 1. RE-READ Phase N SPEC section (every time, no memory) β”‚
893
- β”‚ 2. RE-READ Phase N Feature scenarios β”‚
894
- β”‚ 3. Extract Phase N scope: files, scenarios, requirements β”‚
895
- β”‚ 4. Implement Phase N scenarios β”‚
896
- β”‚ 5. Verify Phase N β”‚
897
- β”‚ 6. Write Phase Checkpoint β†’ .claude/vibe/checkpoints/ β”‚
898
- β”‚ 7. DISCARD Phase N details from working memory β”‚
899
- β”‚ Step C: Next Phase β€” go to Step B β”‚
900
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
901
- ```
902
-
903
- **Phase Checkpoint Format** (`.claude/vibe/checkpoints/{feature}-phase-{N}.md`):
904
-
905
- ```markdown
906
- # Checkpoint: {feature} Phase {N}
907
-
908
- ## Completed
909
- - Scenario 1: {name} βœ…
910
- - Scenario 2: {name} βœ…
911
-
912
- ## Files Changed
913
- - src/auth.service.ts (added login(), validateToken())
914
- - src/auth.controller.ts (POST /login, POST /refresh)
915
-
916
- ## State for Next Phase
917
- - Auth service exports: login(), logout(), validateToken(), refreshToken()
918
- - JWT secret configured in .env (JWT_SECRET)
919
- - Test baseline: 12 tests passing
920
-
921
- ## Remaining Phases
922
- - Phase {N+1}: {name} β€” {scenario count} scenarios
923
- - Phase {N+2}: {name} β€” {scenario count} scenarios
924
- ```
925
-
926
- **SPEC Re-anchoring (Before EVERY scenario):**
927
-
928
- ```
929
- Before implementing Scenario X:
930
- 1. Re-read the EXACT Given/When/Then from Feature file (not from memory!)
931
- 2. Compare: "Am I about to implement what the SPEC says, or what I think it says?"
932
- 3. If single-file SPEC: re-read only the current phase section (use line offsets)
933
- 4. If split SPEC: re-read only phase-N-{name}.md
934
- ```
935
-
936
- **Scope Lock (Per Phase):**
937
-
938
- ```
939
- At Phase start, declare:
940
- MODIFY: [list of files this phase will touch]
941
- CREATE: [list of files this phase will create]
942
- DO NOT TOUCH: everything else
943
-
944
- If implementation requires files outside scope:
945
- β†’ STOP. Re-read SPEC. Is this actually needed?
946
- β†’ If yes: add to scope with explicit justification
947
- β†’ If no: you're drifting. Return to SPEC.
948
- ```
949
-
950
- **Context Pressure Handling:**
951
-
952
- | Context Level | Action |
953
- |---------------|--------|
954
- | < 50% | Normal execution |
955
- | 50-70% | Save checkpoint, trim exploration results |
956
- | 70%+ | Save checkpoint β†’ `/new` β†’ resume from checkpoint |
957
- | Phase boundary | Always save checkpoint regardless of context level |
958
-
959
- ### 1-2. SPEC-First Gate (Level 3: Spec = Source of Truth)
960
-
961
- > **Principle**: SPEC is the source of truth for code. To modify code, update the SPEC first.
962
-
963
- **When a change not in the SPEC is needed during implementation:**
964
-
965
- ```
966
- Discovery during implementation: "An API endpoint not in SPEC is needed"
967
- β”‚
968
- β”œβ”€ Already in SPEC?
969
- β”‚ YES β†’ Implement as-is
970
- β”‚
971
- β”œβ”€ Not in SPEC but within SPEC scope?
972
- β”‚ YES β†’ Add to SPEC first (Edit tool β†’ SPEC file)
973
- β”‚ β†’ Add corresponding scenario to Feature file
974
- β”‚ β†’ Then implement
975
- β”‚
976
- └─ Outside SPEC scope?
977
- YES β†’ Record as TODO and exclude from current scope
978
- .claude/vibe/todos/out-of-scope-{item}.md
979
- ```
980
-
981
- **Required when changing SPEC:**
982
-
983
- 1. Update REQ-* IDs in SPEC file (add new requirements)
984
- 2. Add corresponding scenarios to Feature file
985
- 3. New REQ-* must be traceable in RTM after implementation
986
-
987
- **Reverse direction also applies β€” when requirements change from code:**
988
-
989
- ```
990
- Test failure β†’ "Is this behavior correct?"
991
- β”‚
992
- β”œβ”€ Check SPEC β†’ If SPEC is correct, fix the code
993
- β”‚
994
- └─ If SPEC is wrong β†’ Fix SPEC first β†’ Then fix code
995
- (Changing code without updating SPEC causes SPEC ↔ code drift)
996
- ```
997
-
998
- **Extended Git commit rules:**
999
-
1000
- - SPEC changes and code changes must be in the same commit
1001
- - Committing feature code without SPEC changes β†’ warning (except intentional refactoring)
1002
-
1003
- ### 2. Extract Scenario List
1004
-
1005
- Extract all Scenarios from Feature file:
1006
-
1007
- ```markdown
1008
- ## Scenarios to Implement
1009
-
1010
- | # | Scenario | Status |
1011
- |---|----------|--------|
1012
- | 1 | Valid login success | ⬜ |
1013
- | 2 | Invalid password error | ⬜ |
1014
- | 3 | Email format validation | ⬜ |
1015
- | 4 | Password reset link | ⬜ |
1016
-
1017
- Total: 4 scenarios
1018
- ```
1019
-
1020
- ### 3. Scenario-by-Scenario Implementation (Core)
1021
-
1022
- **For each scenario**:
1023
-
1024
- ```
1025
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1026
- 🎯 Scenario 1/4: Valid login success
1027
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1028
-
1029
- Given: User is registered
1030
- When: Login with valid email and password
1031
- Then: Login success + JWT token returned
1032
-
1033
- [Step 1] Analyzing implementation...
1034
- - Required files: auth.service.ts, login.controller.ts
1035
- - Exploring related code...
1036
-
1037
- [Step 2] Implementing...
1038
- βœ… auth.service.ts - Added login() method
1039
- βœ… login.controller.ts - POST /login endpoint
1040
-
1041
- [Step 3] Verifying...
1042
- βœ… Given: Test user creation possible
1043
- βœ… When: Login API call succeeded
1044
- βœ… Then: JWT token return confirmed
1045
-
1046
- βœ… Scenario 1 passed!
1047
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1048
- ```
1049
-
1050
- **On failure**:
1051
-
1052
- ```
1053
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1054
- 🎯 Scenario 2/4: Invalid password error
1055
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1056
-
1057
- [Step 3] Verifying...
1058
- βœ… Given: Test user exists
1059
- βœ… When: Login attempt with wrong password
1060
- ❌ Then: "Invalid credentials" error message
1061
- Actual: "Error occurred" returned
1062
-
1063
- [Auto-fix iteration 1]
1064
- Cause: Error message not properly set
1065
- Fix: auth.service.ts line 42
1066
-
1067
- [Re-verify]
1068
- βœ… Then: "Invalid credentials" error message
1069
-
1070
- βœ… Scenario 2 passed! (1 fix)
1071
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1072
- ```
1073
-
1074
- ---
1075
-
1076
- ## **CRITICAL: Parallel Sub-Agent Execution**
1077
-
1078
- > **MUST USE PARALLEL TASK CALLS** - This is REQUIRED, not optional.
1079
- > Sequential execution when parallel is possible = VIOLATION of this workflow.
1080
-
1081
- ### Codex 병렬 κ΅¬ν˜„ (Codex ν”ŒλŸ¬κ·ΈμΈ ν™œμ„±ν™” μ‹œ)
1082
-
1083
- > **ν™œμ„±ν™” 쑰건**: Codex ν”ŒλŸ¬κ·ΈμΈ μ„€μΉ˜ + 독립적인 μ‹œλ‚˜λ¦¬μ˜€ 2개 이상
1084
- > λ―Έμ„€μΉ˜ μ‹œ κΈ°μ‘΄ Claude μ„œλΈŒμ—μ΄μ „νŠΈ λ°©μ‹μœΌλ‘œ λ™μž‘.
1085
-
1086
- 독립적인 μ‹œλ‚˜λ¦¬μ˜€(파일 μ˜μ‘΄μ„± μ—†μŒ)λ₯Ό Codex에 μœ„μž„ν•˜μ—¬ Claude와 **병렬 κ΅¬ν˜„**:
1087
-
1088
- ```
1089
- /codex:rescue "Implement scenario: {scenario-name}. Files: {file-list}. Requirements: {requirements-summary}" --background
1090
- ```
1091
-
1092
- - ClaudeλŠ” λ‹€μŒ μ‹œλ‚˜λ¦¬μ˜€λ₯Ό **λ™μ‹œμ—** κ΅¬ν˜„
1093
- - Codex μ™„λ£Œ μ‹œ `/codex:result`둜 κ²°κ³Ό 확인
1094
- - 좩돌 λ°œμƒ μ‹œ Claudeκ°€ merge νŒλ‹¨
1095
-
1096
- **μœ„μž„ κΈ°μ€€**:
1097
- - μ‹œλ‚˜λ¦¬μ˜€ κ°„ 파일 μ˜μ‘΄μ„± μ—†μŒ (독립적)
1098
- - μ‹œλ‚˜λ¦¬μ˜€ λ³΅μž‘λ„ 쀑간 μ΄ν•˜
1099
- - μ˜μ‘΄μ„± μžˆλŠ” μ‹œλ‚˜λ¦¬μ˜€λŠ” Claudeκ°€ 직접 κ΅¬ν˜„
1100
-
1101
- ### Mandatory Parallel Exploration (Phase Start)
1102
-
1103
- **BEFORE any implementation, you MUST launch these Task calls IN PARALLEL (single message, multiple tool calls):**
1104
-
1105
- ```
1106
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1107
- β”‚ STEP 1: PARALLEL EXPLORATION (REQUIRED) β”‚
1108
- β”‚ β”‚
1109
- β”‚ Launch ALL of these in ONE message: β”‚
1110
- β”‚ β”‚
1111
- β”‚ Task(haiku) ─┬─→ "Analyze related files in <context>" β”‚
1112
- β”‚ β”‚ β”‚
1113
- β”‚ Task(haiku) ─┼─→ "Check dependencies and imports" β”‚
1114
- β”‚ β”‚ β”‚
1115
- β”‚ Task(haiku) ─┴─→ "Find existing patterns and conventions" β”‚
1116
- β”‚ β”‚
1117
- β”‚ [If GPT enabled] Bash: node "[LLM_SCRIPT]" gpt-codex orchestrate-json "[question]"
1118
- β”‚ [If Gemini enabled] Bash: node "[LLM_SCRIPT]" gemini orchestrate-json "[question]"
1119
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1120
- β”‚
1121
- ↓ (wait for all to complete)
1122
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1123
- β”‚ STEP 2: SYNTHESIZE (Opus) β”‚
1124
- β”‚ - Review all exploration results β”‚
1125
- β”‚ - Decide implementation approach β”‚
1126
- β”‚ - Identify files to modify/create β”‚
1127
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1128
- β”‚
1129
- ↓
1130
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1131
- β”‚ STEP 3: IMPLEMENT + BACKGROUND AGENTS (PARALLEL) β”‚
1132
- β”‚ β”‚
1133
- β”‚ Main Agent (sonnet): β”‚
1134
- β”‚ └─→ Execute current phase implementation β”‚
1135
- β”‚ β”‚
1136
- β”‚ Background Agents (haiku, run_in_background=true): β”‚
1137
- β”‚ β”œβ”€β†’ Task: "Prepare Phase N+1 - analyze required files" β”‚
1138
- β”‚ β”œβ”€β†’ Task: "Pre-generate test cases for current implementation" β”‚
1139
- β”‚ └─→ Task: "Search for related types/interfaces needed" β”‚
1140
- β”‚ β”‚
1141
- β”‚ [ULTRAWORK] All 4 agents run simultaneously! β”‚
1142
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1143
- β”‚
1144
- ↓ (main completes, check backgrounds)
1145
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1146
- β”‚ STEP 4: TEST + PHASE PIPELINING β”‚
1147
- β”‚ β”‚
1148
- β”‚ Current Phase: β”‚
1149
- β”‚ └─→ Task(haiku): Write tests using pre-generated cases β”‚
1150
- β”‚ β”‚
1151
- β”‚ Next Phase Prep (from background results): β”‚
1152
- β”‚ └─→ Already have file analysis, ready to start immediately β”‚
1153
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1154
- ```
1155
-
1156
- ### Parallel Task Call Pattern (MUST FOLLOW)
1157
-
1158
- **Correct - Single message with multiple parallel Tasks:**
1159
- ```
1160
- <message>
1161
- Task(haiku, "Analyze src/components/ for existing patterns")
1162
- Task(haiku, "Check package.json dependencies")
1163
- Task(haiku, "Find usage of similar features in codebase")
1164
- </message>
1165
- β†’ All 3 run simultaneously, ~3x faster
1166
- ```
1167
-
1168
- **WRONG - Sequential calls (DO NOT DO THIS):**
1169
- ```
1170
- <message>Task(haiku, "Analyze...")</message>
1171
- <message>Task(haiku, "Check...")</message>
1172
- <message>Task(haiku, "Find...")</message>
1173
- β†’ 3x slower, wastes time
1174
- ```
1175
-
1176
- ### Background Agent Pattern (ULTRAWORK) via Orchestrator
1177
-
1178
- **Launch background agents for next phase via Orchestrator:**
1179
- ```bash
1180
- # Start background agent (doesn't block)
1181
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep').then(r => console.log(r.content[0].text)))"
1182
-
1183
- # Multiple backgrounds in parallel
1184
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(async o => {
1185
- await Promise.all([
1186
- o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep'),
1187
- o.runAgent('Pre-generate test cases for login form', 'test-prep'),
1188
- o.runAgent('Find existing validation patterns', 'pattern-finder')
1189
- ]);
1190
- console.log('All background agents started');
1191
- })"
1192
- ```
1193
-
1194
- **Check background agent status:**
1195
- ```bash
1196
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => console.log(o.status().content[0].text))"
1197
- ```
1198
-
1199
- **Get result when ready:**
1200
- ```bash
1201
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.getResult('SESSION_ID').then(r => console.log(r.content[0].text)))"
1202
- ```
1203
-
1204
- **Why Background Agents Matter:**
1205
-
1206
- | Without Background | With Background |
1207
- |--------------------|-----------------|
1208
- | Phase 1: 60s | Phase 1: 60s (+ backgrounds running) |
1209
- | Phase 2 prep: 20s | Phase 2 prep: 0s (already done!) |
1210
- | Phase 2: 60s | Phase 2: 60s |
1211
- | **Total: 140s** | **Total: 120s** |
1212
-
1213
- For 5 phases: 4 Γ— 20s saved = **80s faster**
1214
-
1215
- ### Why Parallel Matters
1216
-
1217
- | Approach | Time | Cache Benefit |
1218
- |----------|------|---------------|
1219
- | Sequential (3 Tasks) | ~30s | Cache cold on each |
1220
- | **Parallel (3 Tasks)** | **~10s** | **Cache warmed once, shared** |
1221
-
1222
- core ProjectCache (LRU) caches ts-morph parsing results. Parallel calls share the warmed cache.
1223
-
1224
- ### UI/UX Design Intelligence (Auto-triggered before Phase 1)
1225
-
1226
- > **쑰건**: SPEC λ˜λŠ” Feature에 UI/UX ν‚€μ›Œλ“œ 포함 μ‹œ μžλ™ μ‹€ν–‰
1227
- > **λΉ„ν™œμ„±ν™”**: `.claude/vibe/config.json`에 `"uiUxAnalysis": false` μ„€μ •
1228
-
1229
- **Phase 1 μ‹œμž‘ μ „, 2개 μ—μ΄μ „νŠΈ μžλ™ μ‹€ν–‰:**
1230
-
1231
- | Agent | Condition | Role |
1232
- |-------|-----------|------|
1233
- | β‘£ ui-stack-implementer | **항상 μ‹€ν–‰** | ν”„λ ˆμž„μ›Œν¬λ³„ μ»΄ν¬λ„ŒνŠΈ κ°€μ΄λ“œλΌμΈ 제곡 |
1234
- | β‘€ ui-dataviz-advisor | **쑰건뢀** (chart/dashboard/visualization ν‚€μ›Œλ“œ) | 차트/μ‹œκ°ν™” 라이브러리 μΆ”μ²œ |
1235
-
1236
- **μ‹€ν–‰ 방법:**
1237
-
1238
- ```text
1239
- # β‘£ 항상 μ‹€ν–‰ (Haiku)
1240
- Task(subagent_type="ui-stack-implementer",
1241
- prompt="Provide implementation guidelines for project '{project}' using {detected_stack}. Use core_ui_stack_search for framework-specific patterns.")
1242
-
1243
- # β‘€ 쑰건뢀 μ‹€ν–‰ (Haiku) β€” SPEC에 차트/λŒ€μ‹œλ³΄λ“œ/μ‹œκ°ν™” ν‚€μ›Œλ“œ 포함 μ‹œ
1244
- Task(subagent_type="ui-dataviz-advisor",
1245
- prompt="Recommend data visualization approach for project '{project}'. Use core_ui_search for chart types and react-performance patterns.")
1246
- ```
1247
-
1248
- **λ””μžμΈ μ‹œμŠ€ν…œ μžλ™ μ°Έμ‘°:**
1249
- - `.claude/vibe/design-system/{project}/MASTER.md` 쑴재 μ‹œ μžλ™ λ‘œλ“œ
1250
- - κ΅¬ν˜„ μ—μ΄μ „νŠΈκ°€ CSS λ³€μˆ˜, 폰트, 색상 νŒ”λ ˆνŠΈλ₯Ό 직접 μ°Έμ‘°
1251
- - νŽ˜μ΄μ§€λ³„ μ˜€λ²„λΌμ΄λ“œ `pages/{page}.md` 쑴재 μ‹œ μš°μ„  적용
1252
-
1253
- ### Phase Execution Flow (ULTRAWORK Pipeline)
1254
-
1255
- ```
1256
- Phase N Start
1257
- β”‚
1258
- β”œβ”€β†’ [PARALLEL] Task(haiku) Γ— 3: Exploration
1259
- β”‚ - Related code analysis
1260
- β”‚ - Dependency check
1261
- β”‚ - Pattern discovery
1262
- β”‚
1263
- ↓ (all complete)
1264
- β”‚
1265
- β”œβ”€β†’ Opus: Synthesize and decide
1266
- β”‚
1267
- β”œβ”€β†’ [PARALLEL PIPELINE] ←── KEY SPEED OPTIMIZATION
1268
- β”‚ β”‚
1269
- β”‚ β”œβ”€β†’ Main: Task(sonnet) Implementation
1270
- β”‚ β”‚
1271
- β”‚ └─→ Background (run_in_background=true):
1272
- β”‚ β”œβ”€β†’ Task(haiku): Phase N+1 file analysis
1273
- β”‚ β”œβ”€β†’ Task(haiku): Test case preparation
1274
- β”‚ └─→ Task(haiku): Type/interface lookup
1275
- β”‚
1276
- ↓ (main completes)
1277
- β”‚
1278
- β”œβ”€β†’ Task(haiku): Tests (uses pre-generated cases)
1279
- β”‚
1280
- ↓
1281
- Phase N Complete
1282
- β”‚
1283
- ↓ (Background results ready - NO WAIT for Phase N+1 exploration!)
1284
- β”‚
1285
- Phase N+1 Start (IMMEDIATE - exploration already done!)
1286
- ```
1287
-
1288
- **Speed Comparison:**
1289
-
1290
- | Mode | Phase Time | 5 Phases Total |
1291
- |------|------------|----------------|
1292
- | Sequential | ~2min/phase | ~10min |
1293
- | Parallel Exploration | ~1.5min/phase | ~7.5min |
1294
- | **ULTRAWORK Pipeline** | **~1min/phase** | **~5min** |
1295
-
1296
- **Why Pipeline is Faster:**
1297
- - Background agents prepare next phase WHILE current phase implements
1298
- - No idle time between phases
1299
- - Test cases pre-generated during implementation
1300
- - Cache stays warm across parallel tasks
1301
-
1302
- ---
1303
-
1304
- ### Agent Teams β€” Dev Team
1305
-
1306
- > **νŒ€ μ •μ˜**: `agents/teams/dev-team.md` μ°Έμ‘°
1307
- > μ„€μ •: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` + `teammateMode: in-process` (`~/.claude/settings.json` μ „μ—­ β€” postinstall μžλ™ μ„€μ •)
1308
-
1309
- **ν™œμ„±ν™” 쑰건 (Dev Team Full β€” 4λͺ…):**
1310
- - ULTRAWORK λͺ¨λ“œ + 3개 이상 μ‹œλ‚˜λ¦¬μ˜€
1311
- - λ˜λŠ” λ³΅μž‘λ„ 점수 20+ (High)
1312
-
1313
- ### Agent Teams β€” Lite Team (Normal Mode)
1314
-
1315
- > **νŒ€ μ •μ˜**: `agents/teams/lite-team.md` μ°Έμ‘°
1316
-
1317
- **ν™œμ„±ν™” 쑰건 (Lite Team β€” 3λͺ…):**
1318
- - 일반 λͺ¨λ“œ + 3개 이상 μ‹œλ‚˜λ¦¬μ˜€
1319
- - λ³΅μž‘λ„ 점수 8-19 (Medium)
1320
- - λ‹¨μˆœ κ΅¬ν˜„(1-2 파일, μ‹œλ‚˜λ¦¬μ˜€ 2개 μ΄ν•˜)μ—μ„œλŠ” κΈ°μ‘΄ 병렬 λͺ¨λ“œ μœ μ§€
1321
-
1322
- **νŒ€ 선택 κΈ°μ€€:**
1323
-
1324
- | 쑰건 | νŒ€ |
1325
- |------|-----|
1326
- | μ‹œλ‚˜λ¦¬μ˜€ 1-2개, 파일 1-2개 | κΈ°μ‘΄ 병렬 λͺ¨λ“œ (νŒ€ μ—†μŒ) |
1327
- | μ‹œλ‚˜λ¦¬μ˜€ 3개+, 일반 λͺ¨λ“œ | **Lite Team (3λͺ…)** |
1328
- | ULTRAWORK λ˜λŠ” λ³΅μž‘λ„ 20+ | Dev Team Full (4λͺ…) |
1329
-
1330
- ### Agent Teams β€” Review Team
1331
-
1332
- > **νŒ€ μ •μ˜**: `agents/teams/review-debate-team.md` μ°Έμ‘°
1333
-
1334
- **ν™œμ„±ν™” 쑰건:**
1335
-
1336
- - `/vibe.review` μ‹€ν–‰ ν›„ P1 λ˜λŠ” P2 이슈 2개 이상 발견 μ‹œ
1337
- - Agent Teams ν™˜κ²½λ³€μˆ˜ ν™œμ„±ν™” μƒνƒœ
1338
-
1339
- ### Agent Teams β€” Debug Team
1340
-
1341
- > **νŒ€ μ •μ˜**: `agents/teams/debug-team.md` μ°Έμ‘°
1342
-
1343
- **ν™œμ„±ν™” 쑰건:**
1344
-
1345
- - 동일 λΉŒλ“œ/ν…ŒμŠ€νŠΈ μ‹€νŒ¨ 3회 이상
1346
- - UltraQA `architecture_question` μƒνƒœ μ§„μž… μ‹œ
1347
-
1348
- ### Agent Teams β€” Research Team
1349
-
1350
- > **νŒ€ μ •μ˜**: `agents/teams/research-team.md` μ°Έμ‘°
1351
-
1352
- **ν™œμ„±ν™” 쑰건:**
1353
-
1354
- - `/vibe.spec` Step 3 λ¦¬μ„œμΉ˜ 단계
1355
- - Agent Teams ν™˜κ²½λ³€μˆ˜ ν™œμ„±ν™” μƒνƒœ
1356
-
1357
- ### Agent Teams β€” Security Team
1358
-
1359
- > **νŒ€ μ •μ˜**: `agents/teams/security-team.md` μ°Έμ‘°
1360
-
1361
- **ν™œμ„±ν™” 쑰건:**
1362
-
1363
- - auth, payment, user-data, crypto κ΄€λ ¨ 파일 λ³€κ²½ 감지 μ‹œ
1364
- - λ˜λŠ” μˆ˜λ™μœΌλ‘œ `security` ν‚€μ›Œλ“œ μ§€μ • μ‹œ
1365
-
1366
- ### Agent Teams β€” Migration Team
1367
-
1368
- > **νŒ€ μ •μ˜**: `agents/teams/migration-team.md` μ°Έμ‘°
1369
-
1370
- **ν™œμ„±ν™” 쑰건:**
1371
-
1372
- - package.json μ£Όμš” μ˜μ‘΄μ„± 버전 λ³€κ²½ 감지 μ‹œ
1373
- - λ˜λŠ” μˆ˜λ™μœΌλ‘œ `migration` ν‚€μ›Œλ“œ μ§€μ • μ‹œ
1374
-
1375
- ### Agent Teams β€” Fullstack Team
1376
-
1377
- > **νŒ€ μ •μ˜**: `agents/teams/fullstack-team.md` μ°Έμ‘°
1378
-
1379
- **ν™œμ„±ν™” 쑰건:**
1380
-
1381
- - SPEC에 frontend + backend 파일이 λͺ¨λ‘ ν¬ν•¨λœ 경우
1382
- - λ˜λŠ” μˆ˜λ™μœΌλ‘œ `fullstack` ν‚€μ›Œλ“œ μ§€μ • μ‹œ
1383
-
1384
- ---
1385
-
1386
- 1. **Related code analysis**: Task(haiku) explores `<context>` related code
1387
- 2. **File creation/modification**: Task(sonnet) implements per `<output_format>`
1388
- 3. **Constraint compliance**: Check `<constraints>`
1389
- 4. **Run verification**: Execute verification commands
1390
-
1391
- ### 4. Brand Assets Generation (Optional)
1392
-
1393
- When starting a **new project** with brand context in SPEC, auto-generate app icons and favicons:
1394
-
1395
- ```
1396
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1397
- 🎨 BRAND ASSETS GENERATION
1398
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1399
-
1400
- [Check] Brand assets exist? β†’ Skip if favicon.ico exists
1401
- [Check] Gemini API configured? β†’ Required for image generation
1402
- [Check] SPEC has brand context? β†’ Extract app name, colors, style
1403
-
1404
- [Generate] Creating app icon with Gemini Image API...
1405
- - Prompt: "App icon for [AppName], [style], [color]..."
1406
- - Generated: 512x512 master icon
1407
-
1408
- [Resize] Creating platform variants...
1409
- βœ… favicon.ico (16/32/48)
1410
- βœ… favicon-16x16.png
1411
- βœ… favicon-32x32.png
1412
- βœ… apple-touch-icon.png (180x180)
1413
- βœ… android-chrome-192x192.png
1414
- βœ… android-chrome-512x512.png
1415
- βœ… site.webmanifest
1416
-
1417
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1418
- βœ… Brand assets generated in public/
1419
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1420
- ```
1421
-
1422
- **SPEC Brand Context Example:**
1423
-
1424
- ```xml
1425
- <context>
1426
- Brand:
1427
- - App Name: MyApp
1428
- - Primary Color: #2F6BFF
1429
- - Style: Modern, minimalist, flat design
1430
- - Icon Concept: Abstract geometric shape
1431
- </context>
1432
- ```
1433
-
1434
- **Trigger Conditions:**
1435
- - First `/vibe.run` execution (no existing icons)
1436
- - SPEC contains brand/design context
1437
- - Gemini API key configured (`vibe gemini key <key>`)
1438
-
1439
- **Manual Generation:**
1440
- ```bash
1441
- # [LLM_SCRIPT] = {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js
1442
- node "[LLM_SCRIPT]" gemini image "App icon for MyApp, primary color #2F6BFF, square format 1:1, simple recognizable design, works well at small sizes, no text or letters, solid or gradient background, modern minimalist" --output "./public/app-icon.png"
1443
- ```
1444
-
1445
- ---
1446
-
1447
- ### 5. Race Code Review (GPT + Gemini) + Auto-Fix (v2.6.9)
1448
-
1449
- After all scenarios are implemented, **GPT and Gemini review in parallel with cross-validation**:
1450
-
1451
- > **ULTRAWORK Default**: In ULTRAWORK mode, race review is automatically enabled.
1452
-
1453
- ```
1454
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1455
- 🏁 RACE CODE REVIEW (GPT + Gemini)
1456
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1457
-
1458
- [Step 1] Parallel review execution...
1459
- β”œβ”€ GPT Codex: Reviewing...
1460
- └─ Gemini: Reviewing...
1461
-
1462
- [Step 2] Cross-validation results:
1463
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1464
- β”‚ Issue β”‚ GPT β”‚ Gemini β”‚ Codex β”‚ Confidenceβ”‚
1465
- │────────────────────────────────│─────│────────│───────│───────────│
1466
- β”‚ Timing attack in password β”‚ βœ… β”‚ βœ… β”‚ βœ… β”‚ 100% β†’ P1 β”‚
1467
- β”‚ Rate limiting missing β”‚ βœ… β”‚ βœ… β”‚ βœ… β”‚ 100% β†’ P1 β”‚
1468
- β”‚ Magic number usage β”‚ βœ… β”‚ ❌ β”‚ ❌ β”‚ 50% β†’ P2 β”‚
1469
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1470
-
1471
- Summary: 3 issues (P1: 2, P2: 1)
1472
-
1473
- [Step 3] Auto-fixing P1/P2 issues...
1474
- βœ… auth.service.ts:24 - Applied timingSafeEqual (P1)
1475
- βœ… auth.controller.ts:15 - Added rate limiter (P1)
1476
- βœ… auth.service.ts:42 - Extracted constant (P2)
1477
-
1478
- [Step 4] Re-verifying...
1479
- βœ… Build succeeded
1480
- βœ… Tests passed
1481
-
1482
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1483
- βœ… Race review complete! 3 improvements (2 P1, 1 P2)
1484
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1485
- ```
1486
-
1487
- **Race Review Invocation (GPT + Gemini in parallel via Bash):**
1488
-
1489
- **🚨 Use --input file to avoid CLI argument length limits and Windows pipe issues.**
1490
-
1491
- 1. Save code to review into `[SCRATCHPAD]/review-code.txt` (using Write tool)
1492
- 2. Write JSON input file `[SCRATCHPAD]/review-input.json` (using Write tool):
1493
- - `{"prompt": "Review this code for security, performance, and best practices. Return JSON: {issues: [{id, title, description, severity, suggestion}]}. Code: [CODE_CONTENT]"}`
1494
- - Where `[CODE_CONTENT]` is the code text (properly JSON-escaped inside the prompt string)
1495
- 3. Script path: `[LLM_SCRIPT]` = `{{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js`
1496
- 4. Run GPT + Gemini in PARALLEL (two Bash tool calls at once):
1497
-
1498
- ```bash
1499
- # GPT review (Bash tool call 1)
1500
- node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/review-input.json"
1501
- ```
1502
-
1503
- ```bash
1504
- # Gemini review (Bash tool call 2 - run in parallel)
1505
- node "[LLM_SCRIPT]" gemini orchestrate-json --input "[SCRATCHPAD]/review-input.json"
1506
- ```
1507
-
1508
- **Confidence-based Priority:**
1509
-
1510
- | Confidence | Priority | Action |
1511
- |------------|----------|--------|
1512
- | 100% (3/3 or 2/2) | P1 | Auto-fix immediately |
1513
- | 67% (2/3) | P1 | Auto-fix immediately |
1514
- | 50% (1/2) or 33% (1/3) | P2 | Auto-fix with review |
1515
-
1516
- **Fallback handling:**
1517
- - If one LLM fails β†’ Use remaining LLM results (reduced confidence)
1518
- - If all fail β†’ Skip and proceed (log warning)
1519
-
1520
- **Review application rules:**
1521
-
1522
- | Feedback Type | Action |
1523
- |---------------|--------|
1524
- | Security vulnerability (P1) | Auto-fix immediately |
1525
- | Performance improvement (P1/P2) | Auto-fix immediately |
1526
- | Best practices (P2) | Auto-fix |
1527
- | Style/preference (P3) | Apply selectively |
1528
-
1529
- **Conditions:**
1530
- - **ULTRAWORK**: Race review enabled by default
1531
- - **Normal mode**: Use `--race` flag to enable
1532
- - Must re-verify build/tests after fixes
1533
-
1534
- ### Codex Code Review (Codex ν”ŒλŸ¬κ·ΈμΈ ν™œμ„±ν™” μ‹œ)
1535
-
1536
- GPT+Gemini race와 **λ™μ‹œμ—** Codex review μ‹€ν–‰:
1537
-
1538
- ```
1539
- /codex:review
1540
- ```
1541
-
1542
- κ²°κ³Όλ₯Ό race review ꡐ차 검증에 포함 β€” 3쀑 리뷰:
1543
-
1544
- ```markdown
1545
- | Issue | GPT | Gemini | Codex | Confidence |
1546
- |-------|-----|--------|-------|------------|
1547
- | {이슈} | βœ…/❌ | βœ…/❌ | βœ…/❌ | {%} |
1548
- ```
1549
-
1550
- ### 6. Quality Report (Auto-generated)
1551
-
1552
- After all scenarios complete + Gemini review, **quality report is auto-generated**:
1553
-
1554
- ```
1555
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1556
- β”‚ πŸ“Š QUALITY REPORT: login β”‚
1557
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
1558
- β”‚ β”‚
1559
- β”‚ βœ… Scenarios: 4/4 passed β”‚
1560
- β”‚ β”‚
1561
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
1562
- β”‚ β”‚ # β”‚ Scenario β”‚ Status β”‚ Retries β”‚ β”‚ β”‚
1563
- β”‚ │───│───────────────────────────│────────│─────────│ β”‚ β”‚
1564
- β”‚ β”‚ 1 β”‚ Valid login success β”‚ βœ… β”‚ 0 β”‚ β”‚ β”‚
1565
- β”‚ β”‚ 2 β”‚ Invalid password error β”‚ βœ… β”‚ 1 β”‚ β”‚ β”‚
1566
- β”‚ β”‚ 3 β”‚ Email format validation β”‚ βœ… β”‚ 0 β”‚ β”‚ β”‚
1567
- β”‚ β”‚ 4 β”‚ Password reset link β”‚ βœ… β”‚ 0 β”‚ β”‚ β”‚
1568
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
1569
- β”‚ β”‚
1570
- β”‚ πŸ“ˆ Quality score: 94/100 β”‚
1571
- β”‚ β”‚
1572
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
1573
- β”‚ β”‚ Item β”‚ Result β”‚ Notes β”‚ β”‚
1574
- β”‚ │───────────────────│────────│─────────────────────────────│ β”‚
1575
- β”‚ β”‚ Build β”‚ βœ… β”‚ npm run build succeeded β”‚ β”‚
1576
- β”‚ β”‚ Tests β”‚ βœ… β”‚ 12/12 passed β”‚ β”‚
1577
- β”‚ β”‚ Type check β”‚ βœ… β”‚ 0 errors β”‚ β”‚
1578
- β”‚ β”‚ Complexity β”‚ βœ… β”‚ All functions ≀30 lines β”‚ β”‚
1579
- β”‚ β”‚ Security β”‚ βœ… β”‚ 0 vulnerabilities β”‚ β”‚
1580
- β”‚ β”‚ Race review β”‚ βœ… β”‚ 3 improvements applied β”‚ β”‚
1581
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
1582
- β”‚ β”‚
1583
- β”‚ ⏱️ Started: {start_time} β”‚
1584
- β”‚ ⏱️ Completed: {getCurrentTime κ²°κ³Ό} β”‚
1585
- β”‚ β”‚
1586
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1587
- ```
1588
-
1589
- **What users should check**:
1590
- - Scenario pass rate (4/4 = 100%)
1591
- - Quality score (94/100)
1592
- - Build/test status
1593
-
1594
- **This alone is enough to trust quality.**
1595
-
1596
- ### 7. Update Feature File
1597
-
1598
- Auto-update scenario status:
1599
-
1600
- ```markdown
1601
- ## Coverage
1602
-
1603
- | Scenario | SPEC AC | Status |
1604
- |----------|---------|--------|
1605
- | Valid login success | AC-1 | βœ… |
1606
- | Invalid password error | AC-2 | βœ… |
1607
- | Email format validation | AC-3 | βœ… |
1608
- | Password reset link | AC-4 | βœ… |
1609
-
1610
- **Last verified**: 2024-01-15 14:32
1611
- **Quality score**: 94/100
1612
- ```
1613
-
1614
- ## TRUST 5 Principles
1615
-
1616
- Follow during implementation:
1617
-
1618
- | Principle | Description |
1619
- |-----------|-------------|
1620
- | **T**est-first | Write tests first |
1621
- | **R**eadable | Clear code |
1622
- | **U**nified | Consistent style |
1623
- | **S**ecured | Consider security |
1624
- | **T**rackable | Logging, monitoring |
1625
-
1626
- ## Input
1627
-
1628
- - `.claude/vibe/specs/{feature-name}.md` (PTCF SPEC)
1629
- - `.claude/vibe/features/{feature-name}.feature` (BDD)
1630
- - `CLAUDE.md` (project context)
1631
-
1632
- ## Output
1633
-
1634
- - Implemented code files
1635
- - Test files
1636
- - Updated SPEC document (checkmarks)
1637
-
1638
- ## Example
1639
-
1640
- ```
1641
- User: /vibe.run "login"
1642
-
1643
- Claude:
1644
- πŸ“„ Loading SPEC: .claude/vibe/specs/login.md
1645
- πŸ“„ Loading Feature: .claude/vibe/features/login.feature
1646
-
1647
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1648
- πŸ“‹ Scenarios to Implement
1649
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1650
-
1651
- | # | Scenario | Status |
1652
- |---|----------|--------|
1653
- | 1 | Valid login success | ⬜ |
1654
- | 2 | Invalid password error | ⬜ |
1655
- | 3 | Email format validation | ⬜ |
1656
- | 4 | Password reset link | ⬜ |
1657
-
1658
- Total: 4 scenarios
1659
-
1660
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1661
- 🎯 Scenario 1/4: Valid login success
1662
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1663
-
1664
- Given: User is registered
1665
- When: Login with valid email and password
1666
- Then: Login success + JWT token returned
1667
-
1668
- ⚑ [PARALLEL] Exploring...
1669
- βœ… Exploration complete (2.1s)
1670
-
1671
- πŸ”¨ Implementing...
1672
- βœ… auth.service.ts - Added login()
1673
- βœ… auth.controller.ts - POST /login
1674
-
1675
- πŸ” Verifying...
1676
- βœ… Given: OK
1677
- βœ… When: OK
1678
- βœ… Then: OK
1679
-
1680
- βœ… Scenario 1 passed!
1681
-
1682
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1683
- 🎯 Scenario 2/4: Invalid password error
1684
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1685
-
1686
- πŸ”¨ Implementing...
1687
- βœ… auth.service.ts - Password validation logic
1688
-
1689
- πŸ” Verifying...
1690
- βœ… Given: OK
1691
- βœ… When: OK
1692
- ❌ Then: "Invalid credentials" error message
1693
- Actual: "Error" returned
1694
-
1695
- πŸ”„ Auto-fix [iteration 1]...
1696
- Fix: auth.service.ts line 42
1697
-
1698
- πŸ” Re-verifying...
1699
- βœ… Then: OK
1700
-
1701
- βœ… Scenario 2 passed! (1 fix)
1702
-
1703
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1704
- 🎯 Scenario 3/4: Email format validation
1705
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1706
-
1707
- πŸ”¨ Implementing...
1708
- πŸ” Verifying...
1709
- βœ… Scenario 3 passed!
1710
-
1711
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1712
- 🎯 Scenario 4/4: Password reset link
1713
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1714
-
1715
- πŸ”¨ Implementing...
1716
- πŸ” Verifying...
1717
- βœ… Scenario 4 passed!
1718
-
1719
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1720
- πŸ” GEMINI CODE REVIEW
1721
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1722
-
1723
- πŸ“€ Sending code to Gemini...
1724
- πŸ“ Gemini feedback:
1725
- 1. [Security] Need timing attack prevention β†’ Fixing...
1726
- 2. [Performance] Unnecessary DB call β†’ Fixing...
1727
-
1728
- βœ… 2 improvements auto-applied
1729
- πŸ” Re-verifying... βœ… Passed
1730
-
1731
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1732
- β”‚ πŸ“Š QUALITY REPORT: login β”‚
1733
- β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
1734
- β”‚ β”‚
1735
- β”‚ βœ… Scenarios: 4/4 passed β”‚
1736
- β”‚ β”‚
1737
- β”‚ | # | Scenario | Status | Retries | β”‚
1738
- β”‚ |---|───────────────────────|───────|─────────| β”‚
1739
- β”‚ | 1 | Valid login success | βœ… | 0 | β”‚
1740
- β”‚ | 2 | Invalid password error| βœ… | 1 | β”‚
1741
- β”‚ | 3 | Email format validation| βœ… | 0 | β”‚
1742
- β”‚ | 4 | Password reset link | βœ… | 0 | β”‚
1743
- β”‚ β”‚
1744
- β”‚ πŸ“ˆ Quality score: 94/100 β”‚
1745
- β”‚ Build: βœ… | Tests: βœ… | Types: βœ… | Gemini: βœ… (2 applied) β”‚
1746
- β”‚ β”‚
1747
- β”‚ ⏱️ Started: {start_time} β”‚
1748
- β”‚ ⏱️ Completed: {getCurrentTime κ²°κ³Ό} β”‚
1749
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1750
-
1751
- πŸŽ‰ Implementation complete! All scenarios passed + Gemini review applied.
1752
-
1753
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1754
- πŸ” AUTO REVIEW (13+ Agents)
1755
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1756
-
1757
- ⚑ [PARALLEL] 13 expert agents reviewing...
1758
- - security-reviewer βœ…
1759
- - performance-reviewer βœ…
1760
- - architecture-reviewer βœ…
1761
- - ...
1762
-
1763
- πŸ“‹ Review results:
1764
- - P1 Critical: 0
1765
- - P2 Important: 2
1766
- - P3 Nice-to-have: 1
1767
-
1768
- πŸ”§ Auto-fixing P2 issues...
1769
- 1. [PERF] N+1 query β†’ Fixed
1770
- 2. [ARCH] Circular dependency β†’ Fixed
1771
-
1772
- βœ… Auto Review complete! 2 issues auto-resolved.
1773
- ```
1774
-
1775
- ### Phase-specific Execution
1776
-
1777
- ```
1778
- User: /vibe.run "brick-game" --phase 2
1779
-
1780
- Claude:
1781
- πŸ“„ Reading SPEC: .claude/vibe/specs/brick-game.md
1782
- 🎯 Executing Phase 2 only.
1783
-
1784
- Phase 2: Game Logic
1785
- 1. [ ] Paddle movement implementation
1786
- 2. [ ] Ball physics engine
1787
- 3. [ ] Brick collision handling
1788
- 4. [ ] Score system
1789
- 5. [ ] Game over conditions
1790
-
1791
- ⚑ Launching parallel exploration...
1792
- [Task(haiku) Γ— 3 launched in parallel]
1793
-
1794
- πŸš€ Starting implementation...
1795
- ```
1796
-
1797
- ## Error Handling
1798
-
1799
- On failure:
1800
- 1. Check error message
1801
- 2. Review `<constraints>`
1802
- 3. Fix code and retry
1803
- 4. If continues to fail, report to user
1804
-
1805
- ---
1806
-
1807
- ## Quality Gate (Mandatory)
1808
-
1809
- ### Implementation Quality Checklist
1810
-
1811
- Before marking any scenario as complete, ALL items must pass:
1812
-
1813
- | Category | Check Item | Weight |
1814
- |----------|------------|--------|
1815
- | **Functionality** | All Given/When/Then conditions verified | 20% |
1816
- | **Functionality** | Edge cases handled per scenario | 10% |
1817
- | **Code Quality** | No `any` types in TypeScript | 10% |
1818
- | **Code Quality** | Functions ≀30 lines, nesting ≀3 levels | 10% |
1819
- | **Code Quality** | No hardcoded values (use constants) | 5% |
1820
- | **Security** | Input validation implemented | 10% |
1821
- | **Security** | Authentication/authorization checked | 5% |
1822
- | **Error Handling** | Try-catch or error states present | 10% |
1823
- | **Error Handling** | User-friendly error messages | 5% |
1824
- | **Testing** | Unit tests exist for core logic | 10% |
1825
- | **Performance** | No N+1 queries or unnecessary loops | 5% |
1826
-
1827
- ### Quality Score Calculation
1828
-
1829
- ```
1830
- Score = Ξ£(checked items Γ— weight) / 100
1831
-
1832
- Grades:
1833
- - 95-100: βœ… EXCELLENT - Ready to merge
1834
- - 90-94: ⚠️ GOOD - Minor improvements required before merge
1835
- - 80-89: ⚠️ FAIR - Significant improvements required
1836
- - 0-79: ❌ POOR - Major fixes needed
1837
- ```
1838
-
1839
- ### Quality Gate Thresholds
1840
-
1841
- | Gate | Minimum Score | Condition |
1842
- |------|---------------|-----------|
1843
- | **Scenario Complete** | 95 | Each scenario must score β‰₯95 |
1844
- | **Phase Complete** | 95 | Average of all scenarios β‰₯95 |
1845
- | **Feature Complete** | 95 | All phases complete + Gemini review |
1846
-
1847
- ### Auto-Fix Triggers
1848
-
1849
- | Issue Type | Auto-Fix Action |
1850
- |------------|-----------------|
1851
- | Missing error handling | Add try-catch wrapper |
1852
- | Hardcoded values | Extract to constants file |
1853
- | Missing input validation | Add validation schema |
1854
- | Function too long | Suggest split points |
1855
- | N+1 query detected | Add eager loading |
1856
-
1857
- ### Auto-Fix μ‹€νŒ¨ μ‹œ Codex Rescue (Codex ν”ŒλŸ¬κ·ΈμΈ ν™œμ„±ν™” μ‹œ)
1858
-
1859
- P1 auto-fixκ°€ **3회 μ‹€νŒ¨** μ‹œ, Codex에 μœ„μž„:
1860
-
1861
- ```
1862
- /codex:rescue "Fix P1 issue: {issue-description}. File: {file-path}. Error: {error-message}"
1863
- ```
1864
-
1865
- Codex μˆ˜μ • μ™„λ£Œ ν›„ μž¬κ²€μ¦. Codex도 μ‹€νŒ¨ μ‹œ TODO νŒŒμΌμ— 기둝.
1866
-
1867
- ### Forbidden Patterns (Block Merge)
1868
-
1869
- | Pattern | Why Forbidden | Detection |
1870
- |---------|---------------|-----------|
1871
- | `console.log` | Debug code in production | Regex scan |
1872
- | `// TODO` without issue | Untracked work | Comment scan |
1873
- | `any` type | Type safety bypass | TypeScript check |
1874
- | `@ts-ignore` | Type error suppression | TypeScript check |
1875
- | Empty catch blocks | Silent error swallowing | AST analysis |
1876
- | Commented-out code | Dead code | Comment scan |
1877
-
1878
- ---
1879
-
1880
- ## Auto-Retrospective (Post-Implementation)
1881
-
1882
- After ALL phases complete successfully, **automatically** perform a brief retrospective:
1883
-
1884
- ### Retrospective Template
1885
-
1886
- ```
1887
- ## Retrospective: {feature-name}
1888
-
1889
- ### What Worked
1890
- - [List effective patterns, tools, approaches used]
1891
-
1892
- ### What Didn't
1893
- - [List issues, failures, unexpected blockers]
1894
-
1895
- ### Key Decisions
1896
- - [Important architectural or implementation decisions made during this run]
1897
-
1898
- ### Lessons Learned
1899
- - [Principle format: "When X, do Y because Z"]
1900
- ```
1901
-
1902
- ### Execution Steps
1903
-
1904
- 1. Generate retrospective based on the implementation session
1905
- 2. Save to `.claude/vibe/retros/{feature-name}.md`
1906
- 3. Save key lessons via `core_save_memory` (for cross-session recall)
1907
- 4. Update `claude-progress.txt` with final status
1908
-
1909
- **Important:**
1910
-
1911
- - Keep it concise (under 20 lines)
1912
- - Focus on **project-specific** insights, not generic knowledge
1913
- - Only save to memory if the lesson is actionable and non-obvious
1914
-
1915
- ---
1916
-
1917
- ## Next Step
1918
-
1919
- ```
1920
- /vibe.verify "brick-game"
1921
- ```
1922
-
1923
- ---
1924
-
1925
- ARGUMENTS: $ARGUMENTS
1
+ ---
2
+ description: Execute implementation from SPEC
3
+ argument-hint: "feature name" or --phase N
4
+ ---
5
+
6
+ # /vibe.run
7
+
8
+ Execute **Scenario-Driven Implementation** with automatic quality verification.
9
+
10
+ > **Core Principle**: Scenarios are both the implementation unit and verification criteria. All scenarios passing = Quality guaranteed.
11
+
12
+ ## Usage
13
+
14
+ ```
15
+ /vibe.run "feature-name" # Full implementation
16
+ /vibe.run "feature-name" --phase 1 # Specific Phase only
17
+ /vibe.run "feature-name" ultrawork # ULTRAWORK mode (recommended)
18
+ /vibe.run "feature-name" ulw # Short alias for ultrawork
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Codex Plugin Integration
24
+
25
+ > **Codex ν”ŒλŸ¬κ·ΈμΈ 감지**: μ›Œν¬ν”Œλ‘œμš° μ‹œμž‘ μ‹œ μ•„λž˜ λͺ…λ ΉμœΌλ‘œ μžλ™ 감지.
26
+ >
27
+ > ```bash
28
+ > CODEX_AVAILABLE=$(node "{{VIBE_PATH}}/hooks/scripts/codex-detect.js" 2>/dev/null || echo "unavailable")
29
+ > ```
30
+ >
31
+ > `available`이면 `/codex:rescue` (κ΅¬ν˜„ μœ„μž„), `/codex:review` (μ½”λ“œ 리뷰) μžλ™ 호좜. `unavailable`이면 κΈ°μ‘΄ μ›Œν¬ν”Œλ‘œμš°λ‘œ λ™μž‘.
32
+
33
+ ---
34
+
35
+ > **⏱️ Timer**: Call `getCurrentTime` tool at the START. Record the result as `{start_time}`.
36
+
37
+ ## File Reading Policy (Mandatory)
38
+
39
+ - **SPEC/Feature 파일**: λ°˜λ“œμ‹œ `Read` λ„κ΅¬λ‘œ 전체 νŒŒμΌμ„ 읽을 것 (Grep κΈˆμ§€)
40
+ - **μ†ŒμŠ€μ½”λ“œ 파일**: κ΅¬ν˜„/μˆ˜μ • λŒ€μƒ νŒŒμΌμ€ λ°˜λ“œμ‹œ `Read` λ„κ΅¬λ‘œ 전체 읽은 ν›„ μž‘μ—…ν•  것
41
+ - **Grep μ‚¬μš© μ œν•œ**: 파일 μœ„μΉ˜ 탐색(μ–΄λ–€ νŒŒμΌμ— μžˆλŠ”μ§€ μ°ΎκΈ°)μ—λ§Œ μ‚¬μš©. 파일 λ‚΄μš© νŒŒμ•…μ—λŠ” λ°˜λ“œμ‹œ Read μ‚¬μš©
42
+ - **μ—μ΄μ „νŠΈ spawn μ‹œ**: ν”„λ‘¬ν”„νŠΈμ— "λŒ€μƒ νŒŒμΌμ„ Read λ„κ΅¬λ‘œ 전체 읽은 ν›„ κ΅¬ν˜„ν•˜λΌ"λ₯Ό λ°˜λ“œμ‹œ 포함할 것
43
+ - **λΆ€λΆ„ 읽기 κΈˆμ§€**: Grep 결과의 μ£Όλ³€ λͺ‡ μ€„λ§Œ 보고 μˆ˜μ •ν•˜μ§€ 말 것. 전체 λ§₯락을 νŒŒμ•…ν•΄μ•Ό κΈ°μ‘΄ μ½”λ“œμ™€ μΌκ΄€λœ κ΅¬ν˜„ κ°€λŠ₯
44
+
45
+ ## **Scenario-Driven Development (SDD)**
46
+
47
+ > Automate **Scenario = Implementation = Verification** so even non-developers can trust quality
48
+
49
+ ### Core Flow
50
+
51
+ ```
52
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
53
+ β”‚ SCENARIO-DRIVEN IMPLEMENTATION β”‚
54
+ β”‚ β”‚
55
+ β”‚ Load Feature file β”‚
56
+ β”‚ ↓ β”‚
57
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
58
+ β”‚ β”‚ Scenario 1: Happy Path β”‚ β”‚
59
+ β”‚ β”‚ Given β†’ When β†’ Then β”‚ β”‚
60
+ β”‚ β”‚ ↓ β”‚ β”‚
61
+ β”‚ β”‚ [Implement] β†’ [Verify immediately] β†’ βœ… Pass β”‚ β”‚
62
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
63
+ β”‚ ↓ β”‚
64
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
65
+ β”‚ β”‚ Scenario 2: Edge Case β”‚ β”‚
66
+ β”‚ β”‚ Given β†’ When β†’ Then β”‚ β”‚
67
+ β”‚ β”‚ ↓ β”‚ β”‚
68
+ β”‚ β”‚ [Implement] β†’ [Verify] β†’ ❌ Fail β†’ [Fix] β†’ βœ… Pass β”‚ β”‚
69
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
70
+ β”‚ ↓ β”‚
71
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
72
+ β”‚ β”‚ Scenario N: ... β”‚ β”‚
73
+ β”‚ β”‚ [Implement] β†’ [Verify immediately] β†’ βœ… Pass β”‚ β”‚
74
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
75
+ β”‚ ↓ β”‚
76
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
77
+ β”‚ β”‚ πŸ“Š QUALITY REPORT β”‚ β”‚
78
+ β”‚ β”‚ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ β”‚ β”‚
79
+ β”‚ β”‚ Scenarios: 5/5 passed βœ… β”‚ β”‚
80
+ β”‚ β”‚ Quality score: 94/100 β”‚ β”‚
81
+ β”‚ β”‚ Build: βœ… | Tests: βœ… β”‚ β”‚
82
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
83
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
84
+ ```
85
+
86
+ ### Scenario = Implementation Unit
87
+
88
+ **Traditional approach (Phase-based)**:
89
+ ```
90
+ Phase 1 β†’ Phase 2 β†’ Phase 3 β†’ ... β†’ Verify at the end
91
+ ↓
92
+ "Where did it go wrong?"
93
+ ```
94
+
95
+ **SDD approach (Scenario-based)**:
96
+ ```
97
+ Scenario 1 β†’ Implement β†’ Verify βœ…
98
+ Scenario 2 β†’ Implement β†’ Verify βœ…
99
+ Scenario 3 β†’ Implement β†’ Verify ❌ β†’ Fix β†’ βœ…
100
+ ...
101
+ All pass = Quality guaranteed
102
+ ```
103
+
104
+ ### Automated Verification (Closed Loop)
105
+
106
+ **자율적 AI μ½”λ”© = κ΅¬ν˜„ + 검증 + 반볡. 검증을 AIμ—κ²Œ λ§‘κΈ°λŠ” μˆœκ°„ 루프가 λ‹«νžŒλ‹€.**
107
+
108
+ After implementing each scenario, **automatic verification**:
109
+
110
+ | Verification Item | Auto Check | Method |
111
+ |-------------------|------------|--------|
112
+ | Given (precondition) | State/data preparation confirmed | Code analysis |
113
+ | When (action) | Feature execution possible | Code analysis + Build |
114
+ | Then (result) | Expected result matches | Code analysis + Test |
115
+ | Code quality | Complexity, style, security | Static analysis |
116
+ | **UI behavior** | **μ‹€μ œ λΈŒλΌμš°μ €μ—μ„œ λ™μž‘ 확인** | **E2E Closed Loop** |
117
+
118
+ ### E2E Closed Loop (UI Scenarios)
119
+
120
+ **UI μ‹œλ‚˜λ¦¬μ˜€κ°€ ν¬ν•¨λœ Feature일 λ•Œ μžλ™ ν™œμ„±ν™”.**
121
+
122
+ ```
123
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
124
+ β”‚ CLOSED LOOP = κ΅¬ν˜„ + 검증 + 반볡 β”‚
125
+ β”‚ β”‚
126
+ β”‚ Scenario κ΅¬ν˜„ μ™„λ£Œ β”‚
127
+ β”‚ ↓ β”‚
128
+ β”‚ [E2E 검증] AIκ°€ 직접 λΈŒλΌμš°μ € μ‘°μž‘ β”‚
129
+ β”‚ β”‚ (μ ‘κ·Όμ„± 트리 기반 β€” 토큰 효율적) β”‚
130
+ β”‚ β”œβ”€ PASS β†’ Next scenario β”‚
131
+ β”‚ └─ FAIL β†’ Root cause analysis β”‚
132
+ β”‚ β†’ Fix code (Read full file first) β”‚
133
+ β”‚ β†’ Re-run failed scenario only β”‚
134
+ β”‚ β†’ PASS? β†’ Next scenario β”‚
135
+ β”‚ β†’ FAIL (same as prev)? β†’ STUCK β†’ Ask user β”‚
136
+ β”‚ β”‚
137
+ β”‚ 핡심: 검증이 κ°€λ²ΌμšΈμˆ˜λ‘ λ£¨ν”„λŠ” 더 많이 λˆλ‹€ β”‚
138
+ β”‚ - μ ‘κ·Όμ„± 트리: button "Sign In" = 15 chars β”‚
139
+ β”‚ - DOM 트리: div class="nav-wrapper mx-4..." = 200+ chars β”‚
140
+ β”‚ - μ „μžλ₯Ό 써야 ν•œ μ„Έμ…˜μ—μ„œ μˆ˜μ‹­ 개 μ‹œλ‚˜λ¦¬μ˜€ 검증 κ°€λŠ₯ β”‚
141
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
142
+ ```
143
+
144
+ **Browser Tool Priority:**
145
+
146
+ | Priority | Tool | μš©λ„ |
147
+ |----------|------|------|
148
+ | 1st | Agent Browser (μ ‘κ·Όμ„± 트리) | AI 직접 μ‘°μž‘, μ΅œμ†Œ 토큰 |
149
+ | 2nd | Playwright Test Runner | ν…ŒμŠ€νŠΈ μ½”λ“œ μ‹€ν–‰, pass/fail λ°˜ν™˜ |
150
+ | 3rd | Playwright MCP (DOM) | μ΅œν›„ μˆ˜λ‹¨, 토큰 λΉ„νš¨μœ¨ |
151
+
152
+ **ν™œμ„±ν™” 쑰건:**
153
+ - Feature νŒŒμΌμ— UI κ΄€λ ¨ μ‹œλ‚˜λ¦¬μ˜€ 쑴재 (form, button, page, navigate λ“±)
154
+ - `.claude/vibe/e2e/config.json`의 `closedLoop.enabled: true` (κΈ°λ³Έκ°’)
155
+ - dev serverκ°€ μ‹€ν–‰ 쀑 (`baseURL` μ ‘κ·Ό κ°€λŠ₯)
156
+
157
+ ### Auto-Fix on Failure
158
+
159
+ ```
160
+ Scenario verification failed (μ½”λ“œ 뢄석 λ˜λŠ” E2E)
161
+ ↓
162
+ [Collect evidence]
163
+ - E2E: screenshot, console errors, accessibility tree snapshot
164
+ - Code: build errors, test failures, type errors
165
+ ↓
166
+ [Root cause analysis] - Which Then condition failed?
167
+ ↓
168
+ [Read target file FULLY] - Grep으둜 ν›‘μ§€ 말 것
169
+ ↓
170
+ [Implement fix] - Fix only that part
171
+ ↓
172
+ [Re-verify] - Re-run ONLY failed scenario (save tokens)
173
+ ↓
174
+ Repeat until pass (λΌμš΄λ“œ 수 μΊ‘ μ—†μŒ β€” stuck κ°μ§€λ‘œ μ’…λ£Œ)
175
+ ```
176
+
177
+ **Termination conditions:**
178
+ - βœ… PASS β†’ λ‹€μŒ scenario
179
+ - ⚠️ Stuck (같은 failureκ°€ 이전 λΌμš΄λ“œμ™€ 동일) β†’ μ‚¬μš©μž 질문:
180
+ 1. 직접 μˆ˜μ • 방법 제곡 (예: "LoginForm.tsx 42쀄 μˆ˜μ •") β†’ μž¬μ‹œλ„
181
+ 2. "proceed" β€” 남은 μ‹€νŒ¨ TODO 기둝 ν›„ λ‹€μŒ scenario
182
+ 3. "abort" β€” κ΅¬ν˜„ 쀑단
183
+ - `ultrawork` λͺ¨λ“œ: stuck μ‹œ ν”„λ‘¬ν”„νŠΈ 없이 TODO 기둝 ν›„ λ‹€μŒ scenario
184
+
185
+ ---
186
+
187
+ ## **ULTRAWORK Mode** (ulw)
188
+
189
+ > Include `ultrawork` or `ulw` in your command to activate **maximum performance mode**.
190
+
191
+ ### What ULTRAWORK Enables
192
+
193
+ When you include `ultrawork` (or `ulw`), ALL of these activate automatically:
194
+
195
+ | Feature | Description |
196
+ |---------|-------------|
197
+ | **Parallel Exploration** | 3+ Task(haiku) agents run simultaneously |
198
+ | **Boulder Loop** | Auto-continues until ALL phases complete |
199
+ | **Context Compression** | Aggressive auto-save at 70%+ context |
200
+ | **No Pause** | Doesn't wait for confirmation between phases |
201
+ | **External LLMs** | Auto-consults GPT/Gemini if enabled |
202
+ | **Error Recovery** | Loops until 100% or stuck; on stuck auto-records TODO and proceeds (no user prompt) |
203
+ | **Race Review (v2.6.9)** | Multi-LLM review (GPT+Gemini) with cross-validation |
204
+
205
+ ### Boulder Loop (Inspired by Sisyphus)
206
+
207
+ Like Sisyphus rolling the boulder, ULTRAWORK **keeps going until done**:
208
+
209
+ ```
210
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
211
+ β”‚ BOULDER LOOP (ultrawork) β”‚
212
+ β”‚ β”‚
213
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
214
+ β”‚ β”‚ Phase 1 │───→│ Phase 2 │───→│ Phase 3 │───→│ Phase N β”‚ β”‚
215
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
216
+ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
217
+ β”‚ ↓ ↓ ↓ ↓ β”‚
218
+ β”‚ [Parallel] [Parallel] [Parallel] [Parallel] β”‚
219
+ β”‚ [Implement] [Implement] [Implement] [Implement] β”‚
220
+ β”‚ [Test] [Test] [Test] [Test] β”‚
221
+ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
222
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
223
+ β”‚ β”‚ β”‚
224
+ β”‚ ↓ β”‚
225
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
226
+ β”‚ β”‚ ALL DONE? β”‚ β”‚
227
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
228
+ β”‚ β”‚ β”‚ β”‚
229
+ β”‚ NO YES β”‚
230
+ β”‚ β”‚ β”‚ β”‚
231
+ β”‚ ↓ ↓ β”‚
232
+ β”‚ [Continue] [πŸŽ‰ Complete!] β”‚
233
+ β”‚ β”‚
234
+ β”‚ NO STOPPING until acceptance criteria met or error limit hit β”‚
235
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
236
+ ```
237
+
238
+ ### Ralph Loop (Completion Verification) - CRITICAL
239
+
240
+ > **Inspired by [ghuntley.com/ralph](https://ghuntley.com/ralph)**: "Deterministically bad in an undeterministic world" - Keep iterating until TRULY complete.
241
+
242
+ **Problem**: AI often claims "complete" when implementation is partial.
243
+
244
+ **Solution**: RTM-based automated coverage verification with iteration tracking.
245
+
246
+ ```
247
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
248
+ β”‚ RALPH LOOP (Mandatory) β”‚
249
+ β”‚ β”‚
250
+ β”‚ After ALL phases complete: β”‚
251
+ β”‚ β”‚
252
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
253
+ β”‚ β”‚ RTM COVERAGE VERIFICATION [Iteration {{ITER}}/{{MAX}}] β”‚ β”‚
254
+ β”‚ β”‚ β”‚ β”‚
255
+ β”‚ β”‚ Generate RTM via core tools: β”‚ β”‚
256
+ β”‚ β”‚ β†’ generateTraceabilityMatrix("{feature-name}") β”‚ β”‚
257
+ β”‚ β”‚ β”‚ β”‚
258
+ β”‚ β”‚ Coverage Metrics (automated): β”‚ β”‚
259
+ β”‚ β”‚ β–‘ Requirements coverage: {coveragePercent}% β”‚ β”‚
260
+ β”‚ β”‚ β–‘ SPEC β†’ Feature mapping: {featureCovered}/{total} β”‚ β”‚
261
+ β”‚ β”‚ β–‘ Feature β†’ Test mapping: {testCovered}/{total} β”‚ β”‚
262
+ β”‚ β”‚ β–‘ Build successful? β”‚ β”‚
263
+ β”‚ β”‚ β–‘ Tests passing? β”‚ β”‚
264
+ β”‚ β”‚ β”‚ β”‚
265
+ β”‚ β”‚ UNCOVERED: {uncoveredRequirements[]} β”‚ β”‚
266
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
267
+ β”‚ β”‚ β”‚
268
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
269
+ β”‚ β”‚ Coverage == 100%? β”‚ β”‚
270
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
271
+ β”‚ β”‚ β”‚ β”‚
272
+ β”‚ NO YES β”‚
273
+ β”‚ β”‚ β”‚ β”‚
274
+ β”‚ ↓ ↓ β”‚
275
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
276
+ β”‚ β”‚ IMPLEMENT β”‚ β”‚ βœ… TRULY DONE β”‚ β”‚
277
+ β”‚ β”‚ UNCOVERED β”‚ β”‚ β”‚ β”‚
278
+ β”‚ β”‚ REQUIREMENTS β”‚ β”‚ Report final β”‚ β”‚
279
+ β”‚ β”‚ (auto-extract) β”‚ β”‚ RTM coverage β”‚ β”‚
280
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
281
+ β”‚ β”‚ β”‚
282
+ β”‚ └──────────→ [Re-generate RTM] β”‚
283
+ β”‚ β”‚
284
+ β”‚ β”‚ β”‚
285
+ β”‚ ↓ β”‚
286
+ β”‚ Stuck? (coverage unchanged from prev iteration) β”‚
287
+ β”‚ β”‚ β”‚
288
+ β”‚ β”œβ”€ Interactive: Ask user β”‚
289
+ β”‚ β”‚ 1. Provide resolution β†’ retry β”‚
290
+ β”‚ β”‚ 2. "proceed" β†’ TODO + done β”‚
291
+ β”‚ β”‚ 3. "abort" β†’ stop β”‚
292
+ β”‚ └─ ultrawork: TODO + done β”‚
293
+ β”‚ β”‚
294
+ β”‚ NO iteration cap β€” loop until 100% OR stuck β”‚
295
+ β”‚ ZERO TOLERANCE for silent scope reduction β”‚
296
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
297
+ ```
298
+
299
+ **Ralph Loop with RTM:**
300
+
301
+ ```bash
302
+ # Generate RTM for coverage verification
303
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.generateTraceabilityMatrix('{feature-name}', {projectPath: process.cwd()}).then(r => console.log(JSON.stringify(r, null, 2))))"
304
+ ```
305
+
306
+ **RTM provides automated metrics:**
307
+
308
+ | Metric | Description |
309
+ |--------|-------------|
310
+ | `totalRequirements` | Total REQ-* items in SPEC |
311
+ | `specCovered` | Requirements with SPEC mapping |
312
+ | `featureCovered` | Requirements with Feature scenarios |
313
+ | `testCovered` | Requirements with test files |
314
+ | `coveragePercent` | Overall coverage percentage |
315
+ | `uncoveredRequirements` | List of missing REQ-* IDs |
316
+
317
+ **Ralph Loop Rules:**
318
+
319
+ | Rule | Description |
320
+ |------|-------------|
321
+ | **No Scope Reduction** | Never say "simplified" or "basic version" - implement FULL request |
322
+ | **Iteration Tracking** | Display `[{{ITER}}]` to show progress (no max β€” loop until done) |
323
+ | **RTM-Based Gap List** | Use `uncoveredRequirements` array - no manual comparison |
324
+ | **Coverage Threshold** | Must reach 100% coverage to complete |
325
+ | **No Iteration Cap** | Loop until 100% coverage OR stuck (convergence detected) |
326
+ | **Stuck Handling** | If coverage % unchanged between iterations β†’ ask user (proceed/abort/fix), or ultrawork β†’ TODO + done |
327
+ | **Diminishing Returns (Narrowing)** | Iteration 3+ β†’ focus on core requirements (REQ-*-001~003) first; P2/P3 requirements continue to loop but lower priority |
328
+
329
+ **Ralph Loop Output Format:**
330
+
331
+ ```
332
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
333
+ πŸ”„ RALPH VERIFICATION [Iteration 1]
334
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
335
+
336
+ πŸ“Š RTM Coverage Report: login
337
+
338
+ Requirements Traceability:
339
+ Total Requirements: 9
340
+ SPEC Covered: 9/9 (100%)
341
+ Feature Covered: 5/9 (55%)
342
+ Test Covered: 4/9 (44%)
343
+
344
+ βœ… REQ-login-001: Login form UI β†’ Scenario 1 β†’ login.test.ts
345
+ βœ… REQ-login-002: Email validation β†’ Scenario 2 β†’ validation.test.ts
346
+ βœ… REQ-login-003: Password validation β†’ Scenario 2 β†’ validation.test.ts
347
+ ❌ REQ-login-004: Remember me checkbox β†’ NOT IMPLEMENTED
348
+ ❌ REQ-login-005: Forgot password link β†’ NOT IMPLEMENTED
349
+ βœ… REQ-login-006: API integration β†’ Scenario 3 β†’ api.test.ts
350
+ ❌ REQ-login-007: Loading state β†’ NOT IMPLEMENTED
351
+ ❌ REQ-login-008: Error toast β†’ NOT IMPLEMENTED
352
+ βœ… REQ-login-009: Session storage β†’ Scenario 4 β†’ (no test)
353
+
354
+ Overall Coverage: 55% ⚠️ BELOW 100% TARGET
355
+
356
+ UNCOVERED REQUIREMENTS (auto-extracted from RTM):
357
+ 1. REQ-login-004: Remember me checkbox
358
+ 2. REQ-login-005: Forgot password link
359
+ 3. REQ-login-007: Loading state
360
+ 4. REQ-login-008: Error toast notifications
361
+
362
+ ⚠️ NOT COMPLETE - Implementing uncovered requirements...
363
+
364
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
365
+ πŸ”„ RALPH VERIFICATION [Iteration 2]
366
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
367
+
368
+ πŸ“Š RTM Coverage Report: login
369
+
370
+ Requirements Traceability:
371
+ Total Requirements: 9
372
+ SPEC Covered: 9/9 (100%)
373
+ Feature Covered: 9/9 (100%)
374
+ Test Covered: 9/9 (100%)
375
+
376
+ Overall Coverage: 100% βœ… TARGET REACHED
377
+
378
+ Build: βœ… Passed
379
+ Tests: βœ… 12/12 Passed
380
+ Type Check: βœ… No errors
381
+
382
+ βœ… RALPH VERIFIED COMPLETE!
383
+
384
+ πŸ“„ RTM saved: .claude/vibe/rtm/login-rtm.md
385
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
386
+ ```
387
+
388
+ **When to Trigger Ralph Loop:**
389
+
390
+ 1. After all phases complete
391
+ 2. Before final quality report
392
+ 3. Whenever user says "ultrawork" or "ralph"
393
+
394
+ **Forbidden Responses (VIOLATIONS):**
395
+
396
+ | ❌ NEVER Say | βœ… Instead |
397
+ |-------------|-----------|
398
+ | "I've implemented a basic version" | Implement the FULL version |
399
+ | "This is a simplified approach" | Implement as specified |
400
+ | "You can add X later" | Add X now |
401
+ | "For demonstration purposes" | Implement production-ready |
402
+ | "The core functionality is done" | ALL functionality must be done |
403
+
404
+ ### ULTRAWORK Example
405
+
406
+ ```
407
+ User: /vibe.run "brick-game" ultrawork
408
+
409
+ Claude:
410
+ πŸš€ ULTRAWORK MODE ACTIVATED
411
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
412
+
413
+ πŸ“„ SPEC: .claude/vibe/specs/brick-game.md
414
+ 🎯 4 Phases detected
415
+ ⚑ Boulder Loop: ENABLED (will continue until all phases complete)
416
+ πŸ”„ Auto-retry: ON (loop until 100% or stuck β†’ auto-TODO)
417
+ πŸ’Ύ Context compression: AGGRESSIVE
418
+
419
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
420
+ πŸ”οΈ BOULDER ROLLING... Phase 1/4
421
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
422
+
423
+ ⚑ [PARALLEL] Launching 3 exploration agents...
424
+ βœ… Exploration complete (7.2s)
425
+ πŸ”¨ Implementing...
426
+ βœ… Phase 1 complete
427
+
428
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
429
+ πŸ”οΈ BOULDER ROLLING... Phase 2/4
430
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
431
+
432
+ ⚑ [PARALLEL] Launching 3 exploration agents...
433
+ βœ… Exploration complete (6.8s)
434
+ πŸ”¨ Implementing...
435
+ ❌ Test failed: collision detection
436
+ πŸ”„ Auto-retry [iteration 1]...
437
+ πŸ”¨ Fixing...
438
+ βœ… Phase 2 complete
439
+
440
+ [...continues automatically...]
441
+
442
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
443
+ πŸŽ‰ BOULDER REACHED THE TOP!
444
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
445
+
446
+ βœ… All 4 phases complete
447
+ βœ… All acceptance criteria passed
448
+ βœ… Build succeeded
449
+ βœ… Tests passed
450
+
451
+ ⏱️ Total: 8m 24s
452
+ πŸ“Š Retries: 2
453
+ πŸ’Ύ Context saved: 3 checkpoints
454
+ ```
455
+
456
+ ### Normal vs ULTRAWORK Comparison
457
+
458
+ | Aspect | Normal | ULTRAWORK |
459
+ |--------|--------|-----------|
460
+ | Phase transition | May pause | Auto-continues |
461
+ | On error | Reports and stops | Auto-retries (3x) |
462
+ | Context 70%+ | Warning only | Auto-compress + save |
463
+ | Exploration | Sequential possible | FORCED parallel |
464
+ | Completion | Phase-by-phase | Until ALL done |
465
+
466
+ ---
467
+
468
+ ## Automation Level System
469
+
470
+ Magic keywords in the user input automatically set the **AutomationLevel**, which controls how much the AI self-advances vs. pausing for confirmation.
471
+
472
+ ### Level Definitions
473
+
474
+ | Level | Name | Keyword(s) | Auto-advance | Auto-retry | Stuck Behavior | Parallel Agents | Checkpoints |
475
+ |-------|------|------------|--------------|------------|----------------|-----------------|-------------|
476
+ | L0 | Manual | `manual` | No | No | Ask user every step | No | All |
477
+ | L1 | Guided | `guided`, `verify` | No | No | Ask user on stuck | No | All |
478
+ | L2 | Semi-auto | `quick` (default) | Yes | Yes (low cap: 2) | Ask user after 2 retries | No | Key points |
479
+ | L3 | Auto | `ultrawork`, `ulw` | Yes | Yes (no cap) | Auto-TODO + proceed | Yes | Checkpoint-only |
480
+ | L4 | Full-auto | `ralph`, `ralplan` | Yes | Yes (no cap) | Auto-TODO + proceed | Yes | None |
481
+
482
+ ### Detection Rule
483
+
484
+ The AI detects automation level from word boundaries in the user's input:
485
+
486
+ ```
487
+ /vibe.run "login" β†’ L2 Semi-auto (default)
488
+ /vibe.run "login" ultrawork β†’ L3 Auto
489
+ /vibe.run "login" ralph β†’ L4 Full-auto
490
+ /vibe.run "login" verify β†’ L1 Guided
491
+ ```
492
+
493
+ ### Confirmation Matrix
494
+
495
+ Certain action types require user confirmation depending on the active level:
496
+
497
+ | Action | L0 | L1 | L2 | L3 | L4 |
498
+ |--------|----|----|----|----|-----|
499
+ | `destructive` | confirm | confirm | confirm | confirm | auto |
500
+ | `architecture_choice` | confirm | confirm | confirm | auto | auto |
501
+ | `implementation_scope` | confirm | confirm | confirm | auto | auto |
502
+ | `phase_advance` | confirm | confirm | auto | auto | auto |
503
+ | `fix_strategy` | confirm | confirm | auto | auto | auto |
504
+ | `retry` | confirm | auto | auto | auto | auto |
505
+
506
+ **Rule**: When confirmation is required, pause and display a checkpoint before proceeding.
507
+
508
+ ---
509
+
510
+ ## Interactive Checkpoints
511
+
512
+ Checkpoints are decision gates inserted at critical points in the workflow. At L3/L4, most checkpoints are **auto-resolved** using the default option.
513
+
514
+ ### Checkpoint Types
515
+
516
+ | Type | When It Fires | Default Option |
517
+ |------|--------------|----------------|
518
+ | `requirements_confirm` | Before starting Phase 1 | Confirm (a) |
519
+ | `architecture_choice` | When architecture approach is ambiguous | Clean/balanced (b) |
520
+ | `implementation_scope` | Before any large scope change (6+ files) | Approve (a) |
521
+ | `verification_result` | After each VerificationLoop iteration below threshold | Continue fixing (a) |
522
+ | `fix_strategy` | When critical issues are found during quality gate | Fix all (a) |
523
+
524
+ ### Checkpoint Format
525
+
526
+ When a checkpoint fires, display it in this format:
527
+
528
+ ```
529
+ ──────────────────────────────────────────────────
530
+ CHECKPOINT: Requirements Confirmation
531
+ ──────────────────────────────────────────────────
532
+ Feature: login
533
+
534
+ Requirements:
535
+ 1. User can log in with email and password
536
+ 2. Invalid credentials show an error message
537
+ 3. Remember me persists session for 30 days
538
+
539
+ Options:
540
+ a) Confirm
541
+ Proceed with these requirements as stated.
542
+ b) Revise
543
+ Modify or clarify requirements before proceeding.
544
+ c) Abort
545
+ Cancel this workflow.
546
+
547
+ Default: a
548
+ ──────────────────────────────────────────────────
549
+ ```
550
+
551
+ ### Auto-Resolution (L3/L4)
552
+
553
+ At automation levels L3 and L4, checkpoints that do not require confirmation are auto-resolved:
554
+
555
+ ```
556
+ [AUTO] CHECKPOINT: implementation_scope β†’ option a (Approve) [auto-resolved]
557
+ ```
558
+
559
+ ---
560
+
561
+ ## Rules Reference
562
+
563
+ **Must follow `~/.claude/vibe/rules/` (global):**
564
+
565
+ - `core/development-philosophy.md` - Surgical precision, modify only requested scope
566
+ - `core/quick-start.md` - Korean, DRY, SRP, YAGNI
567
+ - `standards/complexity-metrics.md` - Functions ≀20 lines, nesting ≀3 levels
568
+ - `quality/checklist.md` - Code quality checklist
569
+
570
+ **Language guide:** `~/.claude/vibe/languages/{stack}.md` (global reference)
571
+
572
+ ---
573
+
574
+ ## Coding Guidelines (Mandatory)
575
+
576
+ ### Type Safety: Use Types Explicitly
577
+
578
+ > **Core Principle**: Use types explicitly in every language that has a type system!
579
+
580
+ Type definitions are not just language syntax β€” they are a **core engineering philosophy for simplifying and controlling complex software**.
581
+
582
+ ### Applies to ALL Typed Languages
583
+
584
+ | Category | Languages | Key Principle |
585
+ |----------|-----------|---------------|
586
+ | **Static Typed** | Java, C#, C++, Go, Rust, Swift, Kotlin, Scala | Types = compile-time contracts |
587
+ | **Gradual Typed** | TypeScript, Python (typing), PHP (typed), Ruby (RBS) | Types = optional safety nets |
588
+ | **Functional** | Haskell, OCaml, F#, Elm | Types = logical proofs |
589
+
590
+ ### Universal Anti-Patterns (All Languages)
591
+
592
+ | ❌ Forbidden Pattern | Why | βœ… Instead |
593
+ |---------------------|-----|-----------|
594
+ | Type escape hatches (`any`, `Any`, `Object`, `void*`, `interface{}`) | Loses type info, runtime errors | Concrete types or `unknown` + guards |
595
+ | Type suppression (`@ts-ignore`, `# type: ignore`, `@SuppressWarnings`) | Hides errors | Fix actual type issues |
596
+ | Raw generic types (`List`, `Map` without params) | Loses type safety | `List<User>`, `Map<String, Order>` |
597
+ | Excessive casting (`as`, `(Type)`, `unsafe`) | Bypasses compiler | Type guards or pattern matching |
598
+
599
+ ### Language-Specific Guidelines
600
+
601
+ **TypeScript/JavaScript:**
602
+ ```typescript
603
+ // ❌ BAD
604
+ function process(data: any): any { return data.foo; }
605
+
606
+ // βœ… GOOD
607
+ function process(data: unknown): Result {
608
+ if (isValidData(data)) return data.foo;
609
+ throw new Error('Invalid');
610
+ }
611
+ ```
612
+
613
+ **Python:**
614
+ ```python
615
+ # ❌ BAD
616
+ def process(data: Any) -> Any: return data["key"]
617
+
618
+ # βœ… GOOD
619
+ def process(data: UserData) -> str: return data["name"]
620
+ ```
621
+
622
+ **Java/Kotlin:**
623
+ ```java
624
+ // ❌ BAD
625
+ List items = new ArrayList(); // Raw type
626
+ Object data = getData(); // Lost type info
627
+
628
+ // βœ… GOOD
629
+ List<User> users = new ArrayList<>();
630
+ User user = getUser();
631
+ ```
632
+
633
+ **Go:**
634
+ ```go
635
+ // ❌ BAD
636
+ func process(data interface{}) interface{} { ... }
637
+
638
+ // βœ… GOOD
639
+ func process(data UserRequest) (UserResponse, error) { ... }
640
+ ```
641
+
642
+ **Rust:**
643
+ ```rust
644
+ // ❌ BAD (unnecessary unsafe or Box<dyn Any>)
645
+ let data: Box<dyn Any> = get_data();
646
+
647
+ // βœ… GOOD
648
+ let data: UserData = get_data()?;
649
+ ```
650
+
651
+ **C#:**
652
+ ```csharp
653
+ // ❌ BAD
654
+ object data = GetData();
655
+ dynamic result = Process(data);
656
+
657
+ // βœ… GOOD
658
+ UserData data = GetData();
659
+ Result result = Process(data);
660
+ ```
661
+
662
+ ### Type Safety Rules (Universal)
663
+
664
+ | Rule | Description |
665
+ |------|-------------|
666
+ | **Boundary Validation** | Validate only at system boundaries (API, JSON, user input) |
667
+ | **Internal Trust** | After validation, pass only precise types internally |
668
+ | **No Type Escape** | Never use escape hatches to "fix" type errors |
669
+ | **Explicit Signatures** | Specify types in function/method signatures |
670
+ | **Generics with Params** | Always use generics with type parameters |
671
+
672
+ ### Quality Gate: Type Violations Block Merge
673
+
674
+ | Violation | Action |
675
+ |-----------|--------|
676
+ | Type escape hatches (`any`, `Any`, `Object`, `interface{}`, etc.) | ❌ Block |
677
+ | Type suppression comments | ❌ Block |
678
+ | Raw generic types | ❌ Block |
679
+ | Missing function return types | ⚠️ Warning |
680
+ | Excessive type casting | ⚠️ Warning |
681
+
682
+ ## Description
683
+
684
+ Read PTCF structured SPEC document and execute implementation immediately.
685
+
686
+ > **PLAN, TASKS documents unnecessary** - SPEC is the executable prompt
687
+
688
+ ## Model Orchestration (Intelligent Routing)
689
+
690
+ Automatically select optimal model based on **task complexity analysis**.
691
+
692
+ ### Complexity-Based Model Selection
693
+
694
+ | Complexity Score | Model | When to Use |
695
+ |------------------|-------|-------------|
696
+ | 0-7 (Low) | **Haiku** | Simple fixes, searches, single file changes |
697
+ | 8-19 (Medium) | **Sonnet** | Standard features, 3-5 files, integrations |
698
+ | 20+ (High) | **Opus** | Architecture, security, multi-service, 6+ files |
699
+
700
+ ### Complexity Signals
701
+
702
+ The following signals increase complexity score:
703
+
704
+ | Signal | Score |
705
+ |--------|-------|
706
+ | Architecture change | +15 |
707
+ | Security implication | +12 |
708
+ | Multi-service | +8 |
709
+ | Refactoring | +12 |
710
+ | 6+ files | +15 |
711
+ | 3-5 files | +8 |
712
+ | New feature | +5 |
713
+ | Bug fix | -3 |
714
+ | Documentation | -5 |
715
+
716
+ ### Agent Tier System
717
+
718
+ Each agent has tier variants for cost optimization:
719
+
720
+ | Agent | Low (Haiku) | Medium (Sonnet) | High (Opus) |
721
+ |-------|-------------|-----------------|-------------|
722
+ | explorer | explorer-low | explorer-medium | explorer |
723
+ | implementer | implementer-low | implementer-medium | implementer |
724
+ | architect | architect-low | architect-medium | architect |
725
+
726
+ ### Task Calls by Role
727
+
728
+ | Task Type | Model | Task Parameter |
729
+ |-----------|-------|----------------|
730
+ | Simple search | Haiku | `model: "haiku"` |
731
+ | Codebase exploration | Haiku/Sonnet | Auto-selected |
732
+ | Core implementation | Sonnet | `model: "sonnet"` |
733
+ | Test writing | Haiku | `model: "haiku"` |
734
+ | Architecture decisions | Opus | Main session |
735
+ | Final review | Opus | Main session |
736
+
737
+ ### External LLM Usage (When Enabled)
738
+
739
+ When external LLMs are enabled in `.claude/vibe/config.json`:
740
+
741
+ | Role | Method | Condition |
742
+ |------|--------|-----------|
743
+ | User direct query | `gpt.question`, `gemini.question` | Hook auto-handles |
744
+ | Internal orchestration | Call global script via Bash | Claude calls directly |
745
+
746
+ **User questions (Hook auto-handles):**
747
+ - `gpt.question` - GPT architecture consultation
748
+ - `gemini.question` - Gemini Q&A/consultation
749
+
750
+ **Claude internal calls (directly via Bash):**
751
+ ```bash
752
+ # Usage: node llm-orchestrate.js <provider> <mode> [systemPrompt] [prompt]
753
+ # - If systemPrompt omitted, uses default
754
+ # - If systemPrompt is "-", uses default and treats next argument as prompt
755
+
756
+ # [LLM_SCRIPT] = {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js
757
+
758
+ # GPT call (short prompt - CLI arg)
759
+ node "[LLM_SCRIPT]" gpt orchestrate-json "[question content]"
760
+
761
+ # Gemini call
762
+ node "[LLM_SCRIPT]" gemini orchestrate-json "[question content]"
763
+
764
+ # Custom system prompt usage
765
+ node "[LLM_SCRIPT]" gpt orchestrate-json "You are a code reviewer" "[question content]"
766
+
767
+ # Long prompt - use --input file (write JSON file first with Write tool)
768
+ # JSON format: {"prompt": "your prompt here"}
769
+ node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/input.json"
770
+ ```
771
+
772
+ ### External LLM Fallback
773
+
774
+ **IMPORTANT**: When GPT/Gemini hook fails, Claude MUST handle the task directly:
775
+
776
+ **Fallback behavior**:
777
+ - Do NOT retry the external LLM call
778
+ - Claude handles the task using its own capabilities
779
+ - Continue with the implementation without interruption
780
+ - Log the fallback but don't block progress
781
+
782
+ ## Core Tools (Semantic Analysis & Memory)
783
+
784
+ Use core tools for accurate codebase understanding and session continuity.
785
+
786
+ ### Tool Invocation
787
+
788
+ All tools are called via:
789
+ ```bash
790
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.TOOL_NAME({...args}).then(r => console.log(r.content[0].text)))"
791
+ ```
792
+
793
+ ### Semantic Analysis Tools
794
+
795
+ | Tool | Purpose | Usage |
796
+ |------|---------|-------|
797
+ | `findSymbol` | Find symbol definitions | `{symbolName: 'functionName', searchPath: '.'}` |
798
+ | `findReferences` | Find all references | `{symbolName: 'functionName', searchPath: '.'}` |
799
+ | `analyzeComplexity` | Analyze code complexity | `{filePath: 'src/file.ts'}` |
800
+ | `validateCodeQuality` | Validate code quality | `{filePath: 'src/file.ts'}` |
801
+
802
+ **Example - Find symbol:**
803
+ ```bash
804
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.findSymbol({symbolName: 'login', searchPath: '.'}).then(r => console.log(r.content[0].text)))"
805
+ ```
806
+
807
+ ### Memory Tools
808
+
809
+ | Tool | Purpose | Usage |
810
+ |------|---------|-------|
811
+ | `saveMemory` | Save important decisions | `{key: 'decision-name', value: 'content', category: 'project'}` |
812
+ | `recallMemory` | Recall saved memory | `{key: 'decision-name'}` |
813
+ | `listMemories` | List all memories | `{category: 'project'}` |
814
+
815
+ **Example - Save important decision:**
816
+ ```bash
817
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.saveMemory({key: 'auth-pattern', value: 'Using JWT with refresh tokens', category: 'project'}).then(r => console.log(r.content[0].text)))"
818
+ ```
819
+
820
+ ### Session Management (Auto via Hooks)
821
+
822
+ - **Session start**: Hook auto-calls `startSession` to restore previous context
823
+ - **Context 80%+**: Hook auto-calls `autoSaveContext` to preserve state
824
+
825
+ ## Process
826
+
827
+ ### 1. Load SPEC + Feature
828
+
829
+ **Search order (check BOTH file AND folder):**
830
+
831
+ ```
832
+ Step 1: Check if SPLIT structure exists (folder)
833
+ πŸ“ .claude/vibe/specs/{feature-name}/ β†’ Folder with _index.md + phase files
834
+ πŸ“ .claude/vibe/features/{feature-name}/ β†’ Folder with _index.feature + phase files
835
+
836
+ Step 2: If no folder, check single file
837
+ πŸ“„ .claude/vibe/specs/{feature-name}.md β†’ Single SPEC file
838
+ πŸ“„ .claude/vibe/features/{feature-name}.feature β†’ Single Feature file
839
+
840
+ Step 3: If neither exists β†’ Error
841
+ ```
842
+
843
+ **Split structure (folder) detected:**
844
+ ```
845
+ πŸ“ .claude/vibe/specs/{feature-name}/
846
+ β”œβ”€β”€ _index.md β†’ Master SPEC (read first for overview)
847
+ β”œβ”€β”€ phase-1-{name}.md β†’ Phase 1 SPEC
848
+ β”œβ”€β”€ phase-2-{name}.md β†’ Phase 2 SPEC
849
+ └── ...
850
+
851
+ πŸ“ .claude/vibe/features/{feature-name}/
852
+ β”œβ”€β”€ _index.feature β†’ Master Feature (read first for scenario overview)
853
+ β”œβ”€β”€ phase-1-{name}.feature β†’ Phase 1 scenarios
854
+ β”œβ”€β”€ phase-2-{name}.feature β†’ Phase 2 scenarios
855
+ └── ...
856
+
857
+ β†’ Load _index.md first, then load phase files in order
858
+ β†’ Execute phases sequentially (or per --phase flag)
859
+ ```
860
+
861
+ **Single file detected:**
862
+ ```
863
+ πŸ“„ .claude/vibe/specs/{feature-name}.md β†’ SPEC (structure, constraints, context)
864
+ πŸ“„ .claude/vibe/features/{feature-name}.feature β†’ Feature (scenario = implementation unit)
865
+ ```
866
+
867
+ **Error if NEITHER file NOR folder found:**
868
+ ```
869
+ ❌ SPEC not found. Searched:
870
+ - .claude/vibe/specs/{feature-name}/ (folder)
871
+ - .claude/vibe/specs/{feature-name}.md (file)
872
+
873
+ Run /vibe.spec "{feature-name}" first.
874
+ ```
875
+
876
+ ### 1-1. Phase Isolation Protocol (Large SPEC Guard)
877
+
878
+ > **Problem**: Large SPECs (3+ phases, 5+ scenarios) overflow context β€” agent drifts from SPEC by Phase 3.
879
+ > **Solution**: Load only the current phase's SPEC section. Re-anchor before each scenario.
880
+
881
+ **Phase Isolation Rules (MANDATORY for 3+ phases):**
882
+
883
+ ```
884
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
885
+ β”‚ PHASE ISOLATION PROTOCOL β”‚
886
+ β”‚ β”‚
887
+ β”‚ ❌ WRONG: Load entire SPEC β†’ implement all phases β”‚
888
+ β”‚ βœ… RIGHT: Load _index overview β†’ per-phase load β†’ implement β”‚
889
+ β”‚ β”‚
890
+ β”‚ Step A: Read _index.md (overview only β€” phase list, REQ IDs) β”‚
891
+ β”‚ Step B: For each Phase N: β”‚
892
+ β”‚ 1. RE-READ Phase N SPEC section (every time, no memory) β”‚
893
+ β”‚ 2. RE-READ Phase N Feature scenarios β”‚
894
+ β”‚ 3. Extract Phase N scope: files, scenarios, requirements β”‚
895
+ β”‚ 4. Implement Phase N scenarios β”‚
896
+ β”‚ 5. Verify Phase N β”‚
897
+ β”‚ 6. Write Phase Checkpoint β†’ .claude/vibe/checkpoints/ β”‚
898
+ β”‚ 7. DISCARD Phase N details from working memory β”‚
899
+ β”‚ Step C: Next Phase β€” go to Step B β”‚
900
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
901
+ ```
902
+
903
+ **Phase Checkpoint Format** (`.claude/vibe/checkpoints/{feature}-phase-{N}.md`):
904
+
905
+ ```markdown
906
+ # Checkpoint: {feature} Phase {N}
907
+
908
+ ## Completed
909
+ - Scenario 1: {name} βœ…
910
+ - Scenario 2: {name} βœ…
911
+
912
+ ## Files Changed
913
+ - src/auth.service.ts (added login(), validateToken())
914
+ - src/auth.controller.ts (POST /login, POST /refresh)
915
+
916
+ ## State for Next Phase
917
+ - Auth service exports: login(), logout(), validateToken(), refreshToken()
918
+ - JWT secret configured in .env (JWT_SECRET)
919
+ - Test baseline: 12 tests passing
920
+
921
+ ## Remaining Phases
922
+ - Phase {N+1}: {name} β€” {scenario count} scenarios
923
+ - Phase {N+2}: {name} β€” {scenario count} scenarios
924
+ ```
925
+
926
+ **SPEC Re-anchoring (Before EVERY scenario):**
927
+
928
+ ```
929
+ Before implementing Scenario X:
930
+ 1. Re-read the EXACT Given/When/Then from Feature file (not from memory!)
931
+ 2. Compare: "Am I about to implement what the SPEC says, or what I think it says?"
932
+ 3. If single-file SPEC: re-read only the current phase section (use line offsets)
933
+ 4. If split SPEC: re-read only phase-N-{name}.md
934
+ ```
935
+
936
+ **Scope Lock (Per Phase):**
937
+
938
+ ```
939
+ At Phase start, declare:
940
+ MODIFY: [list of files this phase will touch]
941
+ CREATE: [list of files this phase will create]
942
+ DO NOT TOUCH: everything else
943
+
944
+ If implementation requires files outside scope:
945
+ β†’ STOP. Re-read SPEC. Is this actually needed?
946
+ β†’ If yes: add to scope with explicit justification
947
+ β†’ If no: you're drifting. Return to SPEC.
948
+ ```
949
+
950
+ **Context Pressure Handling:**
951
+
952
+ | Context Level | Action |
953
+ |---------------|--------|
954
+ | < 50% | Normal execution |
955
+ | 50-70% | Save checkpoint, trim exploration results |
956
+ | 70%+ | Save checkpoint β†’ `/new` β†’ resume from checkpoint |
957
+ | Phase boundary | Always save checkpoint regardless of context level |
958
+
959
+ ### 1-2. SPEC-First Gate (Level 3: Spec = Source of Truth)
960
+
961
+ > **Principle**: SPEC is the source of truth for code. To modify code, update the SPEC first.
962
+
963
+ **When a change not in the SPEC is needed during implementation:**
964
+
965
+ ```
966
+ Discovery during implementation: "An API endpoint not in SPEC is needed"
967
+ β”‚
968
+ β”œβ”€ Already in SPEC?
969
+ β”‚ YES β†’ Implement as-is
970
+ β”‚
971
+ β”œβ”€ Not in SPEC but within SPEC scope?
972
+ β”‚ YES β†’ Add to SPEC first (Edit tool β†’ SPEC file)
973
+ β”‚ β†’ Add corresponding scenario to Feature file
974
+ β”‚ β†’ Then implement
975
+ β”‚
976
+ └─ Outside SPEC scope?
977
+ YES β†’ Record as TODO and exclude from current scope
978
+ .claude/vibe/todos/out-of-scope-{item}.md
979
+ ```
980
+
981
+ **Required when changing SPEC:**
982
+
983
+ 1. Update REQ-* IDs in SPEC file (add new requirements)
984
+ 2. Add corresponding scenarios to Feature file
985
+ 3. New REQ-* must be traceable in RTM after implementation
986
+
987
+ **Reverse direction also applies β€” when requirements change from code:**
988
+
989
+ ```
990
+ Test failure β†’ "Is this behavior correct?"
991
+ β”‚
992
+ β”œβ”€ Check SPEC β†’ If SPEC is correct, fix the code
993
+ β”‚
994
+ └─ If SPEC is wrong β†’ Fix SPEC first β†’ Then fix code
995
+ (Changing code without updating SPEC causes SPEC ↔ code drift)
996
+ ```
997
+
998
+ **Extended Git commit rules:**
999
+
1000
+ - SPEC changes and code changes must be in the same commit
1001
+ - Committing feature code without SPEC changes β†’ warning (except intentional refactoring)
1002
+
1003
+ ### 2. Extract Scenario List
1004
+
1005
+ Extract all Scenarios from Feature file:
1006
+
1007
+ ```markdown
1008
+ ## Scenarios to Implement
1009
+
1010
+ | # | Scenario | Status |
1011
+ |---|----------|--------|
1012
+ | 1 | Valid login success | ⬜ |
1013
+ | 2 | Invalid password error | ⬜ |
1014
+ | 3 | Email format validation | ⬜ |
1015
+ | 4 | Password reset link | ⬜ |
1016
+
1017
+ Total: 4 scenarios
1018
+ ```
1019
+
1020
+ ### 3. Scenario-by-Scenario Implementation (Core)
1021
+
1022
+ **For each scenario**:
1023
+
1024
+ ```
1025
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1026
+ 🎯 Scenario 1/4: Valid login success
1027
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1028
+
1029
+ Given: User is registered
1030
+ When: Login with valid email and password
1031
+ Then: Login success + JWT token returned
1032
+
1033
+ [Step 1] Analyzing implementation...
1034
+ - Required files: auth.service.ts, login.controller.ts
1035
+ - Exploring related code...
1036
+
1037
+ [Step 2] Implementing...
1038
+ βœ… auth.service.ts - Added login() method
1039
+ βœ… login.controller.ts - POST /login endpoint
1040
+
1041
+ [Step 3] Verifying...
1042
+ βœ… Given: Test user creation possible
1043
+ βœ… When: Login API call succeeded
1044
+ βœ… Then: JWT token return confirmed
1045
+
1046
+ βœ… Scenario 1 passed!
1047
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1048
+ ```
1049
+
1050
+ **On failure**:
1051
+
1052
+ ```
1053
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1054
+ 🎯 Scenario 2/4: Invalid password error
1055
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1056
+
1057
+ [Step 3] Verifying...
1058
+ βœ… Given: Test user exists
1059
+ βœ… When: Login attempt with wrong password
1060
+ ❌ Then: "Invalid credentials" error message
1061
+ Actual: "Error occurred" returned
1062
+
1063
+ [Auto-fix iteration 1]
1064
+ Cause: Error message not properly set
1065
+ Fix: auth.service.ts line 42
1066
+
1067
+ [Re-verify]
1068
+ βœ… Then: "Invalid credentials" error message
1069
+
1070
+ βœ… Scenario 2 passed! (1 fix)
1071
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1072
+ ```
1073
+
1074
+ ---
1075
+
1076
+ ## **CRITICAL: Parallel Sub-Agent Execution**
1077
+
1078
+ > **MUST USE PARALLEL TASK CALLS** - This is REQUIRED, not optional.
1079
+ > Sequential execution when parallel is possible = VIOLATION of this workflow.
1080
+
1081
+ ### Codex 병렬 κ΅¬ν˜„ (Codex ν”ŒλŸ¬κ·ΈμΈ ν™œμ„±ν™” μ‹œ)
1082
+
1083
+ > **ν™œμ„±ν™” 쑰건**: Codex ν”ŒλŸ¬κ·ΈμΈ μ„€μΉ˜ + 독립적인 μ‹œλ‚˜λ¦¬μ˜€ 2개 이상
1084
+ > λ―Έμ„€μΉ˜ μ‹œ κΈ°μ‘΄ Claude μ„œλΈŒμ—μ΄μ „νŠΈ λ°©μ‹μœΌλ‘œ λ™μž‘.
1085
+
1086
+ 독립적인 μ‹œλ‚˜λ¦¬μ˜€(파일 μ˜μ‘΄μ„± μ—†μŒ)λ₯Ό Codex에 μœ„μž„ν•˜μ—¬ Claude와 **병렬 κ΅¬ν˜„**:
1087
+
1088
+ ```
1089
+ /codex:rescue "Implement scenario: {scenario-name}. Files: {file-list}. Requirements: {requirements-summary}" --background
1090
+ ```
1091
+
1092
+ - ClaudeλŠ” λ‹€μŒ μ‹œλ‚˜λ¦¬μ˜€λ₯Ό **λ™μ‹œμ—** κ΅¬ν˜„
1093
+ - Codex μ™„λ£Œ μ‹œ `/codex:result`둜 κ²°κ³Ό 확인
1094
+ - 좩돌 λ°œμƒ μ‹œ Claudeκ°€ merge νŒλ‹¨
1095
+
1096
+ **μœ„μž„ κΈ°μ€€**:
1097
+ - μ‹œλ‚˜λ¦¬μ˜€ κ°„ 파일 μ˜μ‘΄μ„± μ—†μŒ (독립적)
1098
+ - μ‹œλ‚˜λ¦¬μ˜€ λ³΅μž‘λ„ 쀑간 μ΄ν•˜
1099
+ - μ˜μ‘΄μ„± μžˆλŠ” μ‹œλ‚˜λ¦¬μ˜€λŠ” Claudeκ°€ 직접 κ΅¬ν˜„
1100
+
1101
+ ### Mandatory Parallel Exploration (Phase Start)
1102
+
1103
+ **BEFORE any implementation, you MUST launch these Task calls IN PARALLEL (single message, multiple tool calls):**
1104
+
1105
+ ```
1106
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1107
+ β”‚ STEP 1: PARALLEL EXPLORATION (REQUIRED) β”‚
1108
+ β”‚ β”‚
1109
+ β”‚ Launch ALL of these in ONE message: β”‚
1110
+ β”‚ β”‚
1111
+ β”‚ Task(haiku) ─┬─→ "Analyze related files in <context>" β”‚
1112
+ β”‚ β”‚ β”‚
1113
+ β”‚ Task(haiku) ─┼─→ "Check dependencies and imports" β”‚
1114
+ β”‚ β”‚ β”‚
1115
+ β”‚ Task(haiku) ─┴─→ "Find existing patterns and conventions" β”‚
1116
+ β”‚ β”‚
1117
+ β”‚ [If GPT enabled] Bash: node "[LLM_SCRIPT]" gpt-codex orchestrate-json "[question]"
1118
+ β”‚ [If Gemini enabled] Bash: node "[LLM_SCRIPT]" gemini orchestrate-json "[question]"
1119
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1120
+ β”‚
1121
+ ↓ (wait for all to complete)
1122
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1123
+ β”‚ STEP 2: SYNTHESIZE (Opus) β”‚
1124
+ β”‚ - Review all exploration results β”‚
1125
+ β”‚ - Decide implementation approach β”‚
1126
+ β”‚ - Identify files to modify/create β”‚
1127
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1128
+ β”‚
1129
+ ↓
1130
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1131
+ β”‚ STEP 3: IMPLEMENT + BACKGROUND AGENTS (PARALLEL) β”‚
1132
+ β”‚ β”‚
1133
+ β”‚ Main Agent (sonnet): β”‚
1134
+ β”‚ └─→ Execute current phase implementation β”‚
1135
+ β”‚ β”‚
1136
+ β”‚ Background Agents (haiku, run_in_background=true): β”‚
1137
+ β”‚ β”œβ”€β†’ Task: "Prepare Phase N+1 - analyze required files" β”‚
1138
+ β”‚ β”œβ”€β†’ Task: "Pre-generate test cases for current implementation" β”‚
1139
+ β”‚ └─→ Task: "Search for related types/interfaces needed" β”‚
1140
+ β”‚ β”‚
1141
+ β”‚ [ULTRAWORK] All 4 agents run simultaneously! β”‚
1142
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1143
+ β”‚
1144
+ ↓ (main completes, check backgrounds)
1145
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1146
+ β”‚ STEP 4: TEST + PHASE PIPELINING β”‚
1147
+ β”‚ β”‚
1148
+ β”‚ Current Phase: β”‚
1149
+ β”‚ └─→ Task(haiku): Write tests using pre-generated cases β”‚
1150
+ β”‚ β”‚
1151
+ β”‚ Next Phase Prep (from background results): β”‚
1152
+ β”‚ └─→ Already have file analysis, ready to start immediately β”‚
1153
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1154
+ ```
1155
+
1156
+ ### Parallel Task Call Pattern (MUST FOLLOW)
1157
+
1158
+ **Correct - Single message with multiple parallel Tasks:**
1159
+ ```
1160
+ <message>
1161
+ Task(haiku, "Analyze src/components/ for existing patterns")
1162
+ Task(haiku, "Check package.json dependencies")
1163
+ Task(haiku, "Find usage of similar features in codebase")
1164
+ </message>
1165
+ β†’ All 3 run simultaneously, ~3x faster
1166
+ ```
1167
+
1168
+ **WRONG - Sequential calls (DO NOT DO THIS):**
1169
+ ```
1170
+ <message>Task(haiku, "Analyze...")</message>
1171
+ <message>Task(haiku, "Check...")</message>
1172
+ <message>Task(haiku, "Find...")</message>
1173
+ β†’ 3x slower, wastes time
1174
+ ```
1175
+
1176
+ ### Background Agent Pattern (ULTRAWORK) via Orchestrator
1177
+
1178
+ **Launch background agents for next phase via Orchestrator:**
1179
+ ```bash
1180
+ # Start background agent (doesn't block)
1181
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep').then(r => console.log(r.content[0].text)))"
1182
+
1183
+ # Multiple backgrounds in parallel
1184
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(async o => {
1185
+ await Promise.all([
1186
+ o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep'),
1187
+ o.runAgent('Pre-generate test cases for login form', 'test-prep'),
1188
+ o.runAgent('Find existing validation patterns', 'pattern-finder')
1189
+ ]);
1190
+ console.log('All background agents started');
1191
+ })"
1192
+ ```
1193
+
1194
+ **Check background agent status:**
1195
+ ```bash
1196
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => console.log(o.status().content[0].text))"
1197
+ ```
1198
+
1199
+ **Get result when ready:**
1200
+ ```bash
1201
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.getResult('SESSION_ID').then(r => console.log(r.content[0].text)))"
1202
+ ```
1203
+
1204
+ **Why Background Agents Matter:**
1205
+
1206
+ | Without Background | With Background |
1207
+ |--------------------|-----------------|
1208
+ | Phase 1: 60s | Phase 1: 60s (+ backgrounds running) |
1209
+ | Phase 2 prep: 20s | Phase 2 prep: 0s (already done!) |
1210
+ | Phase 2: 60s | Phase 2: 60s |
1211
+ | **Total: 140s** | **Total: 120s** |
1212
+
1213
+ For 5 phases: 4 Γ— 20s saved = **80s faster**
1214
+
1215
+ ### Why Parallel Matters
1216
+
1217
+ | Approach | Time | Cache Benefit |
1218
+ |----------|------|---------------|
1219
+ | Sequential (3 Tasks) | ~30s | Cache cold on each |
1220
+ | **Parallel (3 Tasks)** | **~10s** | **Cache warmed once, shared** |
1221
+
1222
+ core ProjectCache (LRU) caches ts-morph parsing results. Parallel calls share the warmed cache.
1223
+
1224
+ ### UI/UX Design Intelligence (Auto-triggered before Phase 1)
1225
+
1226
+ > **쑰건**: SPEC λ˜λŠ” Feature에 UI/UX ν‚€μ›Œλ“œ 포함 μ‹œ μžλ™ μ‹€ν–‰
1227
+ > **λΉ„ν™œμ„±ν™”**: `.claude/vibe/config.json`에 `"uiUxAnalysis": false` μ„€μ •
1228
+
1229
+ **Phase 1 μ‹œμž‘ μ „, 2개 μ—μ΄μ „νŠΈ μžλ™ μ‹€ν–‰:**
1230
+
1231
+ | Agent | Condition | Role |
1232
+ |-------|-----------|------|
1233
+ | β‘£ ui-stack-implementer | **항상 μ‹€ν–‰** | ν”„λ ˆμž„μ›Œν¬λ³„ μ»΄ν¬λ„ŒνŠΈ κ°€μ΄λ“œλΌμΈ 제곡 |
1234
+ | β‘€ ui-dataviz-advisor | **쑰건뢀** (chart/dashboard/visualization ν‚€μ›Œλ“œ) | 차트/μ‹œκ°ν™” 라이브러리 μΆ”μ²œ |
1235
+
1236
+ **μ‹€ν–‰ 방법:**
1237
+
1238
+ ```text
1239
+ # β‘£ 항상 μ‹€ν–‰ (Haiku)
1240
+ Task(subagent_type="ui-stack-implementer",
1241
+ prompt="Provide implementation guidelines for project '{project}' using {detected_stack}. Use core_ui_stack_search for framework-specific patterns.")
1242
+
1243
+ # β‘€ 쑰건뢀 μ‹€ν–‰ (Haiku) β€” SPEC에 차트/λŒ€μ‹œλ³΄λ“œ/μ‹œκ°ν™” ν‚€μ›Œλ“œ 포함 μ‹œ
1244
+ Task(subagent_type="ui-dataviz-advisor",
1245
+ prompt="Recommend data visualization approach for project '{project}'. Use core_ui_search for chart types and react-performance patterns.")
1246
+ ```
1247
+
1248
+ **λ””μžμΈ μ‹œμŠ€ν…œ μžλ™ μ°Έμ‘°:**
1249
+ - `.claude/vibe/design-system/{project}/MASTER.md` 쑴재 μ‹œ μžλ™ λ‘œλ“œ
1250
+ - κ΅¬ν˜„ μ—μ΄μ „νŠΈκ°€ CSS λ³€μˆ˜, 폰트, 색상 νŒ”λ ˆνŠΈλ₯Ό 직접 μ°Έμ‘°
1251
+ - νŽ˜μ΄μ§€λ³„ μ˜€λ²„λΌμ΄λ“œ `pages/{page}.md` 쑴재 μ‹œ μš°μ„  적용
1252
+
1253
+ ### Phase Execution Flow (ULTRAWORK Pipeline)
1254
+
1255
+ ```
1256
+ Phase N Start
1257
+ β”‚
1258
+ β”œβ”€β†’ [PARALLEL] Task(haiku) Γ— 3: Exploration
1259
+ β”‚ - Related code analysis
1260
+ β”‚ - Dependency check
1261
+ β”‚ - Pattern discovery
1262
+ β”‚
1263
+ ↓ (all complete)
1264
+ β”‚
1265
+ β”œβ”€β†’ Opus: Synthesize and decide
1266
+ β”‚
1267
+ β”œβ”€β†’ [PARALLEL PIPELINE] ←── KEY SPEED OPTIMIZATION
1268
+ β”‚ β”‚
1269
+ β”‚ β”œβ”€β†’ Main: Task(sonnet) Implementation
1270
+ β”‚ β”‚
1271
+ β”‚ └─→ Background (run_in_background=true):
1272
+ β”‚ β”œβ”€β†’ Task(haiku): Phase N+1 file analysis
1273
+ β”‚ β”œβ”€β†’ Task(haiku): Test case preparation
1274
+ β”‚ └─→ Task(haiku): Type/interface lookup
1275
+ β”‚
1276
+ ↓ (main completes)
1277
+ β”‚
1278
+ β”œβ”€β†’ Task(haiku): Tests (uses pre-generated cases)
1279
+ β”‚
1280
+ ↓
1281
+ Phase N Complete
1282
+ β”‚
1283
+ ↓ (Background results ready - NO WAIT for Phase N+1 exploration!)
1284
+ β”‚
1285
+ Phase N+1 Start (IMMEDIATE - exploration already done!)
1286
+ ```
1287
+
1288
+ **Speed Comparison:**
1289
+
1290
+ | Mode | Phase Time | 5 Phases Total |
1291
+ |------|------------|----------------|
1292
+ | Sequential | ~2min/phase | ~10min |
1293
+ | Parallel Exploration | ~1.5min/phase | ~7.5min |
1294
+ | **ULTRAWORK Pipeline** | **~1min/phase** | **~5min** |
1295
+
1296
+ **Why Pipeline is Faster:**
1297
+ - Background agents prepare next phase WHILE current phase implements
1298
+ - No idle time between phases
1299
+ - Test cases pre-generated during implementation
1300
+ - Cache stays warm across parallel tasks
1301
+
1302
+ ---
1303
+
1304
+ ### Agent Teams β€” Dev Team
1305
+
1306
+ > **νŒ€ μ •μ˜**: `agents/teams/dev-team.md` μ°Έμ‘°
1307
+ > μ„€μ •: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` + `teammateMode: in-process` (`~/.claude/settings.json` μ „μ—­ β€” postinstall μžλ™ μ„€μ •)
1308
+
1309
+ **ν™œμ„±ν™” 쑰건 (Dev Team Full β€” 4λͺ…):**
1310
+ - ULTRAWORK λͺ¨λ“œ + 3개 이상 μ‹œλ‚˜λ¦¬μ˜€
1311
+ - λ˜λŠ” λ³΅μž‘λ„ 점수 20+ (High)
1312
+
1313
+ ### Agent Teams β€” Lite Team (Normal Mode)
1314
+
1315
+ > **νŒ€ μ •μ˜**: `agents/teams/lite-team.md` μ°Έμ‘°
1316
+
1317
+ **ν™œμ„±ν™” 쑰건 (Lite Team β€” 3λͺ…):**
1318
+ - 일반 λͺ¨λ“œ + 3개 이상 μ‹œλ‚˜λ¦¬μ˜€
1319
+ - λ³΅μž‘λ„ 점수 8-19 (Medium)
1320
+ - λ‹¨μˆœ κ΅¬ν˜„(1-2 파일, μ‹œλ‚˜λ¦¬μ˜€ 2개 μ΄ν•˜)μ—μ„œλŠ” κΈ°μ‘΄ 병렬 λͺ¨λ“œ μœ μ§€
1321
+
1322
+ **νŒ€ 선택 κΈ°μ€€:**
1323
+
1324
+ | 쑰건 | νŒ€ |
1325
+ |------|-----|
1326
+ | μ‹œλ‚˜λ¦¬μ˜€ 1-2개, 파일 1-2개 | κΈ°μ‘΄ 병렬 λͺ¨λ“œ (νŒ€ μ—†μŒ) |
1327
+ | μ‹œλ‚˜λ¦¬μ˜€ 3개+, 일반 λͺ¨λ“œ | **Lite Team (3λͺ…)** |
1328
+ | ULTRAWORK λ˜λŠ” λ³΅μž‘λ„ 20+ | Dev Team Full (4λͺ…) |
1329
+
1330
+ ### Agent Teams β€” Review Team
1331
+
1332
+ > **νŒ€ μ •μ˜**: `agents/teams/review-debate-team.md` μ°Έμ‘°
1333
+
1334
+ **ν™œμ„±ν™” 쑰건:**
1335
+
1336
+ - `/vibe.review` μ‹€ν–‰ ν›„ P1 λ˜λŠ” P2 이슈 2개 이상 발견 μ‹œ
1337
+ - Agent Teams ν™˜κ²½λ³€μˆ˜ ν™œμ„±ν™” μƒνƒœ
1338
+
1339
+ ### Agent Teams β€” Debug Team
1340
+
1341
+ > **νŒ€ μ •μ˜**: `agents/teams/debug-team.md` μ°Έμ‘°
1342
+
1343
+ **ν™œμ„±ν™” 쑰건:**
1344
+
1345
+ - 동일 λΉŒλ“œ/ν…ŒμŠ€νŠΈ μ‹€νŒ¨ 3회 이상
1346
+ - UltraQA `architecture_question` μƒνƒœ μ§„μž… μ‹œ
1347
+
1348
+ ### Agent Teams β€” Research Team
1349
+
1350
+ > **νŒ€ μ •μ˜**: `agents/teams/research-team.md` μ°Έμ‘°
1351
+
1352
+ **ν™œμ„±ν™” 쑰건:**
1353
+
1354
+ - `/vibe.spec` Step 3 λ¦¬μ„œμΉ˜ 단계
1355
+ - Agent Teams ν™˜κ²½λ³€μˆ˜ ν™œμ„±ν™” μƒνƒœ
1356
+
1357
+ ### Agent Teams β€” Security Team
1358
+
1359
+ > **νŒ€ μ •μ˜**: `agents/teams/security-team.md` μ°Έμ‘°
1360
+
1361
+ **ν™œμ„±ν™” 쑰건:**
1362
+
1363
+ - auth, payment, user-data, crypto κ΄€λ ¨ 파일 λ³€κ²½ 감지 μ‹œ
1364
+ - λ˜λŠ” μˆ˜λ™μœΌλ‘œ `security` ν‚€μ›Œλ“œ μ§€μ • μ‹œ
1365
+
1366
+ ### Agent Teams β€” Migration Team
1367
+
1368
+ > **νŒ€ μ •μ˜**: `agents/teams/migration-team.md` μ°Έμ‘°
1369
+
1370
+ **ν™œμ„±ν™” 쑰건:**
1371
+
1372
+ - package.json μ£Όμš” μ˜μ‘΄μ„± 버전 λ³€κ²½ 감지 μ‹œ
1373
+ - λ˜λŠ” μˆ˜λ™μœΌλ‘œ `migration` ν‚€μ›Œλ“œ μ§€μ • μ‹œ
1374
+
1375
+ ### Agent Teams β€” Fullstack Team
1376
+
1377
+ > **νŒ€ μ •μ˜**: `agents/teams/fullstack-team.md` μ°Έμ‘°
1378
+
1379
+ **ν™œμ„±ν™” 쑰건:**
1380
+
1381
+ - SPEC에 frontend + backend 파일이 λͺ¨λ‘ ν¬ν•¨λœ 경우
1382
+ - λ˜λŠ” μˆ˜λ™μœΌλ‘œ `fullstack` ν‚€μ›Œλ“œ μ§€μ • μ‹œ
1383
+
1384
+ ---
1385
+
1386
+ 1. **Related code analysis**: Task(haiku) explores `<context>` related code
1387
+ 2. **File creation/modification**: Task(sonnet) implements per `<output_format>`
1388
+ 3. **Constraint compliance**: Check `<constraints>`
1389
+ 4. **Run verification**: Execute verification commands
1390
+
1391
+ ### 4. Brand Assets Generation (Optional)
1392
+
1393
+ When starting a **new project** with brand context in SPEC, auto-generate app icons and favicons:
1394
+
1395
+ ```
1396
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1397
+ 🎨 BRAND ASSETS GENERATION
1398
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1399
+
1400
+ [Check] Brand assets exist? β†’ Skip if favicon.ico exists
1401
+ [Check] Gemini API configured? β†’ Required for image generation
1402
+ [Check] SPEC has brand context? β†’ Extract app name, colors, style
1403
+
1404
+ [Generate] Creating app icon with Gemini Image API...
1405
+ - Prompt: "App icon for [AppName], [style], [color]..."
1406
+ - Generated: 512x512 master icon
1407
+
1408
+ [Resize] Creating platform variants...
1409
+ βœ… favicon.ico (16/32/48)
1410
+ βœ… favicon-16x16.png
1411
+ βœ… favicon-32x32.png
1412
+ βœ… apple-touch-icon.png (180x180)
1413
+ βœ… android-chrome-192x192.png
1414
+ βœ… android-chrome-512x512.png
1415
+ βœ… site.webmanifest
1416
+
1417
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1418
+ βœ… Brand assets generated in public/
1419
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1420
+ ```
1421
+
1422
+ **SPEC Brand Context Example:**
1423
+
1424
+ ```xml
1425
+ <context>
1426
+ Brand:
1427
+ - App Name: MyApp
1428
+ - Primary Color: #2F6BFF
1429
+ - Style: Modern, minimalist, flat design
1430
+ - Icon Concept: Abstract geometric shape
1431
+ </context>
1432
+ ```
1433
+
1434
+ **Trigger Conditions:**
1435
+ - First `/vibe.run` execution (no existing icons)
1436
+ - SPEC contains brand/design context
1437
+ - Gemini API key configured (`vibe gemini key <key>`)
1438
+
1439
+ **Manual Generation:**
1440
+ ```bash
1441
+ # [LLM_SCRIPT] = {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js
1442
+ node "[LLM_SCRIPT]" gemini image "App icon for MyApp, primary color #2F6BFF, square format 1:1, simple recognizable design, works well at small sizes, no text or letters, solid or gradient background, modern minimalist" --output "./public/app-icon.png"
1443
+ ```
1444
+
1445
+ ---
1446
+
1447
+ ### 5. Race Code Review (GPT + Gemini) + Auto-Fix (v2.6.9)
1448
+
1449
+ After all scenarios are implemented, **GPT and Gemini review in parallel with cross-validation**:
1450
+
1451
+ > **ULTRAWORK Default**: In ULTRAWORK mode, race review is automatically enabled.
1452
+
1453
+ ```
1454
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1455
+ 🏁 RACE CODE REVIEW (GPT + Gemini)
1456
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1457
+
1458
+ [Step 1] Parallel review execution...
1459
+ β”œβ”€ GPT Codex: Reviewing...
1460
+ └─ Gemini: Reviewing...
1461
+
1462
+ [Step 2] Cross-validation results:
1463
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1464
+ β”‚ Issue β”‚ GPT β”‚ Gemini β”‚ Codex β”‚ Confidenceβ”‚
1465
+ │────────────────────────────────│─────│────────│───────│───────────│
1466
+ β”‚ Timing attack in password β”‚ βœ… β”‚ βœ… β”‚ βœ… β”‚ 100% β†’ P1 β”‚
1467
+ β”‚ Rate limiting missing β”‚ βœ… β”‚ βœ… β”‚ βœ… β”‚ 100% β†’ P1 β”‚
1468
+ β”‚ Magic number usage β”‚ βœ… β”‚ ❌ β”‚ ❌ β”‚ 50% β†’ P2 β”‚
1469
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1470
+
1471
+ Summary: 3 issues (P1: 2, P2: 1)
1472
+
1473
+ [Step 3] Auto-fixing P1/P2 issues...
1474
+ βœ… auth.service.ts:24 - Applied timingSafeEqual (P1)
1475
+ βœ… auth.controller.ts:15 - Added rate limiter (P1)
1476
+ βœ… auth.service.ts:42 - Extracted constant (P2)
1477
+
1478
+ [Step 4] Re-verifying...
1479
+ βœ… Build succeeded
1480
+ βœ… Tests passed
1481
+
1482
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1483
+ βœ… Race review complete! 3 improvements (2 P1, 1 P2)
1484
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1485
+ ```
1486
+
1487
+ **Race Review Invocation (GPT + Gemini in parallel via Bash):**
1488
+
1489
+ **🚨 Use --input file to avoid CLI argument length limits and Windows pipe issues.**
1490
+
1491
+ 1. Save code to review into `[SCRATCHPAD]/review-code.txt` (using Write tool)
1492
+ 2. Write JSON input file `[SCRATCHPAD]/review-input.json` (using Write tool):
1493
+ - `{"prompt": "Review this code for security, performance, and best practices. Return JSON: {issues: [{id, title, description, severity, suggestion}]}. Code: [CODE_CONTENT]"}`
1494
+ - Where `[CODE_CONTENT]` is the code text (properly JSON-escaped inside the prompt string)
1495
+ 3. Script path: `[LLM_SCRIPT]` = `{{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js`
1496
+ 4. Run GPT + Gemini in PARALLEL (two Bash tool calls at once):
1497
+
1498
+ ```bash
1499
+ # GPT review (Bash tool call 1)
1500
+ node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/review-input.json"
1501
+ ```
1502
+
1503
+ ```bash
1504
+ # Gemini review (Bash tool call 2 - run in parallel)
1505
+ node "[LLM_SCRIPT]" gemini orchestrate-json --input "[SCRATCHPAD]/review-input.json"
1506
+ ```
1507
+
1508
+ **Confidence-based Priority:**
1509
+
1510
+ | Confidence | Priority | Action |
1511
+ |------------|----------|--------|
1512
+ | 100% (3/3 or 2/2) | P1 | Auto-fix immediately |
1513
+ | 67% (2/3) | P1 | Auto-fix immediately |
1514
+ | 50% (1/2) or 33% (1/3) | P2 | Auto-fix with review |
1515
+
1516
+ **Fallback handling:**
1517
+ - If one LLM fails β†’ Use remaining LLM results (reduced confidence)
1518
+ - If all fail β†’ Skip and proceed (log warning)
1519
+
1520
+ **Review application rules:**
1521
+
1522
+ | Feedback Type | Action |
1523
+ |---------------|--------|
1524
+ | Security vulnerability (P1) | Auto-fix immediately |
1525
+ | Performance improvement (P1/P2) | Auto-fix immediately |
1526
+ | Best practices (P2) | Auto-fix |
1527
+ | Style/preference (P3) | Apply selectively |
1528
+
1529
+ **Conditions:**
1530
+ - **ULTRAWORK**: Race review enabled by default
1531
+ - **Normal mode**: Use `--race` flag to enable
1532
+ - Must re-verify build/tests after fixes
1533
+
1534
+ ### Codex Code Review (Codex ν”ŒλŸ¬κ·ΈμΈ ν™œμ„±ν™” μ‹œ)
1535
+
1536
+ GPT+Gemini race와 **λ™μ‹œμ—** Codex review μ‹€ν–‰:
1537
+
1538
+ ```
1539
+ /codex:review
1540
+ ```
1541
+
1542
+ κ²°κ³Όλ₯Ό race review ꡐ차 검증에 포함 β€” 3쀑 리뷰:
1543
+
1544
+ ```markdown
1545
+ | Issue | GPT | Gemini | Codex | Confidence |
1546
+ |-------|-----|--------|-------|------------|
1547
+ | {이슈} | βœ…/❌ | βœ…/❌ | βœ…/❌ | {%} |
1548
+ ```
1549
+
1550
+ ### 6. Quality Report (Auto-generated)
1551
+
1552
+ After all scenarios complete + Gemini review, **quality report is auto-generated**:
1553
+
1554
+ ```
1555
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1556
+ β”‚ πŸ“Š QUALITY REPORT: login β”‚
1557
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
1558
+ β”‚ β”‚
1559
+ β”‚ βœ… Scenarios: 4/4 passed β”‚
1560
+ β”‚ β”‚
1561
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
1562
+ β”‚ β”‚ # β”‚ Scenario β”‚ Status β”‚ Retries β”‚ β”‚ β”‚
1563
+ β”‚ │───│───────────────────────────│────────│─────────│ β”‚ β”‚
1564
+ β”‚ β”‚ 1 β”‚ Valid login success β”‚ βœ… β”‚ 0 β”‚ β”‚ β”‚
1565
+ β”‚ β”‚ 2 β”‚ Invalid password error β”‚ βœ… β”‚ 1 β”‚ β”‚ β”‚
1566
+ β”‚ β”‚ 3 β”‚ Email format validation β”‚ βœ… β”‚ 0 β”‚ β”‚ β”‚
1567
+ β”‚ β”‚ 4 β”‚ Password reset link β”‚ βœ… β”‚ 0 β”‚ β”‚ β”‚
1568
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
1569
+ β”‚ β”‚
1570
+ β”‚ πŸ“ˆ Quality score: 94/100 β”‚
1571
+ β”‚ β”‚
1572
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
1573
+ β”‚ β”‚ Item β”‚ Result β”‚ Notes β”‚ β”‚
1574
+ β”‚ │───────────────────│────────│─────────────────────────────│ β”‚
1575
+ β”‚ β”‚ Build β”‚ βœ… β”‚ npm run build succeeded β”‚ β”‚
1576
+ β”‚ β”‚ Tests β”‚ βœ… β”‚ 12/12 passed β”‚ β”‚
1577
+ β”‚ β”‚ Type check β”‚ βœ… β”‚ 0 errors β”‚ β”‚
1578
+ β”‚ β”‚ Complexity β”‚ βœ… β”‚ All functions ≀30 lines β”‚ β”‚
1579
+ β”‚ β”‚ Security β”‚ βœ… β”‚ 0 vulnerabilities β”‚ β”‚
1580
+ β”‚ β”‚ Race review β”‚ βœ… β”‚ 3 improvements applied β”‚ β”‚
1581
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
1582
+ β”‚ β”‚
1583
+ β”‚ ⏱️ Started: {start_time} β”‚
1584
+ β”‚ ⏱️ Completed: {getCurrentTime κ²°κ³Ό} β”‚
1585
+ β”‚ β”‚
1586
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1587
+ ```
1588
+
1589
+ **What users should check**:
1590
+ - Scenario pass rate (4/4 = 100%)
1591
+ - Quality score (94/100)
1592
+ - Build/test status
1593
+
1594
+ **This alone is enough to trust quality.**
1595
+
1596
+ ### 7. Update Feature File
1597
+
1598
+ Auto-update scenario status:
1599
+
1600
+ ```markdown
1601
+ ## Coverage
1602
+
1603
+ | Scenario | SPEC AC | Status |
1604
+ |----------|---------|--------|
1605
+ | Valid login success | AC-1 | βœ… |
1606
+ | Invalid password error | AC-2 | βœ… |
1607
+ | Email format validation | AC-3 | βœ… |
1608
+ | Password reset link | AC-4 | βœ… |
1609
+
1610
+ **Last verified**: 2024-01-15 14:32
1611
+ **Quality score**: 94/100
1612
+ ```
1613
+
1614
+ ## TRUST 5 Principles
1615
+
1616
+ Follow during implementation:
1617
+
1618
+ | Principle | Description |
1619
+ |-----------|-------------|
1620
+ | **T**est-first | Write tests first |
1621
+ | **R**eadable | Clear code |
1622
+ | **U**nified | Consistent style |
1623
+ | **S**ecured | Consider security |
1624
+ | **T**rackable | Logging, monitoring |
1625
+
1626
+ ## Input
1627
+
1628
+ - `.claude/vibe/specs/{feature-name}.md` (PTCF SPEC)
1629
+ - `.claude/vibe/features/{feature-name}.feature` (BDD)
1630
+ - `CLAUDE.md` (project context)
1631
+
1632
+ ## Output
1633
+
1634
+ - Implemented code files
1635
+ - Test files
1636
+ - Updated SPEC document (checkmarks)
1637
+
1638
+ ## Example
1639
+
1640
+ ```
1641
+ User: /vibe.run "login"
1642
+
1643
+ Claude:
1644
+ πŸ“„ Loading SPEC: .claude/vibe/specs/login.md
1645
+ πŸ“„ Loading Feature: .claude/vibe/features/login.feature
1646
+
1647
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1648
+ πŸ“‹ Scenarios to Implement
1649
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1650
+
1651
+ | # | Scenario | Status |
1652
+ |---|----------|--------|
1653
+ | 1 | Valid login success | ⬜ |
1654
+ | 2 | Invalid password error | ⬜ |
1655
+ | 3 | Email format validation | ⬜ |
1656
+ | 4 | Password reset link | ⬜ |
1657
+
1658
+ Total: 4 scenarios
1659
+
1660
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1661
+ 🎯 Scenario 1/4: Valid login success
1662
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1663
+
1664
+ Given: User is registered
1665
+ When: Login with valid email and password
1666
+ Then: Login success + JWT token returned
1667
+
1668
+ ⚑ [PARALLEL] Exploring...
1669
+ βœ… Exploration complete (2.1s)
1670
+
1671
+ πŸ”¨ Implementing...
1672
+ βœ… auth.service.ts - Added login()
1673
+ βœ… auth.controller.ts - POST /login
1674
+
1675
+ πŸ” Verifying...
1676
+ βœ… Given: OK
1677
+ βœ… When: OK
1678
+ βœ… Then: OK
1679
+
1680
+ βœ… Scenario 1 passed!
1681
+
1682
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1683
+ 🎯 Scenario 2/4: Invalid password error
1684
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1685
+
1686
+ πŸ”¨ Implementing...
1687
+ βœ… auth.service.ts - Password validation logic
1688
+
1689
+ πŸ” Verifying...
1690
+ βœ… Given: OK
1691
+ βœ… When: OK
1692
+ ❌ Then: "Invalid credentials" error message
1693
+ Actual: "Error" returned
1694
+
1695
+ πŸ”„ Auto-fix [iteration 1]...
1696
+ Fix: auth.service.ts line 42
1697
+
1698
+ πŸ” Re-verifying...
1699
+ βœ… Then: OK
1700
+
1701
+ βœ… Scenario 2 passed! (1 fix)
1702
+
1703
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1704
+ 🎯 Scenario 3/4: Email format validation
1705
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1706
+
1707
+ πŸ”¨ Implementing...
1708
+ πŸ” Verifying...
1709
+ βœ… Scenario 3 passed!
1710
+
1711
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1712
+ 🎯 Scenario 4/4: Password reset link
1713
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1714
+
1715
+ πŸ”¨ Implementing...
1716
+ πŸ” Verifying...
1717
+ βœ… Scenario 4 passed!
1718
+
1719
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1720
+ πŸ” GEMINI CODE REVIEW
1721
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1722
+
1723
+ πŸ“€ Sending code to Gemini...
1724
+ πŸ“ Gemini feedback:
1725
+ 1. [Security] Need timing attack prevention β†’ Fixing...
1726
+ 2. [Performance] Unnecessary DB call β†’ Fixing...
1727
+
1728
+ βœ… 2 improvements auto-applied
1729
+ πŸ” Re-verifying... βœ… Passed
1730
+
1731
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1732
+ β”‚ πŸ“Š QUALITY REPORT: login β”‚
1733
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
1734
+ β”‚ β”‚
1735
+ β”‚ βœ… Scenarios: 4/4 passed β”‚
1736
+ β”‚ β”‚
1737
+ β”‚ | # | Scenario | Status | Retries | β”‚
1738
+ β”‚ |---|───────────────────────|───────|─────────| β”‚
1739
+ β”‚ | 1 | Valid login success | βœ… | 0 | β”‚
1740
+ β”‚ | 2 | Invalid password error| βœ… | 1 | β”‚
1741
+ β”‚ | 3 | Email format validation| βœ… | 0 | β”‚
1742
+ β”‚ | 4 | Password reset link | βœ… | 0 | β”‚
1743
+ β”‚ β”‚
1744
+ β”‚ πŸ“ˆ Quality score: 94/100 β”‚
1745
+ β”‚ Build: βœ… | Tests: βœ… | Types: βœ… | Gemini: βœ… (2 applied) β”‚
1746
+ β”‚ β”‚
1747
+ β”‚ ⏱️ Started: {start_time} β”‚
1748
+ β”‚ ⏱️ Completed: {getCurrentTime κ²°κ³Ό} β”‚
1749
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
1750
+
1751
+ πŸŽ‰ Implementation complete! All scenarios passed + Gemini review applied.
1752
+
1753
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1754
+ πŸ” AUTO REVIEW (13+ Agents)
1755
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1756
+
1757
+ ⚑ [PARALLEL] 13 expert agents reviewing...
1758
+ - security-reviewer βœ…
1759
+ - performance-reviewer βœ…
1760
+ - architecture-reviewer βœ…
1761
+ - ...
1762
+
1763
+ πŸ“‹ Review results:
1764
+ - P1 Critical: 0
1765
+ - P2 Important: 2
1766
+ - P3 Nice-to-have: 1
1767
+
1768
+ πŸ”§ Auto-fixing P2 issues...
1769
+ 1. [PERF] N+1 query β†’ Fixed
1770
+ 2. [ARCH] Circular dependency β†’ Fixed
1771
+
1772
+ βœ… Auto Review complete! 2 issues auto-resolved.
1773
+ ```
1774
+
1775
+ ### Phase-specific Execution
1776
+
1777
+ ```
1778
+ User: /vibe.run "brick-game" --phase 2
1779
+
1780
+ Claude:
1781
+ πŸ“„ Reading SPEC: .claude/vibe/specs/brick-game.md
1782
+ 🎯 Executing Phase 2 only.
1783
+
1784
+ Phase 2: Game Logic
1785
+ 1. [ ] Paddle movement implementation
1786
+ 2. [ ] Ball physics engine
1787
+ 3. [ ] Brick collision handling
1788
+ 4. [ ] Score system
1789
+ 5. [ ] Game over conditions
1790
+
1791
+ ⚑ Launching parallel exploration...
1792
+ [Task(haiku) Γ— 3 launched in parallel]
1793
+
1794
+ πŸš€ Starting implementation...
1795
+ ```
1796
+
1797
+ ## Error Handling
1798
+
1799
+ On failure:
1800
+ 1. Check error message
1801
+ 2. Review `<constraints>`
1802
+ 3. Fix code and retry
1803
+ 4. If continues to fail, report to user
1804
+
1805
+ ---
1806
+
1807
+ ## Quality Gate (Mandatory)
1808
+
1809
+ ### Implementation Quality Checklist
1810
+
1811
+ Before marking any scenario as complete, ALL items must pass:
1812
+
1813
+ | Category | Check Item | Weight |
1814
+ |----------|------------|--------|
1815
+ | **Functionality** | All Given/When/Then conditions verified | 20% |
1816
+ | **Functionality** | Edge cases handled per scenario | 10% |
1817
+ | **Code Quality** | No `any` types in TypeScript | 10% |
1818
+ | **Code Quality** | Functions ≀30 lines, nesting ≀3 levels | 10% |
1819
+ | **Code Quality** | No hardcoded values (use constants) | 5% |
1820
+ | **Security** | Input validation implemented | 10% |
1821
+ | **Security** | Authentication/authorization checked | 5% |
1822
+ | **Error Handling** | Try-catch or error states present | 10% |
1823
+ | **Error Handling** | User-friendly error messages | 5% |
1824
+ | **Testing** | Unit tests exist for core logic | 10% |
1825
+ | **Performance** | No N+1 queries or unnecessary loops | 5% |
1826
+
1827
+ ### Quality Score Calculation
1828
+
1829
+ ```
1830
+ Score = Ξ£(checked items Γ— weight) / 100
1831
+
1832
+ Grades:
1833
+ - 95-100: βœ… EXCELLENT - Ready to merge
1834
+ - 90-94: ⚠️ GOOD - Minor improvements required before merge
1835
+ - 80-89: ⚠️ FAIR - Significant improvements required
1836
+ - 0-79: ❌ POOR - Major fixes needed
1837
+ ```
1838
+
1839
+ ### Quality Gate Thresholds
1840
+
1841
+ | Gate | Minimum Score | Condition |
1842
+ |------|---------------|-----------|
1843
+ | **Scenario Complete** | 95 | Each scenario must score β‰₯95 |
1844
+ | **Phase Complete** | 95 | Average of all scenarios β‰₯95 |
1845
+ | **Feature Complete** | 95 | All phases complete + Gemini review |
1846
+
1847
+ ### Auto-Fix Triggers
1848
+
1849
+ | Issue Type | Auto-Fix Action |
1850
+ |------------|-----------------|
1851
+ | Missing error handling | Add try-catch wrapper |
1852
+ | Hardcoded values | Extract to constants file |
1853
+ | Missing input validation | Add validation schema |
1854
+ | Function too long | Suggest split points |
1855
+ | N+1 query detected | Add eager loading |
1856
+
1857
+ ### Auto-Fix μ‹€νŒ¨ μ‹œ Codex Rescue (Codex ν”ŒλŸ¬κ·ΈμΈ ν™œμ„±ν™” μ‹œ)
1858
+
1859
+ P1 auto-fixκ°€ **3회 μ‹€νŒ¨** μ‹œ, Codex에 μœ„μž„:
1860
+
1861
+ ```
1862
+ /codex:rescue "Fix P1 issue: {issue-description}. File: {file-path}. Error: {error-message}"
1863
+ ```
1864
+
1865
+ Codex μˆ˜μ • μ™„λ£Œ ν›„ μž¬κ²€μ¦. Codex도 μ‹€νŒ¨ μ‹œ TODO νŒŒμΌμ— 기둝.
1866
+
1867
+ ### Forbidden Patterns (Block Merge)
1868
+
1869
+ | Pattern | Why Forbidden | Detection |
1870
+ |---------|---------------|-----------|
1871
+ | `console.log` | Debug code in production | Regex scan |
1872
+ | `// TODO` without issue | Untracked work | Comment scan |
1873
+ | `any` type | Type safety bypass | TypeScript check |
1874
+ | `@ts-ignore` | Type error suppression | TypeScript check |
1875
+ | Empty catch blocks | Silent error swallowing | AST analysis |
1876
+ | Commented-out code | Dead code | Comment scan |
1877
+
1878
+ ---
1879
+
1880
+ ## Auto-Retrospective (Post-Implementation)
1881
+
1882
+ After ALL phases complete successfully, **automatically** perform a brief retrospective:
1883
+
1884
+ ### Retrospective Template
1885
+
1886
+ ```
1887
+ ## Retrospective: {feature-name}
1888
+
1889
+ ### What Worked
1890
+ - [List effective patterns, tools, approaches used]
1891
+
1892
+ ### What Didn't
1893
+ - [List issues, failures, unexpected blockers]
1894
+
1895
+ ### Key Decisions
1896
+ - [Important architectural or implementation decisions made during this run]
1897
+
1898
+ ### Lessons Learned
1899
+ - [Principle format: "When X, do Y because Z"]
1900
+ ```
1901
+
1902
+ ### Execution Steps
1903
+
1904
+ 1. Generate retrospective based on the implementation session
1905
+ 2. Save to `.claude/vibe/retros/{feature-name}.md`
1906
+ 3. Save key lessons via `core_save_memory` (for cross-session recall)
1907
+ 4. Update `claude-progress.txt` with final status
1908
+
1909
+ **Important:**
1910
+
1911
+ - Keep it concise (under 20 lines)
1912
+ - Focus on **project-specific** insights, not generic knowledge
1913
+ - Only save to memory if the lesson is actionable and non-obvious
1914
+
1915
+ ---
1916
+
1917
+ ## Next Step
1918
+
1919
+ ```
1920
+ /vibe.verify "brick-game"
1921
+ ```
1922
+
1923
+ ---
1924
+
1925
+ ARGUMENTS: $ARGUMENTS