@sandrinio/vdoc 3.5.0 → 3.5.2

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/README.md CHANGED
@@ -11,9 +11,9 @@ One install command. Your AI handles the rest.
11
11
  vdoc teaches your AI coding agent how to create and maintain feature-centric documentation for your codebase. It's not a CLI you run — it's a skill file that gets installed into your AI platform. After install, you just talk to your AI.
12
12
 
13
13
  ```
14
- /vdoc init → AI explores codebase → proposes plan → you approve → generates docs
15
- /vdoc audit → AI detects stale, missing, dead docs → reports → patches
16
- "how does auth work?" → AI reads manifest routes to right doc → answers
14
+ /vdoc-init → AI explores codebase → proposes plan → you approve → generates docs
15
+ /vdoc-update → AI detects stale, missing, dead docs → reports → patches
16
+ /vdoc-create <feature> → AI documents one specific feature on demand
17
17
  ```
18
18
 
19
19
  ---
@@ -32,9 +32,9 @@ Then open Cursor and type: **`/vdoc init`**
32
32
 
33
33
  | Platform | Install Command | `/vdoc` Command | Invocation |
34
34
  |----------|----------------|----------------|------------|
35
- | **Claude Code** | `npx @sandrinio/vdoc install claude` | `/vdoc init` `/vdoc audit` | Skill (SKILL.md) |
35
+ | **Claude Code** | `npx @sandrinio/vdoc install claude` | `/vdoc-init` `/vdoc-update` `/vdoc-create` | Skills |
36
36
  | **Cursor** | `npx @sandrinio/vdoc install cursor` | `/vdoc init` `/vdoc audit` | Command + Rule |
37
- | **Windsurf** | `npx @sandrinio/vdoc install windsurf` | `/vdoc` | Workflow + Rule |
37
+ | **Windsurf** | `npx @sandrinio/vdoc install windsurf` | `/vdoc` | Workflow + Skill |
38
38
  | **VS Code (Copilot)** | `npx @sandrinio/vdoc install vscode` | `/vdoc` | Prompt + Instructions |
39
39
  | **Continue** | `npx @sandrinio/vdoc install continue` | `/vdoc init` `/vdoc audit` | Invokable Prompt + Rule |
40
40
  | **Cline** | `npx @sandrinio/vdoc install cline` | `/vdoc` | Workflow + Rule |
@@ -57,20 +57,20 @@ Copies skill files to your AI platform's rules and commands locations. That's it
57
57
 
58
58
  ### 2. Init
59
59
 
60
- Type **`/vdoc init`** in your AI tool (or say "document this project"). The skill tells the AI to:
60
+ Type **`/vdoc-init`** in your AI tool (or say "document this project"). The skill tells the AI to:
61
61
 
62
62
  1. **Explore** — identify features, tech stack, architecture
63
63
  2. **Plan** — propose a documentation plan for your approval
64
64
  3. **Generate** — create feature-centric docs using a consistent template
65
65
  4. **Index** — build a semantic manifest for future queries
66
66
 
67
- ### 3. Audit
67
+ ### 3. Update
68
68
 
69
- Type **`/vdoc audit`** (or say "audit docs"). The AI detects what changed via git, finds coverage gaps, flags dead docs, checks cross-references, reports everything, and patches only what you approve.
69
+ Type **`/vdoc-update`** (or say "update docs"). The AI detects what changed via git, finds coverage gaps, flags dead docs, checks cross-references, reports everything, and patches only what you approve.
70
70
 
71
- ### 4. Query
71
+ ### 4. Create
72
72
 
73
- Ask any question. The AI reads the manifest, routes to the right doc, and answers from documented knowledge.
73
+ Type **`/vdoc-create authentication system`** to document a single feature on demand. The AI locates the relevant source files, generates one doc, and updates the manifest.
74
74
 
75
75
  ---
76
76
 
@@ -78,14 +78,19 @@ Ask any question. The AI reads the manifest, routes to the right doc, and answer
78
78
 
79
79
  ```
80
80
  your-project/
81
- └── vdocs/
82
- ├── _manifest.json ← Semantic index (AI reads first)
83
- ├── _DOCUMENTATION_PLAN.md ← Approved plan (kept for reference)
84
- ├── PROJECT_OVERVIEW_DOC.md
85
- ├── AUTHENTICATION_DOC.md
86
- ├── API_REFERENCE_DOC.md
87
- ├── DATABASE_SCHEMA_DOC.md
88
- └── ...
81
+ ├── vdocs/
82
+ ├── _manifest.json ← Semantic index (AI reads first)
83
+ ├── PROJECT_OVERVIEW_DOC.md
84
+ ├── AUTHENTICATION_DOC.md
85
+ ├── API_REFERENCE_DOC.md
86
+ ├── DATABASE_SCHEMA_DOC.md
87
+ │ └── ...
88
+ └── .claude/skills/vdoc-config/ ← Planning artifacts (Claude example)
89
+ ├── _exploration_log.md ← What was scanned and why
90
+ ├── _DOCUMENTATION_PLAN.md ← Approved plan
91
+ └── references/
92
+ ├── doc-template.md ← Shared doc template
93
+ └── manifest-schema.json ← Shared manifest schema
89
94
  ```
