@su-record/vibe 2.9.20 → 2.9.22

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.
@@ -0,0 +1,247 @@
1
+ ---
2
+ name: vibe-test
3
+ tier: core
4
+ description: "Self-test vibe across CC and coco. Subcommands: parity (static file/content comparison between ~/.claude and ~/.coco install dirs), report (runtime invocation of every command/skill/hook/agent/tool in the current harness), compare (diff two JSON reports). P1 drift (one-side missing) auto-registers via vibe-regress. Must use this skill when user runs /vibe.test, when verifying multi-harness compatibility before release, or when the user says 'parity', 'self-test', 'CC vs coco', 'both harnesses'."
5
+ triggers: [test, parity, self-test, "양쪽", "CC vs coco", "harness 동일"]
6
+ priority: 70
7
+ chain-next: []
8
+ ---
9
+
10
+ # vibe-test — Multi-Harness Self-Test
11
+
12
+ **Purpose**: mechanically verify vibe presents the same surface in Claude Code and coco. Catch features broken on one harness before users do.
13
+
14
+ ## Why this exists
15
+
16
+ Vibe explicitly supports two harnesses (CC, coco). When new commands are added, only one side might get updated, or `AGENTS.md` ↔ `CLAUDE.md` may drift, and there is no automated check until a user reports it. This skill closes that gap.
17
+
18
+ ## Storage Contract
19
+
20
+ ```
21
+ .claude/vibe/test-reports/ # CC side artifacts
22
+ .coco/vibe/test-reports/ # coco side artifacts (when run from coco)
23
+
24
+ <YYYYMMDD-HHmm>-cc.json # machine-comparable
25
+ <YYYYMMDD-HHmm>-cc.md # human summary
26
+ <YYYYMMDD-HHmm>-coco.json
27
+ <YYYYMMDD-HHmm>-coco.md
28
+ <YYYYMMDD-HHmm>-parity.json # output of `parity` subcommand
29
+ <YYYYMMDD-HHmm>-compare.md # output of `compare` subcommand
30
+ ```
31
+
32
+ ### Report schema (JSON)
33
+
34
+ ```json
35
+ {
36
+ "harness": "cc | coco",
37
+ "version": "2.9.21",
38
+ "timestamp": "2026-04-14T18:30:00+09:00",
39
+ "vibe-version": "from package.json",
40
+ "commands": [
41
+ { "name": "vibe.spec", "loaded": true, "first-response-ok": true, "error": null }
42
+ ],
43
+ "skills": [
44
+ { "name": "vibe-spec", "trigger-recognized": true, "context-injected": true, "error": null }
45
+ ],
46
+ "hooks": [
47
+ { "name": "pre-tool-guard", "test-suite": "passed | failed", "tests": "32/32" }
48
+ ],
49
+ "agents": [],
50
+ "tools": []
51
+ }
52
+ ```
53
+
54
+ ## Subcommand: `parity` — static comparison (stage 1, in-scope target)
55
+
56
+ No harness execution. Only file system + body inspection. Fast and deterministic.
57
+
58
+ ### Steps
59
+
60
+ 1. **Confirm both install dirs exist**:
61
+ - CC: `~/.claude/{commands,skills,agents}/`
62
+ - coco: `~/.coco/{commands,skills,agents}/` (`COCO_HOME` env takes precedence)
63
+ - If either side is missing, exit cleanly with guidance (not an error)
64
+
65
+ 2. **Install set diff**:
66
+ ```bash
67
+ find ~/.claude/commands -type f -name '*.md' -exec basename {} \; | sort > /tmp/cc-cmds
68
+ find ~/.coco/commands -type f -name '*.md' -exec basename {} \; | sort > /tmp/coco-cmds
69
+ diff /tmp/cc-cmds /tmp/coco-cmds
70
+ ```
71
+ Repeat for skills/agents. Persist diff entries to `parity.json` field `install-set-diff`.
72
+
73
+ 3. **Content sync (CLAUDE.md ↔ AGENTS.md)**:
74
+ - Read both files; strip header block (leading `> ` lines plus filename mentions)
75
+ - Normalize body: map `.claude` ↔ `.coco`, `Claude Code` ↔ `coco`, `CLAUDE.md` ↔ `AGENTS.md`
76
+ - Lines that still differ after normalization go into `content-drift`
77
+
78
+ 4. **Path reference validation**:
79
+ - Extract `~/.claude/`, `.claude/vibe/` patterns from CLAUDE.md → confirm each resolves under the actual install dir
80
+ - Extract `~/.coco/`, `.coco/vibe/` patterns from AGENTS.md → same check
81
+ - Wrong paths (e.g. AGENTS.md referencing `.codex/` after a rename) classified as `path-error`
82
+
83
+ 5. **Console output**:
84
+ ```
85
+ 📊 PARITY REPORT
86
+
87
+ Install set:
88
+ ✅ commands: 14/14 matched
89
+ ❌ skills: 1 missing in coco (vibe-test)
90
+
91
+ Content sync:
92
+ ✅ CLAUDE.md ↔ AGENTS.md normalized diff: clean
93
+
94
+ Path references:
95
+ ✅ all paths resolve to existing dirs
96
+
97
+ 📈 Parity Score: 95/100
98
+ 📁 Saved: .claude/vibe/test-reports/20260414-1830-parity.json
99
+ ```
100
+
101
+ 6. **Auto-register P1 drift**:
102
+ - On `install-set-diff` finding → call `/vibe.regress register --from-test`
103
+ - symptom: `"Parity drift: <category> missing in <harness>"`
104
+ - root-cause-tag: `integration`
105
+
106
+ ## Subcommand: `report` — runtime invocation
107
+
108
+ Inspect every shipped feature in the current harness, capture pass/fail, and emit the JSON+MD report defined above.
109
+
110
+ ### Probe philosophy
111
+
112
+ - **No external LLM calls.** The probe is structural + execution-based, not generative. Cost ≈ a few file reads plus running `vitest`.
113
+ - **Interactive commands are NOT actually invoked.** Calling `/vibe.spec` would block on the interview loop. Probe checks structural validity only and records `invocable: true` if the file is well-formed.
114
+ - **Hooks and tools have real unit tests** in the repo — run them, do not simulate.
115
+ - A probe failure never stops the run. Each entry's `error` field captures the cause; the report keeps going.
116
+
117
+ ### Steps
118
+
119
+ 1. **Resolve install dir for current harness**:
120
+ - CC: `~/.claude/`
121
+ - coco: `~/.coco/` (`COCO_HOME` overrides)
122
+ - Detect via `process.env.COCO_HOME` first, then which one is currently being read from. If both present, use the harness this skill was invoked from.
123
+
124
+ 2. **Probe `commands`** — for each `<install>/commands/*.md`:
125
+ - `loaded`: file exists and is non-empty
126
+ - `frontmatter-valid`: YAML frontmatter parses; required keys present (`description`)
127
+ - `argument-hint-present`: optional but recorded
128
+ - `body-references-skill`: body contains `Load skill ` or `## Process` (signal that the command delegates correctly)
129
+ - Result: `{ name, loaded, frontmatter-valid, body-references-skill, error }`
130
+
131
+ 3. **Probe `skills`** — for each `<install>/skills/*/SKILL.md`:
132
+ - `loaded`: file exists
133
+ - `frontmatter-valid`: YAML parses with required keys: `name`, `tier`, `description`, `triggers`
134
+ - `triggers-non-empty`: triggers array has ≥1 entry
135
+ - `description-mentions-trigger-conditions`: heuristic — description contains `Must use this skill when` or equivalent (vibe convention)
136
+ - Result: `{ name, loaded, frontmatter-valid, triggers-count, error }`
137
+
138
+ 4. **Probe `hooks`** — for each `<install>/hooks/scripts/*.js` (or repo `hooks/scripts/` if testing the source):
139
+ - If a matching `__tests__/<hook-name>.test.js` exists → run `npx vitest run hooks/scripts/__tests__/<hook>.test.js --reporter=json` and parse the result
140
+ - If no test exists → mark `test-suite: "no-tests"` (warn, not fail)
141
+ - Result: `{ name, test-suite: "passed" | "failed" | "no-tests", tests: "<passed>/<total>", error }`
142
+
143
+ 5. **Probe `agents`** — for each `<install>/agents/*.md`:
144
+ - `loaded`, `frontmatter-valid` (required: `name`, `description`, `tools`)
145
+ - `tools-list-valid`: every tool in the `tools` array matches a known harness tool (Read, Glob, Grep, Bash, Edit, Write, WebSearch, WebFetch, Task, plus the agent-specific Skill etc.)
146
+ - Result: `{ name, loaded, frontmatter-valid, tools-list-valid, error }`
147
+
148
+ 6. **Probe `tools`** — for each tool exported from `dist/tools/index.js`:
149
+ - If a matching test file exists in `src/tools/__tests__/` → run vitest and capture pass/fail
150
+ - If no test → call the tool with a minimal known-safe input (e.g. `validateCodeQuality` against a tiny fixture) and verify the response is well-shaped JSON
151
+ - Result: `{ name, test-suite | smoke-call, status, error }`
152
+
153
+ 7. **Compile JSON + Markdown reports** to `<project-vibe-dir>/test-reports/<YYYYMMDD-HHmm>-<harness>.{json,md}` per the schema above.
154
+
155
+ 8. **Print summary**:
156
+ ```
157
+ 📊 RUNTIME REPORT (cc)
158
+ commands: 14/14 loaded, 14/14 frontmatter-valid
159
+ skills: 28/28 loaded, 1 missing description-mentions-trigger-conditions
160
+ hooks: 7/7 test suites passed (118/118 tests)
161
+ agents: 42/42 loaded, 0 with invalid tools
162
+ tools: 9/9 passing
163
+ 📈 Score: 99/100
164
+ 📁 .claude/vibe/test-reports/20260414-1845-cc.json
165
+ ```
166
+
167
+ ### Failure handling
168
+
169
+ | Probe failure | Action |
170
+ |---|---|
171
+ | frontmatter parse error | record + continue |
172
+ | missing required key | record + continue |
173
+ | vitest run failure | capture stderr summary into `error` field, continue |
174
+ | tool smoke-call exception | record exception type + continue |
175
+ | install dir not found | abort with clear message — cannot probe what is not installed |
176
+
177
+ ### What this catches
178
+
179
+ - A new command added in source but missed by `postinstall` (file present in repo, absent from `~/.claude/commands/`)
180
+ - Skill with malformed frontmatter (would fail to register at runtime)
181
+ - Agent listing a tool that does not exist in the harness
182
+ - Hook unit test regression (matches existing CI guard but locally observable)
183
+ - Tool that broke between the test fixture and the shipped build
184
+
185
+ ### What this does NOT catch
186
+
187
+ - LLM behavioral drift (interactive command actually behaving differently)
188
+ - Race conditions in agent orchestration
189
+ - Real-world failures that depend on user input
190
+
191
+ These belong to higher-effort future work (functional e2e, currently not in scope).
192
+
193
+ ## Subcommand: `compare` — diff two reports
194
+
195
+ ```
196
+ /vibe.test compare <cc-report.json> <coco-report.json>
197
+ ```
198
+
199
+ ### Steps
200
+
201
+ 1. Load both JSON files. Compare timestamps; warn if delta > ±1 minute ("report timing skew detected, confidence low")
202
+ 2. Match entries per category by `name`
203
+ 3. Classify:
204
+ - **P1**: present on only one side → missing
205
+ - **P2**: present both sides but mismatched booleans (`loaded`, `first-response-ok`, `trigger-recognized`) → behavioral drift
206
+ - **P3**: only error wording differs, behavior identical → informational
207
+ 4. Persist result as `<ts>-compare.md`
208
+ 5. P1 findings auto-register via `/vibe.regress`
209
+
210
+ ## Integration Points
211
+
212
+ ### Release flow
213
+
214
+ Recommended pre-release ritual:
215
+ ```
216
+ 1. From CC: /vibe.test parity → must pass
217
+ 2. From coco: /vibe.test parity → must pass (when feasible)
218
+ 3. Both green → pnpm release
219
+ ```
220
+
221
+ ### To /vibe.regress
222
+
223
+ On P1 drift:
224
+ ```
225
+ Load skill `vibe-regress` with:
226
+ subcommand: register --from-test
227
+ symptom: "<category> drift: <name> missing in <harness>"
228
+ root-cause-tag: integration
229
+ ```
230
+
231
+ ## Done Criteria
232
+
233
+ ### Subcommand: parity
234
+ - [ ] Works without any external calls
235
+ - [ ] Missing one install dir → clean exit with guidance (not an error)
236
+ - [ ] `install-set-diff`, `content-drift`, `path-error` reported as separate categories
237
+ - [ ] P1 findings invoke `/vibe.regress` automatically
238
+ - [ ] `compare` handles timing-skew warning correctly
239
+
240
+ ### Subcommand: report
241
+ - [ ] No external LLM calls (cost = file reads + vitest runs only)
242
+ - [ ] Interactive commands probed structurally, never actually invoked
243
+ - [ ] Hook and tool tests run via real vitest, not simulated
244
+ - [ ] A probe failure on one entry never stops the run
245
+ - [ ] JSON report matches the schema in "Storage Contract"
246
+ - [ ] Markdown summary printed to console after run completes
247
+ - [ ] Install dir absent → abort with clear message (not silent)