@sandrinio/vdoc 3.0.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +13 -13
  2. package/bin/vdoc.mjs +78 -9
  3. package/package.json +1 -1
  4. package/skills/agents/AGENTS.md +17 -143
  5. package/skills/agents/references/audit-workflow.md +65 -0
  6. package/skills/agents/references/doc-template.md +67 -0
  7. package/skills/agents/references/exploration-strategies.md +289 -0
  8. package/skills/agents/references/init-workflow.md +123 -0
  9. package/skills/agents/references/manifest-schema.json +16 -0
  10. package/skills/claude/SKILL.md +14 -198
  11. package/skills/claude/references/audit-workflow.md +65 -0
  12. package/skills/claude/references/exploration-strategies.md +289 -0
  13. package/skills/claude/references/init-workflow.md +123 -0
  14. package/skills/claude/vdoc-audit.md +80 -0
  15. package/skills/claude/vdoc-init.md +216 -0
  16. package/skills/cline/references/audit-workflow.md +65 -0
  17. package/skills/cline/references/doc-template.md +67 -0
  18. package/skills/cline/references/exploration-strategies.md +289 -0
  19. package/skills/cline/references/init-workflow.md +123 -0
  20. package/skills/cline/references/manifest-schema.json +16 -0
  21. package/skills/cline/vdoc-workflow.md +3 -13
  22. package/skills/cline/vdoc.md +10 -148
  23. package/skills/continue/references/audit-workflow.md +65 -0
  24. package/skills/continue/references/doc-template.md +67 -0
  25. package/skills/continue/references/exploration-strategies.md +289 -0
  26. package/skills/continue/references/init-workflow.md +123 -0
  27. package/skills/continue/references/manifest-schema.json +16 -0
  28. package/skills/continue/vdoc-command.md +3 -13
  29. package/skills/continue/vdoc.md +9 -147
  30. package/skills/cursor/RULE.md +68 -0
  31. package/skills/cursor/references/audit-workflow.md +65 -0
  32. package/skills/cursor/references/doc-template.md +67 -0
  33. package/skills/cursor/references/exploration-strategies.md +289 -0
  34. package/skills/cursor/references/init-workflow.md +123 -0
  35. package/skills/cursor/references/manifest-schema.json +16 -0
  36. package/skills/cursor/vdoc-command.md +3 -13
  37. package/skills/gemini/GEMINI.md +17 -143
  38. package/skills/gemini/references/audit-workflow.md +65 -0
  39. package/skills/gemini/references/doc-template.md +67 -0
  40. package/skills/gemini/references/exploration-strategies.md +289 -0
  41. package/skills/gemini/references/init-workflow.md +123 -0
  42. package/skills/gemini/references/manifest-schema.json +16 -0
  43. package/skills/gemini/vdoc.toml +3 -9
  44. package/skills/jetbrains-ai/references/audit-workflow.md +65 -0
  45. package/skills/jetbrains-ai/references/doc-template.md +67 -0
  46. package/skills/jetbrains-ai/references/exploration-strategies.md +289 -0
  47. package/skills/jetbrains-ai/references/init-workflow.md +123 -0
  48. package/skills/jetbrains-ai/references/manifest-schema.json +16 -0
  49. package/skills/jetbrains-ai/vdoc.md +17 -143
  50. package/skills/junie/guidelines.md +17 -143
  51. package/skills/junie/references/audit-workflow.md +65 -0
  52. package/skills/junie/references/doc-template.md +67 -0
  53. package/skills/junie/references/exploration-strategies.md +289 -0
  54. package/skills/junie/references/init-workflow.md +123 -0
  55. package/skills/junie/references/manifest-schema.json +16 -0
  56. package/skills/vscode/SKILL.md +39 -0
  57. package/skills/vscode/references/audit-workflow.md +65 -0
  58. package/skills/vscode/references/doc-template.md +67 -0
  59. package/skills/vscode/references/exploration-strategies.md +289 -0
  60. package/skills/vscode/references/init-workflow.md +123 -0
  61. package/skills/vscode/references/manifest-schema.json +16 -0
  62. package/skills/vscode/vdoc.instructions.md +30 -146
  63. package/skills/vscode/vdoc.prompt.md +5 -15
  64. package/skills/windsurf/SKILL.md +67 -0
  65. package/skills/windsurf/resources/audit-workflow.md +65 -0
  66. package/skills/windsurf/resources/doc-template.md +67 -0
  67. package/skills/windsurf/resources/exploration-strategies.md +289 -0
  68. package/skills/windsurf/resources/init-workflow.md +123 -0
  69. package/skills/windsurf/resources/manifest-schema.json +16 -0
  70. package/skills/windsurf/vdoc-workflow.md +3 -13
  71. package/skills/cursor/vdoc.mdc +0 -176
  72. package/skills/windsurf/vdoc.md +0 -94
