@su-record/vibe 2.6.16 → 2.6.18

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 (249) hide show
  1. package/CLAUDE.md +681 -681
  2. package/LICENSE +21 -21
  3. package/README.md +235 -203
  4. package/agents/architect-low.md +41 -41
  5. package/agents/architect-medium.md +59 -59
  6. package/agents/architect.md +80 -80
  7. package/agents/build-error-resolver.md +115 -115
  8. package/agents/compounder.md +261 -261
  9. package/agents/diagrammer.md +178 -178
  10. package/agents/e2e-tester.md +266 -266
  11. package/agents/explorer-low.md +42 -42
  12. package/agents/explorer-medium.md +59 -59
  13. package/agents/explorer.md +48 -48
  14. package/agents/implementer-low.md +43 -43
  15. package/agents/implementer-medium.md +52 -52
  16. package/agents/implementer.md +54 -54
  17. package/agents/refactor-cleaner.md +143 -143
  18. package/agents/research/best-practices-agent.md +199 -199
  19. package/agents/research/codebase-patterns-agent.md +157 -157
  20. package/agents/research/framework-docs-agent.md +188 -188
  21. package/agents/research/security-advisory-agent.md +213 -213
  22. package/agents/review/architecture-reviewer.md +107 -107
  23. package/agents/review/complexity-reviewer.md +116 -116
  24. package/agents/review/data-integrity-reviewer.md +88 -88
  25. package/agents/review/git-history-reviewer.md +103 -103
  26. package/agents/review/performance-reviewer.md +86 -86
  27. package/agents/review/python-reviewer.md +150 -150
  28. package/agents/review/rails-reviewer.md +139 -139
  29. package/agents/review/react-reviewer.md +144 -144
  30. package/agents/review/security-reviewer.md +80 -80
  31. package/agents/review/simplicity-reviewer.md +140 -140
  32. package/agents/review/test-coverage-reviewer.md +116 -116
  33. package/agents/review/typescript-reviewer.md +127 -127
  34. package/agents/searcher.md +54 -54
  35. package/agents/simplifier.md +120 -120
  36. package/agents/tester.md +49 -49
  37. package/agents/ui-previewer.md +268 -268
  38. package/commands/vibe.analyze.md +356 -356
  39. package/commands/vibe.reason.md +329 -329
  40. package/commands/vibe.review.md +412 -412
  41. package/commands/vibe.run.md +1266 -1266
  42. package/commands/vibe.spec.md +1054 -1054
  43. package/commands/vibe.spec.review.md +319 -319
  44. package/commands/vibe.trace.md +161 -161
  45. package/commands/vibe.utils.md +376 -376
  46. package/commands/vibe.verify.md +375 -375
  47. package/dist/cli/collaborator.js +52 -52
  48. package/dist/cli/detect.js +32 -32
  49. package/dist/cli/hud.js +20 -20
  50. package/dist/cli/index.d.ts.map +1 -1
  51. package/dist/cli/index.js +120 -118
  52. package/dist/cli/index.js.map +1 -1
  53. package/dist/cli/llm.js +144 -144
  54. package/dist/cli/postinstall.d.ts +1 -0
  55. package/dist/cli/postinstall.d.ts.map +1 -1
  56. package/dist/cli/postinstall.js +859 -859
  57. package/dist/cli/postinstall.js.map +1 -1
  58. package/dist/cli/setup/ProjectSetup.d.ts +2 -2
  59. package/dist/cli/setup/ProjectSetup.d.ts.map +1 -1
  60. package/dist/cli/setup/ProjectSetup.js +51 -17
  61. package/dist/cli/setup/ProjectSetup.js.map +1 -1
  62. package/dist/lib/DeepInit.js +24 -24
  63. package/dist/lib/IterationTracker.js +11 -11
  64. package/dist/lib/PythonParser.js +108 -108
  65. package/dist/lib/ReviewRace.js +96 -96
  66. package/dist/lib/SkillFrontmatter.js +28 -28
  67. package/dist/lib/SkillQualityGate.js +9 -9
  68. package/dist/lib/SkillRepository.js +159 -159
  69. package/dist/lib/UltraQA.js +77 -77
  70. package/dist/lib/gemini-api.js +5 -5
  71. package/dist/lib/gpt-api.js +4 -4
  72. package/dist/lib/memory/KnowledgeGraph.js +4 -4
  73. package/dist/lib/memory/MemorySearch.js +20 -20
  74. package/dist/lib/memory/MemoryStorage.js +64 -64
  75. package/dist/orchestrator/AgentManager.js +12 -12
  76. package/dist/orchestrator/MultiLlmResearch.js +8 -8
  77. package/dist/orchestrator/SmartRouter.js +11 -11
  78. package/dist/orchestrator/SwarmOrchestrator.d.ts +144 -0
  79. package/dist/orchestrator/SwarmOrchestrator.d.ts.map +1 -0
  80. package/dist/orchestrator/SwarmOrchestrator.js +361 -0
  81. package/dist/orchestrator/SwarmOrchestrator.js.map +1 -0
  82. package/dist/orchestrator/SwarmOrchestrator.test.d.ts +5 -0
  83. package/dist/orchestrator/SwarmOrchestrator.test.d.ts.map +1 -0
  84. package/dist/orchestrator/SwarmOrchestrator.test.js +95 -0
  85. package/dist/orchestrator/SwarmOrchestrator.test.js.map +1 -0
  86. package/dist/orchestrator/index.d.ts +2 -0
  87. package/dist/orchestrator/index.d.ts.map +1 -1
  88. package/dist/orchestrator/index.js +2 -0
  89. package/dist/orchestrator/index.js.map +1 -1
  90. package/dist/orchestrator/parallelResearch.js +24 -24
  91. package/dist/tools/convention/analyzeComplexity.test.js +115 -115
  92. package/dist/tools/convention/validateCodeQuality.test.js +104 -104
  93. package/dist/tools/spec/prdParser.test.js +171 -171
  94. package/dist/tools/spec/specGenerator.js +169 -169
  95. package/dist/tools/spec/traceabilityMatrix.js +64 -64
  96. package/dist/tools/spec/traceabilityMatrix.test.js +28 -28
  97. package/hooks/hooks.json +222 -222
  98. package/hooks/scripts/code-check.js +22 -22
  99. package/hooks/scripts/code-review.js +22 -22
  100. package/hooks/scripts/complexity.js +22 -22
  101. package/hooks/scripts/compound.js +23 -23
  102. package/hooks/scripts/context-save.js +33 -33
  103. package/hooks/scripts/gemini-ui-gen.js +281 -281
  104. package/hooks/scripts/generate-brand-assets.js +474 -474
  105. package/hooks/scripts/hud-multiline.js +262 -262
  106. package/hooks/scripts/hud-status.js +291 -291
  107. package/hooks/scripts/keyword-detector.js +214 -214
  108. package/hooks/scripts/llm-orchestrate.js +171 -171
  109. package/hooks/scripts/post-edit.js +97 -97
  110. package/hooks/scripts/post-tool-verify.js +210 -210
  111. package/hooks/scripts/pre-tool-guard.js +125 -125
  112. package/hooks/scripts/recall.js +22 -22
  113. package/hooks/scripts/session-start.js +30 -30
  114. package/hooks/scripts/skill-injector.js +191 -191
  115. package/hooks/scripts/utils.js +97 -97
  116. package/languages/csharp-unity.md +515 -515
  117. package/languages/gdscript-godot.md +470 -470
  118. package/languages/ruby-rails.md +489 -489
  119. package/languages/typescript-angular.md +433 -433
  120. package/languages/typescript-astro.md +416 -416
  121. package/languages/typescript-electron.md +406 -406
  122. package/languages/typescript-nestjs.md +524 -524
  123. package/languages/typescript-svelte.md +407 -407
  124. package/languages/typescript-tauri.md +365 -365
  125. package/package.json +84 -84
  126. package/skills/brand-assets.md +141 -141
  127. package/skills/commerce-patterns.md +361 -361
  128. package/skills/context7-usage.md +102 -102
  129. package/skills/e2e-commerce.md +304 -304
  130. package/skills/frontend-design.md +92 -92
  131. package/skills/git-worktree.md +181 -181
  132. package/skills/parallel-research.md +77 -77
  133. package/skills/priority-todos.md +239 -239
  134. package/skills/seo-checklist.md +244 -244
  135. package/skills/tool-fallback.md +190 -190
  136. package/skills/vibe-capabilities.md +161 -161
  137. package/vibe/constitution.md +227 -227
  138. package/vibe/rules/core/communication-guide.md +98 -98
  139. package/vibe/rules/core/development-philosophy.md +52 -52
  140. package/vibe/rules/core/quick-start.md +102 -102
  141. package/vibe/rules/quality/bdd-contract-testing.md +393 -393
  142. package/vibe/rules/quality/checklist.md +276 -276
  143. package/vibe/rules/quality/testing-strategy.md +440 -440
  144. package/vibe/rules/standards/anti-patterns.md +541 -541
  145. package/vibe/rules/standards/code-structure.md +291 -291
  146. package/vibe/rules/standards/complexity-metrics.md +313 -313
  147. package/vibe/rules/standards/naming-conventions.md +198 -198
  148. package/vibe/setup.sh +31 -31
  149. package/vibe/templates/constitution-template.md +252 -252
  150. package/vibe/templates/contract-backend-template.md +526 -526
  151. package/vibe/templates/contract-frontend-template.md +599 -599
  152. package/vibe/templates/feature-template.md +96 -96
  153. package/vibe/templates/spec-template.md +221 -221
  154. package/dist/cli/mcp.d.ts +0 -49
  155. package/dist/cli/mcp.d.ts.map +0 -1
  156. package/dist/cli/mcp.js +0 -169
  157. package/dist/cli/mcp.js.map +0 -1
  158. package/dist/lib/gemini-mcp.d.ts +0 -10
  159. package/dist/lib/gemini-mcp.d.ts.map +0 -1
  160. package/dist/lib/gemini-mcp.js +0 -353
  161. package/dist/lib/gemini-mcp.js.map +0 -1
  162. package/dist/lib/gpt-mcp.d.ts +0 -10
  163. package/dist/lib/gpt-mcp.d.ts.map +0 -1
  164. package/dist/lib/gpt-mcp.js +0 -352
  165. package/dist/lib/gpt-mcp.js.map +0 -1
  166. package/dist/tools/analytics/getUsageAnalytics.d.ts +0 -10
  167. package/dist/tools/analytics/getUsageAnalytics.d.ts.map +0 -1
  168. package/dist/tools/analytics/getUsageAnalytics.js +0 -246
  169. package/dist/tools/analytics/getUsageAnalytics.js.map +0 -1
  170. package/dist/tools/analytics/index.d.ts +0 -5
  171. package/dist/tools/analytics/index.d.ts.map +0 -1
  172. package/dist/tools/analytics/index.js +0 -5
  173. package/dist/tools/analytics/index.js.map +0 -1
  174. package/dist/tools/convention/getCodingGuide.d.ts +0 -7
  175. package/dist/tools/convention/getCodingGuide.d.ts.map +0 -1
  176. package/dist/tools/convention/getCodingGuide.js +0 -69
  177. package/dist/tools/convention/getCodingGuide.js.map +0 -1
  178. package/dist/tools/planning/analyzeRequirements.d.ts +0 -9
  179. package/dist/tools/planning/analyzeRequirements.d.ts.map +0 -1
  180. package/dist/tools/planning/analyzeRequirements.js +0 -171
  181. package/dist/tools/planning/analyzeRequirements.js.map +0 -1
  182. package/dist/tools/planning/createUserStories.d.ts +0 -9
  183. package/dist/tools/planning/createUserStories.d.ts.map +0 -1
  184. package/dist/tools/planning/createUserStories.js +0 -124
  185. package/dist/tools/planning/createUserStories.js.map +0 -1
  186. package/dist/tools/planning/featureRoadmap.d.ts +0 -10
  187. package/dist/tools/planning/featureRoadmap.d.ts.map +0 -1
  188. package/dist/tools/planning/featureRoadmap.js +0 -207
  189. package/dist/tools/planning/featureRoadmap.js.map +0 -1
  190. package/dist/tools/planning/generatePrd.d.ts +0 -11
  191. package/dist/tools/planning/generatePrd.d.ts.map +0 -1
  192. package/dist/tools/planning/generatePrd.js +0 -161
  193. package/dist/tools/planning/generatePrd.js.map +0 -1
  194. package/dist/tools/planning/index.d.ts +0 -8
  195. package/dist/tools/planning/index.d.ts.map +0 -1
  196. package/dist/tools/planning/index.js +0 -8
  197. package/dist/tools/planning/index.js.map +0 -1
  198. package/dist/tools/prompt/analyzePrompt.d.ts +0 -7
  199. package/dist/tools/prompt/analyzePrompt.d.ts.map +0 -1
  200. package/dist/tools/prompt/analyzePrompt.js +0 -150
  201. package/dist/tools/prompt/analyzePrompt.js.map +0 -1
  202. package/dist/tools/prompt/enhancePrompt.d.ts +0 -8
  203. package/dist/tools/prompt/enhancePrompt.d.ts.map +0 -1
  204. package/dist/tools/prompt/enhancePrompt.js +0 -110
  205. package/dist/tools/prompt/enhancePrompt.js.map +0 -1
  206. package/dist/tools/prompt/enhancePromptGemini.d.ts +0 -8
  207. package/dist/tools/prompt/enhancePromptGemini.d.ts.map +0 -1
  208. package/dist/tools/prompt/enhancePromptGemini.js +0 -332
  209. package/dist/tools/prompt/enhancePromptGemini.js.map +0 -1
  210. package/dist/tools/prompt/index.d.ts +0 -7
  211. package/dist/tools/prompt/index.d.ts.map +0 -1
  212. package/dist/tools/prompt/index.js +0 -7
  213. package/dist/tools/prompt/index.js.map +0 -1
  214. package/dist/tools/reasoning/applyReasoningFramework.d.ts +0 -8
  215. package/dist/tools/reasoning/applyReasoningFramework.d.ts.map +0 -1
  216. package/dist/tools/reasoning/applyReasoningFramework.js +0 -266
  217. package/dist/tools/reasoning/applyReasoningFramework.js.map +0 -1
  218. package/dist/tools/reasoning/index.d.ts +0 -5
  219. package/dist/tools/reasoning/index.d.ts.map +0 -1
  220. package/dist/tools/reasoning/index.js +0 -5
  221. package/dist/tools/reasoning/index.js.map +0 -1
  222. package/dist/tools/thinking/analyzeProblem.d.ts +0 -7
  223. package/dist/tools/thinking/analyzeProblem.d.ts.map +0 -1
  224. package/dist/tools/thinking/analyzeProblem.js +0 -55
  225. package/dist/tools/thinking/analyzeProblem.js.map +0 -1
  226. package/dist/tools/thinking/breakDownProblem.d.ts +0 -8
  227. package/dist/tools/thinking/breakDownProblem.d.ts.map +0 -1
  228. package/dist/tools/thinking/breakDownProblem.js +0 -145
  229. package/dist/tools/thinking/breakDownProblem.js.map +0 -1
  230. package/dist/tools/thinking/createThinkingChain.d.ts +0 -7
  231. package/dist/tools/thinking/createThinkingChain.d.ts.map +0 -1
  232. package/dist/tools/thinking/createThinkingChain.js +0 -44
  233. package/dist/tools/thinking/createThinkingChain.js.map +0 -1
  234. package/dist/tools/thinking/formatAsPlan.d.ts +0 -9
  235. package/dist/tools/thinking/formatAsPlan.d.ts.map +0 -1
  236. package/dist/tools/thinking/formatAsPlan.js +0 -78
  237. package/dist/tools/thinking/formatAsPlan.js.map +0 -1
  238. package/dist/tools/thinking/index.d.ts +0 -10
  239. package/dist/tools/thinking/index.d.ts.map +0 -1
  240. package/dist/tools/thinking/index.js +0 -10
  241. package/dist/tools/thinking/index.js.map +0 -1
  242. package/dist/tools/thinking/stepByStepAnalysis.d.ts +0 -8
  243. package/dist/tools/thinking/stepByStepAnalysis.d.ts.map +0 -1
  244. package/dist/tools/thinking/stepByStepAnalysis.js +0 -63
  245. package/dist/tools/thinking/stepByStepAnalysis.js.map +0 -1
  246. package/dist/tools/thinking/thinkAloudProcess.d.ts +0 -8
  247. package/dist/tools/thinking/thinkAloudProcess.d.ts.map +0 -1
  248. package/dist/tools/thinking/thinkAloudProcess.js +0 -80
  249. package/dist/tools/thinking/thinkAloudProcess.js.map +0 -1
