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