@su-record/vibe 2.5.19 → 2.5.21

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,519 +1,523 @@
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 |
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 → /new /vibe.spec.review → /vibe.run → (auto) code review → ✅ Done
44
+ ```
45
+
46
+ **Flow:**
47
+
48
+ 1. `/vibe.spec` - Write SPEC (requirements + research + draft)
49
+ 2. `/new` - Start new session (clean context)
50
+ 3. `/vibe.spec.review` - GPT/Gemini review (3-round mandatory)
51
+ 4. `/vibe.run` - Implementation + Gemini review
52
+ 5. **(auto)** 13+ agent parallel review
53
+ 6. **(auto)** P1/P2 issue auto-fix
54
+
55
+ ## Plan Mode vs VIBE (Workflow Selection)
56
+
57
+ **Offer choice to user on development requests:**
58
+
59
+ | Task Size | Recommended |
60
+ |-----------|-------------|
61
+ | Simple changes (1-2 files) | Plan Mode |
62
+ | Complex features (3+ files, research/verification needed) | `/vibe.spec` |
63
+
64
+ | Item | Plan Mode | VIBE |
65
+ |------|-----------|------|
66
+ | Storage location | `~/.claude/plans/` (global) | `.claude/vibe/specs/` (project) |
67
+ | Document format | Free form | PTCF structure (AI-optimized) |
68
+ | Research | None | 4 parallel agents |
69
+ | Verification | None | `/vibe.verify` against SPEC |
70
+ | History | Not trackable | Git version control |
71
+
72
+ **Rules:**
73
+ - After `/vibe.analyze` or `/vibe.review` with dev/modify request → **Ask user for workflow choice**
74
+ - User chooses VIBE → Wait for `/vibe.spec`
75
+ - User chooses Plan Mode → Proceed with EnterPlanMode
76
+
77
+ ## ULTRAWORK Mode (Recommended)
78
+
79
+ Include `ultrawork` or `ulw` keyword to activate maximum performance mode:
80
+
81
+ ```bash
82
+ /vibe.run "feature-name" ultrawork # All optimizations auto-enabled
83
+ /vibe.run "feature-name" ulw # Same (shorthand)
84
+ ```
85
+
86
+ **Activated Features:**
87
+ - Parallel sub-agent exploration (3+ concurrent)
88
+ - **Background agents** - Prepare next Phase during implementation
89
+ - **Phase pipelining** - Remove wait time between Phases
90
+ - Boulder Loop (auto-continue until all Phases complete)
91
+ - Auto-retry on error (max 3 times)
92
+ - Auto-compress/save at 70%+ context
93
+ - Continuous execution without confirmation between Phases
94
+
95
+ **Speed Comparison:**
96
+
97
+ | Mode | Per Phase | 5 Phases |
98
+ |------|-----------|----------|
99
+ | Sequential | ~2min | ~10min |
100
+ | Parallel Exploration | ~1.5min | ~7.5min |
101
+ | **ULTRAWORK Pipeline** | **~1min** | **~5min** |
102
+
103
+ ## Commands
104
+
105
+ | Command | Description |
106
+ |---------|-------------|
107
+ | `/vibe.spec "feature-name"` | Write SPEC (PTCF structure) + parallel research |
108
+ | `/vibe.spec.review "feature-name"` | **GPT/Gemini review** (run in new session) |
109
+ | `/vibe.run "feature-name"` | Execute implementation |
110
+ | `/vibe.run "feature-name" ultrawork` | **Maximum performance mode** |
111
+ | `/vibe.verify "feature-name"` | Verification |
112
+ | `/vibe.review` | **Parallel code review** (13+ agents) |
113
+ | `/vibe.reason "problem"` | Systematic reasoning |
114
+ | `/vibe.analyze` | Project analysis |
115
+ | `/vibe.utils --e2e` | E2E testing (Playwright) |
116
+ | `/vibe.utils --diagram` | Generate diagrams |
117
+ | `/vibe.utils --ui "description"` | UI preview |
118
+ | `/vibe.utils --continue` | **Session restore** (load previous context) |
119
+
120
+ ## New Features (v2.5.15)
121
+
122
+ ### Rule Build System
123
+
124
+ Compile individual rule files into consolidated AGENTS.md:
125
+
126
+ ```typescript
127
+ import { buildRulesDocument, extractTestCasesFromDir } from '@su-record/vibe/tools';
128
+
129
+ // Build rules from directory
130
+ await buildRulesDocument('./rules', './AGENTS.md', {
131
+ version: '1.0.0',
132
+ title: 'Code Quality Rules',
133
+ abstract: 'Guidelines for code quality',
134
+ });
135
+
136
+ // Extract test cases for LLM evaluation
137
+ await extractTestCasesFromDir('./rules', './test-cases.json');
138
+ ```
139
+
140
+ **Rule file structure:**
141
+ ```markdown
142
+ ---
143
+ title: Rule Title
144
+ impact: CRITICAL
145
+ tags: security, performance
146
+ ---
147
+
148
+ ## Rule Title
149
+
150
+ Explanation of the rule.
151
+
152
+ **Incorrect:**
153
+ \`\`\`typescript
154
+ // Bad code
155
+ \`\`\`
156
+
157
+ **Correct:**
158
+ \`\`\`typescript
159
+ // Good code
160
+ \`\`\`
161
+ ```
162
+
163
+ ### Impact-Based Classification
164
+
165
+ Rules are classified by impact level:
166
+
167
+ | Level | Color | Priority |
168
+ |-------|-------|----------|
169
+ | CRITICAL | 🔴 Red | 0 (highest) |
170
+ | HIGH | 🟡 Yellow | 1 |
171
+ | MEDIUM-HIGH | 🟡 Yellow | 2 |
172
+ | MEDIUM | 🔵 Cyan | 3 |
173
+ | LOW-MEDIUM | 🔵 Cyan | 4 |
174
+ | LOW | 🟢 Green | 5 |
175
+
176
+ ### Framework Auto-Detection
177
+
178
+ Automatically detect project framework from package.json:
179
+
180
+ ```typescript
181
+ import { detectFramework, getFrameworkRecommendations } from '@su-record/vibe/tools';
182
+
183
+ const result = await detectFramework('./my-project');
184
+ // { framework: { id: 'nextjs', name: 'Next.js', category: 'fullstack' }, ... }
185
+
186
+ const recs = getFrameworkRecommendations(result.framework);
187
+ // { reviewers: ['react-reviewer'], rules: ['react-*'], features: ['ssr'] }
188
+ ```
189
+
190
+ **Supported frameworks (40+):**
191
+ - Fullstack: Next.js, Remix, Nuxt, SvelteKit, Astro, RedwoodJS
192
+ - Frontend: React, Vue, Svelte, Angular, Preact
193
+ - Backend: NestJS, Express, Fastify, Hono, Elysia
194
+ - Docs: Docusaurus, VitePress, Eleventy
195
+
196
+ ### Test Case Extraction
197
+
198
+ Extract good/bad examples from rules for LLM evaluation:
199
+
200
+ ```typescript
201
+ import { extractTestCases, validateRule } from '@su-record/vibe/tools';
202
+
203
+ const testCases = extractTestCases(rules);
204
+ // [{ ruleId: '1.1', type: 'bad', code: '...', ... }]
205
+
206
+ const validation = validateRule(rule);
207
+ // { valid: true, errors: [] }
208
+ ```
209
+
210
+ ## Previous Features (v2.5.7-v2.5.11)
211
+
212
+ ### Intelligent Model Routing
213
+
214
+ Automatic model selection based on task complexity:
215
+
216
+ | Complexity | Model | When |
217
+ |------------|-------|------|
218
+ | Low (0-7) | Haiku | Simple fixes, searches |
219
+ | Medium (8-19) | Sonnet | Standard features, 3-5 files |
220
+ | High (20+) | Opus | Architecture, security, 6+ files |
221
+
222
+ ### Agent Tier System
223
+
224
+ Cost-optimized agent variants:
225
+
226
+ | Agent | Low | Medium | High |
227
+ |-------|-----|--------|------|
228
+ | explorer | explorer-low | explorer-medium | explorer |
229
+ | implementer | implementer-low | implementer-medium | implementer |
230
+ | architect | architect-low | architect-medium | architect |
231
+
232
+ ### Magic Keywords
233
+
234
+ | Keyword | Effect |
235
+ |---------|--------|
236
+ | `ultrawork` / `ulw` | Parallel + auto-continue + Ralph Loop |
237
+ | `ralph` | **Ralph Loop**: Iterate until 100% complete (no scope reduction) |
238
+ | `ralplan` | Iterative planning + persistence |
239
+ | `verify` | Strict verification mode |
240
+ | `quick` | Fast mode, minimal verification |
241
+
242
+ **Combinations supported:** `ralph ultrawork`, `ralph verify`, etc.
243
+
244
+ **Ralph Loop** (from [ghuntley.com/ralph](https://ghuntley.com/ralph)):
245
+
246
+ - Compares ORIGINAL request vs current implementation
247
+ - Lists ALL missing items explicitly
248
+ - Iterates until 100% complete (max 5 iterations)
249
+ - **ZERO tolerance for scope reduction** - Never say "basic version" or "simplified"
250
+
251
+ ### Skill Quality Gate
252
+
253
+ Memory saves are validated for quality:
254
+
255
+ - Rejects generic/searchable information
256
+ - Requires context, specificity, actionability
257
+ - Suggests principle format: "When X, do Y because Z"
258
+
259
+ ### HUD Status (Real-time)
260
+
261
+ ```bash
262
+ node hooks/scripts/hud-status.js show full
263
+ node hooks/scripts/hud-status.js start ultrawork "feature"
264
+ node hooks/scripts/hud-status.js phase 2 5 "Implementing core"
265
+ ```
266
+
267
+ ### Pre/Post Tool Hooks
268
+
269
+ - **PreToolUse**: Validates dangerous commands before execution
270
+ - **PostToolUse**: Provides error recovery hints
271
+
272
+ ### Orchestrate Workflow
273
+
274
+ Intent Gate → Codebase Assessment → Delegation → Verification pattern:
275
+
276
+ ```typescript
277
+ import { checkIntentGate, assessCodebase, createDelegationPlan } from '@su-record/vibe/tools';
278
+ ```
279
+
280
+ ### UltraQA (5-Cycle Autonomous QA)
281
+
282
+ ```
283
+ Test/Build/Lint → Fail → Architect Diagnosis → Executor Fix → Repeat (max 5)
284
+ ```
285
+
286
+ Exit conditions: All pass, Max cycles, Same failure 3x
287
+
288
+ ### DeepInit (Hierarchical AGENTS.md)
289
+
290
+ ```
291
+ project/
292
+ ├── AGENTS.md ← Root
293
+ ├── src/
294
+ │ └── AGENTS.md ← <!-- Parent: ../AGENTS.md -->
295
+ ```
296
+
297
+ ### Skill Frontmatter System
298
+
299
+ ```yaml
300
+ ---
301
+ name: my-skill
302
+ model: sonnet
303
+ triggers: [keyword1, keyword2]
304
+ ---
305
+ ```
306
+
307
+ ### Trigger-Based Skill Injection
308
+
309
+ Skills in `~/.claude/vibe/skills/` or `.claude/vibe/skills/` auto-inject on keyword match.
310
+
311
+ ### Multi-Line HUD
312
+
313
+ ```bash
314
+ node hooks/scripts/hud-multiline.js multi # Tree view
315
+ node hooks/scripts/hud-multiline.js compact # 2-line view
316
+ node hooks/scripts/hud-multiline.js single # 1-line view
317
+ ```
318
+
319
+ ### Parallel Code Review (/vibe.review)
320
+
321
+ 13+ specialized agents review code simultaneously:
322
+
323
+ - Security: security-reviewer, data-integrity-reviewer
324
+ - Performance: performance-reviewer, complexity-reviewer
325
+ - Architecture: architecture-reviewer, simplicity-reviewer
326
+ - Language-Specific: python, typescript, rails, react reviewers
327
+ - Context: git-history, test-coverage reviewers
328
+
329
+ **Priority System:**
330
+ - 🔴 P1 (Critical): Blocks merge
331
+ - 🟡 P2 (Important): Fix recommended
332
+ - 🔵 P3 (Nice-to-have): Backlog
333
+
334
+ ### E2E Testing (/vibe.utils --e2e)
335
+
336
+ Playwright-based automated testing:
337
+
338
+ ```bash
339
+ /vibe.utils --e2e "login flow" # Scenario test
340
+ /vibe.utils --e2e --visual # Visual regression test
341
+ /vibe.utils --e2e --record # Video recording
342
+ ```
343
+
344
+ ### Enhanced Research Agents
345
+
346
+ 4 parallel research agents run **after requirements confirmed** during `/vibe.spec`:
347
+
348
+ | Agent | Role |
349
+ |-------|------|
350
+ | best-practices-agent | Best practices for confirmed feature+stack |
351
+ | framework-docs-agent | Latest docs for confirmed stack (context7) |
352
+ | codebase-patterns-agent | Analyze existing similar patterns |
353
+ | security-advisory-agent | Security advisory for confirmed feature |
354
+
355
+ ## PTCF Structure
356
+
357
+ SPEC documents are AI-executable prompt format:
358
+
359
+ ```
360
+ <role> AI role definition
361
+ <context> Background, tech stack, related code
362
+ <task> Phase-by-phase task list
363
+ <constraints> Constraints
364
+ <output_format> Files to create/modify
365
+ <acceptance> Verification criteria
366
+ ```
367
+
368
+ ## Built-in Tools
369
+
370
+ ### Semantic Code Analysis
371
+ | Tool | Purpose |
372
+ |------|---------|
373
+ | `vibe_find_symbol` | Find symbol definitions |
374
+ | `vibe_find_references` | Find references |
375
+ | `vibe_analyze_complexity` | Analyze complexity |
376
+ | `vibe_validate_code_quality` | Validate quality |
377
+
378
+ ### Context Management
379
+ | Tool | Purpose |
380
+ |------|---------|
381
+ | `vibe_start_session` | Start session (restore previous context) |
382
+ | `vibe_auto_save_context` | Save current state |
383
+ | `vibe_save_memory` | Save important decisions |
384
+
385
+ ## Agents
386
+
387
+ ### Review Agents (12)
388
+ ```
389
+ .claude/agents/review/
390
+ ├── security-reviewer.md # Security vulnerabilities
391
+ ├── performance-reviewer.md # Performance bottlenecks
392
+ ├── architecture-reviewer.md # Architecture violations
393
+ ├── complexity-reviewer.md # Complexity exceeded
394
+ ├── simplicity-reviewer.md # Over-abstraction
395
+ ├── data-integrity-reviewer.md # Data integrity
396
+ ├── test-coverage-reviewer.md # Missing tests
397
+ ├── git-history-reviewer.md # Risk patterns
398
+ ├── python-reviewer.md # Python specialist
399
+ ├── typescript-reviewer.md # TypeScript specialist
400
+ ├── rails-reviewer.md # Rails specialist
401
+ └── react-reviewer.md # React specialist
402
+ ```
403
+
404
+ ### Research Agents (4)
405
+ ```
406
+ .claude/agents/research/
407
+ ├── best-practices-agent.md # Best practices
408
+ ├── framework-docs-agent.md # Framework docs
409
+ ├── codebase-patterns-agent.md # Code pattern analysis
410
+ └── security-advisory-agent.md # Security advisory
411
+ ```
412
+
413
+ ## Skills
414
+
415
+ ### Git Worktree
416
+ ```bash
417
+ # Isolated environment for PR review
418
+ git worktree add ../review-123 origin/pr/123
419
+ cd ../review-123 && npm test
420
+ git worktree remove ../review-123
421
+ ```
422
+
423
+ ### Priority Todos
424
+ ```
425
+ .claude/vibe/todos/
426
+ ├── P1-security-sql-injection.md # 🔴 Blocks merge
427
+ ├── P2-perf-n1-query.md # 🟡 Fix recommended
428
+ └── P3-style-extract-helper.md # 🔵 Backlog
429
+ ```
430
+
431
+ ## Context Management Strategy
432
+
433
+ ### Model Selection
434
+ - **Exploration/Search**: Haiku (sub-agent default)
435
+ - **Implementation/Debugging**: Sonnet
436
+ - **Architecture/Complex logic**: Opus
437
+
438
+ ### At 70%+ Context (⚠️ Important)
439
+ ```
440
+ Don't use /compact (risk of information loss/distortion)
441
+ save_memory to store important decisions → /new for new session
442
+ ```
443
+
444
+ vibe maintains context across sessions with its own memory system:
445
+ 1. `save_memory` - Explicitly save important decisions
446
+ 2. `/new` - Start new session
447
+ 3. `start_session` - Auto-restore previous session
448
+
449
+ ### Session Restore
450
+ To continue previous work in a new session:
451
+ ```
452
+ /vibe.utils --continue
453
+ ```
454
+ This command calls `vibe_start_session` to restore previous context from project memory.
455
+
456
+ ### Other Commands
457
+ - `/rewind` - Revert to previous point
458
+ - `/context` - Check current usage
459
+
460
+ ### Using context7
461
+ Use context7 plugin when you need latest library documentation:
462
+ ```
463
+ "Search React 19 use() hook with context7"
464
+ ```
465
+
466
+ ## Documentation Guidelines
467
+
468
+ ### Diagrams/Structure Representation
469
+ - Avoid ASCII boxes (┌─┐) → Alignment breaks with mixed-width characters
470
+ - Use alternatives:
471
+ - Mermaid diagrams (GitHub/Notion supported)
472
+ - Markdown tables
473
+ - Indentation + separators
474
+
475
+ ### Preferred Formats
476
+ | Purpose | Recommended |
477
+ |---------|-------------|
478
+ | Flowcharts | Mermaid flowchart |
479
+ | Structure/Hierarchy | Indented lists |
480
+ | Comparisons/Lists | Markdown tables |
481
+ | Sequences | Mermaid sequenceDiagram |
482
+
483
+ ## Git Commit Rules
484
+
485
+ **Must include:**
486
+ - `.claude/vibe/specs/`, `.claude/vibe/features/`, `.claude/vibe/todos/` (project docs)
487
+ - `.claude/vibe/config.json`, `.claude/vibe/constitution.md` (project config)
488
+ - `CLAUDE.md`
489
+
490
+ **Exclude (globally installed):**
491
+ - `~/.claude/vibe/rules/`, `~/.claude/vibe/languages/`, `~/.claude/vibe/templates/` (global)
492
+ - `~/.claude/commands/`, `~/.claude/agents/`, `~/.claude/skills/` (global)
493
+ - `.claude/settings.local.json` (personal settings)
494
+
495
+ ## Getting Started
496
+
497
+ ```bash
498
+ vibe init
499
+ /vibe.spec "login feature"
500
+ ```
501
+
502
+ ## Full Workflow
503
+
504
+ ```mermaid
505
+ flowchart TD
506
+ A["/vibe.spec"] --> B["(auto) SPEC review"]
507
+ B --> C["SPEC auto-enhancement"]
508
+ C --> D["/vibe.run ultrawork"]
509
+ D --> E["Gemini code review"]
510
+ E --> F["(auto) 13+ Agent Review"]
511
+ F --> G{"P1/P2 issues?"}
512
+ G -->|Yes| H["(auto) Auto-Fix"]
513
+ H --> I["✅ Done"]
514
+ G -->|No| I
515
+ ```
516
+
517
+ | Step | Description | Automation |
518
+ |------|-------------|------------|
519
+ | 1. `/vibe.spec` | Collect requirements + Generate SPEC | Manual start |
520
+ | 2. SPEC review | Gemini reviews SPEC + Auto-apply | ✅ Auto |
521
+ | 3. `/vibe.run` | Implementation + Gemini review | Manual start |
522
+ | 4. Agent Review | 13+ agent parallel review | ✅ Auto |
523
+ | 5. Auto-Fix | P1/P2 issue auto-fix | ✅ Auto |