@su-record/vibe 2.9.14 → 2.9.16

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 (41) hide show
  1. package/CLAUDE.md +101 -190
  2. package/README.ko.md +171 -199
  3. package/README.md +220 -248
  4. package/commands/vibe.docs.md +3 -2
  5. package/dist/cli/auth.d.ts.map +1 -1
  6. package/dist/cli/auth.js +3 -1
  7. package/dist/cli/auth.js.map +1 -1
  8. package/dist/cli/commands/info.d.ts.map +1 -1
  9. package/dist/cli/commands/info.js +7 -3
  10. package/dist/cli/commands/info.js.map +1 -1
  11. package/dist/cli/commands/init.d.ts +0 -10
  12. package/dist/cli/commands/init.d.ts.map +1 -1
  13. package/dist/cli/commands/init.js +6 -77
  14. package/dist/cli/commands/init.js.map +1 -1
  15. package/dist/cli/commands/update.d.ts.map +1 -1
  16. package/dist/cli/commands/update.js +6 -15
  17. package/dist/cli/commands/update.js.map +1 -1
  18. package/dist/cli/postinstall/index.d.ts +0 -4
  19. package/dist/cli/postinstall/index.d.ts.map +1 -1
  20. package/dist/cli/postinstall/index.js +0 -4
  21. package/dist/cli/postinstall/index.js.map +1 -1
  22. package/dist/cli/postinstall/main.d.ts.map +1 -1
  23. package/dist/cli/postinstall/main.js +2 -32
  24. package/dist/cli/postinstall/main.js.map +1 -1
  25. package/dist/cli/postinstall.d.ts +1 -1
  26. package/dist/cli/postinstall.d.ts.map +1 -1
  27. package/dist/cli/postinstall.js +1 -1
  28. package/dist/cli/postinstall.js.map +1 -1
  29. package/dist/cli/setup/ProjectSetup.d.ts +1 -16
  30. package/dist/cli/setup/ProjectSetup.d.ts.map +1 -1
  31. package/dist/cli/setup/ProjectSetup.js +8 -161
  32. package/dist/cli/setup/ProjectSetup.js.map +1 -1
  33. package/dist/cli/setup.d.ts +1 -1
  34. package/dist/cli/setup.d.ts.map +1 -1
  35. package/dist/cli/setup.js +1 -1
  36. package/dist/cli/setup.js.map +1 -1
  37. package/dist/cli/utils/cli-detector.d.ts +1 -1
  38. package/dist/cli/utils/cli-detector.js +1 -1
  39. package/package.json +1 -1
  40. package/skills/vibe-docs/SKILL.md +232 -171
  41. package/skills/vibe-docs/templates/behavioral-principles.md +47 -0
