@su-record/vibe 2.0.0 → 2.0.2

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 (69) hide show
  1. package/.claude/agents/explorer.md +48 -48
  2. package/.claude/agents/implementer.md +53 -53
  3. package/.claude/agents/searcher.md +54 -54
  4. package/.claude/agents/simplifier.md +119 -119
  5. package/.claude/agents/tester.md +49 -49
  6. package/.claude/commands/vibe.analyze.md +239 -239
  7. package/.claude/commands/vibe.continue.md +88 -88
  8. package/.claude/commands/vibe.diagram.md +178 -178
  9. package/.claude/commands/vibe.reason.md +306 -306
  10. package/.claude/commands/vibe.run.md +760 -760
  11. package/.claude/commands/vibe.spec.md +339 -339
  12. package/.claude/commands/vibe.tool.md +153 -153
  13. package/.claude/commands/vibe.ui.md +137 -137
  14. package/.claude/commands/vibe.verify.md +238 -238
  15. package/.claude/settings.json +152 -152
  16. package/.claude/settings.local.json +4 -57
  17. package/.vibe/config.json +9 -0
  18. package/.vibe/constitution.md +184 -184
  19. package/.vibe/rules/core/communication-guide.md +104 -104
  20. package/.vibe/rules/core/development-philosophy.md +52 -52
  21. package/.vibe/rules/core/quick-start.md +120 -120
  22. package/.vibe/rules/quality/bdd-contract-testing.md +388 -388
  23. package/.vibe/rules/quality/checklist.md +276 -276
  24. package/.vibe/rules/quality/testing-strategy.md +437 -437
  25. package/.vibe/rules/standards/anti-patterns.md +369 -369
  26. package/.vibe/rules/standards/code-structure.md +291 -291
  27. package/.vibe/rules/standards/complexity-metrics.md +312 -312
  28. package/.vibe/rules/standards/naming-conventions.md +198 -198
  29. package/.vibe/rules/tools/mcp-hi-ai-guide.md +665 -665
  30. package/.vibe/rules/tools/mcp-workflow.md +51 -51
  31. package/.vibe/setup.sh +31 -31
  32. package/CLAUDE.md +122 -122
  33. package/LICENSE +21 -21
  34. package/README.md +568 -568
  35. package/dist/cli/index.d.ts.map +1 -1
  36. package/dist/cli/index.js +391 -406
  37. package/dist/cli/index.js.map +1 -1
  38. package/dist/lib/MemoryManager.js +92 -92
  39. package/dist/lib/PythonParser.js +108 -108
  40. package/dist/lib/gemini-mcp.js +15 -15
  41. package/dist/lib/gemini-oauth.d.ts.map +1 -1
  42. package/dist/lib/gemini-oauth.js +41 -38
  43. package/dist/lib/gemini-oauth.js.map +1 -1
  44. package/dist/lib/gpt-mcp.js +17 -17
  45. package/dist/lib/gpt-oauth.d.ts.map +1 -1
  46. package/dist/lib/gpt-oauth.js +50 -45
  47. package/dist/lib/gpt-oauth.js.map +1 -1
  48. package/dist/tools/analytics/getUsageAnalytics.js +12 -12
  49. package/dist/tools/memory/createMemoryTimeline.js +10 -10
  50. package/dist/tools/memory/getMemoryGraph.js +12 -12
  51. package/dist/tools/memory/getSessionContext.js +9 -9
  52. package/dist/tools/memory/linkMemories.js +14 -14
  53. package/dist/tools/memory/listMemories.js +4 -4
  54. package/dist/tools/memory/recallMemory.js +4 -4
  55. package/dist/tools/memory/saveMemory.js +4 -4
  56. package/dist/tools/memory/searchMemoriesAdvanced.js +22 -22
  57. package/dist/tools/planning/generatePrd.js +46 -46
  58. package/dist/tools/prompt/enhancePromptGemini.js +160 -160
  59. package/dist/tools/reasoning/applyReasoningFramework.js +56 -56
  60. package/dist/tools/semantic/analyzeDependencyGraph.js +12 -12
  61. package/package.json +67 -67
  62. package/templates/constitution-template.md +184 -184
  63. package/templates/contract-backend-template.md +517 -517
  64. package/templates/contract-frontend-template.md +594 -594
  65. package/templates/feature-template.md +96 -96
  66. package/templates/hooks-template.json +103 -103
  67. package/templates/spec-template.md +199 -199
  68. package/dist/lib/vibe-mcp.d.ts.map +0 -1
  69. package/dist/lib/vibe-mcp.js.map +0 -1
