@su-record/vibe 2.5.11 → 2.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +243 -0
- package/LICENSE +21 -21
- package/README.md +262 -262
- package/agents/architect-low.md +41 -41
- package/agents/architect-medium.md +59 -59
- package/agents/architect.md +80 -80
- package/agents/build-error-resolver.md +115 -115
- package/agents/compounder.md +261 -261
- package/agents/diagrammer.md +178 -178
- package/agents/e2e-tester.md +266 -266
- package/agents/explorer-low.md +42 -42
- package/agents/explorer-medium.md +59 -59
- package/agents/explorer.md +48 -48
- package/agents/implementer-low.md +43 -43
- package/agents/implementer-medium.md +52 -52
- package/agents/implementer.md +54 -54
- package/agents/refactor-cleaner.md +143 -143
- package/agents/research/best-practices-agent.md +189 -189
- package/agents/research/codebase-patterns-agent.md +147 -147
- package/agents/research/framework-docs-agent.md +178 -178
- package/agents/research/security-advisory-agent.md +203 -203
- package/agents/review/architecture-reviewer.md +107 -107
- package/agents/review/complexity-reviewer.md +116 -116
- package/agents/review/data-integrity-reviewer.md +88 -88
- package/agents/review/git-history-reviewer.md +103 -103
- package/agents/review/performance-reviewer.md +86 -86
- package/agents/review/python-reviewer.md +150 -150
- package/agents/review/rails-reviewer.md +139 -139
- package/agents/review/react-reviewer.md +144 -144
- package/agents/review/security-reviewer.md +80 -80
- package/agents/review/simplicity-reviewer.md +140 -140
- package/agents/review/test-coverage-reviewer.md +116 -116
- package/agents/review/typescript-reviewer.md +127 -127
- package/agents/searcher.md +54 -54
- package/agents/simplifier.md +120 -120
- package/agents/tester.md +49 -49
- package/agents/ui-previewer.md +129 -129
- package/commands/vibe.analyze.md +356 -356
- package/commands/vibe.reason.md +329 -329
- package/commands/vibe.review.md +326 -326
- package/commands/vibe.run.md +1117 -1051
- package/commands/vibe.spec.md +1058 -1058
- package/commands/vibe.utils.md +353 -296
- package/commands/vibe.verify.md +375 -375
- package/dist/cli/collaborator.js +52 -52
- package/dist/cli/detect.js +32 -32
- package/dist/cli/index.js +102 -102
- package/dist/cli/llm.js +144 -144
- package/dist/cli/mcp.d.ts +49 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/cli/mcp.js +169 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/postinstall.js +180 -2
- package/dist/cli/postinstall.js.map +1 -1
- package/dist/cli/setup/GlobalInstaller.d.ts +24 -0
- package/dist/cli/setup/GlobalInstaller.d.ts.map +1 -0
- package/dist/cli/setup/GlobalInstaller.js +130 -0
- package/dist/cli/setup/GlobalInstaller.js.map +1 -0
- package/dist/cli/setup/LanguageDetector.d.ts +16 -0
- package/dist/cli/setup/LanguageDetector.d.ts.map +1 -0
- package/dist/cli/setup/LanguageDetector.js +49 -0
- package/dist/cli/setup/LanguageDetector.js.map +1 -0
- package/dist/cli/setup/LegacyMigration.d.ts +25 -0
- package/dist/cli/setup/LegacyMigration.d.ts.map +1 -0
- package/dist/cli/setup/LegacyMigration.js +162 -0
- package/dist/cli/setup/LegacyMigration.js.map +1 -0
- package/dist/cli/setup/ProjectSetup.d.ts +30 -0
- package/dist/cli/setup/ProjectSetup.d.ts.map +1 -0
- package/dist/cli/setup/ProjectSetup.js +238 -0
- package/dist/cli/setup/ProjectSetup.js.map +1 -0
- package/dist/cli/setup/index.d.ts +14 -0
- package/dist/cli/setup/index.d.ts.map +1 -0
- package/dist/cli/setup/index.js +18 -0
- package/dist/cli/setup/index.js.map +1 -0
- package/dist/cli/setup.d.ts +10 -77
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +15 -592
- package/dist/cli/setup.js.map +1 -1
- package/dist/lib/DeepInit.d.ts +0 -2
- package/dist/lib/DeepInit.d.ts.map +1 -1
- package/dist/lib/DeepInit.js +24 -26
- package/dist/lib/DeepInit.js.map +1 -1
- package/dist/lib/IterationTracker.d.ts +0 -2
- package/dist/lib/IterationTracker.d.ts.map +1 -1
- package/dist/lib/IterationTracker.js +11 -13
- package/dist/lib/IterationTracker.js.map +1 -1
- package/dist/lib/ModelRouter.d.ts +0 -2
- package/dist/lib/ModelRouter.d.ts.map +1 -1
- package/dist/lib/ModelRouter.js +0 -2
- package/dist/lib/ModelRouter.js.map +1 -1
- package/dist/lib/OrchestrateWorkflow.d.ts +1 -3
- package/dist/lib/OrchestrateWorkflow.d.ts.map +1 -1
- package/dist/lib/OrchestrateWorkflow.js +1 -3
- package/dist/lib/OrchestrateWorkflow.js.map +1 -1
- package/dist/lib/PythonParser.js +108 -108
- package/dist/lib/SkillFrontmatter.d.ts +0 -2
- package/dist/lib/SkillFrontmatter.d.ts.map +1 -1
- package/dist/lib/SkillFrontmatter.js +28 -30
- package/dist/lib/SkillFrontmatter.js.map +1 -1
- package/dist/lib/SkillQualityGate.d.ts +0 -2
- package/dist/lib/SkillQualityGate.d.ts.map +1 -1
- package/dist/lib/SkillQualityGate.js +9 -11
- package/dist/lib/SkillQualityGate.js.map +1 -1
- package/dist/lib/SkillRepository.d.ts +117 -0
- package/dist/lib/SkillRepository.d.ts.map +1 -0
- package/dist/lib/SkillRepository.js +477 -0
- package/dist/lib/SkillRepository.js.map +1 -0
- package/dist/lib/UltraQA.d.ts +0 -2
- package/dist/lib/UltraQA.d.ts.map +1 -1
- package/dist/lib/UltraQA.js +77 -79
- package/dist/lib/UltraQA.js.map +1 -1
- package/dist/lib/gemini-mcp.d.ts +10 -0
- package/dist/lib/gemini-mcp.d.ts.map +1 -0
- package/dist/lib/gemini-mcp.js +353 -0
- package/dist/lib/gemini-mcp.js.map +1 -0
- package/dist/lib/gpt-api.js +4 -4
- package/dist/lib/gpt-mcp.d.ts +10 -0
- package/dist/lib/gpt-mcp.d.ts.map +1 -0
- package/dist/lib/gpt-mcp.js +352 -0
- package/dist/lib/gpt-mcp.js.map +1 -0
- package/dist/lib/llm/auth/ApiKeyManager.d.ts +21 -0
- package/dist/lib/llm/auth/ApiKeyManager.d.ts.map +1 -0
- package/dist/lib/llm/auth/ApiKeyManager.js +43 -0
- package/dist/lib/llm/auth/ApiKeyManager.js.map +1 -0
- package/dist/lib/llm/auth/ConfigManager.d.ts +29 -0
- package/dist/lib/llm/auth/ConfigManager.d.ts.map +1 -0
- package/dist/lib/llm/auth/ConfigManager.js +67 -0
- package/dist/lib/llm/auth/ConfigManager.js.map +1 -0
- package/dist/lib/llm/auth/index.d.ts +25 -0
- package/dist/lib/llm/auth/index.d.ts.map +1 -0
- package/dist/lib/llm/auth/index.js +83 -0
- package/dist/lib/llm/auth/index.js.map +1 -0
- package/dist/lib/llm/index.d.ts +10 -0
- package/dist/lib/llm/index.d.ts.map +1 -0
- package/dist/lib/llm/index.js +12 -0
- package/dist/lib/llm/index.js.map +1 -0
- package/dist/lib/llm/types.d.ts +96 -0
- package/dist/lib/llm/types.d.ts.map +1 -0
- package/dist/lib/llm/types.js +17 -0
- package/dist/lib/llm/types.js.map +1 -0
- package/dist/lib/llm/utils/index.d.ts +6 -0
- package/dist/lib/llm/utils/index.d.ts.map +1 -0
- package/dist/lib/llm/utils/index.js +6 -0
- package/dist/lib/llm/utils/index.js.map +1 -0
- package/dist/lib/llm/utils/retry.d.ts +25 -0
- package/dist/lib/llm/utils/retry.d.ts.map +1 -0
- package/dist/lib/llm/utils/retry.js +72 -0
- package/dist/lib/llm/utils/retry.js.map +1 -0
- package/dist/lib/llm/utils/stream.d.ts +13 -0
- package/dist/lib/llm/utils/stream.d.ts.map +1 -0
- package/dist/lib/llm/utils/stream.js +110 -0
- package/dist/lib/llm/utils/stream.js.map +1 -0
- package/dist/lib/memory/KnowledgeGraph.js +4 -4
- package/dist/lib/memory/MemorySearch.js +20 -20
- package/dist/lib/memory/MemoryStorage.js +64 -64
- package/dist/orchestrator/AgentExecutor.d.ts +23 -0
- package/dist/orchestrator/AgentExecutor.d.ts.map +1 -0
- package/dist/orchestrator/AgentExecutor.js +231 -0
- package/dist/orchestrator/AgentExecutor.js.map +1 -0
- package/dist/orchestrator/AgentManager.d.ts +73 -0
- package/dist/orchestrator/AgentManager.d.ts.map +1 -0
- package/dist/orchestrator/AgentManager.js +184 -0
- package/dist/orchestrator/AgentManager.js.map +1 -0
- package/dist/orchestrator/LLMCluster.d.ts +70 -0
- package/dist/orchestrator/LLMCluster.d.ts.map +1 -0
- package/dist/orchestrator/LLMCluster.js +91 -0
- package/dist/orchestrator/LLMCluster.js.map +1 -0
- package/dist/orchestrator/MultiLlmResearch.d.ts +27 -0
- package/dist/orchestrator/MultiLlmResearch.d.ts.map +1 -0
- package/dist/orchestrator/MultiLlmResearch.js +145 -0
- package/dist/orchestrator/MultiLlmResearch.js.map +1 -0
- package/dist/orchestrator/SessionStore.d.ts +41 -0
- package/dist/orchestrator/SessionStore.d.ts.map +1 -0
- package/dist/orchestrator/SessionStore.js +117 -0
- package/dist/orchestrator/SessionStore.js.map +1 -0
- package/dist/orchestrator/SmartRouter.d.ts +68 -0
- package/dist/orchestrator/SmartRouter.d.ts.map +1 -0
- package/dist/orchestrator/SmartRouter.js +256 -0
- package/dist/orchestrator/SmartRouter.js.map +1 -0
- package/dist/orchestrator/backgroundAgent.d.ts +10 -28
- package/dist/orchestrator/backgroundAgent.d.ts.map +1 -1
- package/dist/orchestrator/backgroundAgent.js +11 -346
- package/dist/orchestrator/backgroundAgent.js.map +1 -1
- package/dist/orchestrator/index.d.ts +3 -0
- package/dist/orchestrator/index.d.ts.map +1 -1
- package/dist/orchestrator/index.js +4 -0
- package/dist/orchestrator/index.js.map +1 -1
- package/dist/orchestrator/orchestrator.d.ts +19 -154
- package/dist/orchestrator/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator/orchestrator.js +90 -514
- package/dist/orchestrator/orchestrator.js.map +1 -1
- package/dist/orchestrator/parallelResearch.d.ts +5 -12
- package/dist/orchestrator/parallelResearch.d.ts.map +1 -1
- package/dist/orchestrator/parallelResearch.js +10 -193
- package/dist/orchestrator/parallelResearch.js.map +1 -1
- package/dist/tools/analytics/getUsageAnalytics.d.ts +10 -0
- package/dist/tools/analytics/getUsageAnalytics.d.ts.map +1 -0
- package/dist/tools/analytics/getUsageAnalytics.js +246 -0
- package/dist/tools/analytics/getUsageAnalytics.js.map +1 -0
- package/dist/tools/analytics/index.d.ts +5 -0
- package/dist/tools/analytics/index.d.ts.map +1 -0
- package/dist/tools/analytics/index.js +5 -0
- package/dist/tools/analytics/index.js.map +1 -0
- package/dist/tools/convention/analyzeComplexity.test.js +115 -115
- package/dist/tools/convention/getCodingGuide.d.ts +7 -0
- package/dist/tools/convention/getCodingGuide.d.ts.map +1 -0
- package/dist/tools/convention/getCodingGuide.js +69 -0
- package/dist/tools/convention/getCodingGuide.js.map +1 -0
- package/dist/tools/convention/validateCodeQuality.test.js +104 -104
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/planning/analyzeRequirements.d.ts +9 -0
- package/dist/tools/planning/analyzeRequirements.d.ts.map +1 -0
- package/dist/tools/planning/analyzeRequirements.js +171 -0
- package/dist/tools/planning/analyzeRequirements.js.map +1 -0
- package/dist/tools/planning/createUserStories.d.ts +9 -0
- package/dist/tools/planning/createUserStories.d.ts.map +1 -0
- package/dist/tools/planning/createUserStories.js +124 -0
- package/dist/tools/planning/createUserStories.js.map +1 -0
- package/dist/tools/planning/featureRoadmap.d.ts +10 -0
- package/dist/tools/planning/featureRoadmap.d.ts.map +1 -0
- package/dist/tools/planning/featureRoadmap.js +207 -0
- package/dist/tools/planning/featureRoadmap.js.map +1 -0
- package/dist/tools/planning/generatePrd.d.ts +11 -0
- package/dist/tools/planning/generatePrd.d.ts.map +1 -0
- package/dist/tools/planning/generatePrd.js +161 -0
- package/dist/tools/planning/generatePrd.js.map +1 -0
- package/dist/tools/planning/index.d.ts +8 -0
- package/dist/tools/planning/index.d.ts.map +1 -0
- package/dist/tools/planning/index.js +8 -0
- package/dist/tools/planning/index.js.map +1 -0
- package/dist/tools/prompt/analyzePrompt.d.ts +7 -0
- package/dist/tools/prompt/analyzePrompt.d.ts.map +1 -0
- package/dist/tools/prompt/analyzePrompt.js +150 -0
- package/dist/tools/prompt/analyzePrompt.js.map +1 -0
- package/dist/tools/prompt/enhancePrompt.d.ts +8 -0
- package/dist/tools/prompt/enhancePrompt.d.ts.map +1 -0
- package/dist/tools/prompt/enhancePrompt.js +110 -0
- package/dist/tools/prompt/enhancePrompt.js.map +1 -0
- package/dist/tools/prompt/enhancePromptGemini.d.ts +8 -0
- package/dist/tools/prompt/enhancePromptGemini.d.ts.map +1 -0
- package/dist/tools/prompt/enhancePromptGemini.js +332 -0
- package/dist/tools/prompt/enhancePromptGemini.js.map +1 -0
- package/dist/tools/prompt/index.d.ts +7 -0
- package/dist/tools/prompt/index.d.ts.map +1 -0
- package/dist/tools/prompt/index.js +7 -0
- package/dist/tools/prompt/index.js.map +1 -0
- package/dist/tools/reasoning/applyReasoningFramework.d.ts +8 -0
- package/dist/tools/reasoning/applyReasoningFramework.d.ts.map +1 -0
- package/dist/tools/reasoning/applyReasoningFramework.js +266 -0
- package/dist/tools/reasoning/applyReasoningFramework.js.map +1 -0
- package/dist/tools/reasoning/index.d.ts +5 -0
- package/dist/tools/reasoning/index.d.ts.map +1 -0
- package/dist/tools/reasoning/index.js +5 -0
- package/dist/tools/reasoning/index.js.map +1 -0
- package/dist/tools/thinking/analyzeProblem.d.ts +7 -0
- package/dist/tools/thinking/analyzeProblem.d.ts.map +1 -0
- package/dist/tools/thinking/analyzeProblem.js +55 -0
- package/dist/tools/thinking/analyzeProblem.js.map +1 -0
- package/dist/tools/thinking/breakDownProblem.d.ts +8 -0
- package/dist/tools/thinking/breakDownProblem.d.ts.map +1 -0
- package/dist/tools/thinking/breakDownProblem.js +145 -0
- package/dist/tools/thinking/breakDownProblem.js.map +1 -0
- package/dist/tools/thinking/createThinkingChain.d.ts +7 -0
- package/dist/tools/thinking/createThinkingChain.d.ts.map +1 -0
- package/dist/tools/thinking/createThinkingChain.js +44 -0
- package/dist/tools/thinking/createThinkingChain.js.map +1 -0
- package/dist/tools/thinking/formatAsPlan.d.ts +9 -0
- package/dist/tools/thinking/formatAsPlan.d.ts.map +1 -0
- package/dist/tools/thinking/formatAsPlan.js +78 -0
- package/dist/tools/thinking/formatAsPlan.js.map +1 -0
- package/dist/tools/thinking/index.d.ts +10 -0
- package/dist/tools/thinking/index.d.ts.map +1 -0
- package/dist/tools/thinking/index.js +10 -0
- package/dist/tools/thinking/index.js.map +1 -0
- package/dist/tools/thinking/stepByStepAnalysis.d.ts +8 -0
- package/dist/tools/thinking/stepByStepAnalysis.d.ts.map +1 -0
- package/dist/tools/thinking/stepByStepAnalysis.js +63 -0
- package/dist/tools/thinking/stepByStepAnalysis.js.map +1 -0
- package/dist/tools/thinking/thinkAloudProcess.d.ts +8 -0
- package/dist/tools/thinking/thinkAloudProcess.d.ts.map +1 -0
- package/dist/tools/thinking/thinkAloudProcess.js +80 -0
- package/dist/tools/thinking/thinkAloudProcess.js.map +1 -0
- package/hooks/hooks.json +222 -222
- package/hooks/scripts/code-check.js +22 -22
- package/hooks/scripts/code-review.js +22 -22
- package/hooks/scripts/complexity.js +22 -22
- package/hooks/scripts/compound.js +23 -23
- package/hooks/scripts/context-save.js +33 -33
- package/hooks/scripts/generate-brand-assets.js +472 -0
- package/hooks/scripts/hud-multiline.js +262 -264
- package/hooks/scripts/hud-status.js +291 -293
- package/hooks/scripts/keyword-detector.js +214 -216
- package/hooks/scripts/llm-orchestrate.js +171 -171
- package/hooks/scripts/post-edit.js +97 -97
- package/hooks/scripts/post-tool-verify.js +210 -212
- package/hooks/scripts/pre-tool-guard.js +125 -127
- package/hooks/scripts/recall.js +22 -22
- package/hooks/scripts/session-start.js +30 -30
- package/hooks/scripts/skill-injector.js +191 -193
- package/hooks/scripts/utils.js +97 -97
- package/languages/csharp-unity.md +515 -515
- package/languages/gdscript-godot.md +470 -470
- package/languages/ruby-rails.md +489 -489
- package/languages/typescript-angular.md +433 -433
- package/languages/typescript-astro.md +416 -416
- package/languages/typescript-electron.md +406 -406
- package/languages/typescript-nestjs.md +524 -524
- package/languages/typescript-svelte.md +407 -407
- package/languages/typescript-tauri.md +365 -365
- package/package.json +83 -83
- package/skills/brand-assets.md +141 -0
- package/skills/commerce-patterns.md +361 -0
- package/skills/context7-usage.md +102 -102
- package/skills/e2e-commerce.md +304 -0
- package/skills/frontend-design.md +92 -0
- package/skills/git-worktree.md +181 -181
- package/skills/parallel-research.md +77 -77
- package/skills/priority-todos.md +239 -239
- package/skills/seo-checklist.md +244 -0
- package/skills/tool-fallback.md +190 -190
- package/skills/vibe-capabilities.md +161 -161
- package/vibe/constitution.md +227 -227
- package/vibe/rules/core/communication-guide.md +98 -98
- package/vibe/rules/core/development-philosophy.md +52 -52
- package/vibe/rules/core/quick-start.md +102 -102
- package/vibe/rules/quality/bdd-contract-testing.md +393 -393
- package/vibe/rules/quality/checklist.md +276 -276
- package/vibe/rules/quality/testing-strategy.md +440 -440
- package/vibe/rules/standards/anti-patterns.md +541 -541
- package/vibe/rules/standards/code-structure.md +291 -291
- package/vibe/rules/standards/complexity-metrics.md +313 -313
- package/vibe/rules/standards/naming-conventions.md +198 -198
- package/vibe/setup.sh +31 -31
- package/vibe/templates/constitution-template.md +252 -252
- package/vibe/templates/contract-backend-template.md +526 -526
- package/vibe/templates/contract-frontend-template.md +599 -599
- package/vibe/templates/feature-template.md +96 -96
- package/vibe/templates/spec-template.md +221 -221
package/commands/vibe.run.md
CHANGED
|
@@ -1,1051 +1,1117 @@
|
|
|
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
|
-
## **Scenario-Driven Development (SDD)**
|
|
24
|
-
|
|
25
|
-
> Automate **Scenario = Implementation = Verification** so even non-developers can trust quality
|
|
26
|
-
|
|
27
|
-
### Core Flow
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
31
|
-
│ SCENARIO-DRIVEN IMPLEMENTATION │
|
|
32
|
-
│ │
|
|
33
|
-
│ Load Feature file │
|
|
34
|
-
│ ↓ │
|
|
35
|
-
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
36
|
-
│ │ Scenario 1: Happy Path │ │
|
|
37
|
-
│ │ Given → When → Then │ │
|
|
38
|
-
│ │ ↓ │ │
|
|
39
|
-
│ │ [Implement] → [Verify immediately] → ✅ Pass │ │
|
|
40
|
-
│ └──────────────────────────────────────────────────────────┘ │
|
|
41
|
-
│ ↓ │
|
|
42
|
-
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
43
|
-
│ │ Scenario 2: Edge Case │ │
|
|
44
|
-
│ │ Given → When → Then │ │
|
|
45
|
-
│ │ ↓ │ │
|
|
46
|
-
│ │ [Implement] → [Verify] → ❌ Fail → [Fix] → ✅ Pass │ │
|
|
47
|
-
│ └──────────────────────────────────────────────────────────┘ │
|
|
48
|
-
│ ↓ │
|
|
49
|
-
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
50
|
-
│ │ Scenario N: ... │ │
|
|
51
|
-
│ │ [Implement] → [Verify immediately] → ✅ Pass │ │
|
|
52
|
-
│ └──────────────────────────────────────────────────────────┘ │
|
|
53
|
-
│ ↓ │
|
|
54
|
-
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
55
|
-
│ │ 📊 QUALITY REPORT │ │
|
|
56
|
-
│ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │ │
|
|
57
|
-
│ │ Scenarios: 5/5 passed ✅ │ │
|
|
58
|
-
│ │ Quality score: 94/100 │ │
|
|
59
|
-
│ │ Build: ✅ | Tests: ✅ │ │
|
|
60
|
-
│ └──────────────────────────────────────────────────────────┘ │
|
|
61
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Scenario = Implementation Unit
|
|
65
|
-
|
|
66
|
-
**Traditional approach (Phase-based)**:
|
|
67
|
-
```
|
|
68
|
-
Phase 1 → Phase 2 → Phase 3 → ... → Verify at the end
|
|
69
|
-
↓
|
|
70
|
-
"Where did it go wrong?"
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**SDD approach (Scenario-based)**:
|
|
74
|
-
```
|
|
75
|
-
Scenario 1 → Implement → Verify ✅
|
|
76
|
-
Scenario 2 → Implement → Verify ✅
|
|
77
|
-
Scenario 3 → Implement → Verify ❌ → Fix → ✅
|
|
78
|
-
...
|
|
79
|
-
All pass = Quality guaranteed
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Automated Verification
|
|
83
|
-
|
|
84
|
-
After implementing each scenario, **automatic verification**:
|
|
85
|
-
|
|
86
|
-
| Verification Item | Auto Check |
|
|
87
|
-
|-------------------|------------|
|
|
88
|
-
| Given (precondition) | State/data preparation confirmed |
|
|
89
|
-
| When (action) | Feature execution possible |
|
|
90
|
-
| Then (result) | Expected result matches |
|
|
91
|
-
| Code quality | Complexity, style, security |
|
|
92
|
-
|
|
93
|
-
### Auto-Fix on Failure
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
Scenario verification failed
|
|
97
|
-
↓
|
|
98
|
-
[Root cause analysis] - Which Then condition failed?
|
|
99
|
-
↓
|
|
100
|
-
[Implement fix] - Fix only that part
|
|
101
|
-
↓
|
|
102
|
-
[Re-verify] - Check again
|
|
103
|
-
↓
|
|
104
|
-
Repeat until pass (max 3 times)
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## **ULTRAWORK Mode** (ulw)
|
|
110
|
-
|
|
111
|
-
> Include `ultrawork` or `ulw` in your command to activate **maximum performance mode**.
|
|
112
|
-
|
|
113
|
-
### What ULTRAWORK Enables
|
|
114
|
-
|
|
115
|
-
When you include `ultrawork` (or `ulw`), ALL of these activate automatically:
|
|
116
|
-
|
|
117
|
-
| Feature | Description |
|
|
118
|
-
|---------|-------------|
|
|
119
|
-
| **Parallel Exploration** | 3+ Task(haiku) agents run simultaneously |
|
|
120
|
-
| **Boulder Loop** | Auto-continues until ALL phases complete |
|
|
121
|
-
| **Context Compression** | Aggressive auto-save at 70%+ context |
|
|
122
|
-
| **No Pause** | Doesn't wait for confirmation between phases |
|
|
123
|
-
| **External LLMs** | Auto-consults GPT/Gemini if enabled |
|
|
124
|
-
| **Error Recovery** | Auto-retries on failure (up to 3 times) |
|
|
125
|
-
|
|
126
|
-
### Boulder Loop (Inspired by Sisyphus)
|
|
127
|
-
|
|
128
|
-
Like Sisyphus rolling the boulder, ULTRAWORK **keeps going until done**:
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
132
|
-
│ BOULDER LOOP (ultrawork) │
|
|
133
|
-
│ │
|
|
134
|
-
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
135
|
-
│ │ Phase 1 │───→│ Phase 2 │───→│ Phase 3 │───→│ Phase N │ │
|
|
136
|
-
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
|
|
137
|
-
│ │ │ │ │ │
|
|
138
|
-
│ ↓ ↓ ↓ ↓ │
|
|
139
|
-
│ [Parallel] [Parallel] [Parallel] [Parallel] │
|
|
140
|
-
│ [Implement] [Implement] [Implement] [Implement] │
|
|
141
|
-
│ [Test] [Test] [Test] [Test] │
|
|
142
|
-
│ │ │ │ │ │
|
|
143
|
-
│ └───────────────┴───────────────┴───────────────┘ │
|
|
144
|
-
│ │ │
|
|
145
|
-
│ ↓ │
|
|
146
|
-
│ ┌──────────────┐ │
|
|
147
|
-
│ │ ALL DONE? │ │
|
|
148
|
-
│ └──────────────┘ │
|
|
149
|
-
│ │ │ │
|
|
150
|
-
│ NO YES │
|
|
151
|
-
│ │ │ │
|
|
152
|
-
│ ↓ ↓ │
|
|
153
|
-
│ [Continue] [🎉 Complete!] │
|
|
154
|
-
│ │
|
|
155
|
-
│ NO STOPPING until acceptance criteria met or error limit hit │
|
|
156
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### ULTRAWORK Example
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
User: /vibe.run "brick-game" ultrawork
|
|
163
|
-
|
|
164
|
-
Claude:
|
|
165
|
-
🚀 ULTRAWORK MODE ACTIVATED
|
|
166
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
167
|
-
|
|
168
|
-
📄 SPEC: .claude/vibe/specs/brick-game.md
|
|
169
|
-
🎯 4 Phases detected
|
|
170
|
-
⚡ Boulder Loop: ENABLED (will continue until all phases complete)
|
|
171
|
-
🔄 Auto-retry: ON (max 3 per phase)
|
|
172
|
-
💾 Context compression: AGGRESSIVE
|
|
173
|
-
|
|
174
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
175
|
-
🏔️ BOULDER ROLLING... Phase 1/4
|
|
176
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
177
|
-
|
|
178
|
-
⚡ [PARALLEL] Launching 3 exploration agents...
|
|
179
|
-
✅ Exploration complete (7.2s)
|
|
180
|
-
🔨 Implementing...
|
|
181
|
-
✅ Phase 1 complete
|
|
182
|
-
|
|
183
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
184
|
-
🏔️ BOULDER ROLLING... Phase 2/4
|
|
185
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
186
|
-
|
|
187
|
-
⚡ [PARALLEL] Launching 3 exploration agents...
|
|
188
|
-
✅ Exploration complete (6.8s)
|
|
189
|
-
🔨 Implementing...
|
|
190
|
-
❌ Test failed: collision detection
|
|
191
|
-
🔄 Auto-retry 1/3...
|
|
192
|
-
🔨 Fixing...
|
|
193
|
-
✅ Phase 2 complete
|
|
194
|
-
|
|
195
|
-
[...continues automatically...]
|
|
196
|
-
|
|
197
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
198
|
-
🎉 BOULDER REACHED THE TOP!
|
|
199
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
200
|
-
|
|
201
|
-
✅ All 4 phases complete
|
|
202
|
-
✅ All acceptance criteria passed
|
|
203
|
-
✅ Build succeeded
|
|
204
|
-
✅ Tests passed
|
|
205
|
-
|
|
206
|
-
⏱️ Total: 8m 24s
|
|
207
|
-
📊 Retries: 2
|
|
208
|
-
💾 Context saved: 3 checkpoints
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Normal vs ULTRAWORK Comparison
|
|
212
|
-
|
|
213
|
-
| Aspect | Normal | ULTRAWORK |
|
|
214
|
-
|--------|--------|-----------|
|
|
215
|
-
| Phase transition | May pause | Auto-continues |
|
|
216
|
-
| On error | Reports and stops | Auto-retries (3x) |
|
|
217
|
-
| Context 70%+ | Warning only | Auto-compress + save |
|
|
218
|
-
| Exploration | Sequential possible | FORCED parallel |
|
|
219
|
-
| Completion | Phase-by-phase | Until ALL done |
|
|
220
|
-
|
|
221
|
-
---
|
|
222
|
-
|
|
223
|
-
## Rules Reference
|
|
224
|
-
|
|
225
|
-
**Must follow `~/.claude/vibe/rules/` (global):**
|
|
226
|
-
|
|
227
|
-
- `core/development-philosophy.md` - Surgical precision, modify only requested scope
|
|
228
|
-
- `core/quick-start.md` - Korean, DRY, SRP, YAGNI
|
|
229
|
-
- `standards/complexity-metrics.md` - Functions ≤20 lines, nesting ≤3 levels
|
|
230
|
-
- `quality/checklist.md` - Code quality checklist
|
|
231
|
-
|
|
232
|
-
**Language guide:** `~/.claude/vibe/languages/{stack}.md` (global reference)
|
|
233
|
-
|
|
234
|
-
## Description
|
|
235
|
-
|
|
236
|
-
Read PTCF structured SPEC document and execute implementation immediately.
|
|
237
|
-
|
|
238
|
-
> **PLAN, TASKS documents unnecessary** - SPEC is the executable prompt
|
|
239
|
-
|
|
240
|
-
## Model Orchestration (Intelligent Routing)
|
|
241
|
-
|
|
242
|
-
Automatically select optimal model based on **task complexity analysis**.
|
|
243
|
-
|
|
244
|
-
### Complexity-Based Model Selection
|
|
245
|
-
|
|
246
|
-
| Complexity Score | Model | When to Use |
|
|
247
|
-
|------------------|-------|-------------|
|
|
248
|
-
| 0-7 (Low) | **Haiku** | Simple fixes, searches, single file changes |
|
|
249
|
-
| 8-19 (Medium) | **Sonnet** | Standard features, 3-5 files, integrations |
|
|
250
|
-
| 20+ (High) | **Opus** | Architecture, security, multi-service, 6+ files |
|
|
251
|
-
|
|
252
|
-
### Complexity Signals
|
|
253
|
-
|
|
254
|
-
The following signals increase complexity score:
|
|
255
|
-
|
|
256
|
-
| Signal | Score |
|
|
257
|
-
|--------|-------|
|
|
258
|
-
| Architecture change | +15 |
|
|
259
|
-
| Security implication | +12 |
|
|
260
|
-
| Multi-service | +8 |
|
|
261
|
-
| Refactoring | +12 |
|
|
262
|
-
| 6+ files | +15 |
|
|
263
|
-
| 3-5 files | +8 |
|
|
264
|
-
| New feature | +5 |
|
|
265
|
-
| Bug fix | -3 |
|
|
266
|
-
| Documentation | -5 |
|
|
267
|
-
|
|
268
|
-
### Agent Tier System
|
|
269
|
-
|
|
270
|
-
Each agent has tier variants for cost optimization:
|
|
271
|
-
|
|
272
|
-
| Agent | Low (Haiku) | Medium (Sonnet) | High (Opus) |
|
|
273
|
-
|-------|-------------|-----------------|-------------|
|
|
274
|
-
| explorer | explorer-low | explorer-medium | explorer |
|
|
275
|
-
| implementer | implementer-low | implementer-medium | implementer |
|
|
276
|
-
| architect | architect-low | architect-medium | architect |
|
|
277
|
-
|
|
278
|
-
### Task Calls by Role
|
|
279
|
-
|
|
280
|
-
| Task Type | Model | Task Parameter |
|
|
281
|
-
|-----------|-------|----------------|
|
|
282
|
-
| Simple search | Haiku | `model: "haiku"` |
|
|
283
|
-
| Codebase exploration | Haiku/Sonnet | Auto-selected |
|
|
284
|
-
| Core implementation | Sonnet | `model: "sonnet"` |
|
|
285
|
-
| Test writing | Haiku | `model: "haiku"` |
|
|
286
|
-
| Architecture decisions | Opus | Main session |
|
|
287
|
-
| Final review | Opus | Main session |
|
|
288
|
-
|
|
289
|
-
### External LLM Usage (When Enabled)
|
|
290
|
-
|
|
291
|
-
When external LLMs are enabled in `.claude/vibe/config.json`:
|
|
292
|
-
|
|
293
|
-
| Role | Method | Condition |
|
|
294
|
-
|------|--------|-----------|
|
|
295
|
-
| User direct query | `gpt.question`, `gemini.question` | Hook auto-handles |
|
|
296
|
-
| Internal orchestration | Call global script via Bash | Claude calls directly |
|
|
297
|
-
|
|
298
|
-
**User questions (Hook auto-handles):**
|
|
299
|
-
- `gpt.question` - GPT architecture consultation
|
|
300
|
-
- `gemini.question` - Gemini Q&A/consultation
|
|
301
|
-
|
|
302
|
-
**Claude internal calls (directly via Bash):**
|
|
303
|
-
```bash
|
|
304
|
-
# Usage: node llm-orchestrate.js <provider> <mode> [systemPrompt] [prompt]
|
|
305
|
-
# - If systemPrompt omitted, uses default
|
|
306
|
-
# - If systemPrompt is "-", uses default and treats next argument as prompt
|
|
307
|
-
|
|
308
|
-
# Cross-platform path (works on Windows/macOS/Linux)
|
|
309
|
-
VIBE_SCRIPTS="$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts"
|
|
310
|
-
|
|
311
|
-
# GPT call
|
|
312
|
-
node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "[question content]"
|
|
313
|
-
|
|
314
|
-
# Gemini call
|
|
315
|
-
node "$VIBE_SCRIPTS/llm-orchestrate.js" gemini orchestrate-json "[question content]"
|
|
316
|
-
|
|
317
|
-
# Custom system prompt usage
|
|
318
|
-
node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "You are a code reviewer" "[question content]"
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
### External LLM Fallback
|
|
322
|
-
|
|
323
|
-
**IMPORTANT**: When GPT/Gemini hook fails, Claude MUST handle the task directly:
|
|
324
|
-
|
|
325
|
-
**Fallback behavior**:
|
|
326
|
-
- Do NOT retry the external LLM call
|
|
327
|
-
- Claude handles the task using its own capabilities
|
|
328
|
-
- Continue with the implementation without interruption
|
|
329
|
-
- Log the fallback but don't block progress
|
|
330
|
-
|
|
331
|
-
## Vibe Tools (Semantic Analysis & Memory)
|
|
332
|
-
|
|
333
|
-
Use vibe tools for accurate codebase understanding and session continuity.
|
|
334
|
-
|
|
335
|
-
### Tool Invocation
|
|
336
|
-
|
|
337
|
-
All tools are called via:
|
|
338
|
-
```bash
|
|
339
|
-
node -e "import('@su-record/vibe/tools').then(t => t.TOOL_NAME({...args}).then(r => console.log(r.content[0].text)))"
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
### Semantic Analysis Tools
|
|
343
|
-
|
|
344
|
-
| Tool | Purpose | Usage |
|
|
345
|
-
|------|---------|-------|
|
|
346
|
-
| `findSymbol` | Find symbol definitions | `{symbolName: 'functionName', searchPath: '.'}` |
|
|
347
|
-
| `findReferences` | Find all references | `{symbolName: 'functionName', searchPath: '.'}` |
|
|
348
|
-
| `analyzeComplexity` | Analyze code complexity | `{filePath: 'src/file.ts'}` |
|
|
349
|
-
| `validateCodeQuality` | Validate code quality | `{filePath: 'src/file.ts'}` |
|
|
350
|
-
|
|
351
|
-
**Example - Find symbol:**
|
|
352
|
-
```bash
|
|
353
|
-
node -e "import('@su-record/vibe/tools').then(t => t.findSymbol({symbolName: 'login', searchPath: '.'}).then(r => console.log(r.content[0].text)))"
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
### Memory Tools
|
|
357
|
-
|
|
358
|
-
| Tool | Purpose | Usage |
|
|
359
|
-
|------|---------|-------|
|
|
360
|
-
| `saveMemory` | Save important decisions | `{key: 'decision-name', value: 'content', category: 'project'}` |
|
|
361
|
-
| `recallMemory` | Recall saved memory | `{key: 'decision-name'}` |
|
|
362
|
-
| `listMemories` | List all memories | `{category: 'project'}` |
|
|
363
|
-
|
|
364
|
-
**Example - Save important decision:**
|
|
365
|
-
```bash
|
|
366
|
-
node -e "import('@su-record/vibe/tools').then(t => t.saveMemory({key: 'auth-pattern', value: 'Using JWT with refresh tokens', category: 'project'}).then(r => console.log(r.content[0].text)))"
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
### Session Management (Auto via Hooks)
|
|
370
|
-
|
|
371
|
-
- **Session start**: Hook auto-calls `startSession` to restore previous context
|
|
372
|
-
- **Context 80%+**: Hook auto-calls `autoSaveContext` to preserve state
|
|
373
|
-
|
|
374
|
-
## Process
|
|
375
|
-
|
|
376
|
-
### 1. Load SPEC + Feature
|
|
377
|
-
|
|
378
|
-
```
|
|
379
|
-
📄 .claude/vibe/specs/{feature-name}.md → SPEC (structure, constraints, context)
|
|
380
|
-
📄 .claude/vibe/features/{feature-name}.feature → Feature (scenario = implementation unit)
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
**Error if Feature file missing**:
|
|
384
|
-
```
|
|
385
|
-
❌ Feature file not found.
|
|
386
|
-
Run /vibe.spec "{feature-name}" first.
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
### 2. Extract Scenario List
|
|
390
|
-
|
|
391
|
-
Extract all Scenarios from Feature file:
|
|
392
|
-
|
|
393
|
-
```markdown
|
|
394
|
-
## Scenarios to Implement
|
|
395
|
-
|
|
396
|
-
| # | Scenario | Status |
|
|
397
|
-
|---|----------|--------|
|
|
398
|
-
| 1 | Valid login success | ⬜ |
|
|
399
|
-
| 2 | Invalid password error | ⬜ |
|
|
400
|
-
| 3 | Email format validation | ⬜ |
|
|
401
|
-
| 4 | Password reset link | ⬜ |
|
|
402
|
-
|
|
403
|
-
Total: 4 scenarios
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
### 3. Scenario-by-Scenario Implementation (Core)
|
|
407
|
-
|
|
408
|
-
**For each scenario**:
|
|
409
|
-
|
|
410
|
-
```
|
|
411
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
412
|
-
🎯 Scenario 1/4: Valid login success
|
|
413
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
414
|
-
|
|
415
|
-
Given: User is registered
|
|
416
|
-
When: Login with valid email and password
|
|
417
|
-
Then: Login success + JWT token returned
|
|
418
|
-
|
|
419
|
-
[Step 1] Analyzing implementation...
|
|
420
|
-
- Required files: auth.service.ts, login.controller.ts
|
|
421
|
-
- Exploring related code...
|
|
422
|
-
|
|
423
|
-
[Step 2] Implementing...
|
|
424
|
-
✅ auth.service.ts - Added login() method
|
|
425
|
-
✅ login.controller.ts - POST /login endpoint
|
|
426
|
-
|
|
427
|
-
[Step 3] Verifying...
|
|
428
|
-
✅ Given: Test user creation possible
|
|
429
|
-
✅ When: Login API call succeeded
|
|
430
|
-
✅ Then: JWT token return confirmed
|
|
431
|
-
|
|
432
|
-
✅ Scenario 1 passed!
|
|
433
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
**On failure**:
|
|
437
|
-
|
|
438
|
-
```
|
|
439
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
440
|
-
🎯 Scenario 2/4: Invalid password error
|
|
441
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
442
|
-
|
|
443
|
-
[Step 3] Verifying...
|
|
444
|
-
✅ Given: Test user exists
|
|
445
|
-
✅ When: Login attempt with wrong password
|
|
446
|
-
❌ Then: "Invalid credentials" error message
|
|
447
|
-
Actual: "Error occurred" returned
|
|
448
|
-
|
|
449
|
-
[Auto-fix 1/3]
|
|
450
|
-
Cause: Error message not properly set
|
|
451
|
-
Fix: auth.service.ts line 42
|
|
452
|
-
|
|
453
|
-
[Re-verify]
|
|
454
|
-
✅ Then: "Invalid credentials" error message
|
|
455
|
-
|
|
456
|
-
✅ Scenario 2 passed! (1 fix)
|
|
457
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
---
|
|
461
|
-
|
|
462
|
-
## **CRITICAL: Parallel Sub-Agent Execution**
|
|
463
|
-
|
|
464
|
-
> **MUST USE PARALLEL TASK CALLS** - This is REQUIRED, not optional.
|
|
465
|
-
> Sequential execution when parallel is possible = VIOLATION of this workflow.
|
|
466
|
-
|
|
467
|
-
### Mandatory Parallel Exploration (Phase Start)
|
|
468
|
-
|
|
469
|
-
**BEFORE any implementation, you MUST launch these Task calls IN PARALLEL (single message, multiple tool calls):**
|
|
470
|
-
|
|
471
|
-
```
|
|
472
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
473
|
-
│ STEP 1: PARALLEL EXPLORATION (REQUIRED) │
|
|
474
|
-
│ │
|
|
475
|
-
│ Launch ALL of these in ONE message: │
|
|
476
|
-
│ │
|
|
477
|
-
│ Task(haiku) ─┬─→ "Analyze related files in <context>" │
|
|
478
|
-
│ │ │
|
|
479
|
-
│ Task(haiku) ─┼─→ "Check dependencies and imports" │
|
|
480
|
-
│ │ │
|
|
481
|
-
│ Task(haiku) ─┴─→ "Find existing patterns and conventions" │
|
|
482
|
-
│ │
|
|
483
|
-
│ [If GPT enabled] Bash: node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gpt orchestrate-json "[question]"
|
|
484
|
-
│ [If Gemini enabled] Bash: node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gemini orchestrate-json "[question]"
|
|
485
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
486
|
-
│
|
|
487
|
-
↓ (wait for all to complete)
|
|
488
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
489
|
-
│ STEP 2: SYNTHESIZE (Opus) │
|
|
490
|
-
│ - Review all exploration results │
|
|
491
|
-
│ - Decide implementation approach │
|
|
492
|
-
│ - Identify files to modify/create │
|
|
493
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
494
|
-
│
|
|
495
|
-
↓
|
|
496
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
497
|
-
│ STEP 3: IMPLEMENT + BACKGROUND AGENTS (PARALLEL) │
|
|
498
|
-
│ │
|
|
499
|
-
│ Main Agent (sonnet): │
|
|
500
|
-
│ └─→ Execute current phase implementation │
|
|
501
|
-
│ │
|
|
502
|
-
│ Background Agents (haiku, run_in_background=true): │
|
|
503
|
-
│ ├─→ Task: "Prepare Phase N+1 - analyze required files" │
|
|
504
|
-
│ ├─→ Task: "Pre-generate test cases for current implementation" │
|
|
505
|
-
│ └─→ Task: "Search for related types/interfaces needed" │
|
|
506
|
-
│ │
|
|
507
|
-
│ [ULTRAWORK] All 4 agents run simultaneously! │
|
|
508
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
509
|
-
│
|
|
510
|
-
↓ (main completes, check backgrounds)
|
|
511
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
512
|
-
│ STEP 4: TEST + PHASE PIPELINING │
|
|
513
|
-
│ │
|
|
514
|
-
│ Current Phase: │
|
|
515
|
-
│ └─→ Task(haiku): Write tests using pre-generated cases │
|
|
516
|
-
│ │
|
|
517
|
-
│ Next Phase Prep (from background results): │
|
|
518
|
-
│ └─→ Already have file analysis, ready to start immediately │
|
|
519
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
520
|
-
```
|
|
521
|
-
|
|
522
|
-
### Parallel Task Call Pattern (MUST FOLLOW)
|
|
523
|
-
|
|
524
|
-
**Correct - Single message with multiple parallel Tasks:**
|
|
525
|
-
```
|
|
526
|
-
<message>
|
|
527
|
-
Task(haiku, "Analyze src/components/ for existing patterns")
|
|
528
|
-
Task(haiku, "Check package.json dependencies")
|
|
529
|
-
Task(haiku, "Find usage of similar features in codebase")
|
|
530
|
-
</message>
|
|
531
|
-
→ All 3 run simultaneously, ~3x faster
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
**WRONG - Sequential calls (DO NOT DO THIS):**
|
|
535
|
-
```
|
|
536
|
-
<message>Task(haiku, "Analyze...")</message>
|
|
537
|
-
<message>Task(haiku, "Check...")</message>
|
|
538
|
-
<message>Task(haiku, "Find...")</message>
|
|
539
|
-
→ 3x slower, wastes time
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
### Background Agent Pattern (ULTRAWORK) via Orchestrator
|
|
543
|
-
|
|
544
|
-
**Launch background agents for next phase via Orchestrator:**
|
|
545
|
-
```bash
|
|
546
|
-
# Start background agent (doesn't block)
|
|
547
|
-
node -e "import('@su-record/vibe/orchestrator').then(o => o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep').then(r => console.log(r.content[0].text)))"
|
|
548
|
-
|
|
549
|
-
# Multiple backgrounds in parallel
|
|
550
|
-
node -e "import('@su-record/vibe/orchestrator').then(async o => {
|
|
551
|
-
await Promise.all([
|
|
552
|
-
o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep'),
|
|
553
|
-
o.runAgent('Pre-generate test cases for login form', 'test-prep'),
|
|
554
|
-
o.runAgent('Find existing validation patterns', 'pattern-finder')
|
|
555
|
-
]);
|
|
556
|
-
console.log('All background agents started');
|
|
557
|
-
})"
|
|
558
|
-
```
|
|
559
|
-
|
|
560
|
-
**Check background agent status:**
|
|
561
|
-
```bash
|
|
562
|
-
node -e "import('@su-record/vibe/orchestrator').then(o => console.log(o.status().content[0].text))"
|
|
563
|
-
```
|
|
564
|
-
|
|
565
|
-
**Get result when ready:**
|
|
566
|
-
```bash
|
|
567
|
-
node -e "import('@su-record/vibe/orchestrator').then(o => o.getResult('SESSION_ID').then(r => console.log(r.content[0].text)))"
|
|
568
|
-
```
|
|
569
|
-
|
|
570
|
-
**Why Background Agents Matter:**
|
|
571
|
-
|
|
572
|
-
| Without Background | With Background |
|
|
573
|
-
|--------------------|-----------------|
|
|
574
|
-
| Phase 1: 60s | Phase 1: 60s (+ backgrounds running) |
|
|
575
|
-
| Phase 2 prep: 20s | Phase 2 prep: 0s (already done!) |
|
|
576
|
-
| Phase 2: 60s | Phase 2: 60s |
|
|
577
|
-
| **Total: 140s** | **Total: 120s** |
|
|
578
|
-
|
|
579
|
-
For 5 phases: 4 × 20s saved = **80s faster**
|
|
580
|
-
|
|
581
|
-
### Why Parallel Matters
|
|
582
|
-
|
|
583
|
-
| Approach | Time | Cache Benefit |
|
|
584
|
-
|----------|------|---------------|
|
|
585
|
-
| Sequential (3 Tasks) | ~30s | Cache cold on each |
|
|
586
|
-
| **Parallel (3 Tasks)** | **~10s** | **Cache warmed once, shared** |
|
|
587
|
-
|
|
588
|
-
vibe ProjectCache (LRU) caches ts-morph parsing results. Parallel calls share the warmed cache.
|
|
589
|
-
|
|
590
|
-
### Phase Execution Flow (ULTRAWORK Pipeline)
|
|
591
|
-
|
|
592
|
-
```
|
|
593
|
-
Phase N Start
|
|
594
|
-
│
|
|
595
|
-
├─→ [PARALLEL] Task(haiku) × 3: Exploration
|
|
596
|
-
│ - Related code analysis
|
|
597
|
-
│ - Dependency check
|
|
598
|
-
│ - Pattern discovery
|
|
599
|
-
│
|
|
600
|
-
↓ (all complete)
|
|
601
|
-
│
|
|
602
|
-
├─→ Opus: Synthesize and decide
|
|
603
|
-
│
|
|
604
|
-
├─→ [PARALLEL PIPELINE] ←── KEY SPEED OPTIMIZATION
|
|
605
|
-
│ │
|
|
606
|
-
│ ├─→ Main: Task(sonnet) Implementation
|
|
607
|
-
│ │
|
|
608
|
-
│ └─→ Background (run_in_background=true):
|
|
609
|
-
│ ├─→ Task(haiku): Phase N+1 file analysis
|
|
610
|
-
│ ├─→ Task(haiku): Test case preparation
|
|
611
|
-
│ └─→ Task(haiku): Type/interface lookup
|
|
612
|
-
│
|
|
613
|
-
↓ (main completes)
|
|
614
|
-
│
|
|
615
|
-
├─→ Task(haiku): Tests (uses pre-generated cases)
|
|
616
|
-
│
|
|
617
|
-
↓
|
|
618
|
-
Phase N Complete
|
|
619
|
-
│
|
|
620
|
-
↓ (Background results ready - NO WAIT for Phase N+1 exploration!)
|
|
621
|
-
│
|
|
622
|
-
Phase N+1 Start (IMMEDIATE - exploration already done!)
|
|
623
|
-
```
|
|
624
|
-
|
|
625
|
-
**Speed Comparison:**
|
|
626
|
-
|
|
627
|
-
| Mode | Phase Time | 5 Phases Total |
|
|
628
|
-
|------|------------|----------------|
|
|
629
|
-
| Sequential | ~2min/phase | ~10min |
|
|
630
|
-
| Parallel Exploration | ~1.5min/phase | ~7.5min |
|
|
631
|
-
| **ULTRAWORK Pipeline** | **~1min/phase** | **~5min** |
|
|
632
|
-
|
|
633
|
-
**Why Pipeline is Faster:**
|
|
634
|
-
- Background agents prepare next phase WHILE current phase implements
|
|
635
|
-
- No idle time between phases
|
|
636
|
-
- Test cases pre-generated during implementation
|
|
637
|
-
- Cache stays warm across parallel tasks
|
|
638
|
-
|
|
639
|
-
---
|
|
640
|
-
|
|
641
|
-
1. **Related code analysis**: Task(haiku) explores `<context>` related code
|
|
642
|
-
2. **File creation/modification**: Task(sonnet) implements per `<output_format>`
|
|
643
|
-
3. **Constraint compliance**: Check `<constraints>`
|
|
644
|
-
4. **Run verification**: Execute verification commands
|
|
645
|
-
|
|
646
|
-
### 4.
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
```
|
|
651
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
652
|
-
|
|
653
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
654
|
-
|
|
655
|
-
[
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
```
|
|
688
|
-
|
|
689
|
-
**
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
│
|
|
734
|
-
│
|
|
735
|
-
│
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
|
780
|
-
|
|
781
|
-
|
|
|
782
|
-
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
[
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
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
|
+
## **Scenario-Driven Development (SDD)**
|
|
24
|
+
|
|
25
|
+
> Automate **Scenario = Implementation = Verification** so even non-developers can trust quality
|
|
26
|
+
|
|
27
|
+
### Core Flow
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
31
|
+
│ SCENARIO-DRIVEN IMPLEMENTATION │
|
|
32
|
+
│ │
|
|
33
|
+
│ Load Feature file │
|
|
34
|
+
│ ↓ │
|
|
35
|
+
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
36
|
+
│ │ Scenario 1: Happy Path │ │
|
|
37
|
+
│ │ Given → When → Then │ │
|
|
38
|
+
│ │ ↓ │ │
|
|
39
|
+
│ │ [Implement] → [Verify immediately] → ✅ Pass │ │
|
|
40
|
+
│ └──────────────────────────────────────────────────────────┘ │
|
|
41
|
+
│ ↓ │
|
|
42
|
+
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
43
|
+
│ │ Scenario 2: Edge Case │ │
|
|
44
|
+
│ │ Given → When → Then │ │
|
|
45
|
+
│ │ ↓ │ │
|
|
46
|
+
│ │ [Implement] → [Verify] → ❌ Fail → [Fix] → ✅ Pass │ │
|
|
47
|
+
│ └──────────────────────────────────────────────────────────┘ │
|
|
48
|
+
│ ↓ │
|
|
49
|
+
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
50
|
+
│ │ Scenario N: ... │ │
|
|
51
|
+
│ │ [Implement] → [Verify immediately] → ✅ Pass │ │
|
|
52
|
+
│ └──────────────────────────────────────────────────────────┘ │
|
|
53
|
+
│ ↓ │
|
|
54
|
+
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
55
|
+
│ │ 📊 QUALITY REPORT │ │
|
|
56
|
+
│ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │ │
|
|
57
|
+
│ │ Scenarios: 5/5 passed ✅ │ │
|
|
58
|
+
│ │ Quality score: 94/100 │ │
|
|
59
|
+
│ │ Build: ✅ | Tests: ✅ │ │
|
|
60
|
+
│ └──────────────────────────────────────────────────────────┘ │
|
|
61
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Scenario = Implementation Unit
|
|
65
|
+
|
|
66
|
+
**Traditional approach (Phase-based)**:
|
|
67
|
+
```
|
|
68
|
+
Phase 1 → Phase 2 → Phase 3 → ... → Verify at the end
|
|
69
|
+
↓
|
|
70
|
+
"Where did it go wrong?"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**SDD approach (Scenario-based)**:
|
|
74
|
+
```
|
|
75
|
+
Scenario 1 → Implement → Verify ✅
|
|
76
|
+
Scenario 2 → Implement → Verify ✅
|
|
77
|
+
Scenario 3 → Implement → Verify ❌ → Fix → ✅
|
|
78
|
+
...
|
|
79
|
+
All pass = Quality guaranteed
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Automated Verification
|
|
83
|
+
|
|
84
|
+
After implementing each scenario, **automatic verification**:
|
|
85
|
+
|
|
86
|
+
| Verification Item | Auto Check |
|
|
87
|
+
|-------------------|------------|
|
|
88
|
+
| Given (precondition) | State/data preparation confirmed |
|
|
89
|
+
| When (action) | Feature execution possible |
|
|
90
|
+
| Then (result) | Expected result matches |
|
|
91
|
+
| Code quality | Complexity, style, security |
|
|
92
|
+
|
|
93
|
+
### Auto-Fix on Failure
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Scenario verification failed
|
|
97
|
+
↓
|
|
98
|
+
[Root cause analysis] - Which Then condition failed?
|
|
99
|
+
↓
|
|
100
|
+
[Implement fix] - Fix only that part
|
|
101
|
+
↓
|
|
102
|
+
[Re-verify] - Check again
|
|
103
|
+
↓
|
|
104
|
+
Repeat until pass (max 3 times)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## **ULTRAWORK Mode** (ulw)
|
|
110
|
+
|
|
111
|
+
> Include `ultrawork` or `ulw` in your command to activate **maximum performance mode**.
|
|
112
|
+
|
|
113
|
+
### What ULTRAWORK Enables
|
|
114
|
+
|
|
115
|
+
When you include `ultrawork` (or `ulw`), ALL of these activate automatically:
|
|
116
|
+
|
|
117
|
+
| Feature | Description |
|
|
118
|
+
|---------|-------------|
|
|
119
|
+
| **Parallel Exploration** | 3+ Task(haiku) agents run simultaneously |
|
|
120
|
+
| **Boulder Loop** | Auto-continues until ALL phases complete |
|
|
121
|
+
| **Context Compression** | Aggressive auto-save at 70%+ context |
|
|
122
|
+
| **No Pause** | Doesn't wait for confirmation between phases |
|
|
123
|
+
| **External LLMs** | Auto-consults GPT/Gemini if enabled |
|
|
124
|
+
| **Error Recovery** | Auto-retries on failure (up to 3 times) |
|
|
125
|
+
|
|
126
|
+
### Boulder Loop (Inspired by Sisyphus)
|
|
127
|
+
|
|
128
|
+
Like Sisyphus rolling the boulder, ULTRAWORK **keeps going until done**:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
132
|
+
│ BOULDER LOOP (ultrawork) │
|
|
133
|
+
│ │
|
|
134
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
135
|
+
│ │ Phase 1 │───→│ Phase 2 │───→│ Phase 3 │───→│ Phase N │ │
|
|
136
|
+
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
|
|
137
|
+
│ │ │ │ │ │
|
|
138
|
+
│ ↓ ↓ ↓ ↓ │
|
|
139
|
+
│ [Parallel] [Parallel] [Parallel] [Parallel] │
|
|
140
|
+
│ [Implement] [Implement] [Implement] [Implement] │
|
|
141
|
+
│ [Test] [Test] [Test] [Test] │
|
|
142
|
+
│ │ │ │ │ │
|
|
143
|
+
│ └───────────────┴───────────────┴───────────────┘ │
|
|
144
|
+
│ │ │
|
|
145
|
+
│ ↓ │
|
|
146
|
+
│ ┌──────────────┐ │
|
|
147
|
+
│ │ ALL DONE? │ │
|
|
148
|
+
│ └──────────────┘ │
|
|
149
|
+
│ │ │ │
|
|
150
|
+
│ NO YES │
|
|
151
|
+
│ │ │ │
|
|
152
|
+
│ ↓ ↓ │
|
|
153
|
+
│ [Continue] [🎉 Complete!] │
|
|
154
|
+
│ │
|
|
155
|
+
│ NO STOPPING until acceptance criteria met or error limit hit │
|
|
156
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### ULTRAWORK Example
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
User: /vibe.run "brick-game" ultrawork
|
|
163
|
+
|
|
164
|
+
Claude:
|
|
165
|
+
🚀 ULTRAWORK MODE ACTIVATED
|
|
166
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
167
|
+
|
|
168
|
+
📄 SPEC: .claude/vibe/specs/brick-game.md
|
|
169
|
+
🎯 4 Phases detected
|
|
170
|
+
⚡ Boulder Loop: ENABLED (will continue until all phases complete)
|
|
171
|
+
🔄 Auto-retry: ON (max 3 per phase)
|
|
172
|
+
💾 Context compression: AGGRESSIVE
|
|
173
|
+
|
|
174
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
175
|
+
🏔️ BOULDER ROLLING... Phase 1/4
|
|
176
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
177
|
+
|
|
178
|
+
⚡ [PARALLEL] Launching 3 exploration agents...
|
|
179
|
+
✅ Exploration complete (7.2s)
|
|
180
|
+
🔨 Implementing...
|
|
181
|
+
✅ Phase 1 complete
|
|
182
|
+
|
|
183
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
184
|
+
🏔️ BOULDER ROLLING... Phase 2/4
|
|
185
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
186
|
+
|
|
187
|
+
⚡ [PARALLEL] Launching 3 exploration agents...
|
|
188
|
+
✅ Exploration complete (6.8s)
|
|
189
|
+
🔨 Implementing...
|
|
190
|
+
❌ Test failed: collision detection
|
|
191
|
+
🔄 Auto-retry 1/3...
|
|
192
|
+
🔨 Fixing...
|
|
193
|
+
✅ Phase 2 complete
|
|
194
|
+
|
|
195
|
+
[...continues automatically...]
|
|
196
|
+
|
|
197
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
198
|
+
🎉 BOULDER REACHED THE TOP!
|
|
199
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
200
|
+
|
|
201
|
+
✅ All 4 phases complete
|
|
202
|
+
✅ All acceptance criteria passed
|
|
203
|
+
✅ Build succeeded
|
|
204
|
+
✅ Tests passed
|
|
205
|
+
|
|
206
|
+
⏱️ Total: 8m 24s
|
|
207
|
+
📊 Retries: 2
|
|
208
|
+
💾 Context saved: 3 checkpoints
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Normal vs ULTRAWORK Comparison
|
|
212
|
+
|
|
213
|
+
| Aspect | Normal | ULTRAWORK |
|
|
214
|
+
|--------|--------|-----------|
|
|
215
|
+
| Phase transition | May pause | Auto-continues |
|
|
216
|
+
| On error | Reports and stops | Auto-retries (3x) |
|
|
217
|
+
| Context 70%+ | Warning only | Auto-compress + save |
|
|
218
|
+
| Exploration | Sequential possible | FORCED parallel |
|
|
219
|
+
| Completion | Phase-by-phase | Until ALL done |
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Rules Reference
|
|
224
|
+
|
|
225
|
+
**Must follow `~/.claude/vibe/rules/` (global):**
|
|
226
|
+
|
|
227
|
+
- `core/development-philosophy.md` - Surgical precision, modify only requested scope
|
|
228
|
+
- `core/quick-start.md` - Korean, DRY, SRP, YAGNI
|
|
229
|
+
- `standards/complexity-metrics.md` - Functions ≤20 lines, nesting ≤3 levels
|
|
230
|
+
- `quality/checklist.md` - Code quality checklist
|
|
231
|
+
|
|
232
|
+
**Language guide:** `~/.claude/vibe/languages/{stack}.md` (global reference)
|
|
233
|
+
|
|
234
|
+
## Description
|
|
235
|
+
|
|
236
|
+
Read PTCF structured SPEC document and execute implementation immediately.
|
|
237
|
+
|
|
238
|
+
> **PLAN, TASKS documents unnecessary** - SPEC is the executable prompt
|
|
239
|
+
|
|
240
|
+
## Model Orchestration (Intelligent Routing)
|
|
241
|
+
|
|
242
|
+
Automatically select optimal model based on **task complexity analysis**.
|
|
243
|
+
|
|
244
|
+
### Complexity-Based Model Selection
|
|
245
|
+
|
|
246
|
+
| Complexity Score | Model | When to Use |
|
|
247
|
+
|------------------|-------|-------------|
|
|
248
|
+
| 0-7 (Low) | **Haiku** | Simple fixes, searches, single file changes |
|
|
249
|
+
| 8-19 (Medium) | **Sonnet** | Standard features, 3-5 files, integrations |
|
|
250
|
+
| 20+ (High) | **Opus** | Architecture, security, multi-service, 6+ files |
|
|
251
|
+
|
|
252
|
+
### Complexity Signals
|
|
253
|
+
|
|
254
|
+
The following signals increase complexity score:
|
|
255
|
+
|
|
256
|
+
| Signal | Score |
|
|
257
|
+
|--------|-------|
|
|
258
|
+
| Architecture change | +15 |
|
|
259
|
+
| Security implication | +12 |
|
|
260
|
+
| Multi-service | +8 |
|
|
261
|
+
| Refactoring | +12 |
|
|
262
|
+
| 6+ files | +15 |
|
|
263
|
+
| 3-5 files | +8 |
|
|
264
|
+
| New feature | +5 |
|
|
265
|
+
| Bug fix | -3 |
|
|
266
|
+
| Documentation | -5 |
|
|
267
|
+
|
|
268
|
+
### Agent Tier System
|
|
269
|
+
|
|
270
|
+
Each agent has tier variants for cost optimization:
|
|
271
|
+
|
|
272
|
+
| Agent | Low (Haiku) | Medium (Sonnet) | High (Opus) |
|
|
273
|
+
|-------|-------------|-----------------|-------------|
|
|
274
|
+
| explorer | explorer-low | explorer-medium | explorer |
|
|
275
|
+
| implementer | implementer-low | implementer-medium | implementer |
|
|
276
|
+
| architect | architect-low | architect-medium | architect |
|
|
277
|
+
|
|
278
|
+
### Task Calls by Role
|
|
279
|
+
|
|
280
|
+
| Task Type | Model | Task Parameter |
|
|
281
|
+
|-----------|-------|----------------|
|
|
282
|
+
| Simple search | Haiku | `model: "haiku"` |
|
|
283
|
+
| Codebase exploration | Haiku/Sonnet | Auto-selected |
|
|
284
|
+
| Core implementation | Sonnet | `model: "sonnet"` |
|
|
285
|
+
| Test writing | Haiku | `model: "haiku"` |
|
|
286
|
+
| Architecture decisions | Opus | Main session |
|
|
287
|
+
| Final review | Opus | Main session |
|
|
288
|
+
|
|
289
|
+
### External LLM Usage (When Enabled)
|
|
290
|
+
|
|
291
|
+
When external LLMs are enabled in `.claude/vibe/config.json`:
|
|
292
|
+
|
|
293
|
+
| Role | Method | Condition |
|
|
294
|
+
|------|--------|-----------|
|
|
295
|
+
| User direct query | `gpt.question`, `gemini.question` | Hook auto-handles |
|
|
296
|
+
| Internal orchestration | Call global script via Bash | Claude calls directly |
|
|
297
|
+
|
|
298
|
+
**User questions (Hook auto-handles):**
|
|
299
|
+
- `gpt.question` - GPT architecture consultation
|
|
300
|
+
- `gemini.question` - Gemini Q&A/consultation
|
|
301
|
+
|
|
302
|
+
**Claude internal calls (directly via Bash):**
|
|
303
|
+
```bash
|
|
304
|
+
# Usage: node llm-orchestrate.js <provider> <mode> [systemPrompt] [prompt]
|
|
305
|
+
# - If systemPrompt omitted, uses default
|
|
306
|
+
# - If systemPrompt is "-", uses default and treats next argument as prompt
|
|
307
|
+
|
|
308
|
+
# Cross-platform path (works on Windows/macOS/Linux)
|
|
309
|
+
VIBE_SCRIPTS="$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts"
|
|
310
|
+
|
|
311
|
+
# GPT call
|
|
312
|
+
node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "[question content]"
|
|
313
|
+
|
|
314
|
+
# Gemini call
|
|
315
|
+
node "$VIBE_SCRIPTS/llm-orchestrate.js" gemini orchestrate-json "[question content]"
|
|
316
|
+
|
|
317
|
+
# Custom system prompt usage
|
|
318
|
+
node "$VIBE_SCRIPTS/llm-orchestrate.js" gpt orchestrate-json "You are a code reviewer" "[question content]"
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### External LLM Fallback
|
|
322
|
+
|
|
323
|
+
**IMPORTANT**: When GPT/Gemini hook fails, Claude MUST handle the task directly:
|
|
324
|
+
|
|
325
|
+
**Fallback behavior**:
|
|
326
|
+
- Do NOT retry the external LLM call
|
|
327
|
+
- Claude handles the task using its own capabilities
|
|
328
|
+
- Continue with the implementation without interruption
|
|
329
|
+
- Log the fallback but don't block progress
|
|
330
|
+
|
|
331
|
+
## Vibe Tools (Semantic Analysis & Memory)
|
|
332
|
+
|
|
333
|
+
Use vibe tools for accurate codebase understanding and session continuity.
|
|
334
|
+
|
|
335
|
+
### Tool Invocation
|
|
336
|
+
|
|
337
|
+
All tools are called via:
|
|
338
|
+
```bash
|
|
339
|
+
node -e "import('@su-record/vibe/tools').then(t => t.TOOL_NAME({...args}).then(r => console.log(r.content[0].text)))"
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Semantic Analysis Tools
|
|
343
|
+
|
|
344
|
+
| Tool | Purpose | Usage |
|
|
345
|
+
|------|---------|-------|
|
|
346
|
+
| `findSymbol` | Find symbol definitions | `{symbolName: 'functionName', searchPath: '.'}` |
|
|
347
|
+
| `findReferences` | Find all references | `{symbolName: 'functionName', searchPath: '.'}` |
|
|
348
|
+
| `analyzeComplexity` | Analyze code complexity | `{filePath: 'src/file.ts'}` |
|
|
349
|
+
| `validateCodeQuality` | Validate code quality | `{filePath: 'src/file.ts'}` |
|
|
350
|
+
|
|
351
|
+
**Example - Find symbol:**
|
|
352
|
+
```bash
|
|
353
|
+
node -e "import('@su-record/vibe/tools').then(t => t.findSymbol({symbolName: 'login', searchPath: '.'}).then(r => console.log(r.content[0].text)))"
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### Memory Tools
|
|
357
|
+
|
|
358
|
+
| Tool | Purpose | Usage |
|
|
359
|
+
|------|---------|-------|
|
|
360
|
+
| `saveMemory` | Save important decisions | `{key: 'decision-name', value: 'content', category: 'project'}` |
|
|
361
|
+
| `recallMemory` | Recall saved memory | `{key: 'decision-name'}` |
|
|
362
|
+
| `listMemories` | List all memories | `{category: 'project'}` |
|
|
363
|
+
|
|
364
|
+
**Example - Save important decision:**
|
|
365
|
+
```bash
|
|
366
|
+
node -e "import('@su-record/vibe/tools').then(t => t.saveMemory({key: 'auth-pattern', value: 'Using JWT with refresh tokens', category: 'project'}).then(r => console.log(r.content[0].text)))"
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Session Management (Auto via Hooks)
|
|
370
|
+
|
|
371
|
+
- **Session start**: Hook auto-calls `startSession` to restore previous context
|
|
372
|
+
- **Context 80%+**: Hook auto-calls `autoSaveContext` to preserve state
|
|
373
|
+
|
|
374
|
+
## Process
|
|
375
|
+
|
|
376
|
+
### 1. Load SPEC + Feature
|
|
377
|
+
|
|
378
|
+
```
|
|
379
|
+
📄 .claude/vibe/specs/{feature-name}.md → SPEC (structure, constraints, context)
|
|
380
|
+
📄 .claude/vibe/features/{feature-name}.feature → Feature (scenario = implementation unit)
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
**Error if Feature file missing**:
|
|
384
|
+
```
|
|
385
|
+
❌ Feature file not found.
|
|
386
|
+
Run /vibe.spec "{feature-name}" first.
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### 2. Extract Scenario List
|
|
390
|
+
|
|
391
|
+
Extract all Scenarios from Feature file:
|
|
392
|
+
|
|
393
|
+
```markdown
|
|
394
|
+
## Scenarios to Implement
|
|
395
|
+
|
|
396
|
+
| # | Scenario | Status |
|
|
397
|
+
|---|----------|--------|
|
|
398
|
+
| 1 | Valid login success | ⬜ |
|
|
399
|
+
| 2 | Invalid password error | ⬜ |
|
|
400
|
+
| 3 | Email format validation | ⬜ |
|
|
401
|
+
| 4 | Password reset link | ⬜ |
|
|
402
|
+
|
|
403
|
+
Total: 4 scenarios
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### 3. Scenario-by-Scenario Implementation (Core)
|
|
407
|
+
|
|
408
|
+
**For each scenario**:
|
|
409
|
+
|
|
410
|
+
```
|
|
411
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
412
|
+
🎯 Scenario 1/4: Valid login success
|
|
413
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
414
|
+
|
|
415
|
+
Given: User is registered
|
|
416
|
+
When: Login with valid email and password
|
|
417
|
+
Then: Login success + JWT token returned
|
|
418
|
+
|
|
419
|
+
[Step 1] Analyzing implementation...
|
|
420
|
+
- Required files: auth.service.ts, login.controller.ts
|
|
421
|
+
- Exploring related code...
|
|
422
|
+
|
|
423
|
+
[Step 2] Implementing...
|
|
424
|
+
✅ auth.service.ts - Added login() method
|
|
425
|
+
✅ login.controller.ts - POST /login endpoint
|
|
426
|
+
|
|
427
|
+
[Step 3] Verifying...
|
|
428
|
+
✅ Given: Test user creation possible
|
|
429
|
+
✅ When: Login API call succeeded
|
|
430
|
+
✅ Then: JWT token return confirmed
|
|
431
|
+
|
|
432
|
+
✅ Scenario 1 passed!
|
|
433
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
**On failure**:
|
|
437
|
+
|
|
438
|
+
```
|
|
439
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
440
|
+
🎯 Scenario 2/4: Invalid password error
|
|
441
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
442
|
+
|
|
443
|
+
[Step 3] Verifying...
|
|
444
|
+
✅ Given: Test user exists
|
|
445
|
+
✅ When: Login attempt with wrong password
|
|
446
|
+
❌ Then: "Invalid credentials" error message
|
|
447
|
+
Actual: "Error occurred" returned
|
|
448
|
+
|
|
449
|
+
[Auto-fix 1/3]
|
|
450
|
+
Cause: Error message not properly set
|
|
451
|
+
Fix: auth.service.ts line 42
|
|
452
|
+
|
|
453
|
+
[Re-verify]
|
|
454
|
+
✅ Then: "Invalid credentials" error message
|
|
455
|
+
|
|
456
|
+
✅ Scenario 2 passed! (1 fix)
|
|
457
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
## **CRITICAL: Parallel Sub-Agent Execution**
|
|
463
|
+
|
|
464
|
+
> **MUST USE PARALLEL TASK CALLS** - This is REQUIRED, not optional.
|
|
465
|
+
> Sequential execution when parallel is possible = VIOLATION of this workflow.
|
|
466
|
+
|
|
467
|
+
### Mandatory Parallel Exploration (Phase Start)
|
|
468
|
+
|
|
469
|
+
**BEFORE any implementation, you MUST launch these Task calls IN PARALLEL (single message, multiple tool calls):**
|
|
470
|
+
|
|
471
|
+
```
|
|
472
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
473
|
+
│ STEP 1: PARALLEL EXPLORATION (REQUIRED) │
|
|
474
|
+
│ │
|
|
475
|
+
│ Launch ALL of these in ONE message: │
|
|
476
|
+
│ │
|
|
477
|
+
│ Task(haiku) ─┬─→ "Analyze related files in <context>" │
|
|
478
|
+
│ │ │
|
|
479
|
+
│ Task(haiku) ─┼─→ "Check dependencies and imports" │
|
|
480
|
+
│ │ │
|
|
481
|
+
│ Task(haiku) ─┴─→ "Find existing patterns and conventions" │
|
|
482
|
+
│ │
|
|
483
|
+
│ [If GPT enabled] Bash: node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gpt orchestrate-json "[question]"
|
|
484
|
+
│ [If Gemini enabled] Bash: node {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js gemini orchestrate-json "[question]"
|
|
485
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
486
|
+
│
|
|
487
|
+
↓ (wait for all to complete)
|
|
488
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
489
|
+
│ STEP 2: SYNTHESIZE (Opus) │
|
|
490
|
+
│ - Review all exploration results │
|
|
491
|
+
│ - Decide implementation approach │
|
|
492
|
+
│ - Identify files to modify/create │
|
|
493
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
494
|
+
│
|
|
495
|
+
↓
|
|
496
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
497
|
+
│ STEP 3: IMPLEMENT + BACKGROUND AGENTS (PARALLEL) │
|
|
498
|
+
│ │
|
|
499
|
+
│ Main Agent (sonnet): │
|
|
500
|
+
│ └─→ Execute current phase implementation │
|
|
501
|
+
│ │
|
|
502
|
+
│ Background Agents (haiku, run_in_background=true): │
|
|
503
|
+
│ ├─→ Task: "Prepare Phase N+1 - analyze required files" │
|
|
504
|
+
│ ├─→ Task: "Pre-generate test cases for current implementation" │
|
|
505
|
+
│ └─→ Task: "Search for related types/interfaces needed" │
|
|
506
|
+
│ │
|
|
507
|
+
│ [ULTRAWORK] All 4 agents run simultaneously! │
|
|
508
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
509
|
+
│
|
|
510
|
+
↓ (main completes, check backgrounds)
|
|
511
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
512
|
+
│ STEP 4: TEST + PHASE PIPELINING │
|
|
513
|
+
│ │
|
|
514
|
+
│ Current Phase: │
|
|
515
|
+
│ └─→ Task(haiku): Write tests using pre-generated cases │
|
|
516
|
+
│ │
|
|
517
|
+
│ Next Phase Prep (from background results): │
|
|
518
|
+
│ └─→ Already have file analysis, ready to start immediately │
|
|
519
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### Parallel Task Call Pattern (MUST FOLLOW)
|
|
523
|
+
|
|
524
|
+
**Correct - Single message with multiple parallel Tasks:**
|
|
525
|
+
```
|
|
526
|
+
<message>
|
|
527
|
+
Task(haiku, "Analyze src/components/ for existing patterns")
|
|
528
|
+
Task(haiku, "Check package.json dependencies")
|
|
529
|
+
Task(haiku, "Find usage of similar features in codebase")
|
|
530
|
+
</message>
|
|
531
|
+
→ All 3 run simultaneously, ~3x faster
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
**WRONG - Sequential calls (DO NOT DO THIS):**
|
|
535
|
+
```
|
|
536
|
+
<message>Task(haiku, "Analyze...")</message>
|
|
537
|
+
<message>Task(haiku, "Check...")</message>
|
|
538
|
+
<message>Task(haiku, "Find...")</message>
|
|
539
|
+
→ 3x slower, wastes time
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
### Background Agent Pattern (ULTRAWORK) via Orchestrator
|
|
543
|
+
|
|
544
|
+
**Launch background agents for next phase via Orchestrator:**
|
|
545
|
+
```bash
|
|
546
|
+
# Start background agent (doesn't block)
|
|
547
|
+
node -e "import('@su-record/vibe/orchestrator').then(o => o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep').then(r => console.log(r.content[0].text)))"
|
|
548
|
+
|
|
549
|
+
# Multiple backgrounds in parallel
|
|
550
|
+
node -e "import('@su-record/vibe/orchestrator').then(async o => {
|
|
551
|
+
await Promise.all([
|
|
552
|
+
o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep'),
|
|
553
|
+
o.runAgent('Pre-generate test cases for login form', 'test-prep'),
|
|
554
|
+
o.runAgent('Find existing validation patterns', 'pattern-finder')
|
|
555
|
+
]);
|
|
556
|
+
console.log('All background agents started');
|
|
557
|
+
})"
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
**Check background agent status:**
|
|
561
|
+
```bash
|
|
562
|
+
node -e "import('@su-record/vibe/orchestrator').then(o => console.log(o.status().content[0].text))"
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
**Get result when ready:**
|
|
566
|
+
```bash
|
|
567
|
+
node -e "import('@su-record/vibe/orchestrator').then(o => o.getResult('SESSION_ID').then(r => console.log(r.content[0].text)))"
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
**Why Background Agents Matter:**
|
|
571
|
+
|
|
572
|
+
| Without Background | With Background |
|
|
573
|
+
|--------------------|-----------------|
|
|
574
|
+
| Phase 1: 60s | Phase 1: 60s (+ backgrounds running) |
|
|
575
|
+
| Phase 2 prep: 20s | Phase 2 prep: 0s (already done!) |
|
|
576
|
+
| Phase 2: 60s | Phase 2: 60s |
|
|
577
|
+
| **Total: 140s** | **Total: 120s** |
|
|
578
|
+
|
|
579
|
+
For 5 phases: 4 × 20s saved = **80s faster**
|
|
580
|
+
|
|
581
|
+
### Why Parallel Matters
|
|
582
|
+
|
|
583
|
+
| Approach | Time | Cache Benefit |
|
|
584
|
+
|----------|------|---------------|
|
|
585
|
+
| Sequential (3 Tasks) | ~30s | Cache cold on each |
|
|
586
|
+
| **Parallel (3 Tasks)** | **~10s** | **Cache warmed once, shared** |
|
|
587
|
+
|
|
588
|
+
vibe ProjectCache (LRU) caches ts-morph parsing results. Parallel calls share the warmed cache.
|
|
589
|
+
|
|
590
|
+
### Phase Execution Flow (ULTRAWORK Pipeline)
|
|
591
|
+
|
|
592
|
+
```
|
|
593
|
+
Phase N Start
|
|
594
|
+
│
|
|
595
|
+
├─→ [PARALLEL] Task(haiku) × 3: Exploration
|
|
596
|
+
│ - Related code analysis
|
|
597
|
+
│ - Dependency check
|
|
598
|
+
│ - Pattern discovery
|
|
599
|
+
│
|
|
600
|
+
↓ (all complete)
|
|
601
|
+
│
|
|
602
|
+
├─→ Opus: Synthesize and decide
|
|
603
|
+
│
|
|
604
|
+
├─→ [PARALLEL PIPELINE] ←── KEY SPEED OPTIMIZATION
|
|
605
|
+
│ │
|
|
606
|
+
│ ├─→ Main: Task(sonnet) Implementation
|
|
607
|
+
│ │
|
|
608
|
+
│ └─→ Background (run_in_background=true):
|
|
609
|
+
│ ├─→ Task(haiku): Phase N+1 file analysis
|
|
610
|
+
│ ├─→ Task(haiku): Test case preparation
|
|
611
|
+
│ └─→ Task(haiku): Type/interface lookup
|
|
612
|
+
│
|
|
613
|
+
↓ (main completes)
|
|
614
|
+
│
|
|
615
|
+
├─→ Task(haiku): Tests (uses pre-generated cases)
|
|
616
|
+
│
|
|
617
|
+
↓
|
|
618
|
+
Phase N Complete
|
|
619
|
+
│
|
|
620
|
+
↓ (Background results ready - NO WAIT for Phase N+1 exploration!)
|
|
621
|
+
│
|
|
622
|
+
Phase N+1 Start (IMMEDIATE - exploration already done!)
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
**Speed Comparison:**
|
|
626
|
+
|
|
627
|
+
| Mode | Phase Time | 5 Phases Total |
|
|
628
|
+
|------|------------|----------------|
|
|
629
|
+
| Sequential | ~2min/phase | ~10min |
|
|
630
|
+
| Parallel Exploration | ~1.5min/phase | ~7.5min |
|
|
631
|
+
| **ULTRAWORK Pipeline** | **~1min/phase** | **~5min** |
|
|
632
|
+
|
|
633
|
+
**Why Pipeline is Faster:**
|
|
634
|
+
- Background agents prepare next phase WHILE current phase implements
|
|
635
|
+
- No idle time between phases
|
|
636
|
+
- Test cases pre-generated during implementation
|
|
637
|
+
- Cache stays warm across parallel tasks
|
|
638
|
+
|
|
639
|
+
---
|
|
640
|
+
|
|
641
|
+
1. **Related code analysis**: Task(haiku) explores `<context>` related code
|
|
642
|
+
2. **File creation/modification**: Task(sonnet) implements per `<output_format>`
|
|
643
|
+
3. **Constraint compliance**: Check `<constraints>`
|
|
644
|
+
4. **Run verification**: Execute verification commands
|
|
645
|
+
|
|
646
|
+
### 4. Brand Assets Generation (Optional)
|
|
647
|
+
|
|
648
|
+
When starting a **new project** with brand context in SPEC, auto-generate app icons and favicons:
|
|
649
|
+
|
|
650
|
+
```
|
|
651
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
652
|
+
🎨 BRAND ASSETS GENERATION
|
|
653
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
654
|
+
|
|
655
|
+
[Check] Brand assets exist? → Skip if favicon.ico exists
|
|
656
|
+
[Check] Gemini API configured? → Required for image generation
|
|
657
|
+
[Check] SPEC has brand context? → Extract app name, colors, style
|
|
658
|
+
|
|
659
|
+
[Generate] Creating app icon with Gemini Image API...
|
|
660
|
+
- Prompt: "App icon for [AppName], [style], [color]..."
|
|
661
|
+
- Generated: 512x512 master icon
|
|
662
|
+
|
|
663
|
+
[Resize] Creating platform variants...
|
|
664
|
+
✅ favicon.ico (16/32/48)
|
|
665
|
+
✅ favicon-16x16.png
|
|
666
|
+
✅ favicon-32x32.png
|
|
667
|
+
✅ apple-touch-icon.png (180x180)
|
|
668
|
+
✅ android-chrome-192x192.png
|
|
669
|
+
✅ android-chrome-512x512.png
|
|
670
|
+
✅ site.webmanifest
|
|
671
|
+
|
|
672
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
673
|
+
✅ Brand assets generated in public/
|
|
674
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
**SPEC Brand Context Example:**
|
|
678
|
+
|
|
679
|
+
```xml
|
|
680
|
+
<context>
|
|
681
|
+
Brand:
|
|
682
|
+
- App Name: MyApp
|
|
683
|
+
- Primary Color: #2F6BFF
|
|
684
|
+
- Style: Modern, minimalist, flat design
|
|
685
|
+
- Icon Concept: Abstract geometric shape
|
|
686
|
+
</context>
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
**Trigger Conditions:**
|
|
690
|
+
- First `/vibe.run` execution (no existing icons)
|
|
691
|
+
- SPEC contains brand/design context
|
|
692
|
+
- Gemini API key configured (`vibe gemini auth`)
|
|
693
|
+
|
|
694
|
+
**Manual Generation:**
|
|
695
|
+
```bash
|
|
696
|
+
node hooks/scripts/generate-brand-assets.js \
|
|
697
|
+
--spec ".claude/vibe/specs/my-feature.md" \
|
|
698
|
+
--output "./public"
|
|
699
|
+
|
|
700
|
+
# Or with explicit values
|
|
701
|
+
node hooks/scripts/generate-brand-assets.js \
|
|
702
|
+
--name "MyApp" \
|
|
703
|
+
--color "#2F6BFF" \
|
|
704
|
+
--style "modern minimal" \
|
|
705
|
+
--output "./public"
|
|
706
|
+
```
|
|
707
|
+
|
|
708
|
+
**Fallback:** If Gemini Image fails, generates text monogram icon (first letter + primary color).
|
|
709
|
+
|
|
710
|
+
---
|
|
711
|
+
|
|
712
|
+
### 5. Gemini Code Review + Auto-Fix
|
|
713
|
+
|
|
714
|
+
After all scenarios are implemented, **Gemini reviews the code and auto-fixes based on feedback**:
|
|
715
|
+
|
|
716
|
+
```
|
|
717
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
718
|
+
🔍 GEMINI CODE REVIEW
|
|
719
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
720
|
+
|
|
721
|
+
[Step 1] Sending implementation code to Gemini...
|
|
722
|
+
- Changed files: auth.service.ts, auth.controller.ts, ...
|
|
723
|
+
|
|
724
|
+
[Step 2] Gemini review results:
|
|
725
|
+
┌─────────────────────────────────────────────────────┐
|
|
726
|
+
│ 📝 Gemini Feedback │
|
|
727
|
+
│ │
|
|
728
|
+
│ 1. [Improvement] auth.service.ts:24 │
|
|
729
|
+
│ Need timing attack prevention for password compare│
|
|
730
|
+
│ → Recommend using crypto.timingSafeEqual() │
|
|
731
|
+
│ │
|
|
732
|
+
│ 2. [Improvement] auth.controller.ts:15 │
|
|
733
|
+
│ Rate limiting not applied │
|
|
734
|
+
│ → Recommend adding login attempt limit │
|
|
735
|
+
│ │
|
|
736
|
+
│ 3. [Style] auth.service.ts:42 │
|
|
737
|
+
│ Magic number usage │
|
|
738
|
+
│ → Recommend extracting to constant │
|
|
739
|
+
└─────────────────────────────────────────────────────┘
|
|
740
|
+
|
|
741
|
+
[Step 3] Auto-fixing based on feedback...
|
|
742
|
+
✅ auth.service.ts:24 - Applied timingSafeEqual
|
|
743
|
+
✅ auth.controller.ts:15 - Added rate limiter
|
|
744
|
+
✅ auth.service.ts:42 - Extracted constant
|
|
745
|
+
|
|
746
|
+
[Step 4] Re-verifying...
|
|
747
|
+
✅ Build succeeded
|
|
748
|
+
✅ Tests passed
|
|
749
|
+
|
|
750
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
751
|
+
✅ Gemini review complete! 3 improvements applied
|
|
752
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
**MUST: Gemini Code Review (Required)**
|
|
756
|
+
|
|
757
|
+
When Gemini is enabled, **must** use global hook script for code review:
|
|
758
|
+
|
|
759
|
+
```bash
|
|
760
|
+
# Cross-platform path (works on Windows/macOS/Linux)
|
|
761
|
+
VIBE_SCRIPTS="$(node -p "process.env.APPDATA || require('os').homedir() + '/.config'")/vibe/hooks/scripts"
|
|
762
|
+
|
|
763
|
+
node "$VIBE_SCRIPTS/llm-orchestrate.js" gemini orchestrate-json "Review this code for security, performance, best-practices: [code summary]. SPEC: [summary]. Scenarios: [list]"
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
**Call sequence:**
|
|
767
|
+
1. Summarize key content of changed files
|
|
768
|
+
2. Add SPEC requirements summary
|
|
769
|
+
3. Execute global script call
|
|
770
|
+
4. Fix code for each feedback item in response
|
|
771
|
+
5. Re-run build/tests
|
|
772
|
+
|
|
773
|
+
**Fallback handling:**
|
|
774
|
+
- On `"status": "fallback"` response → Skip and proceed to next step
|
|
775
|
+
- On network error → Retry once, then skip
|
|
776
|
+
|
|
777
|
+
**Review application rules:**
|
|
778
|
+
|
|
779
|
+
| Feedback Type | Action |
|
|
780
|
+
|---------------|--------|
|
|
781
|
+
| Security vulnerability | Auto-fix immediately |
|
|
782
|
+
| Performance improvement | Auto-fix immediately |
|
|
783
|
+
| Best practices | Auto-fix |
|
|
784
|
+
| Style/preference | Apply selectively (project convention takes priority) |
|
|
785
|
+
|
|
786
|
+
**Conditions:**
|
|
787
|
+
- Only runs when Gemini MCP is enabled (`vibe gemini auth`)
|
|
788
|
+
- Skip and proceed on fallback response
|
|
789
|
+
- Must re-verify build/tests after fixes
|
|
790
|
+
|
|
791
|
+
### 6. Quality Report (Auto-generated)
|
|
792
|
+
|
|
793
|
+
After all scenarios complete + Gemini review, **quality report is auto-generated**:
|
|
794
|
+
|
|
795
|
+
```
|
|
796
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
797
|
+
│ 📊 QUALITY REPORT: login │
|
|
798
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
799
|
+
│ │
|
|
800
|
+
│ ✅ Scenarios: 4/4 passed │
|
|
801
|
+
│ │
|
|
802
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
803
|
+
│ │ # │ Scenario │ Status │ Retries │ │ │
|
|
804
|
+
│ │───│───────────────────────────│────────│─────────│ │ │
|
|
805
|
+
│ │ 1 │ Valid login success │ ✅ │ 0 │ │ │
|
|
806
|
+
│ │ 2 │ Invalid password error │ ✅ │ 1 │ │ │
|
|
807
|
+
│ │ 3 │ Email format validation │ ✅ │ 0 │ │ │
|
|
808
|
+
│ │ 4 │ Password reset link │ ✅ │ 0 │ │ │
|
|
809
|
+
│ └───────────────────────────────────────────────────────────┘ │
|
|
810
|
+
│ │
|
|
811
|
+
│ 📈 Quality score: 94/100 │
|
|
812
|
+
│ │
|
|
813
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
814
|
+
│ │ Item │ Result │ Notes │ │
|
|
815
|
+
│ │───────────────────│────────│─────────────────────────────│ │
|
|
816
|
+
│ │ Build │ ✅ │ npm run build succeeded │ │
|
|
817
|
+
│ │ Tests │ ✅ │ 12/12 passed │ │
|
|
818
|
+
│ │ Type check │ ✅ │ 0 errors │ │
|
|
819
|
+
│ │ Complexity │ ✅ │ All functions ≤30 lines │ │
|
|
820
|
+
│ │ Security │ ✅ │ 0 vulnerabilities │ │
|
|
821
|
+
│ │ Gemini review │ ✅ │ 3 improvements applied │ │
|
|
822
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
823
|
+
│ │
|
|
824
|
+
│ ⏱️ Total time: 3m 42s │
|
|
825
|
+
│ │
|
|
826
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
**What users should check**:
|
|
830
|
+
- Scenario pass rate (4/4 = 100%)
|
|
831
|
+
- Quality score (94/100)
|
|
832
|
+
- Build/test status
|
|
833
|
+
|
|
834
|
+
**This alone is enough to trust quality.**
|
|
835
|
+
|
|
836
|
+
### 7. Update Feature File
|
|
837
|
+
|
|
838
|
+
Auto-update scenario status:
|
|
839
|
+
|
|
840
|
+
```markdown
|
|
841
|
+
## Coverage
|
|
842
|
+
|
|
843
|
+
| Scenario | SPEC AC | Status |
|
|
844
|
+
|----------|---------|--------|
|
|
845
|
+
| Valid login success | AC-1 | ✅ |
|
|
846
|
+
| Invalid password error | AC-2 | ✅ |
|
|
847
|
+
| Email format validation | AC-3 | ✅ |
|
|
848
|
+
| Password reset link | AC-4 | ✅ |
|
|
849
|
+
|
|
850
|
+
**Last verified**: 2024-01-15 14:32
|
|
851
|
+
**Quality score**: 94/100
|
|
852
|
+
```
|
|
853
|
+
|
|
854
|
+
## TRUST 5 Principles
|
|
855
|
+
|
|
856
|
+
Follow during implementation:
|
|
857
|
+
|
|
858
|
+
| Principle | Description |
|
|
859
|
+
|-----------|-------------|
|
|
860
|
+
| **T**est-first | Write tests first |
|
|
861
|
+
| **R**eadable | Clear code |
|
|
862
|
+
| **U**nified | Consistent style |
|
|
863
|
+
| **S**ecured | Consider security |
|
|
864
|
+
| **T**rackable | Logging, monitoring |
|
|
865
|
+
|
|
866
|
+
## Input
|
|
867
|
+
|
|
868
|
+
- `.claude/vibe/specs/{feature-name}.md` (PTCF SPEC)
|
|
869
|
+
- `.claude/vibe/features/{feature-name}.feature` (BDD)
|
|
870
|
+
- `CLAUDE.md` (project context)
|
|
871
|
+
|
|
872
|
+
## Output
|
|
873
|
+
|
|
874
|
+
- Implemented code files
|
|
875
|
+
- Test files
|
|
876
|
+
- Updated SPEC document (checkmarks)
|
|
877
|
+
|
|
878
|
+
## Example
|
|
879
|
+
|
|
880
|
+
```
|
|
881
|
+
User: /vibe.run "login"
|
|
882
|
+
|
|
883
|
+
Claude:
|
|
884
|
+
📄 Loading SPEC: .claude/vibe/specs/login.md
|
|
885
|
+
📄 Loading Feature: .claude/vibe/features/login.feature
|
|
886
|
+
|
|
887
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
888
|
+
📋 Scenarios to Implement
|
|
889
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
890
|
+
|
|
891
|
+
| # | Scenario | Status |
|
|
892
|
+
|---|----------|--------|
|
|
893
|
+
| 1 | Valid login success | ⬜ |
|
|
894
|
+
| 2 | Invalid password error | ⬜ |
|
|
895
|
+
| 3 | Email format validation | ⬜ |
|
|
896
|
+
| 4 | Password reset link | ⬜ |
|
|
897
|
+
|
|
898
|
+
Total: 4 scenarios
|
|
899
|
+
|
|
900
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
901
|
+
🎯 Scenario 1/4: Valid login success
|
|
902
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
903
|
+
|
|
904
|
+
Given: User is registered
|
|
905
|
+
When: Login with valid email and password
|
|
906
|
+
Then: Login success + JWT token returned
|
|
907
|
+
|
|
908
|
+
⚡ [PARALLEL] Exploring...
|
|
909
|
+
✅ Exploration complete (2.1s)
|
|
910
|
+
|
|
911
|
+
🔨 Implementing...
|
|
912
|
+
✅ auth.service.ts - Added login()
|
|
913
|
+
✅ auth.controller.ts - POST /login
|
|
914
|
+
|
|
915
|
+
🔍 Verifying...
|
|
916
|
+
✅ Given: OK
|
|
917
|
+
✅ When: OK
|
|
918
|
+
✅ Then: OK
|
|
919
|
+
|
|
920
|
+
✅ Scenario 1 passed!
|
|
921
|
+
|
|
922
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
923
|
+
🎯 Scenario 2/4: Invalid password error
|
|
924
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
925
|
+
|
|
926
|
+
🔨 Implementing...
|
|
927
|
+
✅ auth.service.ts - Password validation logic
|
|
928
|
+
|
|
929
|
+
🔍 Verifying...
|
|
930
|
+
✅ Given: OK
|
|
931
|
+
✅ When: OK
|
|
932
|
+
❌ Then: "Invalid credentials" error message
|
|
933
|
+
Actual: "Error" returned
|
|
934
|
+
|
|
935
|
+
🔄 Auto-fix 1/3...
|
|
936
|
+
Fix: auth.service.ts line 42
|
|
937
|
+
|
|
938
|
+
🔍 Re-verifying...
|
|
939
|
+
✅ Then: OK
|
|
940
|
+
|
|
941
|
+
✅ Scenario 2 passed! (1 fix)
|
|
942
|
+
|
|
943
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
944
|
+
🎯 Scenario 3/4: Email format validation
|
|
945
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
946
|
+
|
|
947
|
+
🔨 Implementing...
|
|
948
|
+
🔍 Verifying...
|
|
949
|
+
✅ Scenario 3 passed!
|
|
950
|
+
|
|
951
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
952
|
+
🎯 Scenario 4/4: Password reset link
|
|
953
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
954
|
+
|
|
955
|
+
🔨 Implementing...
|
|
956
|
+
🔍 Verifying...
|
|
957
|
+
✅ Scenario 4 passed!
|
|
958
|
+
|
|
959
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
960
|
+
🔍 GEMINI CODE REVIEW
|
|
961
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
962
|
+
|
|
963
|
+
📤 Sending code to Gemini...
|
|
964
|
+
📝 Gemini feedback:
|
|
965
|
+
1. [Security] Need timing attack prevention → Fixing...
|
|
966
|
+
2. [Performance] Unnecessary DB call → Fixing...
|
|
967
|
+
|
|
968
|
+
✅ 2 improvements auto-applied
|
|
969
|
+
🔍 Re-verifying... ✅ Passed
|
|
970
|
+
|
|
971
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
972
|
+
│ 📊 QUALITY REPORT: login │
|
|
973
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
974
|
+
│ │
|
|
975
|
+
│ ✅ Scenarios: 4/4 passed │
|
|
976
|
+
│ │
|
|
977
|
+
│ | # | Scenario | Status | Retries | │
|
|
978
|
+
│ |---|───────────────────────|───────|─────────| │
|
|
979
|
+
│ | 1 | Valid login success | ✅ | 0 | │
|
|
980
|
+
│ | 2 | Invalid password error| ✅ | 1 | │
|
|
981
|
+
│ | 3 | Email format validation| ✅ | 0 | │
|
|
982
|
+
│ | 4 | Password reset link | ✅ | 0 | │
|
|
983
|
+
│ │
|
|
984
|
+
│ 📈 Quality score: 94/100 │
|
|
985
|
+
│ Build: ✅ | Tests: ✅ | Types: ✅ | Gemini: ✅ (2 applied) │
|
|
986
|
+
│ │
|
|
987
|
+
│ ⏱️ Total time: 3m 42s │
|
|
988
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
989
|
+
|
|
990
|
+
🎉 Implementation complete! All scenarios passed + Gemini review applied.
|
|
991
|
+
|
|
992
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
993
|
+
🔍 AUTO REVIEW (13+ Agents)
|
|
994
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
995
|
+
|
|
996
|
+
⚡ [PARALLEL] 13 expert agents reviewing...
|
|
997
|
+
- security-reviewer ✅
|
|
998
|
+
- performance-reviewer ✅
|
|
999
|
+
- architecture-reviewer ✅
|
|
1000
|
+
- ...
|
|
1001
|
+
|
|
1002
|
+
📋 Review results:
|
|
1003
|
+
- P1 Critical: 0
|
|
1004
|
+
- P2 Important: 2
|
|
1005
|
+
- P3 Nice-to-have: 1
|
|
1006
|
+
|
|
1007
|
+
🔧 Auto-fixing P2 issues...
|
|
1008
|
+
1. [PERF] N+1 query → Fixed
|
|
1009
|
+
2. [ARCH] Circular dependency → Fixed
|
|
1010
|
+
|
|
1011
|
+
✅ Auto Review complete! 2 issues auto-resolved.
|
|
1012
|
+
```
|
|
1013
|
+
|
|
1014
|
+
### Phase-specific Execution
|
|
1015
|
+
|
|
1016
|
+
```
|
|
1017
|
+
User: /vibe.run "brick-game" --phase 2
|
|
1018
|
+
|
|
1019
|
+
Claude:
|
|
1020
|
+
📄 Reading SPEC: .claude/vibe/specs/brick-game.md
|
|
1021
|
+
🎯 Executing Phase 2 only.
|
|
1022
|
+
|
|
1023
|
+
Phase 2: Game Logic
|
|
1024
|
+
1. [ ] Paddle movement implementation
|
|
1025
|
+
2. [ ] Ball physics engine
|
|
1026
|
+
3. [ ] Brick collision handling
|
|
1027
|
+
4. [ ] Score system
|
|
1028
|
+
5. [ ] Game over conditions
|
|
1029
|
+
|
|
1030
|
+
⚡ Launching parallel exploration...
|
|
1031
|
+
[Task(haiku) × 3 launched in parallel]
|
|
1032
|
+
|
|
1033
|
+
🚀 Starting implementation...
|
|
1034
|
+
```
|
|
1035
|
+
|
|
1036
|
+
## Error Handling
|
|
1037
|
+
|
|
1038
|
+
On failure:
|
|
1039
|
+
1. Check error message
|
|
1040
|
+
2. Review `<constraints>`
|
|
1041
|
+
3. Fix code and retry
|
|
1042
|
+
4. If continues to fail, report to user
|
|
1043
|
+
|
|
1044
|
+
---
|
|
1045
|
+
|
|
1046
|
+
## Quality Gate (Mandatory)
|
|
1047
|
+
|
|
1048
|
+
### Implementation Quality Checklist
|
|
1049
|
+
|
|
1050
|
+
Before marking any scenario as complete, ALL items must pass:
|
|
1051
|
+
|
|
1052
|
+
| Category | Check Item | Weight |
|
|
1053
|
+
|----------|------------|--------|
|
|
1054
|
+
| **Functionality** | All Given/When/Then conditions verified | 20% |
|
|
1055
|
+
| **Functionality** | Edge cases handled per scenario | 10% |
|
|
1056
|
+
| **Code Quality** | No `any` types in TypeScript | 10% |
|
|
1057
|
+
| **Code Quality** | Functions ≤30 lines, nesting ≤3 levels | 10% |
|
|
1058
|
+
| **Code Quality** | No hardcoded values (use constants) | 5% |
|
|
1059
|
+
| **Security** | Input validation implemented | 10% |
|
|
1060
|
+
| **Security** | Authentication/authorization checked | 5% |
|
|
1061
|
+
| **Error Handling** | Try-catch or error states present | 10% |
|
|
1062
|
+
| **Error Handling** | User-friendly error messages | 5% |
|
|
1063
|
+
| **Testing** | Unit tests exist for core logic | 10% |
|
|
1064
|
+
| **Performance** | No N+1 queries or unnecessary loops | 5% |
|
|
1065
|
+
|
|
1066
|
+
### Quality Score Calculation
|
|
1067
|
+
|
|
1068
|
+
```
|
|
1069
|
+
Score = Σ(checked items × weight) / 100
|
|
1070
|
+
|
|
1071
|
+
Grades:
|
|
1072
|
+
- 95-100: ✅ EXCELLENT - Ready to merge
|
|
1073
|
+
- 90-94: ⚠️ GOOD - Minor improvements required before merge
|
|
1074
|
+
- 80-89: ⚠️ FAIR - Significant improvements required
|
|
1075
|
+
- 0-79: ❌ POOR - Major fixes needed
|
|
1076
|
+
```
|
|
1077
|
+
|
|
1078
|
+
### Quality Gate Thresholds
|
|
1079
|
+
|
|
1080
|
+
| Gate | Minimum Score | Condition |
|
|
1081
|
+
|------|---------------|-----------|
|
|
1082
|
+
| **Scenario Complete** | 95 | Each scenario must score ≥95 |
|
|
1083
|
+
| **Phase Complete** | 95 | Average of all scenarios ≥95 |
|
|
1084
|
+
| **Feature Complete** | 95 | All phases complete + Gemini review |
|
|
1085
|
+
|
|
1086
|
+
### Auto-Fix Triggers
|
|
1087
|
+
|
|
1088
|
+
| Issue Type | Auto-Fix Action |
|
|
1089
|
+
|------------|-----------------|
|
|
1090
|
+
| Missing error handling | Add try-catch wrapper |
|
|
1091
|
+
| Hardcoded values | Extract to constants file |
|
|
1092
|
+
| Missing input validation | Add validation schema |
|
|
1093
|
+
| Function too long | Suggest split points |
|
|
1094
|
+
| N+1 query detected | Add eager loading |
|
|
1095
|
+
|
|
1096
|
+
### Forbidden Patterns (Block Merge)
|
|
1097
|
+
|
|
1098
|
+
| Pattern | Why Forbidden | Detection |
|
|
1099
|
+
|---------|---------------|-----------|
|
|
1100
|
+
| `console.log` | Debug code in production | Regex scan |
|
|
1101
|
+
| `// TODO` without issue | Untracked work | Comment scan |
|
|
1102
|
+
| `any` type | Type safety bypass | TypeScript check |
|
|
1103
|
+
| `@ts-ignore` | Type error suppression | TypeScript check |
|
|
1104
|
+
| Empty catch blocks | Silent error swallowing | AST analysis |
|
|
1105
|
+
| Commented-out code | Dead code | Comment scan |
|
|
1106
|
+
|
|
1107
|
+
---
|
|
1108
|
+
|
|
1109
|
+
## Next Step
|
|
1110
|
+
|
|
1111
|
+
```
|
|
1112
|
+
/vibe.verify "brick-game"
|
|
1113
|
+
```
|
|
1114
|
+
|
|
1115
|
+
---
|
|
1116
|
+
|
|
1117
|
+
ARGUMENTS: $ARGUMENTS
|