@esthernandez/vibe-doc 0.2.1 → 0.2.3

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 (53) hide show
  1. package/.claude-plugin/plugin.json +8 -0
  2. package/commands/check.md +7 -0
  3. package/commands/generate.md +11 -0
  4. package/commands/scan.md +11 -0
  5. package/commands/status.md +7 -0
  6. package/dist/classifier/index.js +9 -0
  7. package/dist/classifier/llm-prompt.d.ts.map +1 -1
  8. package/dist/classifier/llm-prompt.js +1 -0
  9. package/dist/classifier/scoring-engine.d.ts +2 -1
  10. package/dist/classifier/scoring-engine.d.ts.map +1 -1
  11. package/dist/classifier/scoring-engine.js +16 -0
  12. package/dist/classifier/signals.d.ts.map +1 -1
  13. package/dist/classifier/signals.js +46 -7
  14. package/dist/gap-analyzer/breadcrumbs.d.ts.map +1 -1
  15. package/dist/gap-analyzer/breadcrumbs.js +77 -0
  16. package/dist/gap-analyzer/matrix.d.ts +5 -1
  17. package/dist/gap-analyzer/matrix.d.ts.map +1 -1
  18. package/dist/gap-analyzer/matrix.js +51 -0
  19. package/dist/gap-analyzer/tier-assigner.d.ts.map +1 -1
  20. package/dist/gap-analyzer/tier-assigner.js +14 -2
  21. package/dist/generator/docx-writer.d.ts.map +1 -1
  22. package/dist/generator/docx-writer.js +13 -1
  23. package/dist/generator/extractor.d.ts.map +1 -1
  24. package/dist/generator/extractor.js +91 -0
  25. package/dist/generator/markdown-writer.d.ts.map +1 -1
  26. package/dist/generator/markdown-writer.js +13 -1
  27. package/dist/scanner/file-scanner.d.ts.map +1 -1
  28. package/dist/scanner/file-scanner.js +10 -2
  29. package/dist/templates/embedded/adr.md +45 -0
  30. package/dist/templates/embedded/api-spec.md +55 -0
  31. package/dist/templates/embedded/changelog-contributing.md +67 -0
  32. package/dist/templates/embedded/data-model.md +55 -0
  33. package/dist/templates/embedded/deployment-procedure.md +63 -0
  34. package/dist/templates/embedded/install-guide.md +49 -0
  35. package/dist/templates/embedded/readme.md +55 -0
  36. package/dist/templates/embedded/runbook.md +55 -0
  37. package/dist/templates/embedded/skill-command-reference.md +77 -0
  38. package/dist/templates/embedded/test-plan.md +55 -0
  39. package/dist/templates/embedded/threat-model.md +47 -0
  40. package/dist/templates/index.d.ts +13 -0
  41. package/dist/templates/index.d.ts.map +1 -1
  42. package/dist/templates/index.js +18 -7
  43. package/dist/templates/renderer.d.ts.map +1 -1
  44. package/dist/templates/renderer.js +3 -1
  45. package/package.json +4 -1
  46. package/skills/check/SKILL.md +302 -0
  47. package/skills/generate/SKILL.md +391 -0
  48. package/skills/guide/AGENT_GUIDE.md +318 -0
  49. package/skills/guide/SKILL.md +270 -0
  50. package/skills/guide/references/breadcrumb-heuristics.md +441 -0
  51. package/skills/guide/references/classification-taxonomy.md +391 -0
  52. package/skills/guide/references/documentation-matrix.md +297 -0
  53. package/skills/scan/SKILL.md +219 -0
@@ -10,6 +10,19 @@
10
10
  export declare function loadTemplate(docType: string, cacheDir?: string): string;
11
11
  /**
12
12
  * Get path to the embedded template file
13
+ *
14
+ * __dirname at runtime is dist/templates/ (compiled from src/templates/index.ts).
15
+ * Templates are copied to dist/templates/embedded/ by scripts/copy-templates.js.
16
+ * So the templates directory relative to __dirname is just ./embedded/.
17
+ *
18
+ * The same path works in dev under tsx, where __dirname is src/templates/ and
19
+ * templates live at src/templates/embedded/.
20
+ *
21
+ * This was historically broken: the function looked for
22
+ * `__dirname/templates/embedded/` which produced `dist/templates/templates/embedded/`
23
+ * in published packages (nested "templates" directory). Combined with the
24
+ * copy-templates.js fast-glob bug (fixed in v0.2.2), template loading failed
25
+ * in every published version before v0.2.3.
13
26
  */