@@ -1,760 +1,760 @@
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
- > **핵심 원칙**: 시나리오가 곧 구현 단위이자 검증 기준. 모든 시나리오 통과 = 품질 보장.
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
- > 비개발자도 품질을 신뢰할 수 있도록, **시나리오 = 구현 = 검증**을 자동화
26
-
27
- ### 핵심 흐름
28
-
29
- ```
30
- ┌─────────────────────────────────────────────────────────────────┐
31
- │ SCENARIO-DRIVEN IMPLEMENTATION │
32
- │ │
33
- │ Feature 파일 로드 │
34
- │ ↓ │
35
- │ ┌──────────────────────────────────────────────────────────┐ │
36
- │ │ Scenario 1: Happy Path │ │
37
- │ │ Given → When → Then │ │
38
- │ │ ↓ │ │
39
- │ │ [구현] → [즉시 검증] → ✅ Pass │ │
40
- │ └──────────────────────────────────────────────────────────┘ │
41
- │ ↓ │
42
- │ ┌──────────────────────────────────────────────────────────┐ │
43
- │ │ Scenario 2: Edge Case │ │
44
- │ │ Given → When → Then │ │
45
- │ │ ↓ │ │
46
- │ │ [구현] → [즉시 검증] → ❌ Fail → [수정] → ✅ Pass │ │
47
- │ └──────────────────────────────────────────────────────────┘ │
48
- │ ↓ │
49
- │ ┌──────────────────────────────────────────────────────────┐ │
50
- │ │ Scenario N: ... │ │
51
- │ │ [구현] → [즉시 검증] → ✅ Pass │ │
52
- │ └──────────────────────────────────────────────────────────┘ │
53
- │ ↓ │
54
- │ ┌──────────────────────────────────────────────────────────┐ │
55
- │ │ 📊 QUALITY REPORT │ │
56
- │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │ │
57
- │ │ 시나리오: 5/5 통과 ✅ │ │
58
- │ │ 품질 점수: 94/100 │ │
59
- │ │ 빌드: ✅ | 테스트: ✅ │ │
60
- │ └──────────────────────────────────────────────────────────┘ │
61
- └─────────────────────────────────────────────────────────────────┘
62
- ```
63
-
64
- ### 시나리오 = 구현 단위
65
-
66
- **기존 방식 (Phase 기반)**:
67
- ```
68
- Phase 1 → Phase 2 → Phase 3 → ... → 마지막에 검증
69
-
70
- "어디서 잘못됐지?"
71
- ```
72
-
73
- **SDD 방식 (Scenario 기반)**:
74
- ```
75
- Scenario 1 → 구현 → 검증 ✅
76
- Scenario 2 → 구현 → 검증 ✅
77
- Scenario 3 → 구현 → 검증 ❌ → 수정 → ✅
78
- ...
79
- 전체 통과 = 품질 보장
80
- ```
81
-
82
- ### 검증 자동화
83
-
84
- 각 시나리오 구현 후 **자동 검증**:
85
-
86
- | 검증 항목 | 자동 체크 |
87
- |-----------|-----------|
88
- | Given (전제조건) | 상태/데이터 준비 확인 |
89
- | When (행동) | 기능 실행 가능 여부 |
90
- | Then (결과) | 예상 결과 일치 여부 |
91
- | 코드 품질 | 복잡도, 스타일, 보안 |
92
-
93
- ### 실패 시 자동 수정
94
-
95
- ```
96
- Scenario 검증 실패
97
-
98
- [원인 분석] - 어떤 Then 조건이 실패?
99
-
100
- [수정 구현] - 해당 부분만 수정
101
-
102
- [재검증] - 다시 체크
103
-
104
- 통과할 때까지 반복 (최대 3회)
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: .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 `.vibe/rules/`:**
226
- - `core/development-philosophy.md` - Surgical precision, modify only requested scope
227
- - `core/quick-start.md` - Korean, DRY, SRP, YAGNI
228
- - `standards/complexity-metrics.md` - Functions ≤20 lines, nesting ≤3 levels
229
- - `quality/checklist.md` - Code quality checklist
230
-
231
- ## Description
232
-
233
- Read PTCF structured SPEC document and execute implementation immediately.
234
-
235
- > **PLAN, TASKS documents unnecessary** - SPEC is the executable prompt
236
-
237
- ## Model Orchestration
238
-
239
- Automatically select optimal model based on task type:
240
-
241
- ```
242
- ┌─────────────────────────────────────────────────────────────┐
243
- │ Opus 4.5 (Orchestrator) │
244
- │ - Coordinate overall flow │
245
- │ - Final decisions/review │
246
- └─────────────────────────┬───────────────────────────────────┘
247
-
248
- ┌─────────────────────┼─────────────────────┐
249
- ↓ ↓ ↓
250
- ┌─────────┐ ┌─────────┐ ┌─────────┐
251
- │ Haiku │ │ Sonnet │ │ Haiku │
252
- │(Explore)│ │ (Impl) │ │ (Test) │
253
- └─────────┘ └─────────┘ └─────────┘
254
- ```
255
-
256
- ### Task Calls by Role
257
-
258
- | Task Type | Model | Task Parameter |
259
- |-----------|-------|----------------|
260
- | Codebase exploration | Haiku 4.5 | `model: "haiku"` |
261
- | Core implementation | Sonnet 4 | `model: "sonnet"` |
262
- | Test writing | Haiku 4.5 | `model: "haiku"` |
263
- | Architecture decisions | Opus 4.5 | Main session |
264
- | Final review | Opus 4.5 | Main session |
265
-
266
- ### External LLM Usage (When Enabled)
267
-
268
- When external LLMs are enabled in `.vibe/config.json`:
269
-
270
- | Role | Model | Condition |
271
- |------|-------|-----------|
272
- | Architecture/Debugging | GPT 5.2 | When `vibe gpt <key>` executed |
273
- | UI/UX Design, Exploration | Gemini 2.5/3 | When `vibe gemini --auth` executed |
274
-
275
- When external LLM enabled, automatically called via MCP:
276
- - `mcp__vibe-gpt__chat` - GPT 5.2 architecture consultation
277
- - `mcp__vibe-gemini__gemini_chat` - Gemini 질문/상담
278
- - `mcp__vibe-gemini__gemini_analyze_code` - 코드 분석
279
- - `mcp__vibe-gemini__gemini_review_ui` - UI/UX 리뷰
280
- - `mcp__vibe-gemini__gemini_quick_ask` - 빠른 질문 (탐색용)
281
-
282
- ### External LLM Fallback
283
-
284
- **IMPORTANT**: When Gemini/GPT MCP returns `"status": "fallback"`, Claude MUST handle the task directly:
285
-
286
- ```json
287
- {
288
- "status": "fallback",
289
- "reason": "rate_limit", // or "auth_error"
290
- "message": "Gemini API 할당량 초과. Claude가 직접 처리해주세요."
291
- }
292
- ```
293
-
294
- **Fallback behavior**:
295
- - Do NOT retry the external LLM call
296
- - Claude handles the task using its own capabilities
297
- - Continue with the implementation without interruption
298
- - Log the fallback but don't block progress
299
-
300
- ## Semantic Code Analysis (hi-ai MCP)
301
-
302
- Use hi-ai MCP semantic tools to accurately understand codebase before implementation:
303
-
304
- | MCP Tool | Purpose | When Used |
305
- |----------|---------|-----------|
306
- | `vibe_find_symbol` | Find symbol definitions | Locate class/function |
307
- | `vibe_find_references` | Find references | Analyze impact scope |
308
- | `vibe_analyze_complexity` | Analyze complexity | Determine refactoring need |
309
- | `vibe_validate_code_quality` | Validate quality | Verify post-implementation quality |
310
-
311
- ### Semantic Analysis Flow
312
-
313
- ```
314
- Start Implementation
315
-
316
- ├─→ find_symbol: Locate exact position of function/class to modify
317
-
318
- ├─→ find_references: Check all places using that symbol
319
-
320
- ├─→ analyze_complexity: Check existing code complexity
321
-
322
-
323
- Implementation (with accurate understanding of impact scope)
324
-
325
-
326
- validate_code_quality: Verify quality after implementation
327
- ```
328
-
329
- ### Context Management (Session Continuity)
330
-
331
- | MCP Tool | Purpose |
332
- |----------|---------|
333
- | `vibe_start_session` | Start session, restore previous context |
334
- | `vibe_auto_save_context` | Auto-save current state |
335
- | `vibe_restore_session_context` | Restore previous session context |
336
- | `vibe_save_memory` | Save important decisions/patterns |
337
-
338
- **On session start**: `vibe_start_session` auto-restores previous context
339
- **On session end**: Hook auto-executes `vibe_auto_save_context`
340
-
341
- ## Process
342
-
343
- ### 1. Load SPEC + Feature
344
-
345
- ```
346
- 📄 .vibe/specs/{feature-name}.md → SPEC (구조, 제약, 컨텍스트)
347
- 📄 .vibe/features/{feature-name}.feature → Feature (시나리오 = 구현 단위)
348
- ```
349
-
350
- **Feature 파일이 없으면 에러**:
351
- ```
352
- ❌ Feature 파일이 없습니다.
353
- 먼저 /vibe.spec "{feature-name}"을 실행하세요.
354
- ```
355
-
356
- ### 2. Scenario 목록 추출
357
-
358
- Feature 파일에서 모든 Scenario 추출:
359
-
360
- ```markdown
361
- ## Scenarios to Implement
362
-
363
- | # | Scenario | Status |
364
- |---|----------|--------|
365
- | 1 | 유효한 로그인 성공 | ⬜ |
366
- | 2 | 잘못된 비밀번호 에러 | ⬜ |
367
- | 3 | 이메일 형식 검증 | ⬜ |
368
- | 4 | 비밀번호 찾기 링크 | ⬜ |
369
-
370
- Total: 4 scenarios
371
- ```
372
-
373
- ### 3. Scenario-by-Scenario Implementation (핵심)
374
-
375
- **각 시나리오마다**:
376
-
377
- ```
378
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
379
- 🎯 Scenario 1/4: 유효한 로그인 성공
380
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
381
-
382
- Given: 사용자가 등록되어 있다
383
- When: 유효한 이메일과 비밀번호로 로그인
384
- Then: 로그인 성공 + JWT 토큰 반환
385
-
386
- [Step 1] 구현 분석...
387
- - 필요한 파일: auth.service.ts, login.controller.ts
388
- - 관련 코드 탐색 중...
389
-
390
- [Step 2] 구현 중...
391
- ✅ auth.service.ts - login() 메서드 추가
392
- ✅ login.controller.ts - POST /login 엔드포인트
393
-
394
- [Step 3] 검증 중...
395
- ✅ Given: 테스트 사용자 생성 가능
396
- ✅ When: 로그인 API 호출 성공
397
- ✅ Then: JWT 토큰 반환 확인
398
-
399
- ✅ Scenario 1 통과!
400
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
401
- ```
402
-
403
- **실패 시**:
404
-
405
- ```
406
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
407
- 🎯 Scenario 2/4: 잘못된 비밀번호 에러
408
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
409
-
410
- [Step 3] 검증 중...
411
- ✅ Given: 테스트 사용자 존재
412
- ✅ When: 잘못된 비밀번호로 로그인 시도
413
- ❌ Then: "Invalid credentials" 에러 메시지
414
- 실제: "Error occurred" 반환됨
415
-
416
- [자동 수정 1/3]
417
- 원인: 에러 메시지 하드코딩 안됨
418
- 수정: auth.service.ts line 42
419
-
420
- [재검증]
421
- ✅ Then: "Invalid credentials" 에러 메시지
422
-
423
- ✅ Scenario 2 통과! (수정 1회)
424
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
425
- ```
426
-
427
- ---
428
-
429
- ## **CRITICAL: Parallel Sub-Agent Execution**
430
-
431
- > **MUST USE PARALLEL TASK CALLS** - This is REQUIRED, not optional.
432
- > Sequential execution when parallel is possible = VIOLATION of this workflow.
433
-
434
- ### Mandatory Parallel Exploration (Phase Start)
435
-
436
- **BEFORE any implementation, you MUST launch these Task calls IN PARALLEL (single message, multiple tool calls):**
437
-
438
- ```
439
- ┌─────────────────────────────────────────────────────────────────┐
440
- │ STEP 1: PARALLEL EXPLORATION (REQUIRED) │
441
- │ │
442
- │ Launch ALL of these in ONE message: │
443
- │ │
444
- │ Task(haiku) ─┬─→ "Analyze related files in <context>" │
445
- │ │ │
446
- │ Task(haiku) ─┼─→ "Check dependencies and imports" │
447
- │ │ │
448
- │ Task(haiku) ─┴─→ "Find existing patterns and conventions" │
449
- │ │
450
- │ [If GPT enabled] + MCP(vibe-gpt): Architecture review │
451
- │ [If Gemini enabled] + MCP(vibe-gemini): UI/UX consultation │
452
- └─────────────────────────────────────────────────────────────────┘
453
-
454
- ↓ (wait for all to complete)
455
- ┌─────────────────────────────────────────────────────────────────┐
456
- │ STEP 2: SYNTHESIZE (Opus) │
457
- │ - Review all exploration results │
458
- │ - Decide implementation approach │
459
- │ - Identify files to modify/create │
460
- └─────────────────────────────────────────────────────────────────┘
461
-
462
-
463
- ┌─────────────────────────────────────────────────────────────────┐
464
- │ STEP 3: IMPLEMENT (Task sonnet) │
465
- │ - Execute implementation with full context │
466
- └─────────────────────────────────────────────────────────────────┘
467
-
468
-
469
- ┌─────────────────────────────────────────────────────────────────┐
470
- │ STEP 4: TEST (Task haiku) │
471
- │ - Write tests for implemented code │
472
- └─────────────────────────────────────────────────────────────────┘
473
- ```
474
-
475
- ### Parallel Task Call Pattern (MUST FOLLOW)
476
-
477
- **Correct - Single message with multiple parallel Tasks:**
478
- ```
479
- <message>
480
- Task(haiku, "Analyze src/components/ for existing patterns")
481
- Task(haiku, "Check package.json dependencies")
482
- Task(haiku, "Find usage of similar features in codebase")
483
- </message>
484
- → All 3 run simultaneously, ~3x faster
485
- ```
486
-
487
- **WRONG - Sequential calls (DO NOT DO THIS):**
488
- ```
489
- <message>Task(haiku, "Analyze...")</message>
490
- <message>Task(haiku, "Check...")</message>
491
- <message>Task(haiku, "Find...")</message>
492
- → 3x slower, wastes time
493
- ```
494
-
495
- ### Why Parallel Matters
496
-
497
- | Approach | Time | Cache Benefit |
498
- |----------|------|---------------|
499
- | Sequential (3 Tasks) | ~30s | Cache cold on each |
500
- | **Parallel (3 Tasks)** | **~10s** | **Cache warmed once, shared** |
501
-
502
- hi-ai ProjectCache (LRU) caches ts-morph parsing results. Parallel calls share the warmed cache.
503
-
504
- ### Phase Execution Flow
505
-
506
- ```
507
- Phase N Start
508
-
509
- ├─→ [PARALLEL] Task(haiku) × 2-3: Exploration
510
- │ - Related code analysis
511
- │ - Dependency check
512
- │ - Pattern discovery
513
-
514
- ↓ (all complete)
515
-
516
- ├─→ Opus: Synthesize and decide
517
-
518
- ├─→ Task(sonnet): Implementation
519
-
520
- ├─→ Task(haiku): Tests
521
-
522
-
523
- Phase N Complete → Next Phase
524
- ```
525
-
526
- ---
527
-
528
- 1. **Related code analysis**: Task(haiku) explores `<context>` related code
529
- 2. **File creation/modification**: Task(sonnet) implements per `<output_format>`
530
- 3. **Constraint compliance**: Check `<constraints>`
531
- 4. **Run verification**: Execute verification commands
532
-
533
- ### 4. Quality Report (자동 생성)
534
-
535
- 모든 시나리오 완료 후 **품질 리포트 자동 생성**:
536
-
537
- ```
538
- ┌─────────────────────────────────────────────────────────────────┐
539
- │ 📊 QUALITY REPORT: login │
540
- ├─────────────────────────────────────────────────────────────────┤
541
- │ │
542
- │ ✅ 시나리오: 4/4 통과 │
543
- │ │
544
- │ ┌───────────────────────────────────────────────────────────┐ │
545
- │ │ # │ Scenario │ Status │ Retries │ │ │
546
- │ │───│───────────────────────────│────────│─────────│ │ │
547
- │ │ 1 │ 유효한 로그인 성공 │ ✅ │ 0 │ │ │
548
- │ │ 2 │ 잘못된 비밀번호 에러 │ ✅ │ 1 │ │ │
549
- │ │ 3 │ 이메일 형식 검증 │ ✅ │ 0 │ │ │
550
- │ │ 4 │ 비밀번호 찾기 링크 │ ✅ │ 0 │ │ │
551
- │ └───────────────────────────────────────────────────────────┘ │
552
- │ │
553
- │ 📈 품질 점수: 94/100 │
554
- │ │
555
- │ ┌─────────────────────────────────────────────────────────┐ │
556
- │ │ 항목 │ 결과 │ 비고 │ │
557
- │ │───────────────────│───────│─────────────────────────────│ │
558
- │ │ 빌드 │ ✅ │ npm run build 성공 │ │
559
- │ │ 테스트 │ ✅ │ 12/12 통과 │ │
560
- │ │ 타입 검사 │ ✅ │ 에러 0개 │ │
561
- │ │ 복잡도 │ ✅ │ 모든 함수 ≤20줄 │ │
562
- │ │ 보안 │ ✅ │ 취약점 0개 │ │
563
- │ └─────────────────────────────────────────────────────────┘ │
564
- │ │
565
- │ ⏱️ 총 소요: 3m 42s │
566
- │ │
567
- └─────────────────────────────────────────────────────────────────┘
568
- ```
569
-
570
- **사용자가 확인할 것**:
571
- - 시나리오 통과율 (4/4 = 100%)
572
- - 품질 점수 (94/100)
573
- - 빌드/테스트 상태
574
-
575
- **이것만 보면 품질을 신뢰할 수 있음.**
576
-
577
- ### 5. Update Feature File
578
-
579
- 시나리오 상태 자동 업데이트:
580
-
581
- ```markdown
582
- ## Coverage
583
-
584
- | Scenario | SPEC AC | Status |
585
- |----------|---------|--------|
586
- | 유효한 로그인 성공 | AC-1 | ✅ |
587
- | 잘못된 비밀번호 에러 | AC-2 | ✅ |
588
- | 이메일 형식 검증 | AC-3 | ✅ |
589
- | 비밀번호 찾기 링크 | AC-4 | ✅ |
590
-
591
- **Last verified**: 2024-01-15 14:32
592
- **Quality score**: 94/100
593
- ```
594
-
595
- ## TRUST 5 Principles
596
-
597
- Follow during implementation:
598
-
599
- | Principle | Description |
600
- |-----------|-------------|
601
- | **T**est-first | Write tests first |
602
- | **R**eadable | Clear code |
603
- | **U**nified | Consistent style |
604
- | **S**ecured | Consider security |
605
- | **T**rackable | Logging, monitoring |
606
-
607
- ## Input
608
-
609
- - `.vibe/specs/{feature-name}.md` (PTCF SPEC)
610
- - `.vibe/features/{feature-name}.feature` (BDD)
611
- - `CLAUDE.md` (project context)
612
-
613
- ## Output
614
-
615
- - Implemented code files
616
- - Test files
617
- - Updated SPEC document (checkmarks)
618
-
619
- ## Example
620
-
621
- ```
622
- User: /vibe.run "login"
623
-
624
- Claude:
625
- 📄 Loading SPEC: .vibe/specs/login.md
626
- 📄 Loading Feature: .vibe/features/login.feature
627
-
628
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
629
- 📋 Scenarios to Implement
630
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
631
-
632
- | # | Scenario | Status |
633
- |---|----------|--------|
634
- | 1 | 유효한 로그인 성공 | ⬜ |
635
- | 2 | 잘못된 비밀번호 에러 | ⬜ |
636
- | 3 | 이메일 형식 검증 | ⬜ |
637
- | 4 | 비밀번호 찾기 링크 | ⬜ |
638
-
639
- Total: 4 scenarios
640
-
641
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
642
- 🎯 Scenario 1/4: 유효한 로그인 성공
643
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
644
-
645
- Given: 사용자가 등록되어 있다
646
- When: 유효한 이메일과 비밀번호로 로그인
647
- Then: 로그인 성공 + JWT 토큰 반환
648
-
649
- ⚡ [PARALLEL] 탐색 중...
650
- ✅ 탐색 완료 (2.1s)
651
-
652
- 🔨 구현 중...
653
- ✅ auth.service.ts - login() 추가
654
- ✅ auth.controller.ts - POST /login
655
-
656
- 🔍 검증 중...
657
- ✅ Given: OK
658
- ✅ When: OK
659
- ✅ Then: OK
660
-
661
- ✅ Scenario 1 통과!
662
-
663
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
664
- 🎯 Scenario 2/4: 잘못된 비밀번호 에러
665
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
666
-
667
- 🔨 구현 중...
668
- ✅ auth.service.ts - 비밀번호 검증 로직
669
-
670
- 🔍 검증 중...
671
- ✅ Given: OK
672
- ✅ When: OK
673
- ❌ Then: "Invalid credentials" 에러 메시지
674
- 실제: "Error" 반환
675
-
676
- 🔄 자동 수정 1/3...
677
- 수정: auth.service.ts line 42
678
-
679
- 🔍 재검증...
680
- ✅ Then: OK
681
-
682
- ✅ Scenario 2 통과! (수정 1회)
683
-
684
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
685
- 🎯 Scenario 3/4: 이메일 형식 검증
686
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
687
-
688
- 🔨 구현 중...
689
- 🔍 검증 중...
690
- ✅ Scenario 3 통과!
691
-
692
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
693
- 🎯 Scenario 4/4: 비밀번호 찾기 링크
694
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
695
-
696
- 🔨 구현 중...
697
- 🔍 검증 중...
698
- ✅ Scenario 4 통과!
699
-
700
- ┌─────────────────────────────────────────────────────────────────┐
701
- │ 📊 QUALITY REPORT: login │
702
- ├─────────────────────────────────────────────────────────────────┤
703
- │ │
704
- │ ✅ 시나리오: 4/4 통과 │
705
- │ │
706
- │ | # | Scenario | Status | Retries | │
707
- │ |---|───────────────────────|───────|─────────| │
708
- │ | 1 | 유효한 로그인 성공 | ✅ | 0 | │
709
- │ | 2 | 잘못된 비밀번호 에러 | ✅ | 1 | │
710
- │ | 3 | 이메일 형식 검증 | ✅ | 0 | │
711
- │ | 4 | 비밀번호 찾기 링크 | ✅ | 0 | │
712
- │ │
713
- │ 📈 품질 점수: 94/100 │
714
- │ 빌드: ✅ | 테스트: ✅ | 타입: ✅ │
715
- │ │
716
- │ ⏱️ 총 소요: 3m 42s │
717
- └─────────────────────────────────────────────────────────────────┘
718
-
719
- 🎉 구현 완료! 모든 시나리오 통과.
720
- ```
721
-
722
- ### Phase-specific Execution
723
-
724
- ```
725
- User: /vibe.run "brick-game" --phase 2
726
-
727
- Claude:
728
- 📄 Reading SPEC: .vibe/specs/brick-game.md
729
- 🎯 Executing Phase 2 only.
730
-
731
- Phase 2: Game Logic
732
- 1. [ ] Paddle movement implementation
733
- 2. [ ] Ball physics engine
734
- 3. [ ] Brick collision handling
735
- 4. [ ] Score system
736
- 5. [ ] Game over conditions
737
-
738
- ⚡ Launching parallel exploration...
739
- [Task(haiku) × 3 launched in parallel]
740
-
741
- 🚀 Starting implementation...
742
- ```
743
-
744
- ## Error Handling
745
-
746
- On failure:
747
- 1. Check error message
748
- 2. Review `<constraints>`
749
- 3. Fix code and retry
750
- 4. If continues to fail, report to user
751
-
752
- ## Next Step
753
-
754
- ```
755
- /vibe.verify "brick-game"
756
- ```
757
-
758
- ---
759
-
760
- ARGUMENTS: $ARGUMENTS
1
+ ---
2
+ description: Execute implementation from SPEC
3
+ argument-hint: "feature name" or --phase N
4
+ ---
5
+
6
+ # /vibe.run
7
+
8
+ Execute **Scenario-Driven Implementation** with automatic quality verification.
9
+
10
+ > **핵심 원칙**: 시나리오가 곧 구현 단위이자 검증 기준. 모든 시나리오 통과 = 품질 보장.
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
+ > 비개발자도 품질을 신뢰할 수 있도록, **시나리오 = 구현 = 검증**을 자동화
26
+
27
+ ### 핵심 흐름
28
+
29
+ ```
30
+ ┌─────────────────────────────────────────────────────────────────┐
31
+ │ SCENARIO-DRIVEN IMPLEMENTATION │
32
+ │ │
33
+ │ Feature 파일 로드 │
34
+ │ ↓ │
35
+ │ ┌──────────────────────────────────────────────────────────┐ │
36
+ │ │ Scenario 1: Happy Path │ │
37
+ │ │ Given → When → Then │ │
38
+ │ │ ↓ │ │
39
+ │ │ [구현] → [즉시 검증] → ✅ Pass │ │
40
+ │ └──────────────────────────────────────────────────────────┘ │
41
+ │ ↓ │
42
+ │ ┌──────────────────────────────────────────────────────────┐ │
43
+ │ │ Scenario 2: Edge Case │ │
44
+ │ │ Given → When → Then │ │
45
+ │ │ ↓ │ │
46
+ │ │ [구현] → [즉시 검증] → ❌ Fail → [수정] → ✅ Pass │ │
47
+ │ └──────────────────────────────────────────────────────────┘ │
48
+ │ ↓ │
49
+ │ ┌──────────────────────────────────────────────────────────┐ │
50
+ │ │ Scenario N: ... │ │
51
+ │ │ [구현] → [즉시 검증] → ✅ Pass │ │
52
+ │ └──────────────────────────────────────────────────────────┘ │
53
+ │ ↓ │
54
+ │ ┌──────────────────────────────────────────────────────────┐ │
55
+ │ │ 📊 QUALITY REPORT │ │
56
+ │ │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ │ │
57
+ │ │ 시나리오: 5/5 통과 ✅ │ │
58
+ │ │ 품질 점수: 94/100 │ │
59
+ │ │ 빌드: ✅ | 테스트: ✅ │ │
60
+ │ └──────────────────────────────────────────────────────────┘ │
61
+ └─────────────────────────────────────────────────────────────────┘
62
+ ```
63
+
64
+ ### 시나리오 = 구현 단위
65
+
66
+ **기존 방식 (Phase 기반)**:
67
+ ```
68
+ Phase 1 → Phase 2 → Phase 3 → ... → 마지막에 검증
69
+
70
+ "어디서 잘못됐지?"
71
+ ```
72
+
73
+ **SDD 방식 (Scenario 기반)**:
74
+ ```
75
+ Scenario 1 → 구현 → 검증 ✅
76
+ Scenario 2 → 구현 → 검증 ✅
77
+ Scenario 3 → 구현 → 검증 ❌ → 수정 → ✅
78
+ ...
79
+ 전체 통과 = 품질 보장
80
+ ```
81
+
82
+ ### 검증 자동화
83
+
84
+ 각 시나리오 구현 후 **자동 검증**:
85
+
86
+ | 검증 항목 | 자동 체크 |
87
+ |-----------|-----------|
88
+ | Given (전제조건) | 상태/데이터 준비 확인 |
89
+ | When (행동) | 기능 실행 가능 여부 |
90
+ | Then (결과) | 예상 결과 일치 여부 |
91
+ | 코드 품질 | 복잡도, 스타일, 보안 |
92
+
93
+ ### 실패 시 자동 수정
94
+
95
+ ```
96
+ Scenario 검증 실패
97
+
98
+ [원인 분석] - 어떤 Then 조건이 실패?
99
+
100
+ [수정 구현] - 해당 부분만 수정
101
+
102
+ [재검증] - 다시 체크
103
+
104
+ 통과할 때까지 반복 (최대 3회)
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: .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 `.vibe/rules/`:**
226
+ - `core/development-philosophy.md` - Surgical precision, modify only requested scope
227
+ - `core/quick-start.md` - Korean, DRY, SRP, YAGNI
228
+ - `standards/complexity-metrics.md` - Functions ≤20 lines, nesting ≤3 levels
229
+ - `quality/checklist.md` - Code quality checklist
230
+
231
+ ## Description
232
+
233
+ Read PTCF structured SPEC document and execute implementation immediately.
234
+
235
+ > **PLAN, TASKS documents unnecessary** - SPEC is the executable prompt
236
+
237
+ ## Model Orchestration
238
+
239
+ Automatically select optimal model based on task type:
240
+
241
+ ```
242
+ ┌─────────────────────────────────────────────────────────────┐
243
+ │ Opus 4.5 (Orchestrator) │
244
+ │ - Coordinate overall flow │
245
+ │ - Final decisions/review │
246
+ └─────────────────────────┬───────────────────────────────────┘
247
+
248
+ ┌─────────────────────┼─────────────────────┐
249
+ ↓ ↓ ↓
250
+ ┌─────────┐ ┌─────────┐ ┌─────────┐
251
+ │ Haiku │ │ Sonnet │ │ Haiku │
252
+ │(Explore)│ │ (Impl) │ │ (Test) │
253
+ └─────────┘ └─────────┘ └─────────┘
254
+ ```
255
+
256
+ ### Task Calls by Role
257
+
258
+ | Task Type | Model | Task Parameter |
259
+ |-----------|-------|----------------|
260
+ | Codebase exploration | Haiku 4.5 | `model: "haiku"` |
261
+ | Core implementation | Sonnet 4 | `model: "sonnet"` |
262
+ | Test writing | Haiku 4.5 | `model: "haiku"` |
263
+ | Architecture decisions | Opus 4.5 | Main session |
264
+ | Final review | Opus 4.5 | Main session |
265
+
266
+ ### External LLM Usage (When Enabled)
267
+
268
+ When external LLMs are enabled in `.vibe/config.json`:
269
+
270
+ | Role | Model | Condition |
271
+ |------|-------|-----------|
272
+ | Architecture/Debugging | GPT 5.2 | When `vibe gpt <key>` executed |
273
+ | UI/UX Design, Exploration | Gemini 2.5/3 | When `vibe gemini --auth` executed |
274
+
275
+ When external LLM enabled, automatically called via MCP:
276
+ - `mcp__vibe-gpt__chat` - GPT 5.2 architecture consultation
277
+ - `mcp__vibe-gemini__gemini_chat` - Gemini 질문/상담
278
+ - `mcp__vibe-gemini__gemini_analyze_code` - 코드 분석
279
+ - `mcp__vibe-gemini__gemini_review_ui` - UI/UX 리뷰
280
+ - `mcp__vibe-gemini__gemini_quick_ask` - 빠른 질문 (탐색용)
281
+
282
+ ### External LLM Fallback
283
+
284
+ **IMPORTANT**: When Gemini/GPT MCP returns `"status": "fallback"`, Claude MUST handle the task directly:
285
+
286
+ ```json
287
+ {
288
+ "status": "fallback",
289
+ "reason": "rate_limit", // or "auth_error"
290
+ "message": "Gemini API 할당량 초과. Claude가 직접 처리해주세요."
291
+ }
292
+ ```
293
+
294
+ **Fallback behavior**:
295
+ - Do NOT retry the external LLM call
296
+ - Claude handles the task using its own capabilities
297
+ - Continue with the implementation without interruption
298
+ - Log the fallback but don't block progress
299
+
300
+ ## Semantic Code Analysis (hi-ai MCP)
301
+
302
+ Use hi-ai MCP semantic tools to accurately understand codebase before implementation:
303
+
304
+ | MCP Tool | Purpose | When Used |
305
+ |----------|---------|-----------|
306
+ | `vibe_find_symbol` | Find symbol definitions | Locate class/function |
307
+ | `vibe_find_references` | Find references | Analyze impact scope |
308
+ | `vibe_analyze_complexity` | Analyze complexity | Determine refactoring need |
309
+ | `vibe_validate_code_quality` | Validate quality | Verify post-implementation quality |
310
+
311
+ ### Semantic Analysis Flow
312
+
313
+ ```
314
+ Start Implementation
315
+
316
+ ├─→ find_symbol: Locate exact position of function/class to modify
317
+
318
+ ├─→ find_references: Check all places using that symbol
319
+
320
+ ├─→ analyze_complexity: Check existing code complexity
321
+
322
+
323
+ Implementation (with accurate understanding of impact scope)
324
+
325
+
326
+ validate_code_quality: Verify quality after implementation
327
+ ```
328
+
329
+ ### Context Management (Session Continuity)
330
+
331
+ | MCP Tool | Purpose |
332
+ |----------|---------|
333
+ | `vibe_start_session` | Start session, restore previous context |
334
+ | `vibe_auto_save_context` | Auto-save current state |
335
+ | `vibe_restore_session_context` | Restore previous session context |
336
+ | `vibe_save_memory` | Save important decisions/patterns |
337
+
338
+ **On session start**: `vibe_start_session` auto-restores previous context
339
+ **On session end**: Hook auto-executes `vibe_auto_save_context`
340
+
341
+ ## Process
342
+
343
+ ### 1. Load SPEC + Feature
344
+
345
+ ```
346
+ 📄 .vibe/specs/{feature-name}.md → SPEC (구조, 제약, 컨텍스트)
347
+ 📄 .vibe/features/{feature-name}.feature → Feature (시나리오 = 구현 단위)
348
+ ```
349
+
350
+ **Feature 파일이 없으면 에러**:
351
+ ```
352
+ ❌ Feature 파일이 없습니다.
353
+ 먼저 /vibe.spec "{feature-name}"을 실행하세요.
354
+ ```
355
+
356
+ ### 2. Scenario 목록 추출
357
+
358
+ Feature 파일에서 모든 Scenario 추출:
359
+
360
+ ```markdown
361
+ ## Scenarios to Implement
362
+
363
+ | # | Scenario | Status |
364
+ |---|----------|--------|
365
+ | 1 | 유효한 로그인 성공 | ⬜ |
366
+ | 2 | 잘못된 비밀번호 에러 | ⬜ |
367
+ | 3 | 이메일 형식 검증 | ⬜ |
368
+ | 4 | 비밀번호 찾기 링크 | ⬜ |
369
+
370
+ Total: 4 scenarios
371
+ ```
372
+
373
+ ### 3. Scenario-by-Scenario Implementation (핵심)
374
+
375
+ **각 시나리오마다**:
376
+
377
+ ```
378
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
379
+ 🎯 Scenario 1/4: 유효한 로그인 성공
380
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
381
+
382
+ Given: 사용자가 등록되어 있다
383
+ When: 유효한 이메일과 비밀번호로 로그인
384
+ Then: 로그인 성공 + JWT 토큰 반환
385
+
386
+ [Step 1] 구현 분석...
387
+ - 필요한 파일: auth.service.ts, login.controller.ts
388
+ - 관련 코드 탐색 중...
389
+
390
+ [Step 2] 구현 중...
391
+ ✅ auth.service.ts - login() 메서드 추가
392
+ ✅ login.controller.ts - POST /login 엔드포인트
393
+
394
+ [Step 3] 검증 중...
395
+ ✅ Given: 테스트 사용자 생성 가능
396
+ ✅ When: 로그인 API 호출 성공
397
+ ✅ Then: JWT 토큰 반환 확인
398
+
399
+ ✅ Scenario 1 통과!
400
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
401
+ ```
402
+
403
+ **실패 시**:
404
+
405
+ ```
406
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
407
+ 🎯 Scenario 2/4: 잘못된 비밀번호 에러
408
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
409
+
410
+ [Step 3] 검증 중...
411
+ ✅ Given: 테스트 사용자 존재
412
+ ✅ When: 잘못된 비밀번호로 로그인 시도
413
+ ❌ Then: "Invalid credentials" 에러 메시지
414
+ 실제: "Error occurred" 반환됨
415
+
416
+ [자동 수정 1/3]
417
+ 원인: 에러 메시지 하드코딩 안됨
418
+ 수정: auth.service.ts line 42
419
+
420
+ [재검증]
421
+ ✅ Then: "Invalid credentials" 에러 메시지
422
+
423
+ ✅ Scenario 2 통과! (수정 1회)
424
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
425
+ ```
426
+
427
+ ---
428
+
429
+ ## **CRITICAL: Parallel Sub-Agent Execution**
430
+
431
+ > **MUST USE PARALLEL TASK CALLS** - This is REQUIRED, not optional.
432
+ > Sequential execution when parallel is possible = VIOLATION of this workflow.
433
+
434
+ ### Mandatory Parallel Exploration (Phase Start)
435
+
436
+ **BEFORE any implementation, you MUST launch these Task calls IN PARALLEL (single message, multiple tool calls):**
437
+
438
+ ```
439
+ ┌─────────────────────────────────────────────────────────────────┐
440
+ │ STEP 1: PARALLEL EXPLORATION (REQUIRED) │
441
+ │ │
442
+ │ Launch ALL of these in ONE message: │
443
+ │ │
444
+ │ Task(haiku) ─┬─→ "Analyze related files in <context>" │
445
+ │ │ │
446
+ │ Task(haiku) ─┼─→ "Check dependencies and imports" │
447
+ │ │ │
448
+ │ Task(haiku) ─┴─→ "Find existing patterns and conventions" │
449
+ │ │
450
+ │ [If GPT enabled] + MCP(vibe-gpt): Architecture review │
451
+ │ [If Gemini enabled] + MCP(vibe-gemini): UI/UX consultation │
452
+ └─────────────────────────────────────────────────────────────────┘
453
+
454
+ ↓ (wait for all to complete)
455
+ ┌─────────────────────────────────────────────────────────────────┐
456
+ │ STEP 2: SYNTHESIZE (Opus) │
457
+ │ - Review all exploration results │
458
+ │ - Decide implementation approach │
459
+ │ - Identify files to modify/create │
460
+ └─────────────────────────────────────────────────────────────────┘
461
+
462
+
463
+ ┌─────────────────────────────────────────────────────────────────┐
464
+ │ STEP 3: IMPLEMENT (Task sonnet) │
465
+ │ - Execute implementation with full context │
466
+ └─────────────────────────────────────────────────────────────────┘
467
+
468
+
469
+ ┌─────────────────────────────────────────────────────────────────┐
470
+ │ STEP 4: TEST (Task haiku) │
471
+ │ - Write tests for implemented code │
472
+ └─────────────────────────────────────────────────────────────────┘
473
+ ```
474
+
475
+ ### Parallel Task Call Pattern (MUST FOLLOW)
476
+
477
+ **Correct - Single message with multiple parallel Tasks:**
478
+ ```
479
+ <message>
480
+ Task(haiku, "Analyze src/components/ for existing patterns")
481
+ Task(haiku, "Check package.json dependencies")
482
+ Task(haiku, "Find usage of similar features in codebase")
483
+ </message>
484
+ → All 3 run simultaneously, ~3x faster
485
+ ```
486
+
487
+ **WRONG - Sequential calls (DO NOT DO THIS):**
488
+ ```
489
+ <message>Task(haiku, "Analyze...")</message>
490
+ <message>Task(haiku, "Check...")</message>
491
+ <message>Task(haiku, "Find...")</message>
492
+ → 3x slower, wastes time
493
+ ```
494
+
495
+ ### Why Parallel Matters
496
+
497
+ | Approach | Time | Cache Benefit |
498
+ |----------|------|---------------|
499
+ | Sequential (3 Tasks) | ~30s | Cache cold on each |
500
+ | **Parallel (3 Tasks)** | **~10s** | **Cache warmed once, shared** |
501
+
502
+ hi-ai ProjectCache (LRU) caches ts-morph parsing results. Parallel calls share the warmed cache.
503
+
504
+ ### Phase Execution Flow
505
+
506
+ ```
507
+ Phase N Start
508
+
509
+ ├─→ [PARALLEL] Task(haiku) × 2-3: Exploration
510
+ │ - Related code analysis
511
+ │ - Dependency check
512
+ │ - Pattern discovery
513
+
514
+ ↓ (all complete)
515
+
516
+ ├─→ Opus: Synthesize and decide
517
+
518
+ ├─→ Task(sonnet): Implementation
519
+
520
+ ├─→ Task(haiku): Tests
521
+
522
+
523
+ Phase N Complete → Next Phase
524
+ ```
525
+
526
+ ---
527
+
528
+ 1. **Related code analysis**: Task(haiku) explores `<context>` related code
529
+ 2. **File creation/modification**: Task(sonnet) implements per `<output_format>`
530
+ 3. **Constraint compliance**: Check `<constraints>`
531
+ 4. **Run verification**: Execute verification commands
532
+
533
+ ### 4. Quality Report (자동 생성)
534
+
535
+ 모든 시나리오 완료 후 **품질 리포트 자동 생성**:
536
+
537
+ ```
538
+ ┌─────────────────────────────────────────────────────────────────┐
539
+ │ 📊 QUALITY REPORT: login │
540
+ ├─────────────────────────────────────────────────────────────────┤
541
+ │ │
542
+ │ ✅ 시나리오: 4/4 통과 │
543
+ │ │
544
+ │ ┌───────────────────────────────────────────────────────────┐ │
545
+ │ │ # │ Scenario │ Status │ Retries │ │ │
546
+ │ │───│───────────────────────────│────────│─────────│ │ │
547
+ │ │ 1 │ 유효한 로그인 성공 │ ✅ │ 0 │ │ │
548
+ │ │ 2 │ 잘못된 비밀번호 에러 │ ✅ │ 1 │ │ │
549
+ │ │ 3 │ 이메일 형식 검증 │ ✅ │ 0 │ │ │
550
+ │ │ 4 │ 비밀번호 찾기 링크 │ ✅ │ 0 │ │ │
551
+ │ └───────────────────────────────────────────────────────────┘ │
552
+ │ │
553
+ │ 📈 품질 점수: 94/100 │
554
+ │ │
555
+ │ ┌─────────────────────────────────────────────────────────┐ │
556
+ │ │ 항목 │ 결과 │ 비고 │ │
557
+ │ │───────────────────│───────│─────────────────────────────│ │
558
+ │ │ 빌드 │ ✅ │ npm run build 성공 │ │
559
+ │ │ 테스트 │ ✅ │ 12/12 통과 │ │
560
+ │ │ 타입 검사 │ ✅ │ 에러 0개 │ │
561
+ │ │ 복잡도 │ ✅ │ 모든 함수 ≤20줄 │ │
562
+ │ │ 보안 │ ✅ │ 취약점 0개 │ │
563
+ │ └─────────────────────────────────────────────────────────┘ │
564
+ │ │
565
+ │ ⏱️ 총 소요: 3m 42s │
566
+ │ │
567
+ └─────────────────────────────────────────────────────────────────┘
568
+ ```
569
+
570
+ **사용자가 확인할 것**:
571
+ - 시나리오 통과율 (4/4 = 100%)
572
+ - 품질 점수 (94/100)
573
+ - 빌드/테스트 상태
574
+
575
+ **이것만 보면 품질을 신뢰할 수 있음.**
576
+
577
+ ### 5. Update Feature File
578
+
579
+ 시나리오 상태 자동 업데이트:
580
+
581
+ ```markdown
582
+ ## Coverage
583
+
584
+ | Scenario | SPEC AC | Status |
585
+ |----------|---------|--------|
586
+ | 유효한 로그인 성공 | AC-1 | ✅ |
587
+ | 잘못된 비밀번호 에러 | AC-2 | ✅ |
588
+ | 이메일 형식 검증 | AC-3 | ✅ |
589
+ | 비밀번호 찾기 링크 | AC-4 | ✅ |
590
+
591
+ **Last verified**: 2024-01-15 14:32
592
+ **Quality score**: 94/100
593
+ ```
594
+
595
+ ## TRUST 5 Principles
596
+
597
+ Follow during implementation:
598
+
599
+ | Principle | Description |
600
+ |-----------|-------------|
601
+ | **T**est-first | Write tests first |
602
+ | **R**eadable | Clear code |
603
+ | **U**nified | Consistent style |
604
+ | **S**ecured | Consider security |
605
+ | **T**rackable | Logging, monitoring |
606
+
607
+ ## Input
608
+
609
+ - `.vibe/specs/{feature-name}.md` (PTCF SPEC)
610
+ - `.vibe/features/{feature-name}.feature` (BDD)
611
+ - `CLAUDE.md` (project context)
612
+
613
+ ## Output
614
+
615
+ - Implemented code files
616
+ - Test files
617
+ - Updated SPEC document (checkmarks)
618
+
619
+ ## Example
620
+
621
+ ```
622
+ User: /vibe.run "login"
623
+
624
+ Claude:
625
+ 📄 Loading SPEC: .vibe/specs/login.md
626
+ 📄 Loading Feature: .vibe/features/login.feature
627
+
628
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
629
+ 📋 Scenarios to Implement
630
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
631
+
632
+ | # | Scenario | Status |
633
+ |---|----------|--------|
634
+ | 1 | 유효한 로그인 성공 | ⬜ |
635
+ | 2 | 잘못된 비밀번호 에러 | ⬜ |
636
+ | 3 | 이메일 형식 검증 | ⬜ |
637
+ | 4 | 비밀번호 찾기 링크 | ⬜ |
638
+
639
+ Total: 4 scenarios
640
+
641
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
642
+ 🎯 Scenario 1/4: 유효한 로그인 성공
643
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
644
+
645
+ Given: 사용자가 등록되어 있다
646
+ When: 유효한 이메일과 비밀번호로 로그인
647
+ Then: 로그인 성공 + JWT 토큰 반환
648
+
649
+ ⚡ [PARALLEL] 탐색 중...
650
+ ✅ 탐색 완료 (2.1s)
651
+
652
+ 🔨 구현 중...
653
+ ✅ auth.service.ts - login() 추가
654
+ ✅ auth.controller.ts - POST /login
655
+
656
+ 🔍 검증 중...
657
+ ✅ Given: OK
658
+ ✅ When: OK
659
+ ✅ Then: OK
660
+
661
+ ✅ Scenario 1 통과!
662
+
663
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
664
+ 🎯 Scenario 2/4: 잘못된 비밀번호 에러
665
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
666
+
667
+ 🔨 구현 중...
668
+ ✅ auth.service.ts - 비밀번호 검증 로직
669
+
670
+ 🔍 검증 중...
671
+ ✅ Given: OK
672
+ ✅ When: OK
673
+ ❌ Then: "Invalid credentials" 에러 메시지
674
+ 실제: "Error" 반환
675
+
676
+ 🔄 자동 수정 1/3...
677
+ 수정: auth.service.ts line 42
678
+
679
+ 🔍 재검증...
680
+ ✅ Then: OK
681
+
682
+ ✅ Scenario 2 통과! (수정 1회)
683
+
684
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
685
+ 🎯 Scenario 3/4: 이메일 형식 검증
686
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
687
+
688
+ 🔨 구현 중...
689
+ 🔍 검증 중...
690
+ ✅ Scenario 3 통과!
691
+
692
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
693
+ 🎯 Scenario 4/4: 비밀번호 찾기 링크
694
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
695
+
696
+ 🔨 구현 중...
697
+ 🔍 검증 중...
698
+ ✅ Scenario 4 통과!
699
+
700
+ ┌─────────────────────────────────────────────────────────────────┐
701
+ │ 📊 QUALITY REPORT: login │
702
+ ├─────────────────────────────────────────────────────────────────┤
703
+ │ │
704
+ │ ✅ 시나리오: 4/4 통과 │
705
+ │ │
706
+ │ | # | Scenario | Status | Retries | │
707
+ │ |---|───────────────────────|───────|─────────| │
708
+ │ | 1 | 유효한 로그인 성공 | ✅ | 0 | │
709
+ │ | 2 | 잘못된 비밀번호 에러 | ✅ | 1 | │
710
+ │ | 3 | 이메일 형식 검증 | ✅ | 0 | │
711
+ │ | 4 | 비밀번호 찾기 링크 | ✅ | 0 | │
712
+ │ │
713
+ │ 📈 품질 점수: 94/100 │
714
+ │ 빌드: ✅ | 테스트: ✅ | 타입: ✅ │
715
+ │ │
716
+ │ ⏱️ 총 소요: 3m 42s │
717
+ └─────────────────────────────────────────────────────────────────┘
718
+
719
+ 🎉 구현 완료! 모든 시나리오 통과.
720
+ ```
721
+
722
+ ### Phase-specific Execution
723
+
724
+ ```
725
+ User: /vibe.run "brick-game" --phase 2
726
+
727
+ Claude:
728
+ 📄 Reading SPEC: .vibe/specs/brick-game.md
729
+ 🎯 Executing Phase 2 only.
730
+
731
+ Phase 2: Game Logic
732
+ 1. [ ] Paddle movement implementation
733
+ 2. [ ] Ball physics engine
734
+ 3. [ ] Brick collision handling
735
+ 4. [ ] Score system
736
+ 5. [ ] Game over conditions
737
+
738
+ ⚡ Launching parallel exploration...
739
+ [Task(haiku) × 3 launched in parallel]
740
+
741
+ 🚀 Starting implementation...
742
+ ```
743
+
744
+ ## Error Handling
745
+
746
+ On failure:
747
+ 1. Check error message
748
+ 2. Review `<constraints>`
749
+ 3. Fix code and retry
750
+ 4. If continues to fail, report to user
751
+
752
+ ## Next Step
753
+
754
+ ```
755
+ /vibe.verify "brick-game"
756
+ ```
757
+
758
+ ---
759
+
760
+ ARGUMENTS: $ARGUMENTS