90
95
 
91
96
  Docs are **feature-centric** — organized by what your system does, not by file paths.
@@ -138,7 +143,7 @@ Removes all vdoc skill and rule files from **every** supported platform in one c
138
143
 
139
144
  | Platform | Files Removed |
140
145
  |----------|--------------|
141
- | Claude Code | `.claude/skills/vdoc/` |
146
+ | Claude Code | `.claude/skills/vdoc-init/`, `vdoc-update/`, `vdoc-create/`, `vdoc-config/` |
142
147
  | Cursor | `.cursor/rules/vdoc.mdc`, `.cursor/commands/vdoc.md` |
143
148
  | Windsurf | `.windsurf/rules/vdoc.md`, `.windsurf/workflows/vdoc.md` |
144
149
  | VS Code (Copilot) | `.github/instructions/vdoc.instructions.md`, `.github/prompts/vdoc.prompt.md` |
@@ -166,4 +171,4 @@ None. Your AI coding agent is the runtime.
166
171
 
167
172
  ---
168
173
 
169
- *vdoc v3.0.0 — Documentation skills for AI coding agents*
174
+ *vdoc v3.5.0 — Documentation skills for AI coding agents*
package/bin/vdoc.mjs CHANGED
@@ -15,6 +15,7 @@ const PLATFORMS = {
15
15
  files: [
16
16
  { src: 'claude/vdoc-init.md', dest: '.claude/skills/vdoc-init/SKILL.md' },
17
17
  { src: 'claude/vdoc-update.md', dest: '.claude/skills/vdoc-update/SKILL.md' },
18
+ { src: 'claude/vdoc-audit.md', dest: '.claude/skills/vdoc-audit/SKILL.md' },
18
19
  { src: 'claude/vdoc-create.md', dest: '.claude/skills/vdoc-create/SKILL.md' },
19
20
  { src: 'claude/references/exploration-strategies.md', dest: '.claude/skills/vdoc-init/references/exploration-strategies.md' },
20
21
  { src: 'claude/references/doc-template.md', dest: '.claude/skills/vdoc-config/references/doc-template.md' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandrinio/vdoc",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "description": "Documentation skills for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -44,7 +44,7 @@ Read each doc's "Related Features" section. Verify that:
44
44
  Present a clear report:
45
45
 
46
46
  ```
47
- Audit Results:
47
+ Audit Report:
48
48
 
49
49
  STALE (source files changed):
50
50
  - AUTHENTICATION_DOC.md — src/lib/auth.ts changed (added GitHub provider)
@@ -68,7 +68,7 @@ Proceed with fixes?
68
68
 
69
69
  **Wait for user direction**, then:
70
70
  - Patch stale docs (re-read source files, update affected sections only)
71
- - Generate new docs for coverage gaps (use `/vdoc-init` workflow for each)
71
+ - Generate new docs for coverage gaps (use `/vdoc-create` for each)
72
72
  - Flag dead docs for user to confirm deletion
73
73
  - Fix cross-reference issues
74
74
  - Update manifest: bump versions, update `last_updated`, `last_commit`
@@ -1,28 +0,0 @@
1
- ---
2
- name: vdoc-config
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
- ---
5
-
6
- # vdoc — Documentation Query
7
-
8
- Answer questions about the codebase using existing documentation in `vdocs/`.
9
-
10
- ## Other Commands
11
-
12
- - **`/vdoc-init`** — Generate documentation from source code (explore → plan → generate)
13
- - **`/vdoc-audit`** — Audit docs for stale, missing, or dead entries
14
-
15
- ## How to Answer Questions
16
-
17
- 1. Read `vdocs/_manifest.json`
18
- 2. Match the question against `description` and `tags` fields
19
- 3. Read matching doc(s) from `vdocs/`
20
- 4. Answer from documented knowledge
21
- 5. If no match or no `vdocs/` folder, suggest running `/vdoc-init`
22
- 6. If docs seem outdated, suggest running `/vdoc-audit`
23
-
24
- ## Rules
25
-
26
- - Only answer from what's documented — do not hallucinate
27
- - Reference specific doc filenames in your answers
28
- - If the question spans multiple docs, read all relevant ones
@@ -1,65 +0,0 @@
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`
@@ -1,123 +0,0 @@
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. 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
-
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. Combine multiple playbooks when the project doesn't fit a single archetype (see "Composing Archetypes" in the strategies file).
12
-
13
- 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 (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
-
19
- **Phase 3 — Write Exploration Log**
20
- After exploring, write `.claude/skills/vdoc-config/_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 `.claude/skills/vdoc-config/_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. Read the template from `.claude/skills/vdoc-config/references/doc-template.md` and follow it 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 `.claude/skills/vdoc-config/references/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