14
27
  export declare function getTemplatePath(docType: string): string;
15
28
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAuBvE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWvD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAYxC;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAuBvE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAgBxC;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
@@ -76,15 +76,22 @@ function loadTemplate(docType, cacheDir) {
76
76
  }
77
77
  /**
78
78
  * Get path to the embedded template file
79
+ *
80
+ * __dirname at runtime is dist/templates/ (compiled from src/templates/index.ts).
81
+ * Templates are copied to dist/templates/embedded/ by scripts/copy-templates.js.
82
+ * So the templates directory relative to __dirname is just ./embedded/.
83
+ *
84
+ * The same path works in dev under tsx, where __dirname is src/templates/ and
85
+ * templates live at src/templates/embedded/.
86
+ *
87
+ * This was historically broken: the function looked for
88
+ * `__dirname/templates/embedded/` which produced `dist/templates/templates/embedded/`
89
+ * in published packages (nested "templates" directory). Combined with the
90
+ * copy-templates.js fast-glob bug (fixed in v0.2.2), template loading failed
91
+ * in every published version before v0.2.3.
79
92
  */
80
93
  function getTemplatePath(docType) {
81
- // __dirname is the dist directory at runtime
82
- // Look for templates in both src (dev) and dist (prod) locations
83
- let templatesDir = path.join(__dirname, 'templates', 'embedded');
84
- // In development, __dirname points to src/templates, so adjust
85
- if (!fs.existsSync(templatesDir)) {
86
- templatesDir = path.join(__dirname, '..', '..', 'src', 'templates', 'embedded');
87
- }
94
+ const templatesDir = path.join(__dirname, 'embedded');
88
95
  return path.join(templatesDir, `${docType}.md`);
89
96
  }
