@su-record/vibe 2.12.4 → 2.13.0

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 (160) hide show
  1. package/CLAUDE.md +10 -3
  2. package/README.en.md +11 -11
  3. package/README.md +7 -7
  4. package/dist/cli/commands/init.d.ts +8 -0
  5. package/dist/cli/commands/init.d.ts.map +1 -1
  6. package/dist/cli/commands/init.js +24 -1
  7. package/dist/cli/commands/init.js.map +1 -1
  8. package/dist/cli/postinstall/claude-agents.d.ts +11 -1
  9. package/dist/cli/postinstall/claude-agents.d.ts.map +1 -1
  10. package/dist/cli/postinstall/claude-agents.js +22 -2
  11. package/dist/cli/postinstall/claude-agents.js.map +1 -1
  12. package/dist/cli/postinstall/constants.d.ts +18 -0
  13. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  14. package/dist/cli/postinstall/constants.js +50 -0
  15. package/dist/cli/postinstall/constants.js.map +1 -1
  16. package/dist/cli/postinstall/fs-utils.d.ts +23 -0
  17. package/dist/cli/postinstall/fs-utils.d.ts.map +1 -1
  18. package/dist/cli/postinstall/fs-utils.js +71 -0
  19. package/dist/cli/postinstall/fs-utils.js.map +1 -1
  20. package/dist/cli/postinstall/fs-utils.test.js +69 -1
  21. package/dist/cli/postinstall/fs-utils.test.js.map +1 -1
  22. package/dist/cli/postinstall/index.d.ts +1 -1
  23. package/dist/cli/postinstall/index.d.ts.map +1 -1
  24. package/dist/cli/postinstall/index.js +1 -1
  25. package/dist/cli/postinstall/index.js.map +1 -1
  26. package/dist/cli/postinstall/main.d.ts.map +1 -1
  27. package/dist/cli/postinstall/main.js +15 -4
  28. package/dist/cli/postinstall/main.js.map +1 -1
  29. package/dist/cli/postinstall.d.ts +1 -1
  30. package/dist/cli/postinstall.d.ts.map +1 -1
  31. package/dist/cli/postinstall.js +1 -1
  32. package/dist/cli/postinstall.js.map +1 -1
  33. package/dist/cli/setup/CodexHooks.test.js +27 -0
  34. package/dist/cli/setup/CodexHooks.test.js.map +1 -1
  35. package/dist/cli/setup/ProjectSetup.js +2 -2
  36. package/dist/cli/setup/ProjectSetup.js.map +1 -1
  37. package/dist/infra/lib/ContextCompressor.d.ts +11 -2
  38. package/dist/infra/lib/ContextCompressor.d.ts.map +1 -1
  39. package/dist/infra/lib/ContextCompressor.js +26 -41
  40. package/dist/infra/lib/ContextCompressor.js.map +1 -1
  41. package/dist/infra/lib/ContextCompressor.test.d.ts +2 -0
  42. package/dist/infra/lib/ContextCompressor.test.d.ts.map +1 -0
  43. package/dist/infra/lib/ContextCompressor.test.js +25 -0
  44. package/dist/infra/lib/ContextCompressor.test.js.map +1 -0
  45. package/dist/infra/lib/DecisionTracer.d.ts +4 -0
  46. package/dist/infra/lib/DecisionTracer.d.ts.map +1 -1
  47. package/dist/infra/lib/DecisionTracer.js +4 -0
  48. package/dist/infra/lib/DecisionTracer.js.map +1 -1
  49. package/dist/infra/lib/LoopBreaker.d.ts +4 -0
  50. package/dist/infra/lib/LoopBreaker.d.ts.map +1 -1
  51. package/dist/infra/lib/LoopBreaker.js +4 -0
  52. package/dist/infra/lib/LoopBreaker.js.map +1 -1
  53. package/dist/infra/lib/ReviewRace.d.ts +4 -0
  54. package/dist/infra/lib/ReviewRace.d.ts.map +1 -1
  55. package/dist/infra/lib/ReviewRace.js +4 -0
  56. package/dist/infra/lib/ReviewRace.js.map +1 -1
  57. package/dist/infra/lib/SkillQualityGate.d.ts +4 -0
  58. package/dist/infra/lib/SkillQualityGate.d.ts.map +1 -1
  59. package/dist/infra/lib/SkillQualityGate.js +4 -0
  60. package/dist/infra/lib/SkillQualityGate.js.map +1 -1
  61. package/dist/infra/lib/UltraQA.d.ts +4 -0
  62. package/dist/infra/lib/UltraQA.d.ts.map +1 -1
  63. package/dist/infra/lib/UltraQA.js +4 -0
  64. package/dist/infra/lib/UltraQA.js.map +1 -1
  65. package/dist/infra/lib/VerificationLoop.d.ts +4 -0
  66. package/dist/infra/lib/VerificationLoop.d.ts.map +1 -1
  67. package/dist/infra/lib/VerificationLoop.js +4 -0
  68. package/dist/infra/lib/VerificationLoop.js.map +1 -1
  69. package/dist/infra/lib/embedding/VectorStore.d.ts +9 -2
  70. package/dist/infra/lib/embedding/VectorStore.d.ts.map +1 -1
  71. package/dist/infra/lib/embedding/VectorStore.js +42 -19
  72. package/dist/infra/lib/embedding/VectorStore.js.map +1 -1
  73. package/dist/infra/lib/memory/MemoryStorage.d.ts +12 -0
  74. package/dist/infra/lib/memory/MemoryStorage.d.ts.map +1 -1
  75. package/dist/infra/lib/memory/MemoryStorage.js +57 -0
  76. package/dist/infra/lib/memory/MemoryStorage.js.map +1 -1
  77. package/dist/infra/lib/memory/ReflectionStore.d.ts.map +1 -1
  78. package/dist/infra/lib/memory/ReflectionStore.js +8 -27
  79. package/dist/infra/lib/memory/ReflectionStore.js.map +1 -1
  80. package/dist/infra/orchestrator/LLMCluster.d.ts +4 -0
  81. package/dist/infra/orchestrator/LLMCluster.d.ts.map +1 -1
  82. package/dist/infra/orchestrator/LLMCluster.js +35 -8
  83. package/dist/infra/orchestrator/LLMCluster.js.map +1 -1
  84. package/dist/infra/orchestrator/index.d.ts.map +1 -1
  85. package/dist/infra/orchestrator/index.js +1 -3
  86. package/dist/infra/orchestrator/index.js.map +1 -1
  87. package/dist/infra/orchestrator/parallelResearch.d.ts.map +1 -1
  88. package/dist/infra/orchestrator/parallelResearch.js +1 -4
  89. package/dist/infra/orchestrator/parallelResearch.js.map +1 -1
  90. package/dist/tools/convention/validateCodeQuality.d.ts.map +1 -1
  91. package/dist/tools/convention/validateCodeQuality.js +5 -4
  92. package/dist/tools/convention/validateCodeQuality.js.map +1 -1
  93. package/dist/tools/spec/traceabilityMatrix.d.ts +2 -0
  94. package/dist/tools/spec/traceabilityMatrix.d.ts.map +1 -1
  95. package/dist/tools/spec/traceabilityMatrix.js +50 -1
  96. package/dist/tools/spec/traceabilityMatrix.js.map +1 -1
  97. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.d.ts +10 -0
  98. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.d.ts.map +1 -0
  99. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.js +89 -0
  100. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.js.map +1 -0
  101. package/dist/tools/spec/traceabilityMatrix.test.js +19 -0
  102. package/dist/tools/spec/traceabilityMatrix.test.js.map +1 -1
  103. package/hooks/hooks.json +3 -9
  104. package/hooks/scripts/__tests__/.vibe/command-log.txt +39 -0
  105. package/hooks/scripts/__tests__/.vibe/memories/memories.db +0 -0
  106. package/hooks/scripts/__tests__/.vibe/memories/memories.db-shm +0 -0
  107. package/hooks/scripts/__tests__/.vibe/memories/memories.db-wal +0 -0
  108. package/hooks/scripts/__tests__/auto-test-debounce.test.js +145 -0
  109. package/hooks/scripts/__tests__/code-check-detectors.test.js +155 -0
  110. package/hooks/scripts/__tests__/dispatcher-inprocess.test.js +99 -0
  111. package/hooks/scripts/__tests__/post-edit-dispatcher.test.js +139 -0
  112. package/hooks/scripts/__tests__/pre-tool-guard.test.js +115 -1
  113. package/hooks/scripts/__tests__/run-ledger-verify-required.test.js +146 -0
  114. package/hooks/scripts/__tests__/run-ledger.test.js +330 -0
  115. package/hooks/scripts/__tests__/scope-from-spec.test.js +215 -0
  116. package/hooks/scripts/__tests__/sentinel-guard.test.js +79 -24
  117. package/hooks/scripts/__tests__/step-counter.test.js +95 -15
  118. package/hooks/scripts/__tests__/utils-npm-root.test.js +98 -0
  119. package/hooks/scripts/auto-commit.js +30 -11
  120. package/hooks/scripts/auto-format.js +96 -26
  121. package/hooks/scripts/auto-test.js +187 -37
  122. package/hooks/scripts/code-check.js +292 -99
  123. package/hooks/scripts/codex-hook-adapter.js +12 -1
  124. package/hooks/scripts/command-log.js +26 -16
  125. package/hooks/scripts/lib/dispatcher.js +38 -0
  126. package/hooks/scripts/lib/hook-context.js +101 -0
  127. package/hooks/scripts/lib/pr-gate-runner.js +62 -0
  128. package/hooks/scripts/lib/run-ledger.js +169 -0
  129. package/hooks/scripts/lib/scope-from-spec.js +40 -7
  130. package/hooks/scripts/post-edit-dispatcher.js +93 -20
  131. package/hooks/scripts/post-edit.js +40 -19
  132. package/hooks/scripts/pr-test-gate.js +8 -37
  133. package/hooks/scripts/pre-tool-dispatcher.js +18 -16
  134. package/hooks/scripts/pre-tool-guard.js +55 -52
  135. package/hooks/scripts/prompt-dispatcher.js +10 -0
  136. package/hooks/scripts/scope-guard.js +40 -39
  137. package/hooks/scripts/sentinel-guard.js +41 -41
  138. package/hooks/scripts/session-start.js +41 -16
  139. package/hooks/scripts/step-counter.js +100 -7
  140. package/hooks/scripts/stop-dispatcher.js +26 -0
  141. package/hooks/scripts/utils.js +96 -30
  142. package/hooks/scripts/verify-ledger.js +22 -0
  143. package/package.json +2 -2
  144. package/skills/arch-guard/SKILL.md +2 -2
  145. package/skills/characterization-test/SKILL.md +2 -2
  146. package/skills/exec-plan/SKILL.md +2 -2
  147. package/skills/spec/SKILL.md +6 -312
  148. package/skills/spec/references/askuser-examples.md +57 -0
  149. package/skills/spec/references/example-session.md +87 -0
  150. package/skills/spec/references/templates.md +194 -0
  151. package/skills/vibe.run/SKILL.md +145 -1682
  152. package/skills/vibe.run/references/brand-assets.md +59 -0
  153. package/skills/vibe.run/references/parallel-agents.md +326 -0
  154. package/skills/vibe.run/references/race-review.md +272 -0
  155. package/skills/vibe.run/references/ralph-loop.md +172 -0
  156. package/skills/vibe.run/references/ultrawork-mode.md +148 -0
  157. package/skills/vibe.trace/SKILL.md +25 -38
  158. package/skills/vibe.verify/SKILL.md +15 -0
  159. package/vibe/templates/claudemd-template.md +1 -1
  160. package/hooks/scripts/figma-guard.js +0 -219
