@su-record/vibe 2.12.4 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/CLAUDE.md +10 -3
  2. package/README.en.md +11 -11
  3. package/README.md +7 -7
  4. package/dist/cli/commands/init.d.ts +8 -0
  5. package/dist/cli/commands/init.d.ts.map +1 -1
  6. package/dist/cli/commands/init.js +24 -1
  7. package/dist/cli/commands/init.js.map +1 -1
  8. package/dist/cli/postinstall/claude-agents.d.ts +11 -1
  9. package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
  10. package/dist/cli/postinstall/claude-agents.js +22 -2
  11. package/dist/cli/postinstall/claude-agents.js.map +1 -1
  12. package/dist/cli/postinstall/constants.d.ts +18 -0
  13. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  14. package/dist/cli/postinstall/constants.js +50 -0
  15. package/dist/cli/postinstall/constants.js.map +1 -1
  16. package/dist/cli/postinstall/fs-utils.d.ts +23 -0
  17. package/dist/cli/postinstall/fs-utils.d.ts.map +1 -1
  18. package/dist/cli/postinstall/fs-utils.js +71 -0
  19. package/dist/cli/postinstall/fs-utils.js.map +1 -1
  20. package/dist/cli/postinstall/fs-utils.test.js +69 -1
  21. package/dist/cli/postinstall/fs-utils.test.js.map +1 -1
  22. package/dist/cli/postinstall/index.d.ts +1 -1
  23. package/dist/cli/postinstall/index.d.ts.map +1 -1
  24. package/dist/cli/postinstall/index.js +1 -1
  25. package/dist/cli/postinstall/index.js.map +1 -1
  26. package/dist/cli/postinstall/main.d.ts.map +1 -1
  27. package/dist/cli/postinstall/main.js +15 -4
  28. package/dist/cli/postinstall/main.js.map +1 -1
  29. package/dist/cli/postinstall.d.ts +1 -1
  30. package/dist/cli/postinstall.d.ts.map +1 -1
  31. package/dist/cli/postinstall.js +1 -1
  32. package/dist/cli/postinstall.js.map +1 -1
  33. package/dist/cli/setup/CodexHooks.test.js +27 -0
  34. package/dist/cli/setup/CodexHooks.test.js.map +1 -1
  35. package/dist/cli/setup/ProjectSetup.js +2 -2
  36. package/dist/cli/setup/ProjectSetup.js.map +1 -1
  37. package/dist/infra/lib/ContextCompressor.d.ts +11 -2
  38. package/dist/infra/lib/ContextCompressor.d.ts.map +1 -1
  39. package/dist/infra/lib/ContextCompressor.js +26 -41
  40. package/dist/infra/lib/ContextCompressor.js.map +1 -1
  41. package/dist/infra/lib/ContextCompressor.test.d.ts +2 -0
  42. package/dist/infra/lib/ContextCompressor.test.d.ts.map +1 -0
  43. package/dist/infra/lib/ContextCompressor.test.js +25 -0
  44. package/dist/infra/lib/ContextCompressor.test.js.map +1 -0
  45. package/dist/infra/lib/DecisionTracer.d.ts +4 -0
  46. package/dist/infra/lib/DecisionTracer.d.ts.map +1 -1
  47. package/dist/infra/lib/DecisionTracer.js +4 -0
  48. package/dist/infra/lib/DecisionTracer.js.map +1 -1
  49. package/dist/infra/lib/LoopBreaker.d.ts +4 -0
  50. package/dist/infra/lib/LoopBreaker.d.ts.map +1 -1
  51. package/dist/infra/lib/LoopBreaker.js +4 -0
  52. package/dist/infra/lib/LoopBreaker.js.map +1 -1
  53. package/dist/infra/lib/ReviewRace.d.ts +4 -0
  54. package/dist/infra/lib/ReviewRace.d.ts.map +1 -1
  55. package/dist/infra/lib/ReviewRace.js +4 -0
  56. package/dist/infra/lib/ReviewRace.js.map +1 -1
  57. package/dist/infra/lib/SkillQualityGate.d.ts +4 -0
  58. package/dist/infra/lib/SkillQualityGate.d.ts.map +1 -1
  59. package/dist/infra/lib/SkillQualityGate.js +4 -0
  60. package/dist/infra/lib/SkillQualityGate.js.map +1 -1
  61. package/dist/infra/lib/UltraQA.d.ts +4 -0
  62. package/dist/infra/lib/UltraQA.d.ts.map +1 -1
  63. package/dist/infra/lib/UltraQA.js +4 -0
  64. package/dist/infra/lib/UltraQA.js.map +1 -1
  65. package/dist/infra/lib/VerificationLoop.d.ts +4 -0
  66. package/dist/infra/lib/VerificationLoop.d.ts.map +1 -1
  67. package/dist/infra/lib/VerificationLoop.js +4 -0
  68. package/dist/infra/lib/VerificationLoop.js.map +1 -1
  69. package/dist/infra/lib/embedding/VectorStore.d.ts +9 -2
  70. package/dist/infra/lib/embedding/VectorStore.d.ts.map +1 -1
  71. package/dist/infra/lib/embedding/VectorStore.js +42 -19
  72. package/dist/infra/lib/embedding/VectorStore.js.map +1 -1
  73. package/dist/infra/lib/memory/MemoryStorage.d.ts +12 -0
  74. package/dist/infra/lib/memory/MemoryStorage.d.ts.map +1 -1
  75. package/dist/infra/lib/memory/MemoryStorage.js +57 -0
  76. package/dist/infra/lib/memory/MemoryStorage.js.map +1 -1
  77. package/dist/infra/lib/memory/ReflectionStore.d.ts.map +1 -1
  78. package/dist/infra/lib/memory/ReflectionStore.js +8 -27
  79. package/dist/infra/lib/memory/ReflectionStore.js.map +1 -1
  80. package/dist/infra/orchestrator/LLMCluster.d.ts +4 -0
  81. package/dist/infra/orchestrator/LLMCluster.d.ts.map +1 -1
  82. package/dist/infra/orchestrator/LLMCluster.js +35 -8
  83. package/dist/infra/orchestrator/LLMCluster.js.map +1 -1
  84. package/dist/infra/orchestrator/index.d.ts.map +1 -1
  85. package/dist/infra/orchestrator/index.js +1 -3
  86. package/dist/infra/orchestrator/index.js.map +1 -1
  87. package/dist/infra/orchestrator/parallelResearch.d.ts.map +1 -1
  88. package/dist/infra/orchestrator/parallelResearch.js +1 -4
  89. package/dist/infra/orchestrator/parallelResearch.js.map +1 -1
  90. package/dist/tools/convention/validateCodeQuality.d.ts.map +1 -1
  91. package/dist/tools/convention/validateCodeQuality.js +5 -4
  92. package/dist/tools/convention/validateCodeQuality.js.map +1 -1
  93. package/dist/tools/spec/traceabilityMatrix.d.ts +2 -0
  94. package/dist/tools/spec/traceabilityMatrix.d.ts.map +1 -1
  95. package/dist/tools/spec/traceabilityMatrix.js +50 -1
  96. package/dist/tools/spec/traceabilityMatrix.js.map +1 -1
  97. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.d.ts +10 -0
  98. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.d.ts.map +1 -0
  99. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.js +89 -0
  100. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.js.map +1 -0
  101. package/dist/tools/spec/traceabilityMatrix.test.js +19 -0
  102. package/dist/tools/spec/traceabilityMatrix.test.js.map +1 -1
  103. package/hooks/hooks.json +3 -9
  104. package/hooks/scripts/__tests__/.vibe/command-log.txt +39 -0
  105. package/hooks/scripts/__tests__/.vibe/memories/memories.db +0 -0
  106. package/hooks/scripts/__tests__/.vibe/memories/memories.db-shm +0 -0
  107. package/hooks/scripts/__tests__/.vibe/memories/memories.db-wal +0 -0
  108. package/hooks/scripts/__tests__/auto-test-debounce.test.js +145 -0
  109. package/hooks/scripts/__tests__/code-check-detectors.test.js +155 -0
  110. package/hooks/scripts/__tests__/dispatcher-inprocess.test.js +99 -0
  111. package/hooks/scripts/__tests__/post-edit-dispatcher.test.js +139 -0
  112. package/hooks/scripts/__tests__/pre-tool-guard.test.js +115 -1
  113. package/hooks/scripts/__tests__/run-ledger-verify-required.test.js +146 -0
  114. package/hooks/scripts/__tests__/run-ledger.test.js +330 -0
  115. package/hooks/scripts/__tests__/scope-from-spec.test.js +215 -0
  116. package/hooks/scripts/__tests__/sentinel-guard.test.js +79 -24
  117. package/hooks/scripts/__tests__/step-counter.test.js +95 -15
  118. package/hooks/scripts/__tests__/utils-npm-root.test.js +98 -0
  119. package/hooks/scripts/auto-commit.js +30 -11
  120. package/hooks/scripts/auto-format.js +96 -26
  121. package/hooks/scripts/auto-test.js +187 -37
  122. package/hooks/scripts/code-check.js +292 -99
  123. package/hooks/scripts/codex-hook-adapter.js +12 -1
  124. package/hooks/scripts/command-log.js +26 -16
  125. package/hooks/scripts/lib/dispatcher.js +38 -0
  126. package/hooks/scripts/lib/hook-context.js +101 -0
  127. package/hooks/scripts/lib/pr-gate-runner.js +62 -0
  128. package/hooks/scripts/lib/run-ledger.js +169 -0
  129. package/hooks/scripts/lib/scope-from-spec.js +40 -7
  130. package/hooks/scripts/post-edit-dispatcher.js +93 -20
  131. package/hooks/scripts/post-edit.js +40 -19
  132. package/hooks/scripts/pr-test-gate.js +8 -37
  133. package/hooks/scripts/pre-tool-dispatcher.js +18 -16
  134. package/hooks/scripts/pre-tool-guard.js +55 -52
  135. package/hooks/scripts/prompt-dispatcher.js +10 -0
  136. package/hooks/scripts/scope-guard.js +40 -39
  137. package/hooks/scripts/sentinel-guard.js +41 -41
  138. package/hooks/scripts/session-start.js +41 -16
  139. package/hooks/scripts/step-counter.js +100 -7
  140. package/hooks/scripts/stop-dispatcher.js +26 -0
  141. package/hooks/scripts/utils.js +96 -30
  142. package/hooks/scripts/verify-ledger.js +22 -0
  143. package/package.json +2 -2
  144. package/skills/arch-guard/SKILL.md +2 -2
  145. package/skills/characterization-test/SKILL.md +2 -2
  146. package/skills/exec-plan/SKILL.md +2 -2
  147. package/skills/spec/SKILL.md +6 -312
  148. package/skills/spec/references/askuser-examples.md +57 -0
  149. package/skills/spec/references/example-session.md +87 -0
  150. package/skills/spec/references/templates.md +194 -0
  151. package/skills/vibe.run/SKILL.md +145 -1682
  152. package/skills/vibe.run/references/brand-assets.md +59 -0
  153. package/skills/vibe.run/references/parallel-agents.md +326 -0
  154. package/skills/vibe.run/references/race-review.md +272 -0
  155. package/skills/vibe.run/references/ralph-loop.md +172 -0
  156. package/skills/vibe.run/references/ultrawork-mode.md +148 -0
  157. package/skills/vibe.trace/SKILL.md +25 -38
  158. package/skills/vibe.verify/SKILL.md +15 -0
  159. package/vibe/templates/claudemd-template.md +1 -1
  160. package/hooks/scripts/figma-guard.js +0 -219