package/CLAUDE.md CHANGED
@@ -1,681 +1,681 @@
1
- # VIBE
2
-
3
- SPEC-driven AI Coding Framework (Claude Code Exclusive)
4
-
5
- ## Response Language
6
-
7
- **IMPORTANT: Always respond in Korean (한국어) unless the user explicitly requests otherwise.**
8
-
9
- ## Code Quality Standards (Mandatory)
10
-
11
- Follow these standards when writing code. See `~/.claude/vibe/rules/` (global) for detailed rules.
12
-
13
- ### Core Principles
14
- - **Modify only requested scope** - Don't touch unrelated code
15
- - **Preserve existing style** - Follow project conventions
16
- - **Keep working code** - No unnecessary refactoring
17
- - **Respect user interrupts** - If user interrupts (Ctrl+C/Escape) and sends a new message, the previous task is CANCELLED. Do NOT resume or continue interrupted work. Respond ONLY to the new message.
18
-
19
- ### Code Complexity Limits
20
- | Metric | Limit |
21
- |--------|-------|
22
- | Function length | ≤30 lines (recommended), ≤50 lines (allowed) |
23
- | Nesting depth | ≤3 levels |
24
- | Parameters | ≤5 |
25
- | Cyclomatic complexity | ≤10 |
26
-
27
- ### TypeScript Rules
28
- - No `any` type → Use `unknown` + type guards
29
- - No `as any` casting → Define proper interfaces
30
- - No `@ts-ignore` → Fix type issues at root
31
- - Explicit return types on all functions
32
-
33
- ### Error Handling Required
34
- - try-catch or error state required
35
- - Loading state handling
36
- - User-friendly error messages
37
-
38
- ### Forbidden Patterns
39
- - No console.log in commits (remove after debugging)
40
- - No hardcoded strings/numbers → Extract to constants
41
- - No commented-out code in commits
42
- - No incomplete code without TODO
43
-
44
- ## Workflow
45
-
46
- ```
47
- /vibe.spec → /new → /vibe.spec.review → /vibe.run → /vibe.trace → (auto) code review → ✅ Done
48
-
49
- Coverage check (v2.6)
50
- ```
51
-
52
- **Flow:**
53
-
54
- 1. `/vibe.spec` - Write SPEC (requirements + research + draft)
55
- 2. `/new` - Start new session (clean context)
56
- 3. `/vibe.spec.review` - GPT/Gemini review (3-round mandatory)
57
- 4. `/vibe.run` - Implementation + Gemini review
58
- 5. **(auto)** 13+ agent parallel review
59
- 6. **(auto)** P1/P2 issue auto-fix
60
-
61
- ## Plan Mode vs VIBE (Workflow Selection)
62
-
63
- **Offer choice to user on development requests:**
64
-
65
- | Task Size | Recommended |
66
- |-----------|-------------|
67
- | Simple changes (1-2 files) | Plan Mode |
68
- | Complex features (3+ files, research/verification needed) | `/vibe.spec` |
69
-
70
- | Item | Plan Mode | VIBE |
71
- |------|-----------|------|
72
- | Storage location | `~/.claude/plans/` (global) | `.claude/vibe/specs/` (project) |
73
- | Document format | Free form | PTCF structure (AI-optimized) |
74
- | Research | None | 4 parallel agents |
75
- | Verification | None | `/vibe.verify` against SPEC |
76
- | History | Not trackable | Git version control |
77
-
78
- **Rules:**
79
- - After `/vibe.analyze` or `/vibe.review` with dev/modify request → **Ask user for workflow choice**
80
- - User chooses VIBE → Wait for `/vibe.spec`
81
- - User chooses Plan Mode → Proceed with EnterPlanMode
82
-
83
- ## ULTRAWORK Mode (Recommended)
84
-
85
- Include `ultrawork` or `ulw` keyword to activate maximum performance mode:
86
-
87
- ```bash
88
- /vibe.run "feature-name" ultrawork # All optimizations auto-enabled
89
- /vibe.run "feature-name" ulw # Same (shorthand)
90
- ```
91
-
92
- **Activated Features:**
93
- - Parallel sub-agent exploration (3+ concurrent)
94
- - **Background agents** - Prepare next Phase during implementation
95
- - **Phase pipelining** - Remove wait time between Phases
96
- - Boulder Loop (auto-continue until all Phases complete)
97
- - Auto-retry on error (max 3 times)
98
- - Auto-compress/save at 70%+ context
99
- - Continuous execution without confirmation between Phases
100
-
101
- **Speed Comparison:**
102
-
103
- | Mode | Per Phase | 5 Phases |
104
- |------|-----------|----------|
105
- | Sequential | ~2min | ~10min |
106
- | Parallel Exploration | ~1.5min | ~7.5min |
107
- | **ULTRAWORK Pipeline** | **~1min** | **~5min** |
108
-
109
- ## Commands
110
-
111
- | Command | Description |
112
- |---------|-------------|
113
- | `/vibe.spec "feature-name"` | Write SPEC (PTCF structure) + parallel research |
114
- | `/vibe.spec.review "feature-name"` | **GPT/Gemini review** (run in new session) |
115
- | `/vibe.run "feature-name"` | Execute implementation |
116
- | `/vibe.run "feature-name" ultrawork` | **Maximum performance mode** |
117
- | `/vibe.verify "feature-name"` | Verification |
118
- | `/vibe.review` | **Parallel code review** (13+ agents) |
119
- | `/vibe.reason "problem"` | Systematic reasoning |
120
- | `/vibe.analyze` | Project analysis |
121
- | `/vibe.utils --e2e` | E2E testing (Playwright) |
122
- | `/vibe.utils --diagram` | Generate diagrams |
123
- | `/vibe.utils --ui "description"` | UI preview |
124
- | `/vibe.utils --continue` | **Session restore** (load previous context) |
125
-
126
- ## New Features (v2.6.x)
127
-
128
- ### Structured User Questions (v2.6.1)
129
-
130
- Use `askUser` tool for critical requirements that must not be missed:
131
-
132
- ```typescript
133
- import { askUser, askUserQuick } from '@su-record/vibe/tools';
134
-
135
- // Quick helper for login features
136
- const result = await askUserQuick.login('my-login');
137
-
138
- // Custom categories
139
- const result = await askUser({
140
- featureName: 'dashboard',
141
- categories: ['authentication', 'security', 'session'],
142
- });
143
- ```
144
-
145
- **Available categories:**
146
- | Category | Questions |
147
- |----------|-----------|
148
- | `authentication` | Auth method, MFA |
149
- | `security` | Password policy, rate limit |
150
- | `session` | Duration, concurrent login |
151
- | `data_model` | Profile fields |
152
- | `performance` | Response time targets |
153
- | `integration` | External services |
154
-
155
- **When to use:**
156
- - ✅ Critical: auth, security, session → `askUser`
157
- - ❌ Exploratory: scope, style → Natural conversation
158
- - ⚠️ ultrawork mode: skipped (uses defaults)
159
-
160
- ### Fire-and-Forget Background Manager
161
-
162
- Launch background agents without blocking, with automatic concurrency control:
163
-
164
- ```typescript
165
- import { launch, poll, cancel, getStats } from '@su-record/vibe/orchestrator';
166
-
167
- // Fire-and-forget - returns immediately (<100ms)
168
- const { taskId } = launch({
169
- prompt: 'Analyze codebase',
170
- agentName: 'analyzer',
171
- model: 'claude-sonnet-4-5',
172
- });
173
-
174
- // Poll for result later
175
- const result = await poll(taskId);
176
-
177
- // Check queue stats
178
- const stats = getStats();
179
- ```
180
-
181
- **Concurrency limits:**
182
-
183
- | Model | Limit |
184
- |-------|-------|
185
- | claude-opus-4 | 3 |
186
- | claude-sonnet-4-5 | 5 |
187
- | claude-haiku-* | 8 |
188
-
189
- **Error types:**
190
- - `QueueOverflowError`: Queue at capacity (100 tasks max)
191
- - `TaskTimeoutError`: Task exceeded 3 minutes
192
- - `PipelineTimeoutError`: Pipeline exceeded 10 minutes
193
- - `AgentExecutionError`: Agent execution failed
194
-
195
- ### Phase Pipelining
196
-
197
- Remove wait time between phases with background preparation:
198
-
199
- ```typescript
200
- import { PhasePipeline, createStage, createUltraworkPipeline } from '@su-record/vibe/orchestrator';
201
-
202
- const pipeline = createUltraworkPipeline('my-feature', [
203
- createStage('Setup', async (ctx) => { /* ... */ }),
204
- createStage('Core', async (ctx) => { /* ... */ }),
205
- createStage('Test', async (ctx) => { /* ... */ }),
206
- ]);
207
-
208
- const result = await pipeline.execute();
209
- // Next phase preparation happens during current phase execution!
210
- ```
211
-
212
- ### PRD-to-SPEC Automation
213
-
214
- Generate SPEC documents from PRD (Product Requirements Document):
215
-
216
- ```typescript
217
- import { parsePRD, generateSpecFromPRD } from '@su-record/vibe/tools';
218
-
219
- // Parse PRD document
220
- const prd = parsePRD(prdContent, 'login');
221
-
222
- // Generate SPEC
223
- const spec = generateSpecFromPRD(prd, {
224
- techStack: { frontend: 'React', backend: 'Node.js' },
225
- });
226
- ```
227
-
228
- **Supported PRD formats:**
229
- - Markdown with `## Requirements` sections
230
- - YAML frontmatter with `requirements:` array
231
- - Mixed format
232
-
233
- ### Requirements Traceability Matrix (/vibe.trace)
234
-
235
- Track requirements coverage across SPEC → Feature → Test:
236
-
237
- ```bash
238
- /vibe.trace "login" # Generate RTM
239
- /vibe.trace "login" --html # HTML output
240
- /vibe.trace "login" --save # Save to file
241
- ```
242
-
243
- ```typescript
244
- import { generateTraceabilityMatrix, formatMatrixAsMarkdown } from '@su-record/vibe/tools';
245
-
246
- const matrix = generateTraceabilityMatrix('login');
247
- const markdown = formatMatrixAsMarkdown(matrix);
248
- ```
249
-
250
- **Coverage levels:**
251
- | Level | Meaning |
252
- |-------|---------|
253
- | Full (✅) | SPEC + Feature + Test all mapped |
254
- | Partial (⚠️) | Missing one or more mappings |
255
- | None (❌) | Only in SPEC |
256
-
257
- ### SPEC Versioning
258
-
259
- Git-integrated version control for SPEC documents:
260
-
261
- ```typescript
262
- import { bumpSpecVersion, createGitTag, generateChangelog } from '@su-record/vibe/tools';
263
-
264
- // Bump version (major/minor/patch)
265
- const newVersion = bumpSpecVersion(specPath, 'minor', [
266
- { type: 'added', description: 'New login feature' },
267
- ]);
268
-
269
- // Create git tag
270
- createGitTag('login', newVersion.version);
271
-
272
- // Generate changelog
273
- const changelog = generateChangelog(versionHistory);
274
- ```
275
-
276
- ## Previous Features (v2.5.15)
277
-
278
- ### Rule Build System
279
-
280
- Compile individual rule files into consolidated AGENTS.md:
281
-
282
- ```typescript
283
- import { buildRulesDocument, extractTestCasesFromDir } from '@su-record/vibe/tools';
284
-
285
- // Build rules from directory
286
- await buildRulesDocument('./rules', './AGENTS.md', {
287
- version: '1.0.0',
288
- title: 'Code Quality Rules',
289
- abstract: 'Guidelines for code quality',
290
- });
291
-
292
- // Extract test cases for LLM evaluation
293
- await extractTestCasesFromDir('./rules', './test-cases.json');
294
- ```
295
-
296
- **Rule file structure:**
297
- ```markdown
298
- ---
299
- title: Rule Title
300
- impact: CRITICAL
301
- tags: security, performance
302
- ---
303
-
304
- ## Rule Title
305
-
306
- Explanation of the rule.
307
-
308
- **Incorrect:**
309
- \`\`\`typescript
310
- // Bad code
311
- \`\`\`
312
-
313
- **Correct:**
314
- \`\`\`typescript
315
- // Good code
316
- \`\`\`
317
- ```
318
-
319
- ### Impact-Based Classification
320
-
321
- Rules are classified by impact level:
322
-
323
- | Level | Color | Priority |
324
- |-------|-------|----------|
325
- | CRITICAL | 🔴 Red | 0 (highest) |
326
- | HIGH | 🟡 Yellow | 1 |
327
- | MEDIUM-HIGH | 🟡 Yellow | 2 |
328
- | MEDIUM | 🔵 Cyan | 3 |
329
- | LOW-MEDIUM | 🔵 Cyan | 4 |
330
- | LOW | 🟢 Green | 5 |
331
-
332
- ### Framework Auto-Detection
333
-
334
- Automatically detect project framework from package.json:
335
-
336
- ```typescript
337
- import { detectFramework, getFrameworkRecommendations } from '@su-record/vibe/tools';
338
-
339
- const result = await detectFramework('./my-project');
340
- // { framework: { id: 'nextjs', name: 'Next.js', category: 'fullstack' }, ... }
341
-
342
- const recs = getFrameworkRecommendations(result.framework);
343
- // { reviewers: ['react-reviewer'], rules: ['react-*'], features: ['ssr'] }
344
- ```
345
-
346
- **Supported frameworks (40+):**
347
- - Fullstack: Next.js, Remix, Nuxt, SvelteKit, Astro, RedwoodJS
348
- - Frontend: React, Vue, Svelte, Angular, Preact
349
- - Backend: NestJS, Express, Fastify, Hono, Elysia
350
- - Docs: Docusaurus, VitePress, Eleventy
351
-
352
- ### Test Case Extraction
353
-
354
- Extract good/bad examples from rules for LLM evaluation:
355
-
356
- ```typescript
357
- import { extractTestCases, validateRule } from '@su-record/vibe/tools';
358
-
359
- const testCases = extractTestCases(rules);
360
- // [{ ruleId: '1.1', type: 'bad', code: '...', ... }]
361
-
362
- const validation = validateRule(rule);
363
- // { valid: true, errors: [] }
364
- ```
365
-
366
- ## Previous Features (v2.5.7-v2.5.11)
367
-
368
- ### Intelligent Model Routing
369
-
370
- Automatic model selection based on task complexity:
371
-
372
- | Complexity | Model | When |
373
- |------------|-------|------|
374
- | Low (0-7) | Haiku | Simple fixes, searches |
375
- | Medium (8-19) | Sonnet | Standard features, 3-5 files |
376
- | High (20+) | Opus | Architecture, security, 6+ files |
377
-
378
- ### Agent Tier System
379
-
380
- Cost-optimized agent variants:
381
-
382
- | Agent | Low | Medium | High |
383
- |-------|-----|--------|------|
384
- | explorer | explorer-low | explorer-medium | explorer |
385
- | implementer | implementer-low | implementer-medium | implementer |
386
- | architect | architect-low | architect-medium | architect |
387
-
388
- ### Magic Keywords
389
-
390
- | Keyword | Effect |
391
- |---------|--------|
392
- | `ultrawork` / `ulw` | Parallel + auto-continue + Ralph Loop |
393
- | `ralph` | **Ralph Loop**: Iterate until 100% complete (no scope reduction) |
394
- | `ralplan` | Iterative planning + persistence |
395
- | `verify` | Strict verification mode |
396
- | `quick` | Fast mode, minimal verification |
397
-
398
- **Combinations supported:** `ralph ultrawork`, `ralph verify`, etc.
399
-
400
- **Ralph Loop** (from [ghuntley.com/ralph](https://ghuntley.com/ralph)):
401
-
402
- - Compares ORIGINAL request vs current implementation
403
- - Lists ALL missing items explicitly
404
- - Iterates until 100% complete (max 5 iterations)
405
- - **ZERO tolerance for scope reduction** - Never say "basic version" or "simplified"
406
-
407
- ### Skill Quality Gate
408
-
409
- Memory saves are validated for quality:
410
-
411
- - Rejects generic/searchable information
412
- - Requires context, specificity, actionability
413
- - Suggests principle format: "When X, do Y because Z"
414
-
415
- ### HUD Status (Real-time)
416
-
417
- ```bash
418
- node hooks/scripts/hud-status.js show full
419
- node hooks/scripts/hud-status.js start ultrawork "feature"
420
- node hooks/scripts/hud-status.js phase 2 5 "Implementing core"
421
- ```
422
-
423
- ### Pre/Post Tool Hooks
424
-
425
- - **PreToolUse**: Validates dangerous commands before execution
426
- - **PostToolUse**: Provides error recovery hints
427
-
428
- ### Orchestrate Workflow
429
-
430
- Intent Gate → Codebase Assessment → Delegation → Verification pattern:
431
-
432
- ```typescript
433
- import { checkIntentGate, assessCodebase, createDelegationPlan } from '@su-record/vibe/tools';
434
- ```
435
-
436
- ### UltraQA (5-Cycle Autonomous QA)
437
-
438
- ```
439
- Test/Build/Lint → Fail → Architect Diagnosis → Executor Fix → Repeat (max 5)
440
- ```
441
-
442
- Exit conditions: All pass, Max cycles, Same failure 3x
443
-
444
- ### DeepInit (Hierarchical AGENTS.md)
445
-
446
- ```
447
- project/
448
- ├── AGENTS.md ← Root
449
- ├── src/
450
- │ └── AGENTS.md ← <!-- Parent: ../AGENTS.md -->
451
- ```
452
-
453
- ### Skill Frontmatter System
454
-
455
- ```yaml
456
- ---
457
- name: my-skill
458
- model: sonnet
459
- triggers: [keyword1, keyword2]
460
- ---
461
- ```
462
-
463
- ### Trigger-Based Skill Injection
464
-
465
- Skills in `~/.claude/vibe/skills/` or `.claude/vibe/skills/` auto-inject on keyword match.
466
-
467
- ### Multi-Line HUD
468
-
469
- ```bash
470
- node hooks/scripts/hud-multiline.js multi # Tree view
471
- node hooks/scripts/hud-multiline.js compact # 2-line view
472
- node hooks/scripts/hud-multiline.js single # 1-line view
473
- ```
474
-
475
- ### Parallel Code Review (/vibe.review)
476
-
477
- 13+ specialized agents review code simultaneously:
478
-
479
- - Security: security-reviewer, data-integrity-reviewer
480
- - Performance: performance-reviewer, complexity-reviewer
481
- - Architecture: architecture-reviewer, simplicity-reviewer
482
- - Language-Specific: python, typescript, rails, react reviewers
483
- - Context: git-history, test-coverage reviewers
484
-
485
- **Priority System:**
486
- - 🔴 P1 (Critical): Blocks merge
487
- - 🟡 P2 (Important): Fix recommended
488
- - 🔵 P3 (Nice-to-have): Backlog
489
-
490
- ### E2E Testing (/vibe.utils --e2e)
491
-
492
- Playwright-based automated testing:
493
-
494
- ```bash
495
- /vibe.utils --e2e "login flow" # Scenario test
496
- /vibe.utils --e2e --visual # Visual regression test
497
- /vibe.utils --e2e --record # Video recording
498
- ```
499
-
500
- ### Enhanced Research Agents
501
-
502
- 4 parallel research agents run **after requirements confirmed** during `/vibe.spec`:
503
-
504
- | Agent | Role |
505
- |-------|------|
506
- | best-practices-agent | Best practices for confirmed feature+stack |
507
- | framework-docs-agent | Latest docs for confirmed stack (context7) |
508
- | codebase-patterns-agent | Analyze existing similar patterns |
509
- | security-advisory-agent | Security advisory for confirmed feature |
510
-
511
- ## PTCF Structure
512
-
513
- SPEC documents are AI-executable prompt format:
514
-
515
- ```
516
- <role> AI role definition
517
- <context> Background, tech stack, related code
518
- <task> Phase-by-phase task list
519
- <constraints> Constraints
520
- <output_format> Files to create/modify
521
- <acceptance> Verification criteria
522
- ```
523
-
524
- ## Built-in Tools
525
-
526
- ### Semantic Code Analysis
527
- | Tool | Purpose |
528
- |------|---------|
529
- | `vibe_find_symbol` | Find symbol definitions |
530
- | `vibe_find_references` | Find references |
531
- | `vibe_analyze_complexity` | Analyze complexity |
532
- | `vibe_validate_code_quality` | Validate quality |
533
-
534
- ### Context Management
535
- | Tool | Purpose |
536
- |------|---------|
537
- | `vibe_start_session` | Start session (restore previous context) |
538
- | `vibe_auto_save_context` | Save current state |
539
- | `vibe_save_memory` | Save important decisions |
540
-
541
- ## Agents
542
-
543
- ### Review Agents (12)
544
- ```
545
- .claude/agents/review/
546
- ├── security-reviewer.md # Security vulnerabilities
547
- ├── performance-reviewer.md # Performance bottlenecks
548
- ├── architecture-reviewer.md # Architecture violations
549
- ├── complexity-reviewer.md # Complexity exceeded
550
- ├── simplicity-reviewer.md # Over-abstraction
551
- ├── data-integrity-reviewer.md # Data integrity
552
- ├── test-coverage-reviewer.md # Missing tests
553
- ├── git-history-reviewer.md # Risk patterns
554
- ├── python-reviewer.md # Python specialist
555
- ├── typescript-reviewer.md # TypeScript specialist
556
- ├── rails-reviewer.md # Rails specialist
557
- └── react-reviewer.md # React specialist
558
- ```
559
-
560
- ### Research Agents (4)
561
- ```
562
- .claude/agents/research/
563
- ├── best-practices-agent.md # Best practices
564
- ├── framework-docs-agent.md # Framework docs
565
- ├── codebase-patterns-agent.md # Code pattern analysis
566
- └── security-advisory-agent.md # Security advisory
567
- ```
568
-
569
- ## Skills
570
-
571
- ### Git Worktree
572
- ```bash
573
- # Isolated environment for PR review
574
- git worktree add ../review-123 origin/pr/123
575
- cd ../review-123 && npm test
576
- git worktree remove ../review-123
577
- ```
578
-
579
- ### Priority Todos
580
- ```
581
- .claude/vibe/todos/
582
- ├── P1-security-sql-injection.md # 🔴 Blocks merge
583
- ├── P2-perf-n1-query.md # 🟡 Fix recommended
584
- └── P3-style-extract-helper.md # 🔵 Backlog
585
- ```
586
-
587
- ## Context Management Strategy
588
-
589
- ### Model Selection
590
- - **Exploration/Search**: Haiku (sub-agent default)
591
- - **Implementation/Debugging**: Sonnet
592
- - **Architecture/Complex logic**: Opus
593
-
594
- ### At 70%+ Context (⚠️ Important)
595
- ```
596
- ❌ Don't use /compact (risk of information loss/distortion)
597
- ✅ save_memory to store important decisions → /new for new session
598
- ```
599
-
600
- vibe maintains context across sessions with its own memory system:
601
- 1. `save_memory` - Explicitly save important decisions
602
- 2. `/new` - Start new session
603
- 3. `start_session` - Auto-restore previous session
604
-
605
- ### Session Restore
606
- To continue previous work in a new session:
607
- ```
608
- /vibe.utils --continue
609
- ```
610
- This command calls `vibe_start_session` to restore previous context from project memory.
611
-
612
- ### Other Commands
613
- - `/rewind` - Revert to previous point
614
- - `/context` - Check current usage
615
-
616
- ### Using context7
617
- Use context7 plugin when you need latest library documentation:
618
- ```
619
- "Search React 19 use() hook with context7"
620
- ```
621
-
622
- ## Documentation Guidelines
623
-
624
- ### Diagrams/Structure Representation
625
- - Avoid ASCII boxes (┌─┐) → Alignment breaks with mixed-width characters
626
- - Use alternatives:
627
- - Mermaid diagrams (GitHub/Notion supported)
628
- - Markdown tables
629
- - Indentation + separators
630
-
631
- ### Preferred Formats
632
- | Purpose | Recommended |
633
- |---------|-------------|
634
- | Flowcharts | Mermaid flowchart |
635
- | Structure/Hierarchy | Indented lists |
636
- | Comparisons/Lists | Markdown tables |
637
- | Sequences | Mermaid sequenceDiagram |
638
-
639
- ## Git Commit Rules
640
-
641
- **Must include:**
642
- - `.claude/vibe/specs/`, `.claude/vibe/features/`, `.claude/vibe/todos/` (project docs)
643
- - `.claude/vibe/config.json`, `.claude/vibe/constitution.md` (project config)
644
- - `CLAUDE.md`
645
-
646
- **Exclude (globally installed):**
647
- - `~/.claude/vibe/rules/`, `~/.claude/vibe/languages/`, `~/.claude/vibe/templates/` (global)
648
- - `~/.claude/commands/`, `~/.claude/agents/`, `~/.claude/skills/` (global)
649
- - `.claude/settings.local.json` (personal settings)
650
-
651
- ## Getting Started
652
-
653
- ```bash
654
- vibe init
655
- /vibe.spec "login feature"
656
- ```
657
-
658
- ## Full Workflow
659
-
660
- ```mermaid
661
- flowchart TD
662
- A["/vibe.spec"] --> B["(auto) SPEC review"]
663
- B --> C["SPEC auto-enhancement"]
664
- C --> D["/vibe.run ultrawork"]
665
- D --> E["Gemini code review"]
666
- E --> F["(auto) 13+ Agent Review"]
667
- F --> G{"P1/P2 issues?"}
668
- G -->|Yes| H["(auto) Auto-Fix"]
669
- H --> I["✅ Done"]
670
- G -->|No| I
671
- ```
672
-
673
- | Step | Description | Automation |
674
- |------|-------------|------------|
675
- | 1. `/vibe.spec` | Collect requirements + Generate SPEC | Manual start |
676
- | 2. SPEC review | Gemini reviews SPEC + Auto-apply | ✅ Auto |
677
- | 3. `/vibe.run` | Implementation + Gemini review | Manual start |
678
- | 4. Agent Review | 13+ agent parallel review | ✅ Auto |
679
- | 5. Auto-Fix | P1/P2 issue auto-fix | ✅ Auto |
680
-
681
- <!-- VIBE:END -->
1
+ # VIBE
2
+
3
+ SPEC-driven AI Coding Framework (Claude Code Exclusive)
4
+
5
+ ## Response Language
6
+
7
+ **IMPORTANT: Always respond in Korean (한국어) unless the user explicitly requests otherwise.**
8
+
9
+ ## Code Quality Standards (Mandatory)
10
+
11
+ Follow these standards when writing code. See `~/.claude/vibe/rules/` (global) for detailed rules.
12
+
13
+ ### Core Principles
14
+ - **Modify only requested scope** - Don't touch unrelated code
15
+ - **Preserve existing style** - Follow project conventions
16
+ - **Keep working code** - No unnecessary refactoring
17
+ - **Respect user interrupts** - If user interrupts (Ctrl+C/Escape) and sends a new message, the previous task is CANCELLED. Do NOT resume or continue interrupted work. Respond ONLY to the new message.
18
+
19
+ ### Code Complexity Limits
20
+ | Metric | Limit |
21
+ |--------|-------|
22
+ | Function length | ≤30 lines (recommended), ≤50 lines (allowed) |
23
+ | Nesting depth | ≤3 levels |
24
+ | Parameters | ≤5 |
25
+ | Cyclomatic complexity | ≤10 |
26
+
27
+ ### TypeScript Rules
28
+ - No `any` type → Use `unknown` + type guards
29
+ - No `as any` casting → Define proper interfaces
30
+ - No `@ts-ignore` → Fix type issues at root
31
+ - Explicit return types on all functions
32
+
33
+ ### Error Handling Required
34
+ - try-catch or error state required
35
+ - Loading state handling
36
+ - User-friendly error messages
37
+
38
+ ### Forbidden Patterns
39
+ - No console.log in commits (remove after debugging)
40
+ - No hardcoded strings/numbers → Extract to constants
41
+ - No commented-out code in commits
42
+ - No incomplete code without TODO
43
+
44
+ ## Workflow
45
+
46
+ ```
47
+ /vibe.spec → /new → /vibe.spec.review → /vibe.run → /vibe.trace → (auto) code review → ✅ Done
48
+
49
+ Coverage check (v2.6)
50
+ ```
51
+
52
+ **Flow:**
53
+
54
+ 1. `/vibe.spec` - Write SPEC (requirements + research + draft)
55
+ 2. `/new` - Start new session (clean context)
56
+ 3. `/vibe.spec.review` - GPT/Gemini review (3-round mandatory)
57
+ 4. `/vibe.run` - Implementation + Gemini review
58
+ 5. **(auto)** 13+ agent parallel review
59
+ 6. **(auto)** P1/P2 issue auto-fix
60
+
61
+ ## Plan Mode vs VIBE (Workflow Selection)
62
+
63
+ **Offer choice to user on development requests:**
64
+
65
+ | Task Size | Recommended |
66
+ |-----------|-------------|
67
+ | Simple changes (1-2 files) | Plan Mode |
68
+ | Complex features (3+ files, research/verification needed) | `/vibe.spec` |
69
+
70
+ | Item | Plan Mode | VIBE |
71
+ |------|-----------|------|
72
+ | Storage location | `~/.claude/plans/` (global) | `.claude/vibe/specs/` (project) |
73
+ | Document format | Free form | PTCF structure (AI-optimized) |
74
+ | Research | None | 4 parallel agents |
75
+ | Verification | None | `/vibe.verify` against SPEC |
76
+ | History | Not trackable | Git version control |
77
+
78
+ **Rules:**
79
+ - After `/vibe.analyze` or `/vibe.review` with dev/modify request → **Ask user for workflow choice**
80
+ - User chooses VIBE → Wait for `/vibe.spec`
81
+ - User chooses Plan Mode → Proceed with EnterPlanMode
82
+
83
+ ## ULTRAWORK Mode (Recommended)
84
+
85
+ Include `ultrawork` or `ulw` keyword to activate maximum performance mode:
86
+
87
+ ```bash
88
+ /vibe.run "feature-name" ultrawork # All optimizations auto-enabled
89
+ /vibe.run "feature-name" ulw # Same (shorthand)
90
+ ```
91
+
92
+ **Activated Features:**
93
+ - Parallel sub-agent exploration (3+ concurrent)
94
+ - **Background agents** - Prepare next Phase during implementation
95
+ - **Phase pipelining** - Remove wait time between Phases
96
+ - Boulder Loop (auto-continue until all Phases complete)
97
+ - Auto-retry on error (max 3 times)
98
+ - Auto-compress/save at 70%+ context
99
+ - Continuous execution without confirmation between Phases
100
+
101
+ **Speed Comparison:**
102
+
103
+ | Mode | Per Phase | 5 Phases |
104
+ |------|-----------|----------|
105
+ | Sequential | ~2min | ~10min |
106
+ | Parallel Exploration | ~1.5min | ~7.5min |
107
+ | **ULTRAWORK Pipeline** | **~1min** | **~5min** |
108
+
109
+ ## Commands
110
+
111
+ | Command | Description |
112
+ |---------|-------------|
113
+ | `/vibe.spec "feature-name"` | Write SPEC (PTCF structure) + parallel research |
114
+ | `/vibe.spec.review "feature-name"` | **GPT/Gemini review** (run in new session) |
115
+ | `/vibe.run "feature-name"` | Execute implementation |
116
+ | `/vibe.run "feature-name" ultrawork` | **Maximum performance mode** |
117
+ | `/vibe.verify "feature-name"` | Verification |
118
+ | `/vibe.review` | **Parallel code review** (13+ agents) |
119
+ | `/vibe.reason "problem"` | Systematic reasoning |
120
+ | `/vibe.analyze` | Project analysis |
121
+ | `/vibe.utils --e2e` | E2E testing (Playwright) |
122
+ | `/vibe.utils --diagram` | Generate diagrams |
123
+ | `/vibe.utils --ui "description"` | UI preview |
124
+ | `/vibe.utils --continue` | **Session restore** (load previous context) |
125
+
126
+ ## New Features (v2.6.x)
127
+
128
+ ### Structured User Questions (v2.6.1)
129
+
130
+ Use `askUser` tool for critical requirements that must not be missed:
131
+
132
+ ```typescript
133
+ import { askUser, askUserQuick } from '@su-record/vibe/tools';
134
+
135
+ // Quick helper for login features
136
+ const result = await askUserQuick.login('my-login');
137
+
138
+ // Custom categories
139
+ const result = await askUser({
140
+ featureName: 'dashboard',
141
+ categories: ['authentication', 'security', 'session'],
142
+ });
143
+ ```
144
+
145
+ **Available categories:**
146
+ | Category | Questions |
147
+ |----------|-----------|
148
+ | `authentication` | Auth method, MFA |
149
+ | `security` | Password policy, rate limit |
150
+ | `session` | Duration, concurrent login |
151
+ | `data_model` | Profile fields |
152
+ | `performance` | Response time targets |
153
+ | `integration` | External services |
154
+
155
+ **When to use:**
156
+ - ✅ Critical: auth, security, session → `askUser`
157
+ - ❌ Exploratory: scope, style → Natural conversation
158
+ - ⚠️ ultrawork mode: skipped (uses defaults)
159
+
160
+ ### Fire-and-Forget Background Manager
161
+
162
+ Launch background agents without blocking, with automatic concurrency control:
163
+
164
+ ```typescript
165
+ import { launch, poll, cancel, getStats } from '@su-record/vibe/orchestrator';
166
+
167
+ // Fire-and-forget - returns immediately (<100ms)
168
+ const { taskId } = launch({
169
+ prompt: 'Analyze codebase',
170
+ agentName: 'analyzer',
171
+ model: 'claude-sonnet-4-5',
172
+ });
173
+
174
+ // Poll for result later
175
+ const result = await poll(taskId);
176
+
177
+ // Check queue stats
178
+ const stats = getStats();
179
+ ```
180
+
181
+ **Concurrency limits:**
182
+
183
+ | Model | Limit |
184
+ |-------|-------|
185
+ | claude-opus-4 | 3 |
186
+ | claude-sonnet-4-5 | 5 |
187
+ | claude-haiku-* | 8 |
188
+
189
+ **Error types:**
190
+ - `QueueOverflowError`: Queue at capacity (100 tasks max)
191
+ - `TaskTimeoutError`: Task exceeded 3 minutes
192
+ - `PipelineTimeoutError`: Pipeline exceeded 10 minutes
193
+ - `AgentExecutionError`: Agent execution failed
194
+
195
+ ### Phase Pipelining
196
+
197
+ Remove wait time between phases with background preparation:
198
+
199
+ ```typescript
200
+ import { PhasePipeline, createStage, createUltraworkPipeline } from '@su-record/vibe/orchestrator';
201
+
202
+ const pipeline = createUltraworkPipeline('my-feature', [
203
+ createStage('Setup', async (ctx) => { /* ... */ }),
204
+ createStage('Core', async (ctx) => { /* ... */ }),
205
+ createStage('Test', async (ctx) => { /* ... */ }),
206
+ ]);
207
+
208
+ const result = await pipeline.execute();
209
+ // Next phase preparation happens during current phase execution!
210
+ ```
211
+
212
+ ### PRD-to-SPEC Automation
213
+
214
+ Generate SPEC documents from PRD (Product Requirements Document):
215
+
216
+ ```typescript
217
+ import { parsePRD, generateSpecFromPRD } from '@su-record/vibe/tools';
218
+
219
+ // Parse PRD document
220
+ const prd = parsePRD(prdContent, 'login');
221
+
222
+ // Generate SPEC
223
+ const spec = generateSpecFromPRD(prd, {
224
+ techStack: { frontend: 'React', backend: 'Node.js' },
225
+ });
226
+ ```
227
+
228
+ **Supported PRD formats:**
229
+ - Markdown with `## Requirements` sections
230
+ - YAML frontmatter with `requirements:` array
231
+ - Mixed format
232
+
233
+ ### Requirements Traceability Matrix (/vibe.trace)
234
+
235
+ Track requirements coverage across SPEC → Feature → Test:
236
+
237
+ ```bash
238
+ /vibe.trace "login" # Generate RTM
239
+ /vibe.trace "login" --html # HTML output
240
+ /vibe.trace "login" --save # Save to file
241
+ ```
242
+
243
+ ```typescript
244
+ import { generateTraceabilityMatrix, formatMatrixAsMarkdown } from '@su-record/vibe/tools';
245
+
246
+ const matrix = generateTraceabilityMatrix('login');
247
+ const markdown = formatMatrixAsMarkdown(matrix);
248
+ ```
249
+
250
+ **Coverage levels:**
251
+ | Level | Meaning |
252
+ |-------|---------|
253
+ | Full (✅) | SPEC + Feature + Test all mapped |
254
+ | Partial (⚠️) | Missing one or more mappings |
255
+ | None (❌) | Only in SPEC |
256
+
257
+ ### SPEC Versioning
258
+
259
+ Git-integrated version control for SPEC documents:
260
+
261
+ ```typescript
262
+ import { bumpSpecVersion, createGitTag, generateChangelog } from '@su-record/vibe/tools';
263
+
264
+ // Bump version (major/minor/patch)
265
+ const newVersion = bumpSpecVersion(specPath, 'minor', [
266
+ { type: 'added', description: 'New login feature' },
267
+ ]);
268
+
269
+ // Create git tag
270
+ createGitTag('login', newVersion.version);
271
+
272
+ // Generate changelog
273
+ const changelog = generateChangelog(versionHistory);
274
+ ```
275
+
276
+ ## Previous Features (v2.5.15)
277
+
278
+ ### Rule Build System
279
+
280
+ Compile individual rule files into consolidated AGENTS.md:
281
+
282
+ ```typescript
283
+ import { buildRulesDocument, extractTestCasesFromDir } from '@su-record/vibe/tools';
284
+
285
+ // Build rules from directory
286
+ await buildRulesDocument('./rules', './AGENTS.md', {
287
+ version: '1.0.0',
288
+ title: 'Code Quality Rules',
289
+ abstract: 'Guidelines for code quality',
290
+ });
291
+
292
+ // Extract test cases for LLM evaluation
293
+ await extractTestCasesFromDir('./rules', './test-cases.json');
294
+ ```
295
+
296
+ **Rule file structure:**
297
+ ```markdown
298
+ ---
299
+ title: Rule Title
300
+ impact: CRITICAL
301
+ tags: security, performance
302
+ ---
303
+
304
+ ## Rule Title
305
+
306
+ Explanation of the rule.
307
+
308
+ **Incorrect:**
309
+ \`\`\`typescript
310
+ // Bad code
311
+ \`\`\`
312
+
313
+ **Correct:**
314
+ \`\`\`typescript
315
+ // Good code
316
+ \`\`\`
317
+ ```
318
+
319
+ ### Impact-Based Classification
320
+
321
+ Rules are classified by impact level:
322
+
323
+ | Level | Color | Priority |
324
+ |-------|-------|----------|
325
+ | CRITICAL | 🔴 Red | 0 (highest) |
326
+ | HIGH | 🟡 Yellow | 1 |
327
+ | MEDIUM-HIGH | 🟡 Yellow | 2 |
328
+ | MEDIUM | 🔵 Cyan | 3 |
329
+ | LOW-MEDIUM | 🔵 Cyan | 4 |
330
+ | LOW | 🟢 Green | 5 |
331
+
332
+ ### Framework Auto-Detection
333
+
334
+ Automatically detect project framework from package.json:
335
+
336
+ ```typescript
337
+ import { detectFramework, getFrameworkRecommendations } from '@su-record/vibe/tools';
338
+
339
+ const result = await detectFramework('./my-project');
340
+ // { framework: { id: 'nextjs', name: 'Next.js', category: 'fullstack' }, ... }
341
+
342
+ const recs = getFrameworkRecommendations(result.framework);
343
+ // { reviewers: ['react-reviewer'], rules: ['react-*'], features: ['ssr'] }
344
+ ```
345
+
346
+ **Supported frameworks (40+):**
347
+ - Fullstack: Next.js, Remix, Nuxt, SvelteKit, Astro, RedwoodJS
348
+ - Frontend: React, Vue, Svelte, Angular, Preact
349
+ - Backend: NestJS, Express, Fastify, Hono, Elysia
350
+ - Docs: Docusaurus, VitePress, Eleventy
351
+
352
+ ### Test Case Extraction
353
+
354
+ Extract good/bad examples from rules for LLM evaluation:
355
+
356
+ ```typescript
357
+ import { extractTestCases, validateRule } from '@su-record/vibe/tools';
358
+
359
+ const testCases = extractTestCases(rules);
360
+ // [{ ruleId: '1.1', type: 'bad', code: '...', ... }]
361
+
362
+ const validation = validateRule(rule);
363
+ // { valid: true, errors: [] }
364
+ ```
365
+
366
+ ## Previous Features (v2.5.7-v2.5.11)
367
+
368
+ ### Intelligent Model Routing
369
+
370
+ Automatic model selection based on task complexity:
371
+
372
+ | Complexity | Model | When |
373
+ |------------|-------|------|
374
+ | Low (0-7) | Haiku | Simple fixes, searches |
375
+ | Medium (8-19) | Sonnet | Standard features, 3-5 files |
376
+ | High (20+) | Opus | Architecture, security, 6+ files |
377
+
378
+ ### Agent Tier System
379
+
380
+ Cost-optimized agent variants:
381
+
382
+ | Agent | Low | Medium | High |
383
+ |-------|-----|--------|------|
384
+ | explorer | explorer-low | explorer-medium | explorer |
385
+ | implementer | implementer-low | implementer-medium | implementer |
386
+ | architect | architect-low | architect-medium | architect |
387
+
388
+ ### Magic Keywords
389
+
390
+ | Keyword | Effect |
391
+ |---------|--------|
392
+ | `ultrawork` / `ulw` | Parallel + auto-continue + Ralph Loop |
393
+ | `ralph` | **Ralph Loop**: Iterate until 100% complete (no scope reduction) |
394
+ | `ralplan` | Iterative planning + persistence |
395
+ | `verify` | Strict verification mode |
396
+ | `quick` | Fast mode, minimal verification |
397
+
398
+ **Combinations supported:** `ralph ultrawork`, `ralph verify`, etc.
399
+
400
+ **Ralph Loop** (from [ghuntley.com/ralph](https://ghuntley.com/ralph)):
401
+
402
+ - Compares ORIGINAL request vs current implementation
403
+ - Lists ALL missing items explicitly
404
+ - Iterates until 100% complete (max 5 iterations)
405
+ - **ZERO tolerance for scope reduction** - Never say "basic version" or "simplified"
406
+
407
+ ### Skill Quality Gate
408
+
409
+ Memory saves are validated for quality:
410
+
411
+ - Rejects generic/searchable information
412
+ - Requires context, specificity, actionability
413
+ - Suggests principle format: "When X, do Y because Z"
414
+
415
+ ### HUD Status (Real-time)
416
+
417
+ ```bash
418
+ node hooks/scripts/hud-status.js show full
419
+ node hooks/scripts/hud-status.js start ultrawork "feature"
420
+ node hooks/scripts/hud-status.js phase 2 5 "Implementing core"
421
+ ```
422
+
423
+ ### Pre/Post Tool Hooks
424
+
425
+ - **PreToolUse**: Validates dangerous commands before execution
426
+ - **PostToolUse**: Provides error recovery hints
427
+
428
+ ### Orchestrate Workflow
429
+
430
+ Intent Gate → Codebase Assessment → Delegation → Verification pattern:
431
+
432
+ ```typescript
433
+ import { checkIntentGate, assessCodebase, createDelegationPlan } from '@su-record/vibe/tools';
434
+ ```
435
+
436
+ ### UltraQA (5-Cycle Autonomous QA)
437
+
438
+ ```
439
+ Test/Build/Lint → Fail → Architect Diagnosis → Executor Fix → Repeat (max 5)
440
+ ```
441
+
442
+ Exit conditions: All pass, Max cycles, Same failure 3x
443
+
444
+ ### DeepInit (Hierarchical AGENTS.md)
445
+
446
+ ```
447
+ project/
448
+ ├── AGENTS.md ← Root
449
+ ├── src/
450
+ │ └── AGENTS.md ← <!-- Parent: ../AGENTS.md -->
451
+ ```
452
+
453
+ ### Skill Frontmatter System
454
+
455
+ ```yaml
456
+ ---
457
+ name: my-skill
458
+ model: sonnet
459
+ triggers: [keyword1, keyword2]
460
+ ---
461
+ ```
462
+
463
+ ### Trigger-Based Skill Injection
464
+
465
+ Skills in `~/.claude/vibe/skills/` or `.claude/vibe/skills/` auto-inject on keyword match.
466
+
467
+ ### Multi-Line HUD
468
+
469
+ ```bash
470
+ node hooks/scripts/hud-multiline.js multi # Tree view
471
+ node hooks/scripts/hud-multiline.js compact # 2-line view
472
+ node hooks/scripts/hud-multiline.js single # 1-line view
473
+ ```
474
+
475
+ ### Parallel Code Review (/vibe.review)
476
+
477
+ 13+ specialized agents review code simultaneously:
478
+
479
+ - Security: security-reviewer, data-integrity-reviewer
480
+ - Performance: performance-reviewer, complexity-reviewer
481
+ - Architecture: architecture-reviewer, simplicity-reviewer
482
+ - Language-Specific: python, typescript, rails, react reviewers
483
+ - Context: git-history, test-coverage reviewers
484
+
485
+ **Priority System:**
486
+ - 🔴 P1 (Critical): Blocks merge
487
+ - 🟡 P2 (Important): Fix recommended
488
+ - 🔵 P3 (Nice-to-have): Backlog
489
+
490
+ ### E2E Testing (/vibe.utils --e2e)
491
+
492
+ Playwright-based automated testing:
493
+
494
+ ```bash
495
+ /vibe.utils --e2e "login flow" # Scenario test
496
+ /vibe.utils --e2e --visual # Visual regression test
497
+ /vibe.utils --e2e --record # Video recording
498
+ ```
499
+
500
+ ### Enhanced Research Agents
501
+
502
+ 4 parallel research agents run **after requirements confirmed** during `/vibe.spec`:
503
+
504
+ | Agent | Role |
505
+ |-------|------|
506
+ | best-practices-agent | Best practices for confirmed feature+stack |
507
+ | framework-docs-agent | Latest docs for confirmed stack (context7) |
508
+ | codebase-patterns-agent | Analyze existing similar patterns |
509
+ | security-advisory-agent | Security advisory for confirmed feature |
510
+
511
+ ## PTCF Structure
512
+
513
+ SPEC documents are AI-executable prompt format:
514
+
515
+ ```
516
+ <role> AI role definition
517
+ <context> Background, tech stack, related code
518
+ <task> Phase-by-phase task list
519
+ <constraints> Constraints
520
+ <output_format> Files to create/modify
521
+ <acceptance> Verification criteria
522
+ ```
523
+
524
+ ## Built-in Tools
525
+
526
+ ### Semantic Code Analysis
527
+ | Tool | Purpose |
528
+ |------|---------|
529
+ | `vibe_find_symbol` | Find symbol definitions |
530
+ | `vibe_find_references` | Find references |
531
+ | `vibe_analyze_complexity` | Analyze complexity |
532
+ | `vibe_validate_code_quality` | Validate quality |
533
+
534
+ ### Context Management
535
+ | Tool | Purpose |
536
+ |------|---------|
537
+ | `vibe_start_session` | Start session (restore previous context) |
538
+ | `vibe_auto_save_context` | Save current state |
539
+ | `vibe_save_memory` | Save important decisions |
540
+
541
+ ## Agents
542
+
543
+ ### Review Agents (12)
544
+ ```
545
+ .claude/agents/review/
546
+ ├── security-reviewer.md # Security vulnerabilities
547
+ ├── performance-reviewer.md # Performance bottlenecks
548
+ ├── architecture-reviewer.md # Architecture violations
549
+ ├── complexity-reviewer.md # Complexity exceeded
550
+ ├── simplicity-reviewer.md # Over-abstraction
551
+ ├── data-integrity-reviewer.md # Data integrity
552
+ ├── test-coverage-reviewer.md # Missing tests
553
+ ├── git-history-reviewer.md # Risk patterns
554
+ ├── python-reviewer.md # Python specialist
555
+ ├── typescript-reviewer.md # TypeScript specialist
556
+ ├── rails-reviewer.md # Rails specialist
557
+ └── react-reviewer.md # React specialist
558
+ ```
559
+
560
+ ### Research Agents (4)
561
+ ```
562
+ .claude/agents/research/
563
+ ├── best-practices-agent.md # Best practices
564
+ ├── framework-docs-agent.md # Framework docs
565
+ ├── codebase-patterns-agent.md # Code pattern analysis
566
+ └── security-advisory-agent.md # Security advisory
567
+ ```
568
+
569
+ ## Skills
570
+
571
+ ### Git Worktree
572
+ ```bash
573
+ # Isolated environment for PR review
574
+ git worktree add ../review-123 origin/pr/123
575
+ cd ../review-123 && npm test
576
+ git worktree remove ../review-123
577
+ ```
578
+
579
+ ### Priority Todos
580
+ ```
581
+ .claude/vibe/todos/
582
+ ├── P1-security-sql-injection.md # 🔴 Blocks merge
583
+ ├── P2-perf-n1-query.md # 🟡 Fix recommended
584
+ └── P3-style-extract-helper.md # 🔵 Backlog
585
+ ```
586
+
587
+ ## Context Management Strategy
588
+
589
+ ### Model Selection
590
+ - **Exploration/Search**: Haiku (sub-agent default)
591
+ - **Implementation/Debugging**: Sonnet
592
+ - **Architecture/Complex logic**: Opus
593
+
594
+ ### At 70%+ Context (⚠️ Important)
595
+ ```
596
+ ❌ Don't use /compact (risk of information loss/distortion)
597
+ ✅ save_memory to store important decisions → /new for new session
598
+ ```
599
+
600
+ vibe maintains context across sessions with its own memory system:
601
+ 1. `save_memory` - Explicitly save important decisions
602
+ 2. `/new` - Start new session
603
+ 3. `start_session` - Auto-restore previous session
604
+
605
+ ### Session Restore
606
+ To continue previous work in a new session:
607
+ ```
608
+ /vibe.utils --continue
609
+ ```
610
+ This command calls `vibe_start_session` to restore previous context from project memory.
611
+
612
+ ### Other Commands
613
+ - `/rewind` - Revert to previous point
614
+ - `/context` - Check current usage
615
+
616
+ ### Using context7
617
+ Use context7 plugin when you need latest library documentation:
618
+ ```
619
+ "Search React 19 use() hook with context7"
620
+ ```
621
+
622
+ ## Documentation Guidelines
623
+
624
+ ### Diagrams/Structure Representation
625
+ - Avoid ASCII boxes (┌─┐) → Alignment breaks with mixed-width characters
626
+ - Use alternatives:
627
+ - Mermaid diagrams (GitHub/Notion supported)
628
+ - Markdown tables
629
+ - Indentation + separators
630
+
631
+ ### Preferred Formats
632
+ | Purpose | Recommended |
633
+ |---------|-------------|
634
+ | Flowcharts | Mermaid flowchart |
635
+ | Structure/Hierarchy | Indented lists |
636
+ | Comparisons/Lists | Markdown tables |
637
+ | Sequences | Mermaid sequenceDiagram |
638
+
639
+ ## Git Commit Rules
640
+
641
+ **Must include:**
642
+ - `.claude/vibe/specs/`, `.claude/vibe/features/`, `.claude/vibe/todos/` (project docs)
643
+ - `.claude/vibe/config.json`, `.claude/vibe/constitution.md` (project config)
644
+ - `CLAUDE.md`
645
+
646
+ **Exclude (globally installed):**
647
+ - `~/.claude/vibe/rules/`, `~/.claude/vibe/languages/`, `~/.claude/vibe/templates/` (global)
648
+ - `~/.claude/commands/`, `~/.claude/agents/`, `~/.claude/skills/` (global)
649
+ - `.claude/settings.local.json` (personal settings)
650
+
651
+ ## Getting Started
652
+
653
+ ```bash
654
+ vibe init
655
+ /vibe.spec "login feature"
656
+ ```
657
+
658
+ ## Full Workflow
659
+
660
+ ```mermaid
661
+ flowchart TD
662
+ A["/vibe.spec"] --> B["(auto) SPEC review"]
663
+ B --> C["SPEC auto-enhancement"]
664
+ C --> D["/vibe.run ultrawork"]
665
+ D --> E["Gemini code review"]
666
+ E --> F["(auto) 13+ Agent Review"]
667
+ F --> G{"P1/P2 issues?"}
668
+ G -->|Yes| H["(auto) Auto-Fix"]
669
+ H --> I["✅ Done"]
670
+ G -->|No| I
671
+ ```
672
+
673
+ | Step | Description | Automation |
674
+ |------|-------------|------------|
675
+ | 1. `/vibe.spec` | Collect requirements + Generate SPEC | Manual start |
676
+ | 2. SPEC review | Gemini reviews SPEC + Auto-apply | ✅ Auto |
677
+ | 3. `/vibe.run` | Implementation + Gemini review | Manual start |
678
+ | 4. Agent Review | 13+ agent parallel review | ✅ Auto |
679
+ | 5. Auto-Fix | P1/P2 issue auto-fix | ✅ Auto |
680
+
681
+ <!-- VIBE:END -->