90
97
  /**
@@ -99,6 +106,10 @@ function listTemplates() {
99
106
  'deployment-procedure',
100
107
  'test-plan',
101
108
  'data-model',
109
+ 'readme',
110
+ 'install-guide',
111
+ 'skill-command-reference',
112
+ 'changelog-contributing',
102
113
  ];
103
114
  return templates;
104
115
  }
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/templates/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAaD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAwFzE"}
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/templates/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAaD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CA0FzE"}
@@ -17,7 +17,9 @@ function renderTemplate(template, data) {
17
17
  let rendered = template;
18
18
  const confidenceLevels = [];
19
19
  // Extract all token patterns
20
- const tokenPattern = /\{\{(extracted|user)\.([a-z0-9\-]+)\}\}/g;
20
+ // Supports both kebab-case (existing convention: service-overview) and
21
+ // camelCase (new plugin-oriented templates: installSteps).
22
+ const tokenPattern = /\{\{(extracted|user)\.([a-zA-Z0-9\-]+)\}\}/g;
21
23
  const tokens = new Map();
22
24
  let match;
23
25
  while ((match = tokenPattern.exec(template)) !== null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esthernandez/vibe-doc",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "AI-powered documentation gap analyzer and generator for modern codebases. Scans your project, classifies your architecture, and generates professional docs from your existing artifacts.",
5
5
  "author": "626Labs LLC",
6
6
  "license": "MIT",
@@ -24,6 +24,9 @@
24
24
  "types": "./dist/index.d.ts",
25
25
  "files": [
26
26
  "dist",
27
+ "skills",
28
+ "commands",
29
+ ".claude-plugin",
27
30
  "README.md"
28
31
  ],
29
32
  "scripts": {
@@ -0,0 +1,302 @@
1
+ ---
2
+ name: check
3
+ description: >
4
+ This skill should be used when the user mentions "check my docs",
5
+ "am I ready to deploy", "documentation check", "CI check",
6
+ "are my docs current", "deployment readiness", or wants to verify
7
+ their project meets documentation requirements before shipping.
8
+ ---
9
+
10
+ # Vibe Doc Check Skill
11
+
12
+ Simple CI-safe validation: verify that Required documentation exists and is current.
13
+
14
+ **Shared behavior:** Read `skills/guide/SKILL.md` for state management, CLI patterns, and output formatting.
15
+
16
+ ---
17
+
18
+ ## Conversational Flow
19
+
20
+ ### 1. Run Check Command
21
+
22
+ Execute the validation:
23
+
24
+ ```bash
25
+ cd <project-path> && npx vibe-doc check .
26
+ ```
27
+
28
+ ---
29
+
30
+ ### 2. Present Results
31
+
32
+ **If check passes:**
33
+
34
+ ```
35
+ ✓ Documentation Check PASSED
36
+
37
+ Your project meets all Required documentation standards.
38
+
39
+ Status Summary:
40
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
41
+
42
+ Classification: Web Application (Regulated, Customer-Facing)
43
+
44
+ Required Docs:
45
+ ✓ Threat Model
46
+ ✓ Architecture Decision Records
47
+ ✓ Runbook
48
+ ✓ Test Plan
49
+
50
+ All 4 required documents exist and are current.
51
+ Last generated: 2026-04-05 (6 days ago)
52
+ Last significant changes: 2026-04-08 (3 commits)
53
+
54
+ Status: CURRENT (no staleness concerns)
55
+
56
+ Next steps:
57
+ • Continue development
58
+ • Regenerate docs if major changes land (e.g., new deployment target, architecture pivot)
59
+ • Or just re-run this check before each deployment
60
+ ```
61
+
62
+ ---
63
+
64
+ **If check fails:**
65
+
66
+ ```
67
+ ✗ Documentation Check FAILED
68
+
69
+ Your project is missing or has stale Required documentation.
70
+
71
+ Classification: Web Application (Regulated, Customer-Facing)
72
+
73
+ Required Docs:
74
+ ✓ Threat Model (current)
75
+ ✗ Architecture Decision Records (MISSING)
76
+ ✓ Runbook (STALE — 18 commits, last generated 2026-03-25)
77
+ ✗ Test Plan (MISSING)
78
+
79
+ Status: 1 of 4 docs current (25%)
80
+
81
+ Why stale or missing?
82
+ • Runbook: 18 commits landed since generation, including deployment config changes
83
+ • ADRs: No generation history (may never have been created)
84
+ • Test Plan: No generation history (may never have been created)
85
+
86
+ Risk: HIGH — Cannot deploy with missing Required docs
87
+
88
+ Next steps to fix:
89
+
90
+ Option 1: Quick regeneration (5-10 min)
91
+ Run the Generate skill to refresh stale docs and create missing ones.
92
+
93
+ Option 2: Manual review
94
+ If you've already created these docs manually (not via Vibe Doc):
95
+ 1. Review docs/generated/ to see what exists
96
+ 2. Run Scan skill to update your project profile
97
+ 3. Then re-run this check
98
+
99
+ Option 3: Mark as not-applicable
100
+ If a Required doc doesn't apply to your project:
101
+ 1. Update your classification in the Scan skill
102
+ 2. Re-run this check
103
+ ```
104
+
105
+ ---
106
+
107
+ ### 3. Next Steps Checkpoint
108
+
109
+ Ask user how to proceed:
110
+
111
+ ```
112
+ [regenerate] → Run the Generate skill to fix gaps
113
+ [scan] → Update project profile with Scan skill
114
+ [review] → I'll show you what's in docs/generated/
115
+ [exit] → Done with check (I'll report failure to CI)
116
+ ```
117
+
118
+ **If user picks "regenerate":**
119
+ - Transition to Generate skill with pre-selected stale/missing docs
120
+
121
+ **If user picks "scan":**
122
+ - Transition to Scan skill
123
+
124
+ **If user picks "review":**
125
+ - Show contents summary of docs/generated/ folder
126
+ - List which Required docs exist and their last-modified dates
127
+
128
+ **If user picks "exit":**
129
+ - Show exit code for CI integration
130
+ - Provide command to add to pipeline
131
+
132
+ ---
133
+
134
+ ## CI/CD Integration
135
+
136
+ The check command is designed to be CI-safe. Show user how to integrate:
137
+
138
+ ```
139
+ To add this check to your CI/CD pipeline:
140
+
141
+ GitHub Actions example:
142
+
143
+ name: Documentation Check
144
+ on: [push, pull_request]
145
+
146
+ jobs:
147
+ vibe-doc-check:
148
+ runs-on: ubuntu-latest
149
+ steps:
150
+ - uses: actions/checkout@v4
151
+ - uses: actions/setup-node@v4
152
+ with:
153
+ node-version: '20'
154
+ - run: npm install -g vibe-doc
155
+ - run: npx vibe-doc check .
156
+ # Command exits with:
157
+ # 0 = all Required docs exist and current
158
+ # 1 = missing or stale Required docs
159
+ ```
160
+
161
+ Other CI systems (GitLab CI, CircleCI, Jenkins):
162
+
163
+ ```bash
164
+ # Run this command in your pipeline
165
+ npx vibe-doc check .
166
+
167
+ # Exit codes:
168
+ # 0 = PASS (deploy allowed)
169
+ # 1 = FAIL (deploy blocked)
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Exit Codes & Automation
175
+
176
+ The `check` command returns standard exit codes:
177
+
178
+ | Exit Code | Meaning | Action |
179
+ |-----------|---------|--------|
180
+ | `0` | All Required docs exist and are current | Deployment can proceed |
181
+ | `1` | Missing or stale Required docs | Deployment blocked; regenerate docs |
182
+
183
+ **Use in CI conditionals:**
184
+
185
+ ```yaml
186
+ # GitHub Actions
187
+ - run: npx vibe-doc check .
188
+ continue-on-error: true # Optional: allow preview deployments on fail
189
+
190
+ - name: Report Status
191
+ if: success()
192
+ run: echo "Documentation verified ✓"
193
+
194
+ - name: Report Status
195
+ if: failure()
196
+ run: |
197
+ echo "Documentation check failed ✗"
198
+ echo "Regenerate docs before merging: run Generate skill"
199
+ exit 1
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Error Handling
205
+
206
+ ### No Classification Profile
207
+
208
+ If no scan has been run:
209
+
210
+ ```
211
+ Documentation check requires a project profile.
212
+
213
+ Run the Scan skill first to:
214
+ • Analyze your project's artifacts
215
+ • Classify your app type
216
+ • Identify what documentation you need
217
+
218
+ Then re-run this check.
219
+ ```
220
+
221
+ ### Check Command Fails
222
+
223
+ ```
224
+ Check command failed: [error message]
225
+
226
+ This usually means:
227
+ • No .vibe-doc/state.json file (run Scan first)
228
+ • Corrupted state file
229
+ • File system permissions issue
230
+
231
+ Next steps:
232
+ 1. Run Scan skill to create/repair project profile
233
+ 2. Then re-run check
234
+ ```
235
+
236
+ ### Ambiguous Staleness
237
+
238
+ If a doc's staleness is unclear (code changed but impact unknown):
239
+
240
+ ```
241
+ ⚠ Uncertain Staleness: Runbook
242
+
243
+ This doc was generated on 2026-03-25. Since then:
244
+ • 18 commits (mostly feature work)
245
+ • 3 commits touched deployment configs
246
+ • 1 commit changed environment variables
247
+
248
+ The doc may be outdated, but I'm not 100% certain.
249
+
250
+ [regenerate] → Re-create the doc to be safe
251
+ [keep] → The doc is still accurate (skip regeneration)
252
+ ```
253
+
254
+ ---
255
+
256
+ ## State & Output
257
+
258
+ **Read from `.vibe-doc/state.json`:**
259
+ - Classification (which Required docs apply)
260
+ - Generated doc metadata (timestamps, file locations)
261
+ - Generation history (to detect staleness)
262
+
263
+ **Output to user:**
264
+ - Pass/fail status
265
+ - List of missing/stale/current docs
266
+ - Exit code for CI
267
+
268
+ **No files created or modified by this skill.**
269
+
270
+ ---
271
+
272
+ ## Use Cases
273
+
274
+ **Developer before local deployment:**
275
+ ```
276
+ npx vibe-doc check .
277
+ # → Verify docs are current before deploying to staging
278
+ ```
279
+
280
+ **CI pipeline (on every push):**
281
+ ```
282
+ # Block merge if Required docs are missing
283
+ if ! npx vibe-doc check .; then
284
+ exit 1
285
+ fi
286
+ ```
287
+
288
+ **CI pipeline (allow preview on fail):**
289
+ ```
290
+ # Allow preview deployments, but warn on missing docs
291
+ npx vibe-doc check . || true
292
+ ```
293
+
294
+ **Scheduled check (weekly reminder):**
295
+ ```
296
+ # Every Monday, check if docs have gone stale
297
+ # If docs are >2 weeks old, alert the team
298
+ ```
299
+
300
+ ---
301
+
302
+ **Last updated:** 2026-04-11 | **Version:** 1.0