@@ -0,0 +1,123 @@
1
+ # Init Workflow
2
+
3
+ ## Step 1 — Explore
4
+
5
+ Follow the two-phase exploration strategy in `references/exploration-strategies.md`:
6
+
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).
9
+
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.
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.
14
+
15
+ Do not skim. Understand how the system actually works before proposing docs.
16
+
17
+ **Important:** Use your built-in file-reading tools 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
+
19
+ **Phase 3 — Write Exploration Log**
20
+ After exploring, write `vdocs/_exploration_log.md` documenting what you found:
21
+
22
+ ```markdown
23
+ # Exploration Log
24
+
25
+ ## Fingerprint
26
+ - **Language(s):** e.g., TypeScript, Python
27
+ - **Framework(s):** e.g., Next.js 14, FastAPI
28
+ - **Archetype(s):** e.g., Full-stack Framework
29
+ - **Scope:** e.g., ~85 files, medium
30
+
31
+ ## Files Read
32
+ | # | File | Why | What I Found |
33
+ |---|------|-----|--------------|
34
+ | 1 | package.json | Fingerprint | Next.js 14, Prisma, NextAuth |
35
+ | 2 | src/app/ (listing) | Page tree | 12 routes, 3 API routes |
36
+ | ... | ... | ... | ... |
37
+
38
+ ## Feature Signals Detected
39
+ | Signal | Source File(s) | Proposed Doc |
40
+ |--------|---------------|--------------|
41
+ | Auth middleware + login page | middleware.ts, app/login/page.tsx | AUTHENTICATION_DOC.md |
42
+ | Prisma schema with 8 models | prisma/schema.prisma | DATA_MODEL_DOC.md |
43
+ | ... | ... | ... |
44
+
45
+ ## Ambiguities / Open Questions
46
+ - Could not determine why Redis is in dependencies — no usage found. Ask user.
47
+ - Payments folder exists but appears incomplete / WIP.
48
+ ```
49
+
50
+ This log is your working memory. It feeds directly into Step 2 (Plan).
51
+
52
+ ## Step 2 — Plan
53
+
54
+ Create `vdocs/_DOCUMENTATION_PLAN.md` listing each proposed doc:
55
+
56
+ ```markdown
57
+ # Documentation Plan
58
+
59
+ ## Proposed Documents
60
+
61
+ 1. **PROJECT_OVERVIEW_DOC.md** — Tech stack, architecture, project structure, dev setup
62
+ 2. **AUTHENTICATION_DOC.md** — OAuth2 flow, JWT lifecycle, session management, RBAC
63
+ 3. **API_REFERENCE_DOC.md** — All endpoints, request/response shapes, error codes
64
+ ...
65
+
66
+ ## Notes
67
+ - Each doc covers one logical feature, not one file
68
+ - Docs should be useful for onboarding AND as AI context for planning changes
69
+ ```
70
+
71
+ Present the plan to the user. Actively suggest changes:
72
+ - "Should I merge X and Y into one doc?"
73
+ - "I found a websocket system — want that documented separately?"
74
+ - "Any internal/legacy systems I should skip?"
75
+
76
+ Wait for user approval before proceeding.
77
+
78
+ ## Step 3 — Generate
79
+
80
+ For each approved doc:
81
+
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 `.aiassistant/vdoc/doc-template.md` exactly
84
+ 3. Write to `vdocs/FEATURE_NAME_DOC.md`
85
+
86
+ **Writing rules:**
87
+
88
+ - **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.
89
+ - **Data Model** must show real entities from the code, not generic placeholders. Use mermaid ER diagrams for relational data, tables for simpler models.
90
+ - **Constraints & Decisions** is the most valuable section. Dig into the code for non-obvious choices: "Uses polling instead of websockets because...", "Auth tokens expire in 15min because...". If you can't find the reason, state the constraint and mark it: `Reason: unknown — verify with team`.
91
+ - **Related Features** must reference other docs by filename and explain the coupling: "Changes to the JWT schema will require updates to API_REFERENCE_DOC.md (auth middleware affects all endpoints)."
92
+ - **Configuration** must list actual env vars/secrets from the code, not hypothetical ones.
93
+ - **Error Handling** — trace what happens when things fail. What does the user see? What gets logged? Is there retry logic?
94
+
95
+ ## Step 4 — Manifest
96
+
97
+ Create `vdocs/_manifest.json` using the schema in `.aiassistant/vdoc/manifest-schema.json`.
98
+
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
+
101
+ Example:
102
+
103
+ ```json
104
+ {
105
+ "filepath": "AUTHENTICATION_DOC.md",
106
+ "title": "Authentication - OAuth2 & JWT",
107
+ "version": "1.0.0",
108
+ "description": "OAuth2 flow with Google/GitHub providers, JWT token lifecycle, session management via NextAuth.js, route protection middleware, and role-based access control.",
109
+ "tags": ["oauth2", "jwt", "session-management", "rbac"]
110
+ }
111
+ ```
112
+
113
+ ## Step 5 — Self-Review
114
+
115
+ Before finishing, verify:
116
+
117
+ - [ ] Every doc has at least one mermaid diagram in "How It Works"
118
+ - [ ] Every doc has at least 2 entries in "Constraints & Decisions"
119
+ - [ ] Every doc's "Key Files" lists real paths that exist in the codebase
120
+ - [ ] Every doc's "Configuration" lists actual env vars from the code
121
+ - [ ] Every doc's "Related Features" references other doc filenames
122
+ - [ ] Manifest `description` is detailed enough for semantic routing
123
+ - [ ] No doc is just a shallow restatement of file names — each explains WHY and HOW
@@ -0,0 +1,16 @@
1
+ {
2
+ "project": "<project-name>",
3
+ "vdoc_version": "3.0.0",
4
+ "created_at": "<ISO-8601>",
5
+ "last_updated": "<ISO-8601>",
6
+ "last_commit": "<short-sha>",
7
+ "documentation": [
8
+ {
9
+ "filepath": "FEATURE_NAME_DOC.md",
10
+ "title": "Human-Readable Feature Title",
11
+ "version": "1.0.0",
12
+ "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.",
13
+ "tags": ["keyword-1", "keyword-2"]
14
+ }
15
+ ]
16
+ }
@@ -1,164 +1,38 @@
1
1
  # vdoc — Documentation Generator