@@ -278,22 +278,7 @@ After initial conversation, use the structured `askUser` tool for:
278
278
  | **Critical** (auth, security, session) | `askUser` tool |
279
279
  | Optional (performance, integration) | Natural conversation |
280
280
 
281
- **Usage:**
282
-
283
- ```typescript
284
- import { askUser, askUserQuick } from '@su-record/vibe/tools';
285
-
286
- // Quick helper for common scenarios
287
- const result = await askUserQuick.login('my-login-feature');
288
- console.log(result.content[0].text);
289
-
290
- // Custom categories
291
- const result = await askUser({
292
- featureName: 'user-dashboard',
293
- categories: ['authentication', 'security', 'session', 'data_model'],
294
- context: 'Building a user dashboard with role-based access',
295
- });
296
- ```
281
+ **Usage**: read `references/askuser-examples.md` in this skill directory for `askUser`/`askUserQuick` invocation code, example output format, and `parseUserResponse` response parsing.
297
282
 
298
283
  **Available categories:**
299
284
  - `authentication`: Auth methods, MFA
@@ -303,41 +288,6 @@ const result = await askUser({
303
288
  - `performance`: Response time targets
304
289
  - `integration`: External service integration
305
290
 
306
- **Example output:**
307
-
308
- ```
309
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
310
- 📋 Requirements Confirmation
311
- Feature: login
312
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
313
-
314
- ## 🔐 Authentication
315
-
316
- ### 🔐 Q-AUTHENTICATION-001
317
-
318
- **Which authentication methods should be supported?**
319
- (Multiple selection allowed)
320
-
321
- 1. **Email/Password** ✓
322
- 2. **Google Social Login**
323
- 3. **Apple Social Login**
324
- ...
325
-
326
- **Required**
327
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
328
- Total 6 questions (Required: 4)
329
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
330
- ```
331
-
332
- **Response parsing:**
333
-
334
- ```typescript
335
- import { parseUserResponse } from '@su-record/vibe/tools';
336
-
337
- // User responds: "1, 2, 4" (selected option numbers)
338
- const response = parseUserResponse(question, "1, 2, 4");
339
- // { questionId: "Q-AUTH-001", value: ["email_password", "social_google", "passkey"], timestamp: "..." }
340
- ```
341
291
 
342
292
  **ultrawork mode:**
343
293
  - askUser is **skipped** in ultrawork mode
@@ -614,136 +564,11 @@ This makes the next `/vibe.spec` (or future `/vibe.research`) invocation on the
614
564
 
615
565
  **🚨 CRITICAL: Each SPEC phase file MUST have a matching Feature file**
616
566
 
617
- **Master SPEC (`_index.md`):**
618
-
619
- ```markdown
620
- # SPEC: {feature-name} (Master)
621
-
622
- ## Overview
623
- - Total phases: N
624
- - Dependencies: [list]
625
-
626
- ## Sub-SPECs
627
-
628
- | Order | SPEC File | Feature File | Status |
629
- |-------|-----------|--------------|--------|
630
- | 1 | phase-1-setup.md | phase-1-setup.feature | ⬜ |
631
- | 2 | phase-2-core.md | phase-2-core.feature | ⬜ |
632
-
633
- ## Shared Context
634
- - Tech Stack: [all phases]
635
- - Constraints: [all phases]
636
- ```
637
-
638
- **Master Feature (`_index.feature`):**
639
-
640
- ```markdown
641
- # Feature: {feature-name} (Master)
642
-
643
- **Master SPEC**: `.vibe/specs/{feature-name}/_index.md`
644
-
645
- ## Sub-Features
646
-
647
- | Order | Feature File | SPEC File | Status |
648
- |-------|--------------|-----------|--------|
649
- | 1 | phase-1-setup.feature | phase-1-setup.md | ⬜ |
650
- | 2 | phase-2-core.feature | phase-2-core.md | ⬜ |
651
-
652
- ## Overall User Story
653
- **As a** {user}
654
- **I want** {complete feature}
655
- **So that** {value}
656
- ```
567
+ **Master SPEC / Master Feature**: copy the `Master SPEC (_index.md)` and `Master Feature (_index.feature)` templates from `references/templates.md`.
657
568
 
658
569
  **Small scope (default):**
659
570
 
660
- Create `.vibe/specs/{feature-name}.md`:
661
-
662
- ```markdown
663
- ---
664
- status: pending
665
- currentPhase: 0
666
- totalPhases: 3
667
- createdAt: {ISO-timestamp}
668
- lastUpdated: {ISO-timestamp}
669
- ---
670
-
671
- # SPEC: {feature-name}
672
-
673
- ## Persona
674
- <role>
675
- Define AI role and expertise for implementation
676
- - Senior developer on the project
677
- - Follow existing code patterns
678
- - Write testable code
679
- </role>
680
-
681
- ## Context
682
- <context>
683
- ### Background
684
- - Why this feature is needed
685
- - Who will use it
686
-
687
- ### Tech Stack
688
- - Backend: {technology}
689
- - Frontend: {technology}
690
- - Database: {technology}
691
-
692
- ### Related Code
693
- - `src/xxx/`: Existing implementation to reference
694
- - `src/yyy/`: Files to modify
695
-
696
- ### Design Reference
697
- - {Reference app/service}
698
- </context>
699
-
700
- ## Task
701
- <task>
702
- ### Phase 1: {phase-name}
703
- 1. [ ] {specific task}
704
- - File: `path/to/file`
705
- - Verify: `command`
706
- 2. [ ] {specific task}
707
-
708
- ### Phase 2: {phase-name}
709
- 1. [ ] {specific task}
710
- 2. [ ] {specific task}
711
-
712
- ### Phase 3: Testing and Verification
713
- 1. [ ] Unit Tests
714
- 2. [ ] Integration Tests
715
- </task>
716
-
717
- ## Constraints
718
- <constraints>
719
- - Follow existing code patterns
720
- - Localize error messages
721
- - Separate configuration via environment variables
722
- - {other constraints}
723
- </constraints>
724
-
725
- ## Output Format
726
- <output_format>
727
- ### Files to Create
728
- - `path/to/new/file.ts`
729
- - `path/to/new/file.test.ts`
730
-
731
- ### Files to Modify
732
- - `path/to/existing/file.ts`
733
-
734
- ### Verification Commands
735
- - `npm test`
736
- - `npm run build`
737
- </output_format>
738
-
739
- ## Acceptance Criteria
740
- <acceptance>
741
- - [ ] {verifiable criterion 1}
742
- - [ ] {verifiable criterion 2}
743
- - [ ] All tests pass
744
- - [ ] Build succeeds
745
- </acceptance>
746
- ```
571
+ Create `.vibe/specs/{feature-name}.md` with the **Single SPEC template** in `references/templates.md` — PTCF structure (Persona / Context / Task / Constraints / Output Format / Acceptance Criteria) + status frontmatter (status/currentPhase/totalPhases/createdAt/lastUpdated).
747
572
 
748
573
  ### 5. Create Feature File (BDD) - Required
749
574
 
@@ -763,35 +588,7 @@ Create `.vibe/features/{feature-name}.feature`:
763
588
  2. Include Happy Path (normal case) + Edge Case (exception case)
764
589
  3. Follow Given-When-Then format
765
590
 
766
- ```markdown
767
- # Feature: {feature-name}
768
-
769
- **SPEC**: `.vibe/specs/{feature-name}.md`
770
-
771
- ## User Story
772
- **As a** {user}
773
- **I want** {feature}
774
- **So that** {value}
775
-
776
- ## Scenarios
777
-
778
- ### Scenario 1: {Happy Path}
779
- \`\`\`gherkin
780
- Scenario: {title}
781
- Given {precondition}
782
- When {action}
783
- Then {result}
784
- \`\`\`
785
- **Verification**: SPEC AC #1
786
-
787
- ### Scenario 2: {Edge Case}
788
- ...
789
-
790
- ## Coverage
791
- | Scenario | SPEC AC | Status |
792
- |----------|---------|--------|
793
- | 1 | AC-1 | ⬜ |
794
- ```
591
+ Use the **Single Feature template** in `references/templates.md` — User Story + gherkin Given-When-Then scenarios + Coverage table mapping each scenario to a SPEC AC.
795
592
 
796
593
  #### 5.2 Split Files (Large Scope)
797
594
 
@@ -805,29 +602,7 @@ When SPEC is split into phases, Feature files MUST also be split:
805
602
  └── ...
806
603
  ```
807
604
 
808
- **Phase Feature file structure:**
809
-
810
- ```markdown
811
- # Feature: {feature-name} - Phase {N}: {phase-name}
812
-
813
- **SPEC**: `.vibe/specs/{feature-name}/phase-{N}-{name}.md`
814
- **Master Feature**: `.vibe/features/{feature-name}/_index.feature`
815
-
816
- ## User Story (Phase Scope)
817
- **As a** {user}
818
- **I want** {phase-specific feature}
819
- **So that** {phase-specific value}
820
-
821
- ## Scenarios
822
-
823
- ### Scenario 1: {Phase Happy Path}
824
- ...
825
-
826
- ## Coverage
827
- | Scenario | SPEC AC | Status |
828
- |----------|---------|--------|
829
- | 1 | Phase {N} AC-1 | ⬜ |
830
- ```
605
+ **Phase Feature file structure**: use the **Phase Feature template** in `references/templates.md`.
831
606
 
832
607
  ### 6. Ambiguity Scan - Required
833
608
 
@@ -1066,88 +841,7 @@ Option 2 (recommended for large context):
1066
841
 
1067
842
  ## Example
1068
843
 
1069
- ```
1070
- User: /vibe.spec "brick-game"
1071
-
1072
- Claude:
1073
- You're making a brick game! What style are you thinking of?
1074
-
1075
- 1. Classic Breakout style
1076
- 2. Arkanoid (with power-up items)
1077
- 3. Custom style with special gameplay
1078
-
1079
- Feel free to describe in your own words.
1080
-
1081
- User: 1
1082
-
1083
- Claude: What platform will it run on?
1084
-
1085
- 1. Web (browser)
1086
- 2. Mobile (iOS/Android)
1087
- 3. Desktop
1088
-
1089
- User: 1
1090
-
1091
- Claude:
1092
- Here are tech stack suggestions for web game development:
1093
-
1094
- 1. **Phaser.js** (Recommended) - Game framework with built-in physics engine
1095
- 2. **Canvas + JavaScript** - Lightweight with fine control
1096
- 3. **PixiJS + Matter.js** - High-performance rendering
1097
-
1098
- User: 1
1099
-
1100
- Claude: What design style?
1101
-
1102
- 1. Retro pixel (Atari Breakout)
1103
- 2. Neon graphics (Arkanoid)
1104
- 3. Modern 3D effects
1105
-
1106
- User: 2
1107
-
1108
- [Conversation continues...]
1109
-
1110
- Claude: SPEC draft created. Running ambiguity scan.
1111
-
1112
- ## 🔍 Ambiguity Scan Results
1113
-
1114
- ### Functional Scope
1115
- - ⚠️ Game over condition not defined (ball drop vs lives system)
1116
- - ⚠️ Stage clear condition unclear
1117
-
1118
- ### Edge Cases
1119
- - ⚠️ Ball reflection angle when hitting paddle edge
1120
- - ⚠️ Multiple brick collision handling
1121
-
1122
- Please clarify the above items.
1123
-
1124
- User: 3 lives, clear when all bricks destroyed, edge reflects at 45 degrees
1125
-
1126
- Claude: Thank you. SPEC has been refined.
1127
-
1128
- 🔍 Re-check result: 0 ambiguities
1129
- 📊 Quality score: 92/100 (A)
1130
-
1131
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1132
- 🔍 SPEC REVIEW (Antigravity)
1133
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1134
-
1135
- 📤 Sending SPEC...
1136
- 📝 Antigravity feedback:
1137
- 1. [Edge] Ball speed increase logic undefined
1138
- 2. [Security] Need score manipulation prevention
1139
-
1140
- ✅ 2 improvements auto-applied
1141
- 🔍 Re-verifying... ✅ Passed
1142
-
1143
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1144
- ✅ SPEC Complete!
1145
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1146
-
1147
- 📄 .vibe/specs/brick-game.md (PTCF structure)
1148
- 📄 .vibe/features/brick-game.feature
1149
- 📊 Quality score: 100/100 ← Loop converged (no remaining gaps)
1150
- ```
844
+ Full interview → ambiguity scan → quality gate → review walkthrough: read `references/example-session.md` in this skill directory (load only when you need a concrete end-to-end example).
1151
845
 
1152
846
  ## Core Tools (Semantic Analysis & Memory)
1153
847
 
@@ -0,0 +1,57 @@
1
+ # askUser Tool — Usage Examples
2
+
3
+ > Referenced by `spec` SKILL.md Step 2.1 (Critical Requirements Confirmation).
4
+ > Read this file when invoking the `askUser` tool for the first time in a session.
5
+
6
+ ## Usage
7
+
8
+ ```typescript
9
+ import { askUser, askUserQuick } from '@su-record/vibe/tools';
10
+
11
+ // Quick helper for common scenarios
12
+ const result = await askUserQuick.login('my-login-feature');
13
+ console.log(result.content[0].text);
14
+
15
+ // Custom categories
16
+ const result = await askUser({
17
+ featureName: 'user-dashboard',
18
+ categories: ['authentication', 'security', 'session', 'data_model'],
19
+ context: 'Building a user dashboard with role-based access',
20
+ });
21
+ ```
22
+
23
+ ## Example output
24
+
25
+ ```
26
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27
+ 📋 Requirements Confirmation
28
+ Feature: login
29
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
30
+
31
+ ## 🔐 Authentication
32
+
33
+ ### 🔐 Q-AUTHENTICATION-001
34
+
35
+ **Which authentication methods should be supported?**
36
+ (Multiple selection allowed)
37
+
38
+ 1. **Email/Password** ✓
39
+ 2. **Google Social Login**
40
+ 3. **Apple Social Login**
41
+ ...
42
+
43
+ **Required**
44
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
45
+ Total 6 questions (Required: 4)
46
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
47
+ ```
48
+
49
+ ## Response parsing
50
+
51
+ ```typescript
52
+ import { parseUserResponse } from '@su-record/vibe/tools';
53
+
54
+ // User responds: "1, 2, 4" (selected option numbers)
55
+ const response = parseUserResponse(question, "1, 2, 4");
56
+ // { questionId: "Q-AUTH-001", value: ["email_password", "social_google", "passkey"], timestamp: "..." }
57
+ ```
@@ -0,0 +1,87 @@
1
+ # Example Session — /vibe.spec walkthrough
2
+
3
+ > Referenced by `spec` SKILL.md. Read only if you need a concrete end-to-end
4
+ > example of the interview → ambiguity scan → quality gate → review flow.
5
+
6
+ ```
7
+ User: /vibe.spec "brick-game"
8
+
9
+ Claude:
10
+ You're making a brick game! What style are you thinking of?
11
+
12
+ 1. Classic Breakout style
13
+ 2. Arkanoid (with power-up items)
14
+ 3. Custom style with special gameplay
15
+
16
+ Feel free to describe in your own words.
17
+
18
+ User: 1
19
+
20
+ Claude: What platform will it run on?
21
+
22
+ 1. Web (browser)
23
+ 2. Mobile (iOS/Android)
24
+ 3. Desktop
25
+
26
+ User: 1
27
+
28
+ Claude:
29
+ Here are tech stack suggestions for web game development:
30
+
31
+ 1. **Phaser.js** (Recommended) - Game framework with built-in physics engine
32
+ 2. **Canvas + JavaScript** - Lightweight with fine control
33
+ 3. **PixiJS + Matter.js** - High-performance rendering
34
+
35
+ User: 1
36
+
37
+ Claude: What design style?
38
+
39
+ 1. Retro pixel (Atari Breakout)
40
+ 2. Neon graphics (Arkanoid)
41
+ 3. Modern 3D effects
42
+
43
+ User: 2
44
+
45
+ [Conversation continues...]
46
+
47
+ Claude: SPEC draft created. Running ambiguity scan.
48
+
49
+ ## 🔍 Ambiguity Scan Results
50
+
51
+ ### Functional Scope
52
+ - ⚠️ Game over condition not defined (ball drop vs lives system)
53
+ - ⚠️ Stage clear condition unclear
54
+
55
+ ### Edge Cases
56
+ - ⚠️ Ball reflection angle when hitting paddle edge
57
+ - ⚠️ Multiple brick collision handling
58
+
59
+ Please clarify the above items.
60
+
61
+ User: 3 lives, clear when all bricks destroyed, edge reflects at 45 degrees
62
+
63
+ Claude: Thank you. SPEC has been refined.
64
+
65
+ 🔍 Re-check result: 0 ambiguities
66
+ 📊 Quality score: 92/100 (A)
67
+
68
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
69
+ 🔍 SPEC REVIEW (Antigravity)
70
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
71
+
72
+ 📤 Sending SPEC...
73
+ 📝 Antigravity feedback:
74
+ 1. [Edge] Ball speed increase logic undefined
75
+ 2. [Security] Need score manipulation prevention
76
+
77
+ ✅ 2 improvements auto-applied
78
+ 🔍 Re-verifying... ✅ Passed
79
+
80
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
81
+ ✅ SPEC Complete!
82
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
83
+
84
+ 📄 .vibe/specs/brick-game.md (PTCF structure)
85
+ 📄 .vibe/features/brick-game.feature
86
+ 📊 Quality score: 100/100 ← Loop converged (no remaining gaps)
87
+ ```
@@ -0,0 +1,194 @@
1
+ # SPEC / Feature Document Templates
2
+
3
+ > Referenced by `spec` SKILL.md Step 4 (Write SPEC Document) and Step 5 (Create Feature File).
4
+ > Read this file when you reach those steps — copy the matching template verbatim and fill the placeholders.
5
+
6
+ ## Master SPEC (`_index.md`) — Large Scope
7
+
8
+ ```markdown
9
+ # SPEC: {feature-name} (Master)
10
+
11
+ ## Overview
12
+ - Total phases: N
13
+ - Dependencies: [list]
14
+
15
+ ## Sub-SPECs
16
+
17
+ | Order | SPEC File | Feature File | Status |
18
+ |-------|-----------|--------------|--------|
19
+ | 1 | phase-1-setup.md | phase-1-setup.feature | ⬜ |
20
+ | 2 | phase-2-core.md | phase-2-core.feature | ⬜ |
21
+
22
+ ## Shared Context
23
+ - Tech Stack: [all phases]
24
+ - Constraints: [all phases]
25
+ ```
26
+
27
+ ## Master Feature (`_index.feature`) — Large Scope
28
+
29
+ ```markdown
30
+ # Feature: {feature-name} (Master)
31
+
32
+ **Master SPEC**: `.vibe/specs/{feature-name}/_index.md`
33
+
34
+ ## Sub-Features
35
+
36
+ | Order | Feature File | SPEC File | Status |
37
+ |-------|--------------|-----------|--------|
38
+ | 1 | phase-1-setup.feature | phase-1-setup.md | ⬜ |
39
+ | 2 | phase-2-core.feature | phase-2-core.md | ⬜ |
40
+
41
+ ## Overall User Story
42
+ **As a** {user}
43
+ **I want** {complete feature}
44
+ **So that** {value}
45
+ ```
46
+
47
+ ## Single SPEC (`.vibe/specs/{feature-name}.md`) — Small Scope
48
+
49
+ ```markdown
50
+ ---
51
+ status: pending
52
+ currentPhase: 0
53
+ totalPhases: 3
54
+ createdAt: {ISO-timestamp}
55
+ lastUpdated: {ISO-timestamp}
56
+ ---
57
+
58
+ # SPEC: {feature-name}
59
+
60
+ ## Persona
61
+ <role>
62
+ Define AI role and expertise for implementation
63
+ - Senior developer on the project
64
+ - Follow existing code patterns
65
+ - Write testable code
66
+ </role>
67
+
68
+ ## Context
69
+ <context>
70
+ ### Background
71
+ - Why this feature is needed
72
+ - Who will use it
73
+
74
+ ### Tech Stack
75
+ - Backend: {technology}
76
+ - Frontend: {technology}
77
+ - Database: {technology}
78
+
79
+ ### Related Code
80
+ - `src/xxx/`: Existing implementation to reference
81
+ - `src/yyy/`: Files to modify
82
+
83
+ ### Design Reference
84
+ - {Reference app/service}
85
+ </context>
86
+
87
+ ## Task
88
+ <task>
89
+ <!-- ⚠️ MANDATORY: Every functional requirement item MUST carry a REQ-ID so the RTM can extract it.
90
+ Format: REQ-{feature-name}-NNN (feature = SPEC file basename, NNN = 3-digit zero-padded number)
91
+ Example: REQ-auth-login-001
92
+ Regex the RTM uses: /\b(REQ-[a-z0-9-]+-\d{3})[:\s]/gi — use uppercase REQ-, lowercase feature segment, exactly 3 digits.
93
+ status === 'empty' means the RTM gate MUST be treated as failed/not-applicable, never as 100% pass. -->
94
+ ### Phase 1: {phase-name}
95
+ 1. [ ] REQ-{feature-name}-001: {specific task}
96
+ - File: `path/to/file`
97
+ - Verify: `command`
98
+ 2. [ ] REQ-{feature-name}-002: {specific task}
99
+
100
+ ### Phase 2: {phase-name}
101
+ 1. [ ] REQ-{feature-name}-003: {specific task}
102
+ 2. [ ] REQ-{feature-name}-004: {specific task}
103
+
104
+ ### Phase 3: Testing and Verification
105
+ 1. [ ] REQ-{feature-name}-005: Unit Tests
106
+ 2. [ ] REQ-{feature-name}-006: Integration Tests
107
+ </task>
108
+
109
+ ## Constraints
110
+ <constraints>
111
+ - Follow existing code patterns
112
+ - Localize error messages
113
+ - Separate configuration via environment variables
114
+ - {other constraints}
115
+ </constraints>
116
+
117
+ ## Output Format
118
+ <output_format>
119
+ ### Files to Create
120
+ - `path/to/new/file.ts`
121
+ - `path/to/new/file.test.ts`
122
+
123
+ ### Files to Modify
124
+ - `path/to/existing/file.ts`
125
+
126
+ ### Verification Commands
127
+ - `npm test`
128
+ - `npm run build`
129
+ </output_format>
130
+
131
+ ## Acceptance Criteria
132
+ <acceptance>
133
+ - [ ] {verifiable criterion 1}
134
+ - [ ] {verifiable criterion 2}
135
+ - [ ] All tests pass
136
+ - [ ] Build succeeds
137
+ </acceptance>
138
+ ```
139
+
140
+ ## Single Feature (`.vibe/features/{feature-name}.feature`) — Small Scope
141
+
142
+ ```markdown
143
+ # Feature: {feature-name}
144
+
145
+ **SPEC**: `.vibe/specs/{feature-name}.md`
146
+
147
+ ## User Story
148
+ **As a** {user}
149
+ **I want** {feature}
150
+ **So that** {value}
151
+
152
+ ## Scenarios
153
+
154
+ ### Scenario 1: {Happy Path}
155
+ \`\`\`gherkin
156
+ Scenario: {title}
157
+ Given {precondition}
158
+ When {action}
159
+ Then {result}
160
+ \`\`\`
161
+ **Verification**: SPEC AC #1
162
+
163
+ ### Scenario 2: {Edge Case}
164
+ ...
165
+
166
+ ## Coverage
167
+ | Scenario | SPEC AC | Status |
168
+ |----------|---------|--------|
169
+ | 1 | AC-1 | ⬜ |
170
+ ```
171
+
172
+ ## Phase Feature (`.vibe/features/{feature-name}/phase-{N}-{name}.feature`) — Large Scope
173
+
174
+ ```markdown
175
+ # Feature: {feature-name} - Phase {N}: {phase-name}
176
+
177
+ **SPEC**: `.vibe/specs/{feature-name}/phase-{N}-{name}.md`
178
+ **Master Feature**: `.vibe/features/{feature-name}/_index.feature`
179
+
180
+ ## User Story (Phase Scope)
181
+ **As a** {user}
182
+ **I want** {phase-specific feature}
183
+ **So that** {phase-specific value}
184
+
185
+ ## Scenarios
186
+
187
+ ### Scenario 1: {Phase Happy Path}
188
+ ...
189
+
190
+ ## Coverage
191
+ | Scenario | SPEC AC | Status |
192
+ |----------|---------|--------|
193
+ | 1 | Phase {N} AC-1 | ⬜ |
194
+ ```