@su-record/vibe 2.5.17 → 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.
package/CLAUDE.md CHANGED
@@ -1,512 +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
- ### 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/numbers → Extract 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 |
233
- | `ralph` | Persist until verified complete |
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
- ### Skill Quality Gate
241
-
242
- Memory saves are validated for quality:
243
-
244
- - Rejects generic/searchable information
245
- - Requires context, specificity, actionability
246
- - Suggests principle format: "When X, do Y because Z"
247
-
248
- ### HUD Status (Real-time)
249
-
250
- ```bash
251
- node hooks/scripts/hud-status.js show full
252
- node hooks/scripts/hud-status.js start ultrawork "feature"
253
- node hooks/scripts/hud-status.js phase 2 5 "Implementing core"
254
- ```
255
-
256
- ### Pre/Post Tool Hooks
257
-
258
- - **PreToolUse**: Validates dangerous commands before execution
259
- - **PostToolUse**: Provides error recovery hints
260
-
261
- ### Orchestrate Workflow
262
-
263
- Intent Gate Codebase Assessment → Delegation → Verification pattern:
264
-
265
- ```typescript
266
- import { checkIntentGate, assessCodebase, createDelegationPlan } from '@su-record/vibe/tools';
267
- ```
268
-
269
- ### UltraQA (5-Cycle Autonomous QA)
270
-
271
- ```
272
- Test/Build/Lint → Fail → Architect Diagnosis → Executor Fix → Repeat (max 5)
273
- ```
274
-
275
- Exit conditions: All pass, Max cycles, Same failure 3x
276
-
277
- ### DeepInit (Hierarchical AGENTS.md)
278
-
279
- ```
280
- project/
281
- ├── AGENTS.md ← Root
282
- ├── src/
283
- │ └── AGENTS.md ← <!-- Parent: ../AGENTS.md -->
284
- ```
285
-
286
- ### Skill Frontmatter System
287
-
288
- ```yaml
289
- ---
290
- name: my-skill
291
- model: sonnet
292
- triggers: [keyword1, keyword2]
293
- ---
294
- ```
295
-
296
- ### Trigger-Based Skill Injection
297
-
298
- Skills in `~/.claude/vibe/skills/` or `.claude/vibe/skills/` auto-inject on keyword match.
299
-
300
- ### Multi-Line HUD
301
-
302
- ```bash
303
- node hooks/scripts/hud-multiline.js multi # Tree view
304
- node hooks/scripts/hud-multiline.js compact # 2-line view
305
- node hooks/scripts/hud-multiline.js single # 1-line view
306
- ```
307
-
308
- ### Parallel Code Review (/vibe.review)
309
-
310
- 13+ specialized agents review code simultaneously:
311
-
312
- - Security: security-reviewer, data-integrity-reviewer
313
- - Performance: performance-reviewer, complexity-reviewer
314
- - Architecture: architecture-reviewer, simplicity-reviewer
315
- - Language-Specific: python, typescript, rails, react reviewers
316
- - Context: git-history, test-coverage reviewers
317
-
318
- **Priority System:**
319
- - 🔴 P1 (Critical): Blocks merge
320
- - 🟡 P2 (Important): Fix recommended
321
- - 🔵 P3 (Nice-to-have): Backlog
322
-
323
- ### E2E Testing (/vibe.utils --e2e)
324
-
325
- Playwright-based automated testing:
326
-
327
- ```bash
328
- /vibe.utils --e2e "login flow" # Scenario test
329
- /vibe.utils --e2e --visual # Visual regression test
330
- /vibe.utils --e2e --record # Video recording
331
- ```
332
-
333
- ### Enhanced Research Agents
334
-
335
- 4 parallel research agents run **after requirements confirmed** during `/vibe.spec`:
336
-
337
- | Agent | Role |
338
- |-------|------|
339
- | best-practices-agent | Best practices for confirmed feature+stack |
340
- | framework-docs-agent | Latest docs for confirmed stack (context7) |
341
- | codebase-patterns-agent | Analyze existing similar patterns |
342
- | security-advisory-agent | Security advisory for confirmed feature |
343
-
344
- ## PTCF Structure
345
-
346
- SPEC documents are AI-executable prompt format:
347
-
348
- ```
349
- <role> AI role definition
350
- <context> Background, tech stack, related code
351
- <task> Phase-by-phase task list
352
- <constraints> Constraints
353
- <output_format> Files to create/modify
354
- <acceptance> Verification criteria
355
- ```
356
-
357
- ## Built-in Tools
358
-
359
- ### Semantic Code Analysis
360
- | Tool | Purpose |
361
- |------|---------|
362
- | `vibe_find_symbol` | Find symbol definitions |
363
- | `vibe_find_references` | Find references |
364
- | `vibe_analyze_complexity` | Analyze complexity |
365
- | `vibe_validate_code_quality` | Validate quality |
366
-
367
- ### Context Management
368
- | Tool | Purpose |
369
- |------|---------|
370
- | `vibe_start_session` | Start session (restore previous context) |
371
- | `vibe_auto_save_context` | Save current state |
372
- | `vibe_save_memory` | Save important decisions |
373
-
374
- ## Agents
375
-
376
- ### Review Agents (12)
377
- ```
378
- .claude/agents/review/
379
- ├── security-reviewer.md # Security vulnerabilities
380
- ├── performance-reviewer.md # Performance bottlenecks
381
- ├── architecture-reviewer.md # Architecture violations
382
- ├── complexity-reviewer.md # Complexity exceeded
383
- ├── simplicity-reviewer.md # Over-abstraction
384
- ├── data-integrity-reviewer.md # Data integrity
385
- ├── test-coverage-reviewer.md # Missing tests
386
- ├── git-history-reviewer.md # Risk patterns
387
- ├── python-reviewer.md # Python specialist
388
- ├── typescript-reviewer.md # TypeScript specialist
389
- ├── rails-reviewer.md # Rails specialist
390
- └── react-reviewer.md # React specialist
391
- ```
392
-
393
- ### Research Agents (4)
394
- ```
395
- .claude/agents/research/
396
- ├── best-practices-agent.md # Best practices
397
- ├── framework-docs-agent.md # Framework docs
398
- ├── codebase-patterns-agent.md # Code pattern analysis
399
- └── security-advisory-agent.md # Security advisory
400
- ```
401
-
402
- ## Skills
403
-
404
- ### Git Worktree
405
- ```bash
406
- # Isolated environment for PR review
407
- git worktree add ../review-123 origin/pr/123
408
- cd ../review-123 && npm test
409
- git worktree remove ../review-123
410
- ```
411
-
412
- ### Priority Todos
413
- ```
414
- .claude/vibe/todos/
415
- ├── P1-security-sql-injection.md # 🔴 Blocks merge
416
- ├── P2-perf-n1-query.md # 🟡 Fix recommended
417
- └── P3-style-extract-helper.md # 🔵 Backlog
418
- ```
419
-
420
- ## Context Management Strategy
421
-
422
- ### Model Selection
423
- - **Exploration/Search**: Haiku (sub-agent default)
424
- - **Implementation/Debugging**: Sonnet
425
- - **Architecture/Complex logic**: Opus
426
-
427
- ### At 70%+ Context (⚠️ Important)
428
- ```
429
- Don't use /compact (risk of information loss/distortion)
430
- save_memory to store important decisions → /new for new session
431
- ```
432
-
433
- vibe maintains context across sessions with its own memory system:
434
- 1. `save_memory` - Explicitly save important decisions
435
- 2. `/new` - Start new session
436
- 3. `start_session` - Auto-restore previous session
437
-
438
- ### Session Restore
439
- To continue previous work in a new session:
440
- ```
441
- /vibe.utils --continue
442
- ```
443
- This command calls `vibe_start_session` to restore previous context from project memory.
444
-
445
- ### Other Commands
446
- - `/rewind` - Revert to previous point
447
- - `/context` - Check current usage
448
-
449
- ### Using context7
450
- Use context7 plugin when you need latest library documentation:
451
- ```
452
- "Search React 19 use() hook with context7"
453
- ```
454
-
455
- ## Documentation Guidelines
456
-
457
- ### Diagrams/Structure Representation
458
- - Avoid ASCII boxes (┌─┐) → Alignment breaks with mixed-width characters
459
- - Use alternatives:
460
- - Mermaid diagrams (GitHub/Notion supported)
461
- - Markdown tables
462
- - Indentation + separators
463
-
464
- ### Preferred Formats
465
- | Purpose | Recommended |
466
- |---------|-------------|
467
- | Flowcharts | Mermaid flowchart |
468
- | Structure/Hierarchy | Indented lists |
469
- | Comparisons/Lists | Markdown tables |
470
- | Sequences | Mermaid sequenceDiagram |
471
-
472
- ## Git Commit Rules
473
-
474
- **Must include:**
475
- - `.claude/vibe/specs/`, `.claude/vibe/features/`, `.claude/vibe/todos/` (project docs)
476
- - `.claude/vibe/config.json`, `.claude/vibe/constitution.md` (project config)
477
- - `CLAUDE.md`
478
-
479
- **Exclude (globally installed):**
480
- - `~/.claude/vibe/rules/`, `~/.claude/vibe/languages/`, `~/.claude/vibe/templates/` (global)
481
- - `~/.claude/commands/`, `~/.claude/agents/`, `~/.claude/skills/` (global)
482
- - `.claude/settings.local.json` (personal settings)
483
-
484
- ## Getting Started
485
-
486
- ```bash
487
- vibe init
488
- /vibe.spec "login feature"
489
- ```
490
-
491
- ## Full Workflow
492
-
493
- ```mermaid
494
- flowchart TD
495
- A["/vibe.spec"] --> B["(auto) SPEC review"]
496
- B --> C["SPEC auto-enhancement"]
497
- C --> D["/vibe.run ultrawork"]
498
- D --> E["Gemini code review"]
499
- E --> F["(auto) 13+ Agent Review"]
500
- F --> G{"P1/P2 issues?"}
501
- G -->|Yes| H["(auto) Auto-Fix"]
502
- H --> I[" Done"]
503
- G -->|No| I
504
- ```
505
-
506
- | Step | Description | Automation |
507
- |------|-------------|------------|
508
- | 1. `/vibe.spec` | Collect requirements + Generate SPEC | Manual start |
509
- | 2. SPEC review | Gemini reviews SPEC + Auto-apply | Auto |
510
- | 3. `/vibe.run` | Implementation + Gemini review | Manual start |
511
- | 4. Agent Review | 13+ agent parallel review | ✅ Auto |
512
- | 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/numbers → Extract 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 |