2
2
 
3
- You generate and maintain feature-centric documentation for codebases. You have three modes: **init**, **audit**, and **query**.
3
+ Documentation must be feature-centric, plan-approved, and grounded in source code. Never generate docs from assumptions.
4
4
 
5
- All documentation lives in `vdocs/` at the project root. The manifest at `vdocs/_manifest.json` is the semantic index you read first.
5
+ ## When to Use
6
+ - User says `/vdoc`, "document this project", "audit docs", or asks about documentation
7
+ - Docs are stale, missing, or out of sync with code
6
8
 
7
- ---
8
-
9
- ## Mode 1: Init
10
-
11
- **Trigger:** User says "document this project" or similar.
12
-
13
- ### Step 1 — Explore
14
-
15
- Read the codebase thoroughly. Identify:
16
-
17
- - **Tech stack**: languages, frameworks, databases, ORMs
18
- - **Features**: authentication, API, payments, notifications, search, etc.
19
- - **Architecture**: monolith vs microservices, frontend/backend split, key patterns
20
- - **Integrations**: third-party services (Stripe, AWS, Redis, etc.)
21
- - **Entry points**: where requests come in, how they flow through the system
22
-
23
- Do not skim. Read key files — entry points, config, routes, schemas, middleware.
24
-
25
- ### Step 2 — Plan
26
-
27
- Create `vdocs/_DOCUMENTATION_PLAN.md` listing each proposed doc with a one-line description. Present to user. Suggest merges, additions, or removals. Wait for approval.
28
-
29
- ### Step 3 — Generate
30
-
31
- For each approved doc, read ALL relevant source files and generate using this template:
32
-
33
- ```markdown
34
- # {Feature Title}
35
-
36
- > {One-line description}
37
-
38
- ---
39
-
40
- ## Overview
41
- {What it does, why it exists, how it fits in the system.}
42
-
43
- ---
44
-
45
- ## How It Works
46
- {Core logic and flow.}
47
- {Mermaid diagram(s) — max 7-9 nodes per diagram, split if larger.}
9
+ ## When NOT to Use
10
+ - API reference docs (use JSDoc/TSDoc), README files, inline code comments
48
11
 
49
12
  ---
50
13
 
51
- ## Data Model
52
- {Entities this feature owns. Mermaid ER diagram or table.}
14
+ You generate and maintain feature-centric documentation. Three modes: **init**, **audit**, **query**.
53
15
 
54
- ---
16
+ All docs live in `vdocs/`. The manifest at `vdocs/_manifest.json` is the semantic index you read first.
55
17
 
56
- ## Key Files
57
- | File | Purpose |
58
- |------|---------|
59
- | `src/path/file.ts` | What this file does |
18
+ ## Init (`/vdoc init`)
60
19
 
61
- ---
20
+ Read the detailed workflow at `.aiassistant/vdoc/init-workflow.md`.
62
21
 
63
- ## Dependencies & Integrations
64
- {External services, internal features, packages this relies on.}
22
+ Use the doc template at `.aiassistant/vdoc/doc-template.md`.
65
23
 
66
- ---
24
+ Use the manifest schema at `.aiassistant/vdoc/manifest-schema.json`.
67
25
 
68
- ## Configuration
69
- | Variable | Purpose | Required |
70
- |----------|---------|----------|
71
- | `ENV_VAR` | What it controls | Yes/No |
26
+ ## Audit (`/vdoc audit`)
72
27
 
73
- ---
28
+ Read the detailed workflow at `.aiassistant/vdoc/audit-workflow.md`.
74
29
 
75
- ## Error Handling
76
- {Failure modes, what the user sees, retry logic. Mermaid diagram if non-trivial.}
77
-
78
- ---
79
-
80
- ## Constraints & Decisions
81
- {Why it's built this way. What you CANNOT change without breaking things.}
82
-
83
- ---
84
-
85
- ## Related Features
86
- {Cross-references to other docs by filename. Blast radius notes.}
87
-
88
- ---
89
-
90
- *Generated by vdoc v3.0.0 • Last updated: {timestamp}*
91
- ```
92
-
93
- **Writing rules:**
94
-
95
- - **Mermaid diagrams are mandatory** in "How It Works". Max 7-9 nodes — split larger flows.
96
- - **Data Model** must show real entities from the code, not placeholders.
97
- - **Constraints & Decisions** is the most valuable section. Dig for non-obvious choices. If unclear, write: `Reason: unknown — verify with team`.
98
- - **Related Features** must reference other doc filenames and explain coupling.
99
- - **Configuration** must list actual env vars from the code.
100
- - **Error Handling** — trace what happens when things fail.
101
-
102
- ### Step 4 — Manifest
103
-
104
- Create `vdocs/_manifest.json`:
105
-
106
- ```json
107
- {
108
- "project": "<project-name>",
109
- "vdoc_version": "3.0.0",
110
- "created_at": "<ISO-8601>",
111
- "last_updated": "<ISO-8601>",
112
- "last_commit": "<short-sha>",
113
- "documentation": [
114
- {
115
- "filepath": "FEATURE_NAME_DOC.md",
116
- "title": "Human-Readable Title",
117
- "version": "1.0.0",
118
- "description": "Rich semantic description with technology names, patterns, concepts. Detailed enough for AI to route questions to this doc.",
119
- "tags": ["keyword-tag"]
120
- }
121
- ]
122
- }
123
- ```
124
-
125
- ### Step 5 — Self-Review
126
-
127
- Verify: every doc has mermaid diagrams, at least 2 constraints, real file paths, actual env vars, cross-references. Manifest descriptions are detailed for semantic routing. No hallucinated content.
128
-
129
- ---
130
-
131
- ## Mode 2: Audit
132
-
133
- **Trigger:** User says "audit docs" or similar.
134
-
135
- 1. **Read manifest** — load `vdocs/_manifest.json`
136
- 2. **Detect stale** — `git diff` or `git log --name-only --since="<last_updated>"` to find changed source files. Cross-reference with each doc's "Key Files" section.
137
- 3. **Detect gaps** — scan codebase for significant source files not covered by any doc (new routes, services, models, config).
138
- 4. **Detect dead docs** — check each doc's "Key Files" against filesystem. Flag docs referencing deleted files.
139
- 5. **Check cross-refs** — verify "Related Features" links still exist and coupling is accurate.
140
- 6. **Report** — present stale, gaps, dead, cross-ref issues, and current docs. Wait for user direction.
141
- 7. **Patch** — update stale docs, generate new docs for gaps, flag dead docs, fix cross-refs. Update manifest.
142
-
143
- ---
144
-
145
- ## Mode 3: Query
146
-
147
- **Trigger:** User asks any question about the codebase or documentation.
30
+ ## Query (any documentation question)
148
31
 