@@ -0,0 +1,59 @@
1
+ # Brand Assets Generation — Full Reference
2
+
3
+ > Loaded by vibe.run SKILL.md when starting a new project with brand context in SPEC.
4
+
5
+ ## Brand Assets Generation (Optional)
6
+
7
+ When starting a **new project** with brand context in SPEC, auto-generate app icons and favicons:
8
+
9
+ ```
10
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
11
+ BRAND ASSETS GENERATION
12
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13
+
14
+ [Check] Brand assets exist? → Skip if favicon.ico exists
15
+ [Check] Antigravity API configured? → Required for image generation
16
+ [Check] SPEC has brand context? → Extract app name, colors, style
17
+
18
+ [Generate] Creating app icon with Antigravity Image API...
19
+ - Prompt: "App icon for [AppName], [style], [color]..."
20
+ - Generated: 512x512 master icon
21
+
22
+ [Resize] Creating platform variants...
23
+ favicon.ico (16/32/48)
24
+ favicon-16x16.png
25
+ favicon-32x32.png
26
+ apple-touch-icon.png (180x180)
27
+ android-chrome-192x192.png
28
+ android-chrome-512x512.png
29
+ site.webmanifest
30
+
31
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
32
+ Brand assets generated in public/
33
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
34
+ ```
35
+
36
+ ## SPEC Brand Context Example
37
+
38
+ ```xml
39
+ <context>
40
+ Brand:
41
+ - App Name: MyApp
42
+ - Primary Color: #2F6BFF
43
+ - Style: Modern, minimalist, flat design
44
+ - Icon Concept: Abstract geometric shape
45
+ </context>
46
+ ```
47
+
48
+ ## Trigger Conditions
49
+
50
+ - First `/vibe.run` execution (no existing icons)
51
+ - SPEC contains brand/design context
52
+ - Antigravity API key configured (`vibe antigravity key <key>`)
53
+
54
+ ## Manual Generation
55
+
56
+ ```bash
57
+ # [LLM_SCRIPT] = {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js
58
+ node "[LLM_SCRIPT]" antigravity image "App icon for MyApp, primary color #2F6BFF, square format 1:1, simple recognizable design, works well at small sizes, no text or letters, solid or gradient background, modern minimalist" --output "./public/app-icon.png"
59
+ ```
@@ -0,0 +1,326 @@
1
+ # Parallel Agents & Model Orchestration — Full Reference
2
+
3
+ > Loaded by vibe.run SKILL.md when parallel execution patterns, agent teams, or model selection details are needed.
4
+
5
+ ## Model Orchestration (Intelligent Routing)
6
+
7
+ Automatically select optimal model based on **task complexity analysis**.
8
+
9
+ ### Complexity-Based Model Selection
10
+
11
+ | Complexity Score | Model | When to Use |
12
+ |------------------|-------|-------------|
13
+ | 0-7 (Low) | **Haiku** | Simple fixes, searches, single file changes |
14
+ | 8-19 (Medium) | **Sonnet** | Standard features, 3-5 files, integrations |
15
+ | 20+ (High) | **Opus** | Architecture, security, multi-service, 6+ files |
16
+
17
+ ### Complexity Signals
18
+
19
+ | Signal | Score |
20
+ |--------|-------|
21
+ | Architecture change | +15 |
22
+ | Security implication | +12 |
23
+ | Multi-service | +8 |
24
+ | Refactoring | +12 |
25
+ | 6+ files | +15 |
26
+ | 3-5 files | +8 |
27
+ | New feature | +5 |
28
+ | Bug fix | -3 |
29
+ | Documentation | -5 |
30
+
31
+ ### Agent Tier System
32
+
33
+ | Agent | Low (Haiku) | Medium (Sonnet) | High (Opus) |
34
+ |-------|-------------|-----------------|-------------|
35
+ | explorer | explorer-low | explorer-medium | explorer |
36
+ | implementer | implementer-low | implementer-medium | implementer |
37
+ | architect | architect-low | architect-medium | architect |
38
+
39
+ ### Task Calls by Role
40
+
41
+ | Task Type | Model | Task Parameter |
42
+ |-----------|-------|----------------|
43
+ | Simple search | Haiku | `model: "haiku"` |
44
+ | Codebase exploration | Haiku/Sonnet | Auto-selected |
45
+ | Core implementation | Sonnet | `model: "sonnet"` |
46
+ | Test writing | Haiku | `model: "haiku"` |
47
+ | Architecture decisions | Opus | Main session |
48
+ | Final review | Opus | Main session |
49
+
50
+ ## Mandatory Parallel Exploration (Phase Start)
51
+
52
+ **BEFORE any implementation, you MUST launch these Task calls IN PARALLEL (single message, multiple tool calls):**
53
+
54
+ ```
55
+ ┌─────────────────────────────────────────────────────────────────┐
56
+ │ STEP 1: PARALLEL EXPLORATION (REQUIRED) │
57
+ │ │
58
+ │ Launch ALL of these in ONE message: │
59
+ │ │
60
+ │ Task(haiku) ─┬─→ "Analyze related files in <context>" │
61
+ │ │ │
62
+ │ Task(haiku) ─┼─→ "Check dependencies and imports" │
63
+ │ │ │
64
+ │ Task(haiku) ─┴─→ "Find existing patterns and conventions" │
65
+ │ │
66
+ │ [If GPT enabled] Bash: node "[LLM_SCRIPT]" gpt orchestrate-json "[question]"
67
+ │ [If Antigravity enabled] Bash: node "[LLM_SCRIPT]" antigravity orchestrate-json "[question]"
68
+ └─────────────────────────────────────────────────────────────────┘
69
+
70
+ ↓ (wait for all to complete)
71
+ ┌─────────────────────────────────────────────────────────────────┐
72
+ │ STEP 2: SYNTHESIZE (Opus) │
73
+ │ - Review all exploration results │
74
+ │ - Decide implementation approach │
75
+ │ - Identify files to modify/create │
76
+ └─────────────────────────────────────────────────────────────────┘
77
+
78
+
79
+ ┌─────────────────────────────────────────────────────────────────┐
80
+ │ STEP 3: IMPLEMENT + BACKGROUND AGENTS (PARALLEL) │
81
+ │ │
82
+ │ Main Agent (sonnet): │
83
+ │ └─→ Execute current phase implementation │
84
+ │ │
85
+ │ Background Agents (haiku, run_in_background=true): │
86
+ │ ├─→ Task: "Prepare Phase N+1 - analyze required files" │
87
+ │ ├─→ Task: "Pre-generate test cases for current implementation" │
88
+ │ └─→ Task: "Search for related types/interfaces needed" │
89
+ │ │
90
+ │ [ULTRAWORK] All 4 agents run simultaneously! │
91
+ └─────────────────────────────────────────────────────────────────┘
92
+
93
+ ↓ (main completes, check backgrounds)
94
+ ┌─────────────────────────────────────────────────────────────────┐
95
+ │ STEP 4: TEST + PHASE PIPELINING │
96
+ │ │
97
+ │ Current Phase: │
98
+ │ └─→ Task(haiku): Write tests using pre-generated cases │
99
+ │ │
100
+ │ Next Phase Prep (from background results): │
101
+ │ └─→ Already have file analysis, ready to start immediately │
102
+ └─────────────────────────────────────────────────────────────────┘
103
+ ```
104
+
105
+ ### Parallel Task Call Pattern (MUST FOLLOW)
106
+
107
+ **Correct — Single message with multiple parallel Tasks:**
108
+ ```
109
+ <message>
110
+ Task(haiku, "Analyze src/components/ for existing patterns")
111
+ Task(haiku, "Check package.json dependencies")
112
+ Task(haiku, "Find usage of similar features in codebase")
113
+ </message>
114
+ → All 3 run simultaneously, ~3x faster
115
+ ```
116
+
117
+ **WRONG — Sequential calls (DO NOT DO THIS):**
118
+ ```
119
+ <message>Task(haiku, "Analyze...")</message>
120
+ <message>Task(haiku, "Check...")</message>
121
+ <message>Task(haiku, "Find...")</message>
122
+ → 3x slower, wastes time
123
+ ```
124
+
125
+ ### Background Agent Pattern (ULTRAWORK) via Orchestrator
126
+
127
+ ```bash
128
+ # Start background agent (doesn't block)
129
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep').then(r => console.log(r.content[0].text)))"
130
+
131
+ # Multiple backgrounds in parallel
132
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(async o => {
133
+ await Promise.all([
134
+ o.runAgent('Phase 2 prep: Analyze auth API endpoints', 'phase2-prep'),
135
+ o.runAgent('Pre-generate test cases for login form', 'test-prep'),
136
+ o.runAgent('Find existing validation patterns', 'pattern-finder')
137
+ ]);
138
+ console.log('All background agents started');
139
+ })"
140
+ ```
141
+
142
+ **Check background agent status:**
143
+ ```bash
144
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => console.log(o.status().content[0].text))"
145
+ ```
146
+
147
+ **Get result when ready:**
148
+ ```bash
149
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/infra/orchestrator/index.js').then(o => o.getResult('SESSION_ID').then(r => console.log(r.content[0].text)))"
150
+ ```
151
+
152
+ ### Phase Execution Flow (ULTRAWORK Pipeline)
153
+
154
+ ```
155
+ Phase N Start
156
+
157
+ ├─→ [PARALLEL] Task(haiku) × 3: Exploration
158
+ │ - Related code analysis
159
+ │ - Dependency check
160
+ │ - Pattern discovery
161
+
162
+ ↓ (all complete)
163
+
164
+ ├─→ Opus: Synthesize and decide
165
+
166
+ ├─→ [PARALLEL PIPELINE] ←── KEY SPEED OPTIMIZATION
167
+ │ │
168
+ │ ├─→ Main: Task(sonnet) Implementation
169
+ │ │
170
+ │ └─→ Background (run_in_background=true):
171
+ │ ├─→ Task(haiku): Phase N+1 file analysis
172
+ │ ├─→ Task(haiku): Test case preparation
173
+ │ └─→ Task(haiku): Type/interface lookup
174
+
175
+ ↓ (main completes)
176
+
177
+ ├─→ Task(haiku): Tests (uses pre-generated cases)
178
+
179
+
180
+ Phase N Complete
181
+
182
+ ↓ (Background results ready — NO WAIT for Phase N+1 exploration!)
183
+
184
+ Phase N+1 Start (IMMEDIATE — exploration already done!)
185
+ ```
186
+
187
+ **Speed Comparison:**
188
+
189
+ | Mode | Phase Time | 5 Phases Total |
190
+ |------|------------|----------------|
191
+ | Sequential | ~2min/phase | ~10min |
192
+ | Parallel Exploration | ~1.5min/phase | ~7.5min |
193
+ | **ULTRAWORK Pipeline** | **~1min/phase** | **~5min** |
194
+
195
+ **Why Pipeline is Faster:**
196
+ - Background agents prepare next phase WHILE current phase implements
197
+ - No idle time between phases
198
+ - Test cases pre-generated during implementation
199
+ - Cache stays warm across parallel tasks
200
+
201
+ ## Agent Teams
202
+
203
+ ### Dev Team (Full)
204
+
205
+ > **팀 정의**: `agents/teams/dev-team.md` 참조
206
+ > 설정: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` + `teammateMode: in-process`
207
+
208
+ **활성화 조건:**
209
+ - ULTRAWORK 모드 + 3개 이상 시나리오
210
+ - 또는 복잡도 점수 20+ (High)
211
+
212
+ ### Lite Team (Normal Mode)
213
+
214
+ > **팀 정의**: `agents/teams/lite-team.md` 참조
215
+
216
+ **활성화 조건:**
217
+ - 일반 모드 + 3개 이상 시나리오
218
+ - 복잡도 점수 8-19 (Medium)
219
+ - 단순 구현(1-2 파일, 시나리오 2개 이하)에서는 기존 병렬 모드 유지
220
+
221
+ **팀 선택 기준:**
222
+
223
+ | 조건 | 팀 |
224
+ |------|-----|
225
+ | 시나리오 1-2개, 파일 1-2개 | 기존 병렬 모드 (팀 없음) |
226
+ | 시나리오 3개+, 일반 모드 | **Lite Team (3명)** |
227
+ | ULTRAWORK 또는 복잡도 20+ | Dev Team Full (4명) |
228
+
229
+ ### Review Team
230
+
231
+ > **팀 정의**: `agents/teams/review-debate-team.md` 참조
232
+
233
+ **활성화 조건:**
234
+ - `/vibe.review` 실행 후 P1 또는 P2 이슈 2개 이상 발견 시
235
+ - Agent Teams 환경변수 활성화 상태
236
+
237
+ ### Debug Team
238
+
239
+ > **팀 정의**: `agents/teams/debug-team.md` 참조
240
+
241
+ **활성화 조건:**
242
+ - 동일 빌드/테스트 실패 3회 이상
243
+ - architecture-level uncertainty during review (stuck on root cause)
244
+
245
+ ### Research Team
246
+
247
+ > **팀 정의**: `agents/teams/research-team.md` 참조
248
+
249
+ **활성화 조건:**
250
+ - `/vibe.spec` Step 3 리서치 단계
251
+ - Agent Teams 환경변수 활성화 상태
252
+
253
+ ### Security Team
254
+
255
+ > **팀 정의**: `agents/teams/security-team.md` 참조
256
+
257
+ **활성화 조건:**
258
+ - auth, payment, user-data, crypto 관련 파일 변경 감지 시
259
+ - 또는 수동으로 `security` 키워드 지정 시
260
+
261
+ ### Migration Team
262
+
263
+ > **팀 정의**: `agents/teams/migration-team.md` 참조
264
+
265
+ **활성화 조건:**
266
+ - package.json 주요 의존성 버전 변경 감지 시
267
+ - 또는 수동으로 `migration` 키워드 지정 시
268
+
269
+ ### Fullstack Team
270
+
271
+ > **팀 정의**: `agents/teams/fullstack-team.md` 참조
272
+
273
+ **활성화 조건:**
274
+ - SPEC에 frontend + backend 파일이 모두 포함된 경우
275
+ - 또는 수동으로 `fullstack` 키워드 지정 시
276
+
277
+ ## External LLM Usage (When Enabled)
278
+
279
+ When external LLMs are enabled in `.vibe/config.json`:
280
+
281
+ | Role | Method | Condition |
282
+ |------|--------|-----------|
283
+ | User direct query | `gpt.question`, `antigravity.question` | Hook auto-handles |
284
+ | Internal orchestration | Call global script via Bash | Claude calls directly |
285
+
286
+ **Claude internal calls (directly via Bash):**
287
+ ```bash
288
+ # [LLM_SCRIPT] = {{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js
289
+
290
+ # GPT call (short prompt - CLI arg)
291
+ node "[LLM_SCRIPT]" gpt orchestrate-json "[question content]"
292
+
293
+ # Antigravity call
294
+ node "[LLM_SCRIPT]" antigravity orchestrate-json "[question content]"
295
+
296
+ # Long prompt - use --input file (write JSON file first with Write tool)
297
+ node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/input.json"
298
+ ```
299
+
300
+ ### External LLM Fallback
301
+
302
+ **When GPT/Antigravity hook fails, Claude MUST handle the task directly:**
303
+ - Do NOT retry the external LLM call
304
+ - Claude handles the task using its own capabilities
305
+ - Continue with the implementation without interruption
306
+ - Log the fallback but don't block progress
307
+
308
+ ## Codex Plugin Integration
309
+
310
+ > **Codex 플러그인 감지**: 워크플로우 시작 시 아래 명령으로 자동 감지.
311
+
312
+ ```bash
313
+ CODEX_AVAILABLE=$(node "{{VIBE_PATH}}/hooks/scripts/codex-detect.js" 2>/dev/null || echo "unavailable")
314
+ ```
315
+
316
+ `available`이면 `/codex:rescue` (구현 위임), `/codex:review` (코드 리뷰) 자동 호출.
317
+
318
+ **독립 시나리오 위임:**
319
+ ```
320
+ /codex:rescue "Implement scenario: {scenario-name}. Files: {file-list}. Requirements: {requirements-summary}" --background
321
+ ```
322
+
323
+ **위임 기준:**
324
+ - 시나리오 간 파일 의존성 없음 (독립적)
325
+ - 시나리오 복잡도 중간 이하
326
+ - 의존성 있는 시나리오는 Claude가 직접 구현
@@ -0,0 +1,272 @@
1
+ # Race Code Review & Quality Gate — Full Reference
2
+
3
+ > Loaded by vibe.run SKILL.md when Race Review (GPT+Antigravity), quality gate thresholds, or type safety details are needed.
4
+
5
+ ## Race Code Review (GPT + Antigravity) + Auto-Fix (v2.6.9)
6
+
7
+ After all scenarios are implemented, **GPT and Antigravity review in parallel with cross-validation**:
8
+
9
+ > **ULTRAWORK Default**: In ULTRAWORK mode, race review is automatically enabled.
10
+
11
+ ```
12
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13
+ RACE CODE REVIEW (GPT + Antigravity)
14
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+
16
+ [Step 1] Parallel review execution...
17
+ ├─ GPT Codex: Reviewing...
18
+ └─ Antigravity: Reviewing...
19
+
20
+ [Step 2] Cross-validation results:
21
+ ┌──────────────────────────────────────────────────────────────────┐
22
+ │ Issue │ GPT │ Antigravity │ Codex │ Confidence│
23
+ │────────────────────────────────│─────│────────│───────│───────────│
24
+ │ Timing attack in password │ │ │ │ 100% → P1 │
25
+ │ Rate limiting missing │ │ │ │ 100% → P1 │
26
+ │ Magic number usage │ │ │ │ 50% → P2 │
27
+ └──────────────────────────────────────────────────────────────────┘
28
+
29
+ Summary: 3 issues (P1: 2, P2: 1)
30
+
31
+ [Step 3] Auto-fixing P1/P2 issues...
32
+ auth.service.ts:24 - Applied timingSafeEqual (P1)
33
+ auth.controller.ts:15 - Added rate limiter (P1)
34
+ auth.service.ts:42 - Extracted constant (P2)
35
+
36
+ [Step 4] Re-verifying...
37
+ Build succeeded
38
+ Tests passed
39
+
40
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
41
+ Race review complete! 3 improvements (2 P1, 1 P2)
42
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
43
+ ```
44
+
45
+ ## Race Review Invocation
46
+
47
+ **Use --input file to avoid CLI argument length limits and Windows pipe issues.**
48
+
49
+ 1. Save code to review into `[SCRATCHPAD]/review-code.txt` (using Write tool)
50
+ 2. Write JSON input file `[SCRATCHPAD]/review-input.json` (using Write tool):
51
+ - `{"prompt": "Review this code for security, performance, and best practices. Return JSON: {issues: [{id, title, description, severity, suggestion}]}. Code: [CODE_CONTENT]"}`
52
+ 3. Script path: `[LLM_SCRIPT]` = `{{VIBE_PATH}}/hooks/scripts/llm-orchestrate.js`
53
+ 4. Run GPT + Antigravity in PARALLEL (two Bash tool calls at once):
54
+
55
+ ```bash
56
+ # GPT review (Bash tool call 1)
57
+ node "[LLM_SCRIPT]" gpt orchestrate-json --input "[SCRATCHPAD]/review-input.json"
58
+ ```
59
+
60
+ ```bash
61
+ # Antigravity review (Bash tool call 2 - run in parallel)
62
+ node "[LLM_SCRIPT]" antigravity orchestrate-json --input "[SCRATCHPAD]/review-input.json"
63
+ ```
64
+
65
+ **Confidence-based Priority:**
66
+
67
+ | Confidence | Priority | Action |
68
+ |------------|----------|--------|
69
+ | 100% (3/3 or 2/2) | P1 | Auto-fix immediately |
70
+ | 67% (2/3) | P1 | Auto-fix immediately |
71
+ | 50% (1/2) or 33% (1/3) | P2 | Auto-fix with review |
72
+
73
+ **Fallback handling:**
74
+ - If one LLM fails → Use remaining LLM results (reduced confidence)
75
+ - If all fail → Skip and proceed (log warning)
76
+
77
+ **Review application rules:**
78
+
79
+ | Feedback Type | Action |
80
+ |---------------|--------|
81
+ | Security vulnerability (P1) | Auto-fix immediately |
82
+ | Performance improvement (P1/P2) | Auto-fix immediately |
83
+ | Best practices (P2) | Auto-fix |
84
+ | Style/preference (P3) | Apply selectively |
85
+
86
+ **Conditions:**
87
+ - **ULTRAWORK**: Race review enabled by default
88
+ - **Normal mode**: Use `--race` flag to enable
89
+ - Must re-verify build/tests after fixes
90
+
91
+ ### Codex Code Review (Codex 플러그인 활성화 시)
92
+
93
+ GPT+Antigravity race와 **동시에** Codex review 실행:
94
+
95
+ ```
96
+ /codex:review
97
+ ```
98
+
99
+ 결과를 race review 교차 검증에 포함 — 3중 리뷰:
100
+
101
+ ```markdown
102
+ | Issue | GPT | Antigravity | Codex | Confidence |
103
+ |-------|-----|--------|-------|------------|
104
+ | {이슈} | ✅/❌ | ✅/❌ | ✅/❌ | {%} |
105
+ ```
106
+
107
+ ## Implementation Quality Checklist
108
+
109
+ Before marking any scenario as complete, ALL items must pass:
110
+
111
+ | Category | Check Item | Weight |
112
+ |----------|------------|--------|
113
+ | **Functionality** | All Given/When/Then conditions verified | 20% |
114
+ | **Functionality** | Edge cases handled per scenario | 10% |
115
+ | **Code Quality** | No `any` types in TypeScript | 10% |
116
+ | **Code Quality** | Functions ≤50 lines, nesting ≤3 levels | 10% |
117
+ | **Code Quality** | No hardcoded values (use constants) | 5% |
118
+ | **Security** | Input validation implemented | 10% |
119
+ | **Security** | Authentication/authorization checked | 5% |
120
+ | **Error Handling** | Try-catch or error states present | 10% |
121
+ | **Error Handling** | User-friendly error messages | 5% |
122
+ | **Testing** | Unit tests exist for core logic | 10% |
123
+ | **Performance** | No N+1 queries or unnecessary loops | 5% |
124
+
125
+ ## Quality Score Calculation
126
+
127
+ ```
128
+ Score = Σ(checked items × weight) / 100
129
+
130
+ Grades:
131
+ - 95-100: EXCELLENT - Ready to merge
132
+ - 90-94: GOOD - Minor improvements required before merge
133
+ - 80-89: FAIR - Significant improvements required
134
+ - 0-79: POOR - Major fixes needed
135
+ ```
136
+
137
+ ## Quality Gate Thresholds
138
+
139
+ | Gate | Minimum Score | Condition |
140
+ |------|---------------|-----------|
141
+ | **Scenario Complete** | 95 | Each scenario must score ≥95 |
142
+ | **Phase Complete** | 95 | Average of all scenarios ≥95 |
143
+ | **Feature Complete** | 95 | All phases complete + Antigravity review |
144
+
145
+ ## Auto-Fix Triggers
146
+
147
+ | Issue Type | Auto-Fix Action |
148
+ |------------|-----------------|
149
+ | Missing error handling | Add try-catch wrapper |
150
+ | Hardcoded values | Extract to constants file |
151
+ | Missing input validation | Add validation schema |
152
+ | Function too long | Suggest split points |
153
+ | N+1 query detected | Add eager loading |
154
+
155
+ ### Auto-Fix 실패 시 Codex Rescue (Codex 플러그인 활성화 시)
156
+
157
+ P1 auto-fix가 **3회 실패** 시, Codex에 위임:
158
+
159
+ ```
160
+ /codex:rescue "Fix P1 issue: {issue-description}. File: {file-path}. Error: {error-message}"
161
+ ```
162
+
163
+ ## Forbidden Patterns (Detected — Injected as additionalContext, Block at Commit Gate)
164
+
165
+ > Detection results are injected as `additionalContext` into the model; commit-level blocking occurs via the auto-commit verify gate and pr-test-gate. These patterns do not block file edits directly.
166
+
167
+ | Pattern | Why Forbidden | Detection |
168
+ |---------|---------------|-----------|
169
+ | `console.log` | Debug code in production | Regex scan |
170
+ | `// TODO` without issue | Untracked work | Comment scan |
171
+ | `any` type | Type safety bypass | TypeScript check |
172
+ | `@ts-ignore` | Type error suppression | TypeScript check |
173
+ | Empty catch blocks | Silent error swallowing | AST analysis |
174
+ | Commented-out code | Dead code | Comment scan |
175
+
176
+ ## Type Safety — Language-Specific Guidelines
177
+
178
+ ### Universal Anti-Patterns (All Languages)
179
+
180
+ | Forbidden Pattern | Why | Instead |
181
+ |---------------------|-----|-----------|
182
+ | Type escape hatches (`any`, `Any`, `Object`, `void*`, `interface{}`) | Loses type info, runtime errors | Concrete types or `unknown` + guards |
183
+ | Type suppression (`@ts-ignore`, `# type: ignore`, `@SuppressWarnings`) | Hides errors | Fix actual type issues |
184
+ | Raw generic types (`List`, `Map` without params) | Loses type safety | `List<User>`, `Map<String, Order>` |
185
+ | Excessive casting (`as`, `(Type)`, `unsafe`) | Bypasses compiler | Type guards or pattern matching |
186
+
187
+ ### TypeScript/JavaScript
188
+
189
+ ```typescript
190
+ // BAD
191
+ function process(data: any): any { return data.foo; }
192
+
193
+ // GOOD
194
+ function process(data: unknown): Result {
195
+ if (isValidData(data)) return data.foo;
196
+ throw new Error('Invalid');
197
+ }
198
+ ```
199
+
200
+ ### Python
201
+
202
+ ```python
203
+ # BAD
204
+ def process(data: Any) -> Any: return data["key"]
205
+
206
+ # GOOD
207
+ def process(data: UserData) -> str: return data["name"]
208
+ ```
209
+
210
+ ### Java/Kotlin
211
+
212
+ ```java
213
+ // BAD
214
+ List items = new ArrayList(); // Raw type
215
+
216
+ // GOOD
217
+ List<User> users = new ArrayList<>();
218
+ ```
219
+
220
+ ### Go
221
+
222
+ ```go
223
+ // BAD
224
+ func process(data interface{}) interface{} { ... }
225
+
226
+ // GOOD
227
+ func process(data UserRequest) (UserResponse, error) { ... }
228
+ ```
229
+
230
+ ### Rust
231
+
232
+ ```rust
233
+ // BAD (unnecessary unsafe or Box<dyn Any>)
234
+ let data: Box<dyn Any> = get_data();
235
+
236
+ // GOOD
237
+ let data: UserData = get_data()?;
238
+ ```
239
+
240
+ ### C\#
241
+
242
+ ```csharp
243
+ // BAD
244
+ object data = GetData();
245
+ dynamic result = Process(data);
246
+
247
+ // GOOD
248
+ UserData data = GetData();
249
+ Result result = Process(data);
250
+ ```
251
+
252
+ ### Type Safety Rules
253
+
254
+ | Rule | Description |
255
+ |------|-------------|
256
+ | **Boundary Validation** | Validate only at system boundaries (API, JSON, user input) |
257
+ | **Internal Trust** | After validation, pass only precise types internally |
258
+ | **No Type Escape** | Never use escape hatches to "fix" type errors |
259
+ | **Explicit Signatures** | Specify types in function/method signatures |
260
+ | **Generics with Params** | Always use generics with type parameters |
261
+
262
+ ### Type Violations — Detection & Escalation
263
+
264
+ > Type violations are detected by static analysis and injected as `additionalContext` for the model to act on. Commit-level enforcement occurs at the auto-commit verify gate.
265
+
266
+ | Violation | Detection outcome |
267
+ |-----------|--------|
268
+ | Type escape hatches (`any`, `Any`, `Object`, `interface{}`, etc.) | Injected as P1 finding |
269
+ | Type suppression comments | Injected as P1 finding |
270
+ | Raw generic types | Injected as P1 finding |
271
+ | Missing function return types | Injected as warning |
272
+ | Excessive type casting | Injected as warning |