@esthernandez/vibe-doc 0.2.2 → 0.3.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.
- package/.claude-plugin/plugin.json +8 -0
- package/commands/check.md +7 -0
- package/commands/generate.md +11 -0
- package/commands/scan.md +11 -0
- package/commands/status.md +7 -0
- package/dist/generator/docx-writer.d.ts.map +1 -1
- package/dist/generator/docx-writer.js +13 -1
- package/dist/generator/extractor.d.ts.map +1 -1
- package/dist/generator/extractor.js +91 -0
- package/dist/generator/markdown-writer.d.ts.map +1 -1
- package/dist/generator/markdown-writer.js +13 -1
- package/dist/templates/index.d.ts +13 -0
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +14 -7
- package/dist/templates/renderer.d.ts.map +1 -1
- package/dist/templates/renderer.js +3 -1
- package/package.json +4 -1
- package/skills/check/SKILL.md +302 -0
- package/skills/generate/SKILL.md +359 -0
- package/skills/guide/AGENT_GUIDE.md +318 -0
- package/skills/guide/SKILL.md +270 -0
- package/skills/guide/references/breadcrumb-heuristics.md +441 -0
- package/skills/guide/references/classification-taxonomy.md +391 -0
- package/skills/guide/references/documentation-matrix.md +297 -0
- package/skills/scan/SKILL.md +219 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: generate
|
|
3
|
+
description: >
|
|
4
|
+
This skill should be used when the user mentions "generate docs",
|
|
5
|
+
"write my documentation", "fix my gaps", "create a runbook",
|
|
6
|
+
"write the threat model", "generate missing docs", or wants to
|
|
7
|
+
produce technical documentation from their project artifacts.
|
|
8
|
+
Runs an autonomous-first workflow: reads project files, synthesizes
|
|
9
|
+
as much as possible without asking, then interviews the user only
|
|
10
|
+
for the sections that genuinely need human judgment.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Vibe Doc Generate Skill
|
|
14
|
+
|
|
15
|
+
Autonomous-first pipeline: read the project, fill what you can, then ask the user only for the sections that need human judgment.
|
|
16
|
+
|
|
17
|
+
**Shared behavior:** Read `skills/guide/SKILL.md` for state management, CLI patterns, checkpoints, and output formatting.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Design Intent
|
|
22
|
+
|
|
23
|
+
The old model was **agent-interviewed, user-informed**: the agent asked 2-3 synthesis questions per doc type and the user answered them all. That's overkill for factual docs whose content lives in the codebase.
|
|
24
|
+
|
|
25
|
+
The new model is **autonomous-first**:
|
|
26
|
+
|
|
27
|
+
1. **Read the project files directly** — README, CLAUDE.md, package.json, SKILL files, source entry points, git history, CI configs
|
|
28
|
+
2. **Synthesize confidently** from what you read — fill in template sections where you have strong evidence
|
|
29
|
+
3. **Interview only for the gaps** — ask targeted questions for the sections where code can't tell you the answer (security judgment, business intent, operational context the team knows but hasn't written down yet)
|
|
30
|
+
4. **Present the result** — show the user what you filled in, what you left as NEEDS INPUT, and let them review
|
|
31
|
+
|
|
32
|
+
The CLI (`vibe-doc generate <doctype>`) still produces the deterministic scaffold. This skill layers intelligence on top: same scaffold, but the agent keeps going and fills it in from the codebase before handing off to the user.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Entry: Verify Scan State
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
if [ ! -f "<project-path>/.vibe-doc/state.json" ]; then
|
|
40
|
+
echo "No project profile found. Run the Scan skill first."
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If state doesn't exist, redirect to the **Scan skill** and exit.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Main Flow
|
|
50
|
+
|
|
51
|
+
### 1. Present Gaps and Confirm Selection
|
|
52
|
+
|
|
53
|
+
Read state and show gaps grouped by tier:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Documentation Gaps — <Category>
|
|
57
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
58
|
+
|
|
59
|
+
Required (ship blockers) — N missing:
|
|
60
|
+
□ README
|
|
61
|
+
□ Install Guide
|
|
62
|
+
□ Skill/Command Reference
|
|
63
|
+
|
|
64
|
+
Recommended (should do) — M missing:
|
|
65
|
+
□ ADRs
|
|
66
|
+
□ Test Plan
|
|
67
|
+
□ Changelog / Contributing
|
|
68
|
+
|
|
69
|
+
Which would you like to generate?
|
|
70
|
+
|
|
71
|
+
[required] Start with all Required docs (runs autonomous fill in parallel)
|
|
72
|
+
[pick] Let me choose specific docs
|
|
73
|
+
[<name>] Single doc by name
|
|
74
|
+
[all] Every missing doc, Required + Recommended + Optional
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Do not default to "all"** unless the user asks for it. More docs = slower, more tokens, more noise.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
### 2. Route by Count
|
|
82
|
+
|
|
83
|
+
- **Single doc selected** → go to **Section 3: Autonomous Fill (single doc)**
|
|
84
|
+
- **Multiple docs selected** → go to **Section 4: Parallel Dispatch (multiple docs)**
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### 3. Autonomous Fill (Single Doc)
|
|
89
|
+
|
|
90
|
+
Follow these steps, in order, for each doc to generate.
|
|
91
|
+
|
|
92
|
+
#### 3a. Run the CLI for the scaffold
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
cd <project-path> && npx vibe-doc generate <docType> --format both
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
This produces `docs/generated/<docType>.md` with deterministic-extractor fields pre-filled and `NEEDS INPUT` comments marking the gaps.
|
|
99
|
+
|
|
100
|
+
Read the scaffold back so you can edit it in place.
|
|
101
|
+
|
|
102
|
+
#### 3b. Gather source material
|
|
103
|
+
|
|
104
|
+
Read the files most relevant to this doc type. Use the hint table below; add files based on what the scan inventory shows.
|
|
105
|
+
|
|
106
|
+
| Doc Type | Read These Files |
|
|
107
|
+
|----------|------------------|
|
|
108
|
+
| **readme** | `package.json`, `CLAUDE.md`, any existing `README.md`, main source entry file (e.g., `src/index.ts`), `docs/` summaries |
|
|
109
|
+
| **install-guide** | `package.json` (engines, scripts, bin), any existing `INSTALL.md`, CI configs (`.github/workflows/*.yml`), install-related scripts |
|
|
110
|
+
| **skill-command-reference** | every `skills/*/SKILL.md`, every `commands/*.md`, `.claude-plugin/plugin.json` |
|
|
111
|
+
| **changelog-contributing** | `git log --oneline -100`, any existing `CHANGELOG.md`, any existing `CONTRIBUTING.md`, `package.json` version history |
|
|
112
|
+
| **adr** | `CLAUDE.md`, commit messages with "decision:" or "arch:" prefixes, any `docs/adr/` or `docs/decisions/` folder |
|
|
113
|
+
| **runbook** | `package.json` scripts, `Dockerfile`, `.github/workflows/*.yml`, any `scripts/` folder, any deploy config |
|
|
114
|
+
| **api-spec** | Route/controller source files, `openapi.yaml`, `swagger.json`, any existing API docs |
|
|
115
|
+
| **deployment-procedure** | `.github/workflows/*.yml`, `Dockerfile`, deploy scripts, cloud infra configs (terraform, cdk, pulumi) |
|
|
116
|
+
| **test-plan** | Test files, test runner configs (`jest.config.*`, `pytest.ini`), CI test stages |
|
|
117
|
+
| **data-model** | Schema/migration files, ORM model files, database config |
|
|
118
|
+
| **threat-model** | Auth code, permission logic, sensitive-data handling, external API clients, secrets config |
|
|
119
|
+
|
|
120
|
+
For each file, extract what's relevant to the template's sections. Ignore irrelevant content.
|
|
121
|
+
|
|
122
|
+
#### 3c. Fill the template autonomously
|
|
123
|
+
|
|
124
|
+
Open the scaffold at `docs/generated/<docType>.md`. For each `NEEDS INPUT` comment:
|
|
125
|
+
|
|
126
|
+
1. **Can you synthesize this section from what you read?** If yes, replace the empty block (or the `{{user.*}}` placeholder still sitting there) with real content. Remove the `NEEDS INPUT` comment to signal the section is filled.
|
|
127
|
+
2. **Do you need human judgment?** If yes, leave the `NEEDS INPUT` comment in place. These will become the questions you ask the user in the next step.
|
|
128
|
+
|
|
129
|
+
**Rules for autonomous fills:**
|
|
130
|
+
|
|
131
|
+
- **Cite your sources inline** — at the end of a section you wrote, add a markdown comment: `<!-- Source: package.json, README.md -->`. This lets the user verify your work quickly.
|
|
132
|
+
- **Don't fabricate.** If a section would require making something up (an SLA target you don't see, a rollback procedure that isn't documented), leave it as NEEDS INPUT. Confident content only.
|
|
133
|
+
- **Prefer brevity over padding.** A 3-sentence section filled from real evidence beats a 3-paragraph section of boilerplate.
|
|
134
|
+
- **Match the existing doc's voice.** Read at least one existing doc in the repo (README is usually a good reference) to calibrate tone.
|
|
135
|
+
|
|
136
|
+
Write the filled-in doc back to `docs/generated/<docType>.md`.
|
|
137
|
+
|
|
138
|
+
#### 3d. Interview the user for remaining gaps
|
|
139
|
+
|
|
140
|
+
Present a summary:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
✓ Autonomous pass complete — docs/generated/<docType>.md
|
|
144
|
+
|
|
145
|
+
Filled from codebase:
|
|
146
|
+
• <section A> — from <source files>
|
|
147
|
+
• <section B> — from <source files>
|
|
148
|
+
• <section C> — from <source files>
|
|
149
|
+
|
|
150
|
+
Still need your input:
|
|
151
|
+
• <section X> — <why the agent couldn't fill it>
|
|
152
|
+
• <section Y> — <why the agent couldn't fill it>
|
|
153
|
+
|
|
154
|
+
I'll ask about those two now. If you'd rather fill them yourself
|
|
155
|
+
later, say "defer" and I'll leave the NEEDS INPUT comments.
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Then ask **one question at a time** for each remaining gap. Each question should be specific, reference the context, and accept short answers:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
Question 1 of 2: <section X>
|
|
162
|
+
|
|
163
|
+
<one-sentence explanation of what this section is for>
|
|
164
|
+
|
|
165
|
+
From what I read, you have <X, Y, Z>. What's the <specific thing>?
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Capture each answer and update the doc in place. When all questions are answered, remove the `NEEDS INPUT` comments for those sections.
|
|
169
|
+
|
|
170
|
+
#### 3e. Present for review
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
✓ <docType>.md is ready for review.
|
|
174
|
+
|
|
175
|
+
Coverage:
|
|
176
|
+
• Sections filled autonomously: N
|
|
177
|
+
• Sections filled from your answers: M
|
|
178
|
+
• Sections still marked NEEDS INPUT: 0 (or K if deferred)
|
|
179
|
+
|
|
180
|
+
Open: docs/generated/<docType>.md
|
|
181
|
+
|
|
182
|
+
[approve] Move to next doc (or finish if last)
|
|
183
|
+
[revise] Ask different questions / read more files / regenerate
|
|
184
|
+
[edit] I'll wait while you edit manually, then approve
|
|
185
|
+
[defer] Mark remaining gaps as NEEDS INPUT and move on
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
### 4. Parallel Dispatch (Multiple Docs)
|
|
191
|
+
|
|
192
|
+
When the user selects multiple docs, **dispatch one subagent per doc type in parallel** using the Task tool. This is the recommended path — it's faster and each agent gets a focused slice of the codebase to read.
|
|
193
|
+
|
|
194
|
+
#### 4a. Plan the dispatch
|
|
195
|
+
|
|
196
|
+
For each selected doc, build a subagent prompt that covers Section 3a-c (scaffold + read sources + fill autonomously). Do **not** include the conversational interview (Section 3d) in the subagent prompt — that happens in the main agent after all subagents return, so questions don't interleave.
|
|
197
|
+
|
|
198
|
+
Subagent prompt template:
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
You are generating documentation for a <Category> project at <project-path>.
|
|
202
|
+
|
|
203
|
+
Task: Produce a fully-filled `docs/generated/<docType>.md` from the project's
|
|
204
|
+
existing artifacts. Do NOT ask the user questions — fill only what you can
|
|
205
|
+
confidently synthesize from source files, and leave NEEDS INPUT comments for
|
|
206
|
+
anything you can't.
|
|
207
|
+
|
|
208
|
+
Steps:
|
|
209
|
+
1. Run: `cd <project-path> && npx vibe-doc generate <docType> --format both`
|
|
210
|
+
2. Read the generated scaffold at docs/generated/<docType>.md
|
|
211
|
+
3. Read these source files: <from the hint table, plus inventory-specific adds>
|
|
212
|
+
4. For each NEEDS INPUT section in the scaffold:
|
|
213
|
+
- If you can fill it confidently from what you read, replace it with real
|
|
214
|
+
content and add an inline <!-- Source: ... --> comment
|
|
215
|
+
- If you can't, leave the NEEDS INPUT comment so the main agent can ask the user
|
|
216
|
+
5. Write the updated doc back to docs/generated/<docType>.md
|
|
217
|
+
6. Report back with: (a) which sections you filled, (b) which sections still
|
|
218
|
+
need human input, (c) anything suspicious you noticed in the artifacts
|
|
219
|
+
|
|
220
|
+
Do not dispatch further subagents. Do not run the interview. Return findings
|
|
221
|
+
to the main agent.
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
#### 4b. Dispatch in parallel
|
|
225
|
+
|
|
226
|
+
Use the Task tool to fire all subagents in the same message. Each subagent runs independently and edits its own doc.
|
|
227
|
+
|
|
228
|
+
#### 4c. Collect results
|
|
229
|
+
|
|
230
|
+
When all subagents return, aggregate their findings:
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
✓ Autonomous pass complete — <N> docs
|
|
234
|
+
|
|
235
|
+
docs/generated/readme.md
|
|
236
|
+
Filled: overview, install, usage, license
|
|
237
|
+
Needs input: configuration (no .env.example found)
|
|
238
|
+
|
|
239
|
+
docs/generated/install-guide.md
|
|
240
|
+
Filled: prerequisites, install steps, verification
|
|
241
|
+
Needs input: troubleshooting (no existing error documentation)
|
|
242
|
+
|
|
243
|
+
docs/generated/skill-command-reference.md
|
|
244
|
+
Filled: all sections (found 8 SKILL files and 4 command definitions)
|
|
245
|
+
Needs input: none — ready to ship
|
|
246
|
+
|
|
247
|
+
Total: <X> sections filled autonomously, <Y> need your input.
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
#### 4d. Sequential interview for gaps
|
|
251
|
+
|
|
252
|
+
Now run the interview phase (Section 3d) **sequentially** across all docs — for each doc that has unfilled gaps, ask its questions one at a time, update the doc, move to the next. Don't interleave questions across docs; the user needs to stay focused on one doc at a time.
|
|
253
|
+
|
|
254
|
+
#### 4e. Present all docs for review
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
Generation complete ✓
|
|
258
|
+
|
|
259
|
+
Ready for review:
|
|
260
|
+
• docs/generated/readme.md (0 gaps remaining)
|
|
261
|
+
• docs/generated/install-guide.md (0 gaps remaining)
|
|
262
|
+
• docs/generated/skill-command-reference.md (0 gaps remaining)
|
|
263
|
+
|
|
264
|
+
Coverage improved: <before>% → <after>% (<n> Required docs satisfied)
|
|
265
|
+
|
|
266
|
+
Open each file to review. When you're ready, you can promote them to the
|
|
267
|
+
repo root (README.md, INSTALL.md, etc.) or keep them in docs/generated/
|
|
268
|
+
as a staging area.
|
|
269
|
+
|
|
270
|
+
[approve-all] Done, docs are good
|
|
271
|
+
[revise <name>] Re-run autonomous fill on one doc with different focus
|
|
272
|
+
[promote] Move files from docs/generated/ to the repo root
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## When to Fall Back to the Pure Interview Flow
|
|
278
|
+
|
|
279
|
+
The autonomous-first flow works well for docs whose content lives in the codebase. It works **less well** for docs where the substance is judgment, intent, or future plans — specifically:
|
|
280
|
+
|
|
281
|
+
- **Threat Model** — requires security reasoning the agent shouldn't invent
|
|
282
|
+
- **ADRs for decisions not yet documented** — the "why" is in someone's head
|
|
283
|
+
- **Deployment Procedure for an app that hasn't deployed yet** — no evidence exists
|
|
284
|
+
- **Data Model for a pre-alpha app** — no schema yet
|
|
285
|
+
|
|
286
|
+
For these, default to a **short autonomous pass** (fill only what's obviously there) and spend most of the time in the interview phase. Lean on the synthesis questions from `skills/guide/references/breadcrumb-heuristics.md`.
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Anti-Patterns
|
|
291
|
+
|
|
292
|
+
- **Never fabricate.** If you don't have evidence, leave NEEDS INPUT. A scaffold with honest gaps is better than a polished doc that's half hallucination.
|
|
293
|
+
- **Never cite sources you didn't read.** Inline source comments must point to files the agent actually opened.
|
|
294
|
+
- **Don't auto-promote generated files.** `docs/generated/` is a staging area. Moving files to the repo root (README.md, INSTALL.md, CHANGELOG.md) is always an explicit user action.
|
|
295
|
+
- **Don't ask questions the code already answers.** Before asking a question, re-verify you couldn't have derived it from a file you haven't read yet.
|
|
296
|
+
- **Don't interleave questions across docs** in the parallel path. One doc at a time for the interview phase, even if the autonomous passes ran in parallel.
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Error Handling
|
|
301
|
+
|
|
302
|
+
### CLI scaffold generation fails
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
The scaffold step failed: <error>
|
|
306
|
+
|
|
307
|
+
This usually means:
|
|
308
|
+
• The doc type isn't registered (check `vibe-doc templates list`)
|
|
309
|
+
• The template file is missing from the install
|
|
310
|
+
• A filesystem error blocked writing to docs/generated/
|
|
311
|
+
|
|
312
|
+
[retry] Try again
|
|
313
|
+
[skip] Skip this doc and move to the next
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Autonomous pass runs out of context
|
|
317
|
+
|
|
318
|
+
If reading too many source files would exceed a reasonable context budget, narrow the scope:
|
|
319
|
+
|
|
320
|
+
- Read only the top 10-15 files most relevant to the doc type
|
|
321
|
+
- Prefer summary files (READMEs, CLAUDE.md, SKILL.md) over large source files
|
|
322
|
+
- Skim rather than read exhaustively — you're looking for evidence, not comprehension
|
|
323
|
+
|
|
324
|
+
### Subagent returns with everything marked NEEDS INPUT
|
|
325
|
+
|
|
326
|
+
If a subagent couldn't fill any sections, it probably got the wrong doc type or the repo genuinely has no evidence. Options:
|
|
327
|
+
|
|
328
|
+
- Fall back to the pure interview flow for that doc
|
|
329
|
+
- Skip that doc (not everything should be generated for every project)
|
|
330
|
+
- Ask the user to point the agent at the right files manually
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## State & Output
|
|
335
|
+
|
|
336
|
+
**Read from `.vibe-doc/state.json`:**
|
|
337
|
+
- Classification (to pick the right doc types)
|
|
338
|
+
- Gaps list (to know what's missing)
|
|
339
|
+
- Artifact inventory (to know which files to read during autonomous pass)
|
|
340
|
+
|
|
341
|
+
**Write to:**
|
|
342
|
+
- `docs/generated/<docType>.md` — the filled-in doc (autonomous + interview results)
|
|
343
|
+
- `docs/generated/<docType>.docx` — DOCX version from the CLI scaffold pass
|
|
344
|
+
- `.vibe-doc/state.json` — generation history (file paths, timestamps)
|
|
345
|
+
|
|
346
|
+
**Files the agent should NOT modify:**
|
|
347
|
+
- Repo-root docs (README.md, INSTALL.md, CHANGELOG.md) — promotion is explicit user action
|
|
348
|
+
- Source code — docs generation is read-only on the codebase
|
|
349
|
+
- `.vibe-doc/state.json`'s `classification` or `gapReport` blocks — those are owned by scan/check skills
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Synthesis Questions Reference
|
|
354
|
+
|
|
355
|
+
When the interview phase is needed, question sets per doc type live in `skills/guide/references/breadcrumb-heuristics.md`. Each breadcrumb's `gapQuestions` field is a pre-written list of targeted questions for that doc type — use them as a starting point and adapt to what you already filled in.
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
**Last updated:** 2026-04-15 | **Version:** 2.0 (autonomous-first)
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# Agent Guide — How to Use Vibe Doc Skills
|
|
2
|
+
|
|
3
|
+
**This is for agents.** When a user invokes a Vibe Doc skill, read the corresponding SKILL.md file and follow its conversational pipeline exactly.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Quick Reference
|
|
8
|
+
|
|
9
|
+
| Skill | File | Purpose | User-Facing? |
|
|
10
|
+
|-------|------|---------|--------------|
|
|
11
|
+
| **scan** | `scan/SKILL.md` | Scan artifacts, classify app, report gaps | YES |
|
|
12
|
+
| **generate** | `generate/SKILL.md` | Generate selected documentation | YES |
|
|
13
|
+
| **check** | `check/SKILL.md` | Validate Required docs exist and are current | YES |
|
|
14
|
+
| **guide** | `guide/SKILL.md` | Shared behavior (reference only) | NO |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Skill Invocation Pattern
|
|
19
|
+
|
|
20
|
+
When a user says something like:
|
|
21
|
+
- "Scan my project for documentation gaps"
|
|
22
|
+
- "Help me generate missing docs"
|
|
23
|
+
- "Check if my docs are current"
|
|
24
|
+
|
|
25
|
+
The agent should:
|
|
26
|
+
|
|
27
|
+
1. **Identify the skill:** Map user request to scan/generate/check
|
|
28
|
+
2. **Read the SKILL.md:** Open the corresponding file and read the full conversational flow
|
|
29
|
+
3. **Follow the pipeline:** Execute step-by-step as defined in the SKILL.md
|
|
30
|
+
4. **Reference guides:** Consult `skills/guide/references/` when needed (see below)
|
|
31
|
+
5. **Maintain state:** All skills interact with `.vibe-doc/state.json` via CLI commands
|
|
32
|
+
6. **Respect checkpoints:** Pause and ask for user confirmation at critical gates
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Step-by-Step: Scan Skill
|
|
37
|
+
|
|
38
|
+
User: "Scan my project for documentation gaps"
|
|
39
|
+
|
|
40
|
+
1. **Read** `skills/scan/SKILL.md`
|
|
41
|
+
2. **Section 1 — Entry Gate:**
|
|
42
|
+
- Greet user
|
|
43
|
+
- Present two paths: "Add context first" or "Start scanning"
|
|
44
|
+
- Wait for choice
|
|
45
|
+
3. **If Path A (Add context):**
|
|
46
|
+
- Go to section 2 (Intake Interview)
|
|
47
|
+
- Ask 6 questions, save answers
|
|
48
|
+
4. **If Path B (Cold start):**
|
|
49
|
+
- Jump to section 3 (Run Scan)
|
|
50
|
+
5. **Section 3 — Run Scan:**
|
|
51
|
+
- Execute: `cd <project-path> && npx vibe-doc scan .`
|
|
52
|
+
- If fails: show error, suggest next steps, exit
|
|
53
|
+
- If succeeds: proceed
|
|
54
|
+
6. **Section 4 — Present Classification:**
|
|
55
|
+
- Read `.vibe-doc/state.json` to get classification
|
|
56
|
+
- Show it to user in formatted output
|
|
57
|
+
- Checkpoint: ask user to confirm/revise/dispute
|
|
58
|
+
7. **Section 5 — Present Gap Report:**
|
|
59
|
+
- Show summary (counts by tier)
|
|
60
|
+
- Checkpoint: ask how to proceed (walkthrough/generate/check/exit)
|
|
61
|
+
8. **Section 6 — Interactive Walkthrough (optional):**
|
|
62
|
+
- If user picked walkthrough, go through gaps 1-by-1
|
|
63
|
+
- For each gap: show rationale, what was found, what's missing
|
|
64
|
+
- Ask: generate now, skip, or see details
|
|
65
|
+
9. **Section 7 — Completion:**
|
|
66
|
+
- Show final summary
|
|
67
|
+
- Offer next steps (generate, save, check)
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Step-by-Step: Generate Skill
|
|
72
|
+
|
|
73
|
+
User: "Help me generate the missing documentation"
|
|
74
|
+
|
|
75
|
+
1. **Read** `skills/generate/SKILL.md`
|
|
76
|
+
2. **Entry check:**
|
|
77
|
+
- Verify `.vibe-doc/state.json` exists
|
|
78
|
+
- If not: redirect to Scan skill and exit
|
|
79
|
+
3. **Section 1 — Show Gaps:**
|
|
80
|
+
- Read state
|
|
81
|
+
- Display gaps organized by tier
|
|
82
|
+
- Ask: generate Required/pick specific/generate all
|
|
83
|
+
4. **Section 2a — Sequential Generation:**
|
|
84
|
+
- For each selected gap:
|
|
85
|
+
- Consult `skills/guide/references/breadcrumb-heuristics.md` for the doc type
|
|
86
|
+
- Extract the "Gap Questions" section
|
|
87
|
+
- Ask user those 2-3 questions
|
|
88
|
+
- Save answers to temporary JSON
|
|
89
|
+
- Execute: `cd <project-path> && npx vibe-doc generate <docType> --format both --answers '<json>'`
|
|
90
|
+
- Parse output: show file paths, confidence per section
|
|
91
|
+
- Checkpoint: approve/revise/skip
|
|
92
|
+
5. **Section 7 — Completion:**
|
|
93
|
+
- Show summary of what was generated
|
|
94
|
+
- Offer: generate more/check/done
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Step-by-Step: Check Skill
|
|
99
|
+
|
|
100
|
+
User: "Check if my documentation is current"
|
|
101
|
+
|
|
102
|
+
1. **Read** `skills/check/SKILL.md`
|
|
103
|
+
2. **Section 1 — Run Check:**
|
|
104
|
+
- Execute: `cd <project-path> && npx vibe-doc check .`
|
|
105
|
+
3. **Section 2 — Present Results:**
|
|
106
|
+
- If pass: celebrate, show status, offer next steps
|
|
107
|
+
- If fail: show what's missing/stale, suggest fixes
|
|
108
|
+
4. **Section 3 — Checkpoint:**
|
|
109
|
+
- Ask: regenerate/scan/review/exit
|
|
110
|
+
5. **CI Integration:**
|
|
111
|
+
- If user asks about CI/CD, show the example in section "CI/CD Integration"
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## When to Consult Reference Guides
|
|
116
|
+
|
|
117
|
+
### Use `classification-taxonomy.md` when:
|
|
118
|
+
- Classifying an ambiguous application (could be Web App OR API)
|
|
119
|
+
- Determining what docs are appropriate for a category
|
|
120
|
+
- Explaining why a context modifier matters
|
|
121
|
+
|
|
122
|
+
**Example:** User says "My app is both a web app and an API." Consult taxonomy to explain primary vs. secondary categories.
|
|
123
|
+
|
|
124
|
+
### Use `documentation-matrix.md` when:
|
|
125
|
+
- Explaining which docs are Required vs. Recommended for their app type
|
|
126
|
+
- Showing why a doc tier changed (due to modifiers)
|
|
127
|
+
- Justifying a doc as "required for HIPAA compliance"
|
|
128
|
+
|
|
129
|
+
**Example:** Generate skill shows "Test Plan is Recommended for your Web App. However, because you're Customer-Facing, it's elevated to Required."
|
|
130
|
+
|
|
131
|
+
### Use `breadcrumb-heuristics.md` when:
|
|
132
|
+
- Generating a specific document (to get synthesis questions)
|
|
133
|
+
- Explaining confidence levels (why a section was low-confidence)
|
|
134
|
+
- Helping user understand what the scanner looks for
|
|
135
|
+
|
|
136
|
+
**Example:** Generate skill for "Threat Model" doc → consult breadcrumb-heuristics to extract Gap Questions → ask user "Beyond authentication and data encryption, what other sensitive operations exist?"
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## State Management
|
|
141
|
+
|
|
142
|
+
All skills operate on `.vibe-doc/state.json` in the mounted project folder.
|
|
143
|
+
|
|
144
|
+
**Never edit this file directly.** Always use CLI commands:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Scan produces/updates:
|
|
148
|
+
npx vibe-doc scan <path>
|
|
149
|
+
|
|
150
|
+
# Generate updates:
|
|
151
|
+
npx vibe-doc generate <docType> --format both --answers <json>
|
|
152
|
+
|
|
153
|
+
# Check reads (no modifications):
|
|
154
|
+
npx vibe-doc check <path>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**State structure** (from `guide/SKILL.md`):
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"profile": {
|
|
161
|
+
"primaryCategory": "string",
|
|
162
|
+
"secondaryCategories": ["string"],
|
|
163
|
+
"deploymentContexts": ["string"],
|
|
164
|
+
"confidence": 0.0-1.0
|
|
165
|
+
},
|
|
166
|
+
"scan": {
|
|
167
|
+
"timestamp": "ISO8601",
|
|
168
|
+
"artifacts": [],
|
|
169
|
+
"gitHistory": {},
|
|
170
|
+
"codeStructure": {}
|
|
171
|
+
},
|
|
172
|
+
"gaps": {
|
|
173
|
+
"required": [],
|
|
174
|
+
"recommended": [],
|
|
175
|
+
"optional": []
|
|
176
|
+
},
|
|
177
|
+
"generated": {
|
|
178
|
+
"docs": [],
|
|
179
|
+
"timestamps": {}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Error Handling
|
|
187
|
+
|
|
188
|
+
When a CLI command fails, **always:**
|
|
189
|
+
|
|
190
|
+
1. Show the error message to the user
|
|
191
|
+
2. Explain what was being attempted
|
|
192
|
+
3. Suggest concrete next steps
|
|
193
|
+
4. Offer fallback options (if any)
|
|
194
|
+
|
|
195
|
+
See each SKILL.md's "Error Handling" section for specific error patterns and responses.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Checkpoint Pattern (Critical)
|
|
200
|
+
|
|
201
|
+
Vibe Doc uses checkpoints to ensure user control at critical gates:
|
|
202
|
+
|
|
203
|
+
1. **Present findings clearly** (summary first, then details)
|
|
204
|
+
2. **Show the decision** (what's being asked, why it matters)
|
|
205
|
+
3. **Offer explicit choices** (yes/no/revise/skip/etc.)
|
|
206
|
+
4. **Wait for confirmation** (do NOT proceed without user response)
|
|
207
|
+
|
|
208
|
+
Examples of checkpoints:
|
|
209
|
+
- Classification confirmation ("Does this match your project?")
|
|
210
|
+
- Gap walkthrough start ("Would you like to walk through gaps one by one?")
|
|
211
|
+
- Document approval ("Approve this doc before moving to next?")
|
|
212
|
+
- Generation selection ("You've selected 2 docs. Ready to start?")
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Output Formatting Standards
|
|
217
|
+
|
|
218
|
+
From `guide/SKILL.md`:
|
|
219
|
+
|
|
220
|
+
**Headers:** Use Markdown. Structure output with H1, H2, H3.
|
|
221
|
+
|
|
222
|
+
**Lists:** Bullet points for options/findings, numbered for steps.
|
|
223
|
+
|
|
224
|
+
**Code blocks:**
|
|
225
|
+
```bash
|
|
226
|
+
cd /project && npx vibe-doc scan .
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Checkpoints:** Use clear formatting with options in brackets:
|
|
230
|
+
```
|
|
231
|
+
[yes] → Proceed to next step
|
|
232
|
+
[no] → Go back and adjust
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Status indicators:** Use consistent symbols:
|
|
236
|
+
- ✓ Complete/Found
|
|
237
|
+
- ✗ Missing/Failed
|
|
238
|
+
- ⚠ Warning/Low confidence
|
|
239
|
+
- → Next step/redirect
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Example: Full Scan → Generate → Check Flow
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
User: "Help me document my project"
|
|
247
|
+
|
|
248
|
+
Agent reads: skills/scan/SKILL.md
|
|
249
|
+
Agent runs scan pipeline (sections 1-7)
|
|
250
|
+
Output: gaps listed, user prompted next steps
|
|
251
|
+
|
|
252
|
+
User: "Let's generate the required docs"
|
|
253
|
+
|
|
254
|
+
Agent reads: skills/generate/SKILL.md
|
|
255
|
+
Agent checks state, shows gaps, lets user pick
|
|
256
|
+
For each gap:
|
|
257
|
+
- Agent reads: breadcrumb-heuristics.md (for that doc type)
|
|
258
|
+
- Agent asks synthesis questions
|
|
259
|
+
- Agent runs generate CLI
|
|
260
|
+
- Agent shows results + checkpoint
|
|
261
|
+
|
|
262
|
+
User: "Before I commit these, can you verify everything?"
|
|
263
|
+
|
|
264
|
+
Agent reads: skills/check/SKILL.md
|
|
265
|
+
Agent runs check pipeline
|
|
266
|
+
Output: pass/fail status, recommendations
|
|
267
|
+
|
|
268
|
+
Done!
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Tone & Style
|
|
274
|
+
|
|
275
|
+
All skills follow 626Labs communication style:
|
|
276
|
+
- **Direct and clear** — no filler, respect user's time
|
|
277
|
+
- **Technical but accessible** — explain concepts in plain language
|
|
278
|
+
- **Action-oriented** — lead with what to do, not why
|
|
279
|
+
- **Responsive to energy** — match user's pace (quick/thoughtful)
|
|
280
|
+
|
|
281
|
+
From `guide/SKILL.md`:
|
|
282
|
+
- Professional, direct, no filler
|
|
283
|
+
- Technical but accessible
|
|
284
|
+
- Checkpoint before proceeding
|
|
285
|
+
- Structured output (headers, lists, code blocks)
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Testing Your Implementation
|
|
290
|
+
|
|
291
|
+
When integrating these skills, verify:
|
|
292
|
+
|
|
293
|
+
1. **Scan skill:**
|
|
294
|
+
- Entry gate works (context vs. cold)
|
|
295
|
+
- Classification resolves correctly
|
|
296
|
+
- Gap report shows Required/Recommended/Optional
|
|
297
|
+
- Interactive walkthrough processes gaps one by one
|
|
298
|
+
|
|
299
|
+
2. **Generate skill:**
|
|
300
|
+
- State check works (redirects if no scan)
|
|
301
|
+
- Synthesis questions asked and saved
|
|
302
|
+
- CLI commands execute and produce files
|
|
303
|
+
- Checkpoints work at each approval point
|
|
304
|
+
|
|
305
|
+
3. **Check skill:**
|
|
306
|
+
- CLI returns correct exit codes (0/1)
|
|
307
|
+
- Output is CI-safe (no prompts)
|
|
308
|
+
- Suggestions for fixes are clear
|
|
309
|
+
|
|
310
|
+
4. **Reference docs:**
|
|
311
|
+
- Agents can consult taxonomy for edge cases
|
|
312
|
+
- Matrix accurately maps categories to doc types
|
|
313
|
+
- Breadcrumbs provide useful synthesis questions
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
**Last updated:** 2026-04-11
|
|
318
|
+
**For:** Agents implementing Vibe Doc skills
|