149
32
  1. Read `vdocs/_manifest.json`
150
33
  2. Match question against `description` and `tags` fields
151
- 3. Read matching doc(s)
152
- 4. Answer from documented knowledge
153
- 5. If no match, suggest running an audit
154
-
155
- ---
156
-
157
- ## Naming Convention
158
-
159
- Files: `FEATURE_NAME_DOC.md` — uppercase, feature-named, `_DOC` suffix.
160
-
161
- ---
34
+ 3. Read matching doc(s) and answer from documented knowledge
35
+ 4. If no match, suggest running an audit
162
36
 
163
37
  ## Rules
164
38
 
@@ -2,165 +2,39 @@
2
2
 
3
3
  # vdoc — Documentation Generator
4
4
 
5
- You generate and maintain feature-centric documentation for codebases. You have three modes: **init**, **audit**, and **query**.
5
+ Documentation must be feature-centric, plan-approved, and grounded in source code. Never generate docs from assumptions.
6
6
 
7
- All documentation lives in `vdocs/` at the project root. The manifest at `vdocs/_manifest.json` is the semantic index you read first.
7
+ ## When to Use
8
+ - User says `/vdoc`, "document this project", "audit docs", or asks about documentation
9
+ - Docs are stale, missing, or out of sync with code
8
10
 
