@sandrinio/vdoc 3.3.1 → 3.5.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/bin/vdoc.mjs CHANGED
@@ -13,10 +13,12 @@ const CWD = process.cwd();
13
13
  const PLATFORMS = {
14
14
  claude: {
15
15
  files: [
16
- { src: 'claude/SKILL.md', dest: '.claude/skills/vdoc/SKILL.md' },
17
16
  { src: 'claude/vdoc-init.md', dest: '.claude/skills/vdoc-init/SKILL.md' },
18
- { src: 'claude/vdoc-audit.md', dest: '.claude/skills/vdoc-audit/SKILL.md' },
17
+ { src: 'claude/vdoc-update.md', dest: '.claude/skills/vdoc-update/SKILL.md' },
18
+ { src: 'claude/vdoc-create.md', dest: '.claude/skills/vdoc-create/SKILL.md' },
19
19
  { src: 'claude/references/exploration-strategies.md', dest: '.claude/skills/vdoc-init/references/exploration-strategies.md' },
20
+ { src: 'claude/references/doc-template.md', dest: '.claude/skills/vdoc-config/references/doc-template.md' },
21
+ { src: 'claude/references/manifest-schema.json', dest: '.claude/skills/vdoc-config/references/manifest-schema.json' },
20
22
  ],
21
23
  },
22
24
  cursor: {
@@ -257,8 +259,10 @@ function uninstall() {
257
259
 
258
260
  // Clean skill directories that may have nested files
259
261
  const skillDirs = [
260
- join(CWD, '.claude', 'skills', 'vdoc'),
262
+ join(CWD, '.claude', 'skills', 'vdoc-config'),
261
263
  join(CWD, '.claude', 'skills', 'vdoc-init'),
264
+ join(CWD, '.claude', 'skills', 'vdoc-update'),
265
+ join(CWD, '.claude', 'skills', 'vdoc-create'),
262
266
  join(CWD, '.claude', 'skills', 'vdoc-audit'),
263
267
  join(CWD, '.cursor', 'rules', 'vdoc'),
264
268
  join(CWD, '.windsurf', 'skills', 'vdoc'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandrinio/vdoc",
3
- "version": "3.3.1",
3
+ "version": "3.5.0",
4
4
  "description": "Documentation skills for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,12 +5,12 @@
5
5
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: vdoc
2
+ name: vdoc-config
3
3
  description: "Query existing project documentation. Use when user asks questions about the codebase and vdocs/ exists. For generating docs use /vdoc-init, for auditing use /vdoc-audit."
4
4
  ---
5
5
 
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,19 +5,19 @@
5
5
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16
 
17
17
  **Important:** Use your built-in file-reading tools (Read, Glob, Grep) to explore. Do NOT create scanner scripts, shell scripts, or any tooling. vdoc is purely AI-driven — no scripts, no build steps, no infrastructure.
18
18
 
19
19
  **Phase 3 — Write Exploration Log**
20
- After exploring, write `vdocs/_exploration_log.md` documenting what you found:
20
+ After exploring, write `.claude/skills/vdoc-config/_exploration_log.md` documenting what you found:
21
21
 
22
22
  ```markdown
23
23
  # Exploration Log
@@ -51,7 +51,7 @@ This log is your working memory. It feeds directly into Step 2 (Plan).
51
51
 
52
52
  ## Step 2 — Plan
53
53
 
54
- Create `vdocs/_DOCUMENTATION_PLAN.md` listing each proposed doc:
54
+ Create `.claude/skills/vdoc-config/_DOCUMENTATION_PLAN.md` listing each proposed doc:
55
55
 
56
56
  ```markdown
57
57
  # Documentation Plan
@@ -80,7 +80,7 @@ Wait for user approval before proceeding.
80
80
  For each approved doc:
81
81
 
82
82
  1. Read ALL relevant source files for that feature — not just the main file, but helpers, types, middleware, tests
83
- 2. Follow the template in `references/doc-template.md` exactly
83
+ 2. Read the template from `.claude/skills/vdoc-config/references/doc-template.md` and follow it exactly
84
84
  3. Write to `vdocs/FEATURE_NAME_DOC.md`
85
85
 
86
86
  **Writing rules:**
@@ -94,7 +94,7 @@ For each approved doc:
94
94
 
95
95
  ## Step 4 — Manifest
96
96
 
97
- Create `vdocs/_manifest.json` using the schema in `references/manifest-schema.json`.
97
+ Create `vdocs/_manifest.json` using the schema in `.claude/skills/vdoc-config/references/manifest-schema.json`.
98
98
 
99
99
  The `description` field is critical — write it rich enough that you can route any user question to the right doc by matching against descriptions. Include specific technology names, patterns, and concepts.
100
100
 
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: vdoc-create
3
+ description: "Create a single feature doc on demand. Use when user says 'document the auth system', 'create a doc for payments', or wants to add one specific doc to vdocs/."
4
+ argument-hint: "<feature description>"
5
+ ---
6
+
7
+ # vdoc create — Single Doc Generator
8
+
9
+ Create one feature doc based on the user's description. Do NOT create scripts, shell files, scanners, or any tooling — use your built-in tools (Read, Glob, Grep) for everything.
10
+
11
+ ---
12
+
13
+ ## Step 1 — Locate
14
+
15
+ Use the user's description to find the relevant source files:
16
+
17
+ 1. If `.claude/skills/vdoc-config/_exploration_log.md` exists, read it first — it maps the codebase and may already have the feature signal you need
18
+ 2. Otherwise, search the codebase with Glob and Grep to find files matching the user's description
19
+ 3. Read ALL relevant source files — not just the main file, but helpers, types, middleware, tests, API routes, components
20
+
21
+ Do not skim. Understand how the feature actually works before writing.
22
+
23
+ ## Step 2 — Generate
24
+
25
+ 1. Read the template from `.claude/skills/vdoc-config/references/doc-template.md` and follow it exactly
26
+ 2. Write to `vdocs/FEATURE_NAME_DOC.md`
27
+
28
+ ### Writing Rules
29
+
30
+ - **Mermaid diagrams are mandatory** in "How It Works". Show the actual flow — request lifecycle, state transitions, data pipeline. If a flow has more than 7-9 nodes, split into multiple diagrams.
31
+ - **Data Model** must show real entities from the code, not generic placeholders. Use mermaid ER diagrams for relational data, tables for simpler models.
32
+ - **Constraints & Decisions** is the most valuable section. Dig into the code for non-obvious choices. If you can't find the reason, state the constraint and mark it: `Reason: unknown — verify with team`.
33
+ - **Related Features** must reference other docs by filename and explain the coupling.
34
+ - **Configuration** must list actual env vars/secrets from the code, not hypothetical ones.
35
+ - **Error Handling** — trace what happens when things fail. What does the user see? What gets logged? Is there retry logic?
36
+
37
+ ## Step 3 — Update Manifest
38
+
39
+ Read `vdocs/_manifest.json` and add the new doc entry using the schema in `.claude/skills/vdoc-config/references/manifest-schema.json`.
40
+
41
+ If `vdocs/_manifest.json` doesn't exist, create it with the project name, version, and this doc as the first entry.
42
+
43
+ ## Step 4 — Self-Review
44
+
45
+ Before finishing, verify:
46
+
47
+ - [ ] Doc has at least one mermaid diagram in "How It Works"
48
+ - [ ] Doc has at least 2 entries in "Constraints & Decisions"
49
+ - [ ] "Key Files" lists real paths that exist in the codebase
50
+ - [ ] "Configuration" lists actual env vars from the code
51
+ - [ ] "Related Features" references other doc filenames (if other docs exist)
52
+ - [ ] Manifest `description` is detailed enough for semantic routing
53
+ - [ ] Doc explains WHY and HOW, not just WHAT
54
+
55
+ ## Rules
56
+
57
+ 1. **Feature-centric, not file-centric.** The doc covers one logical feature, not one source file.
58
+ 2. **No hallucination.** Only document what exists in code.
59
+ 3. **No scripts.** Do NOT create shell scripts, scanners, or build tools. Use Read/Glob/Grep.
@@ -14,17 +14,17 @@ Generate feature-centric documentation from source code. All docs go in `vdocs/`
14
14
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
15
15
 
16
16
  **Phase 1 — Fingerprint** (3-5 file reads max)
17
- Read package/config files and directory structure using Read, Glob, and Grep to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
17
+ Read package/config files and directory structure using Read, Glob, and Grep to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
18
18
 
19
19
  **Phase 2 — Targeted Exploration** (archetype-specific)
20
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
20
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
21
21
 
22
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
22
+ If no archetype matches, use the Fallback strategy and confirm with the user.
23
23
 
24
24
  Do not skim. Understand how the system actually works before proposing docs.
25
25
 
26
26
  **Phase 3 — Write Exploration Log**
27
- After exploring, write `vdocs/_exploration_log.md` documenting what you found:
27
+ After exploring, write `.claude/skills/vdoc-config/_exploration_log.md` documenting what you found:
28
28
 
29
29
  ```markdown
30
30
  # Exploration Log
@@ -58,7 +58,7 @@ This log is your working memory. It feeds directly into Step 2 (Plan).
58
58
 
59
59
  ## Step 2 — Plan
60
60
 
61
- Create `vdocs/_DOCUMENTATION_PLAN.md` listing each proposed doc:
61
+ Create `.claude/skills/vdoc-config/_DOCUMENTATION_PLAN.md` listing each proposed doc:
62
62
 
63
63
  ```markdown
64
64
  # Documentation Plan
@@ -87,81 +87,9 @@ Present the plan to the user. Actively suggest changes:
87
87
  For each approved doc:
88
88
 
89
89
  1. Read ALL relevant source files for that feature — not just the main file, but helpers, types, middleware, tests
90
- 2. Follow the template below exactly
90
+ 2. Read the template from `.claude/skills/vdoc-config/references/doc-template.md` and follow it exactly
91
91
  3. Write to `vdocs/FEATURE_NAME_DOC.md`
92
92
 
93
- ### Doc Template
94
-
95
- ```markdown
96
- # {Feature Title}
97
-
98
- > {One-line description of what this covers}
99
-
100
- ---
101
-
102
- ## Overview
103
-
104
- {What it does, why it exists, how it fits in the system.}
105
-
106
- ---
107
-
108
- ## How It Works
109
-
110
- {Core logic and flow.}
111
-
112
- {Mermaid diagram(s) — max 7-9 nodes per diagram, split into multiple if larger.}
113
-
114
- ---
115
-
116
- ## Data Model
117
-
118
- {Entities this feature owns and their relationships. Mermaid ER diagram or table.}
119
-
120
- ---
121
-
122
- ## Key Files
123
-
124
- | File | Purpose |
125
- |------|---------|
126
- | `src/path/file.ts` | What this file does |
127
-
128
- ---
129
-
130
- ## Dependencies & Integrations
131
-
132
- {External services, internal features, packages this relies on.}
133
-
134
- ---
135
-
136
- ## Configuration
137
-
138
- | Variable | Purpose | Required |
139
- |----------|---------|----------|
140
- | `ENV_VAR` | What it controls | Yes/No |
141
-
142
- ---
143
-
144
- ## Error Handling
145
-
146
- {Failure modes, what the user sees, retry logic. Mermaid diagram if the error flow is non-trivial.}
147
-
148
- ---
149
-
150
- ## Constraints & Decisions
151
-
152
- {Why it's built this way. What you CANNOT change without breaking things.}
153
-
154
- ---
155
-
156
- ## Related Features
157
-
158
- {Cross-references to other docs by filename. Blast radius — what breaks if this changes.}
159
-
160
- ---
161
-
162
- *Generated by vdoc v3.0.0 • Last updated: {timestamp}*
163
- ```
164
-
165
93
  ### Writing Rules
166
94
 
167
95
  - **Mermaid diagrams are mandatory** in "How It Works". Show the actual flow — request lifecycle, state transitions, data pipeline. If a flow has more than 7-9 nodes, split into multiple diagrams.
@@ -173,26 +101,7 @@ For each approved doc:
173
101
 
174
102
  ## Step 4 — Manifest
175
103
 
176
- Create `vdocs/_manifest.json`:
177
-
178
- ```json
179
- {
180
- "project": "<project-name>",
181
- "vdoc_version": "3.0.0",
182
- "created_at": "<ISO-8601>",
183
- "last_updated": "<ISO-8601>",
184
- "last_commit": "<short-sha>",
185
- "documentation": [
186
- {
187
- "filepath": "FEATURE_NAME_DOC.md",
188
- "title": "Human-Readable Feature Title",
189
- "version": "1.0.0",
190
- "description": "Rich semantic description with specific technology names, patterns, and concepts. Detailed enough that an AI can route any user question to this doc by matching against this field.",
191
- "tags": ["keyword-1", "keyword-2"]
192
- }
193
- ]
194
- }
195
- ```
104
+ Create `vdocs/_manifest.json` using the schema in `.claude/skills/vdoc-config/references/manifest-schema.json`.
196
105
 
197
106
  The `description` field is critical — write it rich enough that you can route any user question to the right doc by matching against descriptions.
198
107
 
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: vdoc-update
3
+ description: "Update existing vdocs to match current code. Use when user says 'update docs', 'sync docs', 'check docs', or documentation may be out of sync with code."
4
+ ---
5
+
6
+ # vdoc update — Documentation Update
7
+
8
+ Detect stale, missing, and dead documentation. Report and patch. Do NOT create scripts, shell files, scanners, or any tooling — use your built-in tools (Read, Glob, Grep, Bash for git commands) for everything.
9
+
10
+ ---
11
+
12
+ ## Step 1 — Read Current State
13
+
14
+ Read `vdocs/_manifest.json`. Load the list of documented features and their metadata.
15
+
16
+ ## Step 2 — Detect Stale Docs
17
+
18
+ Run `git log --name-only --since="<last_updated>" --pretty=format:""` or use `git diff` to find all source files that changed since the last audit.
19
+
20
+ Cross-reference changed files against each doc's "Key Files" section to identify which docs are stale.
21
+
22
+ ## Step 3 — Detect Coverage Gaps
23
+
24
+ Scan the codebase for significant features not covered by any doc. Look for:
25
+ - New route files / API endpoints
26
+ - New service classes or modules
27
+ - New database models / schema changes
28
+ - New configuration or infrastructure files
29
+
30
+ If you find undocumented features, propose new docs.
31
+
32
+ ## Step 4 — Detect Dead Docs
33
+
34
+ Check each doc's "Key Files" section against the actual filesystem. If key files no longer exist, the doc may be dead. Flag it: "PAYMENT_PROCESSING_DOC.md references 3 files that no longer exist — remove or archive?"
35
+
36
+ ## Step 5 — Check Cross-References
37
+
38
+ Read each doc's "Related Features" section. Verify that:
39
+ - Referenced doc filenames still exist
40
+ - The described coupling is still accurate (skim the relevant code)
41
+
42
+ ## Step 6 — Report
43
+
44
+ Present a clear report:
45
+
46
+ ```
47
+ Update Report:
48
+
49
+ STALE (source files changed):
50
+ - AUTHENTICATION_DOC.md — src/lib/auth.ts changed (added GitHub provider)
51
+ - API_REFERENCE_DOC.md — 2 new endpoints added
52
+
53
+ COVERAGE GAPS (undocumented features):
54
+ - src/services/notification.ts — no doc covers notifications
55
+
56
+ DEAD DOCS (source files removed):
57
+ - LEGACY_ADMIN_DOC.md — all 4 source files deleted
58
+
59
+ CROSS-REF ISSUES:
60
+ - AUTHENTICATION_DOC.md references BILLING_DOC.md which no longer exists
61
+
62
+ CURRENT (no changes needed):
63
+ - DATABASE_SCHEMA_DOC.md
64
+ - PROJECT_OVERVIEW_DOC.md
65
+
66
+ Proceed with fixes?
67
+ ```
68
+
69
+ **Wait for user direction**, then:
70
+ - Patch stale docs (re-read source files, update affected sections only)
71
+ - Generate new docs for coverage gaps (use `/vdoc-create` for each)
72
+ - Flag dead docs for user to confirm deletion
73
+ - Fix cross-reference issues
74
+ - Update manifest: bump versions, update `last_updated`, `last_commit`
75
+
76
+ ## Rules
77
+
78
+ 1. **No scripts.** Do NOT create shell scripts, scanners, or build tools. Use Read/Glob/Grep/Bash(git).
79
+ 2. **Report before patching.** Always present findings and wait for user direction.
80
+ 3. **No hallucination.** Only report what you verified in the code and filesystem.
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,12 +5,12 @@
5
5
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16
 
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,12 +5,12 @@
5
5
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16
 
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,12 +5,12 @@
5
5
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16
 
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,12 +5,12 @@
5
5
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16
 
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,12 +5,12 @@
5
5
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16
 
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,12 +5,12 @@
5
5
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16
 
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,12 +5,12 @@
5
5
  Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `references/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `references/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16
 
@@ -47,6 +47,22 @@ Match the detected archetype and follow its playbook. Each defines:
47
47
  - **What to extract** — what each file category reveals
48
48
  - **Feature signals** — patterns that indicate documentable features
49
49
 
50
+ ### Composing Archetypes
51
+
52
+ Most real projects don't fit a single archetype. **Combine playbooks** when needed:
53
+
54
+ - A FastAPI app with AI agent workflows → **Web API** playbook for routes/middleware/auth + read `**/workflows/**`, `**/agents/**`, `**/chains/**`, `**/prompts/**` for the agent layer
55
+ - A Next.js app with a Python microservice → **Full-Stack Framework** + **Web API** playbooks
56
+ - A CLI that wraps an SDK → **CLI Tool** + **Library/SDK** playbooks
57
+
58
+ **How to compose:**
59
+ 1. Pick the **primary archetype** (what the project fundamentally is)
60
+ 2. Follow its playbook fully
61
+ 3. When you encounter directories/patterns that belong to another archetype, pull in that playbook's glob patterns and feature signals
62
+ 4. In the exploration log, note which archetypes you composed and why
63
+
64
+ Do not force a project into one archetype. The playbooks are building blocks — use what fits.
65
+
50
66
  ---
51
67
 
52
68
  ### Web API
@@ -287,3 +303,39 @@ If the project doesn't clearly match any archetype:
287
303
  5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
288
304
 
289
305
  Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
306
+
307
+ ---
308
+
309
+ ## Existing Documentation
310
+
311
+ During fingerprinting, check if the project already has documentation:
312
+
313
+ - `vdocs/_manifest.json` — previous vdoc output
314
+ - `docs/`, `documentation/`, `product_documentation/` — existing docs folder
315
+ - `README.md` (if substantial, beyond basic setup)
316
+ - `*.md` files in the project root
317
+
318
+ **If existing docs are found:**
319
+
320
+ 1. **Read the existing docs first** — they are a head start, not waste
321
+ 2. **Cross-reference with the actual codebase** — verify claims in the docs against real code. Flag anything that's:
322
+ - **Stale** — docs describe behavior that no longer matches the code
323
+ - **Missing** — code has features not covered in docs
324
+ - **Accurate** — docs match the code (reuse this content, don't rewrite it)
325
+ 3. **In the exploration log**, add a section:
326
+
327
+ ```markdown
328
+ ## Existing Documentation
329
+ | Source | Status | Notes |
330
+ |--------|--------|-------|
331
+ | product_documentation/AUTH_DOC.md | Accurate | Matches current auth flow |
332
+ | product_documentation/API_DOC.md | Stale | 3 new endpoints not documented |
333
+ | (no existing doc) | Gap | RAG retrieval pipeline undocumented |
334
+ ```
335
+
336
+ 4. **In the Plan (Step 2)**, propose:
337
+ - **Update** for stale docs (specify what changed)
338
+ - **New** for gaps
339
+ - **Keep** for accurate docs (copy/adapt into vdocs/ format)
340
+
341
+ This avoids regenerating documentation that already exists and is correct.
@@ -5,12 +5,12 @@
5
5
  Follow the two-phase exploration strategy in `resources/exploration-strategies.md`:
6
6
 
7
7
  **Phase 1 — Fingerprint** (3-5 file reads max)
8
- Read package/config files and directory structure to identify the project's language, framework, and archetype (Web API, Frontend SPA, Full-stack, CLI, Library, Mobile, Data Pipeline, Monorepo, Microservices, or Infrastructure).
8
+ Read package/config files and directory structure to identify the project's language, framework, and archetype. Also check for existing documentation (`vdocs/`, `docs/`, `product_documentation/`, substantial `*.md` files). If found, read them first they're a head start. See the "Existing Documentation" section in `resources/exploration-strategies.md`.
9
9
 
10
10
  **Phase 2 — Targeted Exploration** (archetype-specific)
11
- Apply the matching archetype playbook from `resources/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature.
11
+ Apply the matching archetype playbook from `resources/exploration-strategies.md`. Read files in priority order using the glob patterns listed. Identify feature signals — each signal maps to a documentable feature. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
12
 
13
- If the project spans multiple archetypes (e.g., a monorepo with frontend + API), apply multiple playbooks. If no archetype matches, use the Fallback strategy and confirm with the user.
13
+ If no archetype matches, use the Fallback strategy and confirm with the user.
14
14
 
15
15
  Do not skim. Understand how the system actually works before proposing docs.
16
16