package/CLAUDE.md CHANGED
@@ -1,190 +1,101 @@
1
- # VIBE
2
-
3
- ## Project Nature
4
-
5
- > **This is the source code for `@su-record/vibe` npm package.**
6
- > Modify files in THIS repository only never the installed copy (`~/.claude/`, `~/.vibe/`).
7
-
8
- ## Philosophy
9
-
10
- > **vibe = Easy vibe coding + Minimum quality guaranteed**
11
-
12
- - **Easy Vibe Coding** — Fast flow, think collaboratively with AI
13
- - **Minimum Quality Guaranteed** — Type safety, code quality, security — automatic baseline
14
- - **Iterative Reasoning** — Break down problems, ask questions, reason together (don't delegate)
15
-
16
- ## Constraints (Hard Rules)
17
-
18
- ### Code Behavior
19
-
20
- - **Modify only requested scope** — Don't touch unrelated code
21
- - **Preserve existing style** — Follow project conventions
22
- - **Edit existing files, never create new ones** — Fix problems at source
23
- - **Respect user interrupts** — Ctrl+C/Escape = previous task CANCELLED
24
-
25
- ### Complexity Limits
26
-
27
- | Metric | Limit |
28
- |--------|-------|
29
- | Function length | ≤50 lines |
30
- | Nesting depth | ≤3 levels |
31
- | Parameters | ≤5 |
32
- | Cyclomatic complexity | ≤10 |
33
-
34
- ### TypeScript (Enforced by Quality Gate hooks)
35
-
36
- - No `any` — use `unknown` + type guards
37
- - No `as any` define proper interfaces
38
- - No `@ts-ignore` — fix type issues at root
39
- - Explicit return types on all functions
40
-
41
- ### Convergence Principle (Quality-First, No Round Cap)
42
-
43
- - **Loop until quality = 100** — no hard round cap on review/auto-fix loops
44
- - **P1 = 0 AND no new findings**done (the natural termination signal)
45
- - **Narrowing scope per round (noise reduction)** Round 1: full scope, Round 2: P1+P2, Round 3+: P1 only keeps looping until P1=0
46
- - **Stuck detection → ask the user** — Same findings (or same score) as previous round means auto-fixer hit a wall. Prompt the user to fill in values, explicitly approve sub-100, or abort. Never silently proceed with sub-100 quality.
47
- - **ultrawork exception** — In `ultrawork` mode, skip the user prompt and record remaining gaps as TODO to keep the loop non-interactive.
48
- - **Changed files only** — Never scan the entire project
49
-
50
- ### Forbidden Patterns
51
-
52
- - No `console.log` in commits
53
- - No hardcoded strings/numbers (use constants)
54
- - No commented-out code
55
- - No incomplete code without TODO
56
-
57
- ## Architecture (What's NOT Obvious)
58
-
59
- ### Module System
60
-
61
- - ESM only (`"type": "module"`) — imports need `.js` extension
62
- - TypeScript strict mode → `dist/` via `tsc`
63
- - Build before test: `npm run build && npx vitest run`
64
-
65
- ### Config Locations (Don't Confuse)
66
-
67
- | Path | Purpose |
68
- |------|---------|
69
- | `~/.vibe/config.json` | Global credentials, channels, models (0o600) |
70
- | `.claude/vibe/config.json` | Project stacks, capabilities, details |
71
- | `.claude/settings.local.json` | Project hooks (auto-generated, don't commit) |
72
-
73
- ### Installation Flow
74
-
75
- - `postinstall` global assets (`~/.claude/agents/`, `~/.claude/skills/`, `~/.claude/commands/`)
76
- - `vibe init` → project setup (detect stacks → config → constitution → rules → hooks → local skills + languages)
77
- - `vibe update` → re-detect stacks, refresh project config (preserves user capabilities)
78
-
79
- ### Key Directories (Where to Find Things)
80
-
81
- | What | Where |
82
- |------|-------|
83
- | CLI commands | `src/cli/commands/` |
84
- | Postinstall modules | `src/cli/postinstall/` |
85
- | Stack detection | `src/cli/detect.ts` |
86
- | Auth (all LLMs) | `src/cli/auth.ts` |
87
- | Setup helpers | `src/cli/setup.ts`, `src/cli/setup/` |
88
- | Hooks scripts | `hooks/scripts/` |
89
- | Agent definitions | `agents/` |
90
- | Team definitions | `agents/teams/` |
91
- | Skill definitions | `skills/` |
92
- | Language rules | `languages/` |
93
- | SPEC/rule templates | `vibe/rules/`, `vibe/templates/` |
94
- | Infra (daemon, memory, policy) | `src/infra/` |
95
- | Telemetry (local JSONL) | `src/infra/lib/telemetry/` |
96
- | Test helpers (shared) | `src/test-helpers/` |
97
- | Skill catalog generator | `scripts/gen-skill-docs.ts` |
98
-
99
- ### Gotchas
100
-
101
- - `better-sqlite3` WAL mode — DB module uses synchronous API
102
- - `crypto.timingSafeEqual` requires same-length buffers — check length first
103
- - `GLOBAL_SKILLS_CORE`, `GLOBAL_SKILLS_STANDARD`, `GLOBAL_SKILLS_OPTIONAL`, `STACK_TO_SKILLS`, `CAPABILITY_SKILLS` in `src/cli/postinstall/constants.ts` — single source of truth for stack→asset mapping
104
- - Hook dispatch chain: `prompt-dispatcher.js` → `keyword-detector.js` → `llm-orchestrate.js` (order matters)
105
- - Pre-existing test failures in `prdParser.test.ts` (7) and `traceabilityMatrix.test.ts` (1) — unrelated to current work
106
-
107
- ## Workflow
108
-
109
- ```text
110
- /vibe.spec → vibe.interview (skill) → vibe.plan (skill) → vibe.spec (skill) → vibe.spec.review (skill) → ┬→ /vibe.run → /vibe.verify → /vibe.trace → Done
111
- │ (Logic Track)
112
- └→ /vibe.figma → FE UI 코드
113
- (UI Track — type ∈ {website,webapp,mobile}만)
114
- ```
115
-
116
- **단일 진입점**: `/vibe.spec`은 "무엇을 개발할지" 질문으로 시작해서 전체 흐름을 오케스트레이션한다. 사용자는 `/vibe.*` 커맨드 이름을 외울 필요 없음. **Smart Resume**: 기존 interview/plan/spec 파일 존재 여부로 어느 단계부터 시작할지 자동 판단.
117
-
118
- **커맨드 `/vibe.spec` vs 스킬 `vibe.spec`**: 커맨드는 **전체 워크플로 오케스트레이터**, 스킬은 그 안의 **SPEC 작성 단계**. `/vibe.figma` 커맨드와 `vibe.figma` 스킬 관계와 동일한 패턴.
119
-
120
- **스킬 기반 workflow**:
121
- - `vibe.interview` — 반복 인터뷰로 요구사항 수집 (사용자 "그만"까지). 타입별 체크리스트(`skills/vibe.interview/checklists/{type}.md`).
122
- - `vibe.plan` — interview → 마크다운 기획서 정제 (`.claude/vibe/plans/{feature}.md`).
123
- - `vibe.spec` — 기획서 → PTCF SPEC + Feature(BDD) 파일.
124
- - `vibe.spec.review` — GPT/Gemini Race Review + 품질 게이트.
125
- - 모두 자연어 트리거(만들자/개발하자/신규/아이디어)로도 자동 활성화.
126
-
127
- **UI/Logic 분기**: 기획서의 `type` 필드로 자동 판단. UI 포함 프로젝트(website/webapp/mobile)는 Logic + UI 트랙 병렬, 비-UI(api/library)는 Logic만.
128
-
129
- | Task Size | Approach |
130
- |-----------|----------|
131
- | 1-2 files | Plan Mode |
132
- | 3+ files | `/vibe.spec` (전체 워크플로 오케스트레이션) |
133
-
134
- ## Magic Keywords
135
-
136
- | Keyword | Effect |
137
- |---------|--------|
138
- | `ultrawork` / `ulw` | Parallel agents + auto-continue + Ralph Loop |
139
- | `ralph` | Iterate until 100% complete (no scope reduction) |
140
- | `ralplan` | Iterative planning + persistence |
141
- | `verify` | Strict verification mode |
142
- | `quick` | Fast mode, minimal verification |
143
-
144
- ## Skill Tier System
145
-
146
- Skills are classified into 3 tiers to prevent context overload (Curse of Instructions):
147
-
148
- | Tier | Loading | Purpose | Count |
149
- |------|---------|---------|-------|
150
- | **core** | Always active | Bug/mistake prevention + workflow entry (interview/plan) | ~11 |
151
- | **standard** | Project setup selects | Workflow support by stack/capability | ~21 |
152
- | **optional** | Explicit `/skill` only | Reference/wrapper — not auto-loaded | ~4 |
153
-
154
- **Constants**: `GLOBAL_SKILLS_CORE` + `GLOBAL_SKILLS_STANDARD` in `src/cli/postinstall/constants.ts`
155
-
156
- ## Proactive Skill Suggestions
157
-
158
- When the user's context matches a pattern below, suggest the relevant skill **once** per session. If the user says "stop suggesting", disable for the rest of the session.
159
-
160
- | User Context | Suggested Skill | Tier | Signal |
161
- |-------------|-----------------|------|--------|
162
- | New project/feature idea, no plan yet | `/vibe.spec` | command | "만들자", "개발하자", "신규", "아이디어", "무엇을 만들", "let's build", "new feature" |
163
- | Interview 완료, 기획서 필요 | `/vibe.spec` | command | `.claude/vibe/interviews/*.md` 존재, 기획서 없음 (Smart Resume으로 Phase 2부터) |
164
- | 전체 워크플로 진입 | `/vibe.spec` | command | "어디서부터 시작", "전체 워크플로", 커맨드 이름 모를 때 |
165
- | 기획서 → 코드 명세 | `/vibe.spec` | command | `.claude/vibe/plans/*.md` 존재, SPEC 없음 (Smart Resume으로 Phase 3부터) |
166
- | SPEC exists, ready to implement | `/vibe.run` | core | SPEC file present, no implementation started |
167
- | Implementation done, verifying | `/vibe.trace` | core | Code changes match SPEC phases |
168
- | Technical debt accumulating | `/techdebt` | core | Multiple `any` types, console.log, unused imports |
169
- | Multi-file refactoring planned | `/exec-plan` | core | 3+ files to change, complex dependencies |
170
- | Complex feature, unknown tech | `/parallel-research` | standard | "how should we", "which library", architecture questions |
171
- | Debugging errors repeatedly | `/vibe.trace` | core | 3+ error cycles without resolution |
172
- | Session ending, work incomplete | `/handoff` | standard | 70%+ context, incomplete tasks |
173
- | Building new UI/UX | `/design-teach` | standard | "new page", "landing", "dashboard", Figma URL |
174
- | UI code review | `/design-audit` | standard | After implementing UI components |
175
- | New project setup / CLAUDE.md | `/claude-md-guide` | standard | "new project", "write CLAUDE.md" |
176
- | Before shipping UI | `/design-polish` | standard | "ready to deploy", "final check" |
177
- | External API/SDK code needed | `/chub-usage` | optional | "Stripe 연동", "OpenAI API", SDK/API code request |
178
-
179
- ## Context Management
180
-
181
- - **Exploration/Search**: Haiku | **Implementation**: Sonnet | **Architecture**: Opus
182
- - At 70%+ context: `save_memory` → `/new` → `/vibe.utils --continue`
183
-
184
- ## Git Commit Rules
185
-
186
- **Must include:** `.claude/vibe/plans/`, `.claude/vibe/specs/`, `.claude/vibe/features/`, `.claude/vibe/todos/`, `.claude/vibe/config.json`, `CLAUDE.md`
187
-
188
- **Exclude:** `~/.claude/vibe/rules/`, `~/.claude/commands/`, `~/.claude/agents/`, `~/.claude/skills/`, `.claude/settings.local.json`
189
-
190
- <!-- VIBE:END -->
1
+ # VIBE
2
+
3
+ > Source code for `@su-record/vibe` npm package. Modify files in THIS repository only — never the installed copies (`~/.claude/`, `~/.codex/`, `~/.gemini/`, `~/.coco/`, `~/.vibe/`).
4
+ >
5
+ > **File-to-CLI mapping:**
6
+ > - `CLAUDE.md` **Claude Code** (100% supported) · **content SSOT**
7
+ > - `AGENTS.md` — **coco** (100% supported, primary) · Codex CLI (best-effort)
8
+ > - `GEMINI.md` — Gemini CLI (best-effort)
9
+ >
10
+ > `AGENTS.md` and `GEMINI.md` are regenerated from this file via `/vibe.docs agent`. Edit here first.
11
+
12
+ ## Hard Rules
13
+
14
+ ### Behavior
15
+ - **Modify only requested scope** — Every changed line traces to the user's request
16
+ - **Edit existing files over creating new** — Fix at source
17
+ - **Preserve existing style** — Match conventions even if you'd do it differently
18
+ - **Respect Ctrl+C / Escape** — Previous task CANCELLED
19
+ - **State assumptions, ask when uncertain** — Don't pick silently when ambiguity exists; push back if a simpler approach exists
20
+
21
+ ### Goal-Driven Execution
22
+ Transform imperative tasks into verifiable goals **before** coding:
23
+
24
+ | Instead of | Transform to |
25
+ |---|---|
26
+ | "Add validation" | "Tests for invalid inputs pass" |
27
+ | "Fix the bug" | "A test reproducing it passes" |
28
+ | "Refactor X" | "Tests pass before and after" |
29
+
30
+ Weak criteria ("make it work") require constant clarification. Strong criteria let the loop run independently.
31
+
32
+ ### TypeScript (enforced by Quality Gate hooks)
33
+ - No `any` / `as any` / `@ts-ignore` — use `unknown` + type guards; fix at root
34
+ - Explicit return types on all functions
35
+
36
+ ### Complexity Limits
37
+ Function ≤50 lines · Nesting ≤3 · Params ≤5 · Cyclomatic ≤10
38
+
39
+ ### Forbidden Patterns
40
+ No `console.log` in commits · No hardcoded strings/numbers · No commented-out code · No incomplete code without TODO
41
+
42
+ ### Convergence (review / auto-fix loops)
43
+ - **Loop until P1 = 0 AND no new findings** — no round cap
44
+ - **Narrowing scope**: Round 1 full Round 2 P1+P2 Round 3+ P1 only
45
+ - **Stuck detection** (same findings/score 2 rounds in a row) ask user (fill values / approve sub-100 / abort). Never silently proceed sub-100
46
+ - **`ultrawork` exception** — skip user prompt; record gaps as TODO to stay non-interactive
47
+ - **Changed files only** — never full-project scan
48
+
49
+ ## Architecture (Non-Obvious)
50
+
51
+ ### Module System
52
+ - ESM only (`"type": "module"`) imports need `.js` extension
53
+ - Build before test: `npm run build && npx vitest run`
54
+
55
+ ### Config Locations
56
+ | Path | Purpose |
57
+ |---|---|
58
+ | `~/.vibe/config.json` | Global credentials, models (0o600) |
59
+ | `.claude/vibe/config.json` | Project stacks, capabilities |
60
+ | `.claude/settings.local.json` | Project hooks (auto-generated, don't commit) |
61
+
62
+ ### Gotchas
63
+ - `better-sqlite3` WAL mode synchronous API
64
+ - `crypto.timingSafeEqual` requires same-length buffers — check length first
65
+ - **Stack asset SSOT**: `GLOBAL_SKILLS_*`, `STACK_TO_SKILLS`, `CAPABILITY_SKILLS` in `src/cli/postinstall/constants.ts`
66
+ - **Hook dispatch order**: `prompt-dispatcher.js` → `keyword-detector.js` → `llm-orchestrate.js`
67
+
68
+ ## Workflow
69
+
70
+ `/vibe.spec` is the single entry point — orchestrates interview → plan → spec → review → `/vibe.run` → `/vibe.verify` → `/vibe.trace`. For UI types (website/webapp/mobile), `/vibe.figma` branches in parallel. Smart Resume detects existing `.claude/vibe/{interviews,plans,specs}/*.md` to skip phases.
71
+
72
+ | Task Size | Approach |
73
+ |---|---|
74
+ | 1–2 files | Plan Mode |
75
+ | 3+ files | `/vibe.spec` |
76
+
77
+ ## Magic Keywords
78
+
79
+ | Keyword | Effect |
80
+ |---|---|
81
+ | `ultrawork` / `ulw` | Parallel agents + auto-continue + Ralph Loop |
82
+ | `ralph` | Iterate to 100% (no scope reduction) |
83
+ | `ralplan` | Iterative planning + persistence |
84
+ | `verify` | Strict verification mode |
85
+ | `quick` | Fast mode, minimal verification |
86
+
87
+ ## Skill Tiers
88
+
89
+ 3 tiers prevent context overload: **core** (always active) / **standard** (project-setup selected) / **optional** (explicit `/skill` only). SSOT: `GLOBAL_SKILLS_CORE` + `GLOBAL_SKILLS_STANDARD` in `src/cli/postinstall/constants.ts`. Proactive triggers live in each skill's frontmatter.
90
+
91
+ ## Context Management
92
+
93
+ - Exploration Haiku · Implementation → Sonnet · Architecture → Opus
94
+ - At 70%+ context: `save_memory` `/new` → `/vibe.utils --continue`
95
+
96
+ ## Git
97
+
98
+ **Include**: `.claude/vibe/{plans,specs,features,todos}/`, `.claude/vibe/config.json`, `CLAUDE.md`
99
+ **Exclude**: `~/.claude/{rules,commands,agents,skills}/`, `.claude/settings.local.json`
100
+
101
+ <!-- VIBE:END -->