9
- ---
10
-
11
- ## Mode 1: Init
12
-
13
- **Trigger:** User says "document this project" or similar.
14
-
15
- ### Step 1 — Explore
16
-
17
- Read the codebase thoroughly. Identify:
18
-
19
- - **Tech stack**: languages, frameworks, databases, ORMs
20
- - **Features**: authentication, API, payments, notifications, search, etc.
21
- - **Architecture**: monolith vs microservices, frontend/backend split, key patterns
22
- - **Integrations**: third-party services (Stripe, AWS, Redis, etc.)
23
- - **Entry points**: where requests come in, how they flow through the system
24
-
25
- Do not skim. Read key files — entry points, config, routes, schemas, middleware.
26
-
27
- ### Step 2 — Plan
28
-
29
- Create `vdocs/_DOCUMENTATION_PLAN.md` listing each proposed doc with a one-line description. Present to user. Suggest merges, additions, or removals. Wait for approval.
30
-
31
- ### Step 3 — Generate
32
-
33
- For each approved doc, read ALL relevant source files and generate using this template:
34
-
35
- ```markdown
36
- # {Feature Title}
37
-
38
- > {One-line description}
39
-
40
- ---
41
-
42
- ## Overview
43
- {What it does, why it exists, how it fits in the system.}
44
-
45
- ---
46
-
47
- ## How It Works
48
- {Core logic and flow.}
49
- {Mermaid diagram(s) — max 7-9 nodes per diagram, split if larger.}
11
+ ## When NOT to Use
12
+ - API reference docs (use JSDoc/TSDoc), README files, inline code comments
50
13
 
51
14
  ---
52
15
 
53
- ## Data Model
54
- {Entities this feature owns. Mermaid ER diagram or table.}
16
+ You generate and maintain feature-centric documentation. Three modes: **init**, **audit**, **query**.
55
17
 
56
- ---
18
+ All docs live in `vdocs/`. The manifest at `vdocs/_manifest.json` is the semantic index you read first.
57
19
 
58
- ## Key Files
59
- | File | Purpose |
60
- |------|---------|
61
- | `src/path/file.ts` | What this file does |
20
+ ## Init (`/vdoc init`)
62
21
 
63
- ---
22
+ Read the detailed workflow at `.junie/vdoc/init-workflow.md`.
64
23
 
65
- ## Dependencies & Integrations
66
- {External services, internal features, packages this relies on.}
24
+ Use the doc template at `.junie/vdoc/doc-template.md`.
67
25
 
68
- ---
26
+ Use the manifest schema at `.junie/vdoc/manifest-schema.json`.
69
27
 
70
- ## Configuration
71
- | Variable | Purpose | Required |
72
- |----------|---------|----------|
73
- | `ENV_VAR` | What it controls | Yes/No |
28
+ ## Audit (`/vdoc audit`)
74
29
 
75
- ---
30
+ Read the detailed workflow at `.junie/vdoc/audit-workflow.md`.
76
31
 
77
- ## Error Handling
78
- {Failure modes, what the user sees, retry logic. Mermaid diagram if non-trivial.}
79
-
80
- ---
81
-
82
- ## Constraints & Decisions
83
- {Why it's built this way. What you CANNOT change without breaking things.}
84
-
85
- ---
86
-
87
- ## Related Features
88
- {Cross-references to other docs by filename. Blast radius notes.}
89
-
90
- ---
91
-
92
- *Generated by vdoc v3.0.0 • Last updated: {timestamp}*
93
- ```
94
-
95
- **Writing rules:**
96
-
97
- - **Mermaid diagrams are mandatory** in "How It Works". Max 7-9 nodes — split larger flows.
98
- - **Data Model** must show real entities from the code, not placeholders.
99
- - **Constraints & Decisions** is the most valuable section. Dig for non-obvious choices. If unclear, write: `Reason: unknown — verify with team`.
100
- - **Related Features** must reference other doc filenames and explain coupling.
101
- - **Configuration** must list actual env vars from the code.
102
- - **Error Handling** — trace what happens when things fail.
103
-
104
- ### Step 4 — Manifest
105
-
106
- Create `vdocs/_manifest.json`:
107
-
108
- ```json
109
- {
110
- "project": "<project-name>",
111
- "vdoc_version": "3.0.0",
112
- "created_at": "<ISO-8601>",
113
- "last_updated": "<ISO-8601>",
114
- "last_commit": "<short-sha>",
115
- "documentation": [
116
- {
117
- "filepath": "FEATURE_NAME_DOC.md",
118
- "title": "Human-Readable Title",
119
- "version": "1.0.0",
120
- "description": "Rich semantic description with technology names, patterns, concepts. Detailed enough for AI to route questions to this doc.",
121
- "tags": ["keyword-tag"]
122
- }
123
- ]
124
- }
125
- ```
126
-
127
- ### Step 5 — Self-Review
128
-
129
- Verify: every doc has mermaid diagrams, at least 2 constraints, real file paths, actual env vars, cross-references. Manifest descriptions are detailed for semantic routing. No hallucinated content.
130
-
131
- ---
132
-
133
- ## Mode 2: Audit
134
-
135
- **Trigger:** User says "audit docs" or similar.
136
-
137
- 1. **Read manifest** — load `vdocs/_manifest.json`
138
- 2. **Detect stale** — `git diff` or `git log --name-only --since="<last_updated>"` to find changed source files. Cross-reference with each doc's "Key Files" section.
139
- 3. **Detect gaps** — scan codebase for significant source files not covered by any doc (new routes, services, models, config).
140
- 4. **Detect dead docs** — check each doc's "Key Files" against filesystem. Flag docs referencing deleted files.
141
- 5. **Check cross-refs** — verify "Related Features" links still exist and coupling is accurate.
142
- 6. **Report** — present stale, gaps, dead, cross-ref issues, and current docs. Wait for user direction.
143
- 7. **Patch** — update stale docs, generate new docs for gaps, flag dead docs, fix cross-refs. Update manifest.
144
-
145
- ---
146
-
147
- ## Mode 3: Query
148
-
149
- **Trigger:** User asks any question about the codebase or documentation.
32
+ ## Query (any documentation question)
150
33
 
151
34
  1. Read `vdocs/_manifest.json`
152
35
  2. Match question against `description` and `tags` fields
153
- 3. Read matching doc(s)
154
- 4. Answer from documented knowledge
155
- 5. If no match, suggest running an audit
156
-
157
- ---
158
-
159
- ## Naming Convention
160
-
161
- Files: `FEATURE_NAME_DOC.md` — uppercase, feature-named, `_DOC` suffix.
162
-
163
- ---
36
+ 3. Read matching doc(s) and answer from documented knowledge
37
+ 4. If no match, suggest running an audit
164
38
 
165
39
  ## Rules
166
40
 
@@ -0,0 +1,65 @@
1
+ # Audit Workflow
2
+
3
+ ## Step 1 — Read Current State
4
+
5
+ Read `vdocs/_manifest.json`. Load the list of documented features and their metadata.
6
+
7
+ ## Step 2 — Detect Stale Docs
8
+
9
+ 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.
10
+
11
+ Cross-reference changed files against each doc's "Key Files" section to identify which docs are stale.
12
+
13
+ ## Step 3 — Detect Coverage Gaps
14
+
15
+ Scan the codebase for significant features not covered by any doc. Look for:
16
+ - New route files / API endpoints
17
+ - New service classes or modules
18
+ - New database models / schema changes
19
+ - New configuration or infrastructure files
20
+
21
+ If you find undocumented features, propose new docs.
22
+
23
+ ## Step 4 — Detect Dead Docs
24
+
25
+ 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?"
26
+
27
+ ## Step 5 — Check Cross-References
28
+
29
+ Read each doc's "Related Features" section. Verify that:
30
+ - Referenced doc filenames still exist
31
+ - The described coupling is still accurate (skim the relevant code)
32
+
33
+ ## Step 6 — Report
34
+
35
+ Present a clear report:
36
+
37
+ ```
38
+ Audit Results:
39
+
40
+ STALE (source files changed):
41
+ - AUTHENTICATION_DOC.md — src/lib/auth.ts changed (added GitHub provider)
42
+ - API_REFERENCE_DOC.md — 2 new endpoints added
43
+
44
+ COVERAGE GAPS (undocumented features):
45
+ - src/services/notification.ts — no doc covers notifications
46
+
47
+ DEAD DOCS (source files removed):
48
+ - LEGACY_ADMIN_DOC.md — all 4 source files deleted
49
+
50
+ CROSS-REF ISSUES:
51
+ - AUTHENTICATION_DOC.md references BILLING_DOC.md which no longer exists
52
+
53
+ CURRENT (no changes needed):
54
+ - DATABASE_SCHEMA_DOC.md
55
+ - PROJECT_OVERVIEW_DOC.md
56
+
57
+ Proceed with fixes?
58
+ ```
59
+
60
+ Wait for user direction, then:
61
+ - Patch stale docs (re-read source files, update affected sections only)
62
+ - Generate new docs for coverage gaps (follow init workflow for each)
63
+ - Flag dead docs for user to confirm deletion
64
+ - Fix cross-reference issues
65
+ - Update manifest: bump versions, update `last_updated`, `last_commit`
@@ -0,0 +1,67 @@
1
+ # {Feature Title}
2
+
3
+ > {One-line description of what this covers}
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ {What it does, why it exists, how it fits in the system.}
10
+
11
+ ---
12
+
13
+ ## How It Works
14
+
15
+ {Core logic and flow.}
16
+
17
+ {Mermaid diagram(s) — max 7-9 nodes per diagram, split into multiple if larger.}
18
+
19
+ ---
20
+
21
+ ## Data Model
22
+
23
+ {Entities this feature owns and their relationships. Mermaid ER diagram or table.}
24
+
25
+ ---
26
+
27
+ ## Key Files
28
+
29
+ | File | Purpose |
30
+ |------|---------|
31
+ | `src/path/file.ts` | What this file does |
32
+
33
+ ---
34
+
35
+ ## Dependencies & Integrations
36
+
37
+ {External services, internal features, packages this relies on.}
38
+
39
+ ---
40
+
41
+ ## Configuration
42
+
43
+ | Variable | Purpose | Required |
44
+ |----------|---------|----------|
45
+ | `ENV_VAR` | What it controls | Yes/No |
46
+
47
+ ---
48
+
49
+ ## Error Handling
50
+
51
+ {Failure modes, what the user sees, retry logic. Mermaid diagram if the error flow is non-trivial.}
52
+
53
+ ---
54
+
55
+ ## Constraints & Decisions
56
+
57
+ {Why it's built this way. What you CANNOT change without breaking things.}
58
+
59
+ ---
60
+
61
+ ## Related Features
62
+
63
+ {Cross-references to other docs by filename. Blast radius — what breaks if this changes.}
64
+
65
+ ---
66
+
67
+ *Generated by vdoc v3.0.0 • Last updated: {timestamp}*