@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.
- package/README.md +13 -13
- package/bin/vdoc.mjs +78 -9
- package/package.json +1 -1
- package/skills/agents/AGENTS.md +17 -143
- package/skills/agents/references/audit-workflow.md +65 -0
- package/skills/agents/references/doc-template.md +67 -0
- package/skills/agents/references/exploration-strategies.md +289 -0
- package/skills/agents/references/init-workflow.md +123 -0
- package/skills/agents/references/manifest-schema.json +16 -0
- package/skills/claude/SKILL.md +14 -198
- package/skills/claude/references/audit-workflow.md +65 -0
- package/skills/claude/references/exploration-strategies.md +289 -0
- package/skills/claude/references/init-workflow.md +123 -0
- package/skills/claude/vdoc-audit.md +80 -0
- package/skills/claude/vdoc-init.md +216 -0
- package/skills/cline/references/audit-workflow.md +65 -0
- package/skills/cline/references/doc-template.md +67 -0
- package/skills/cline/references/exploration-strategies.md +289 -0
- package/skills/cline/references/init-workflow.md +123 -0
- package/skills/cline/references/manifest-schema.json +16 -0
- package/skills/cline/vdoc-workflow.md +3 -13
- package/skills/cline/vdoc.md +10 -148
- package/skills/continue/references/audit-workflow.md +65 -0
- package/skills/continue/references/doc-template.md +67 -0
- package/skills/continue/references/exploration-strategies.md +289 -0
- package/skills/continue/references/init-workflow.md +123 -0
- package/skills/continue/references/manifest-schema.json +16 -0
- package/skills/continue/vdoc-command.md +3 -13
- package/skills/continue/vdoc.md +9 -147
- package/skills/cursor/RULE.md +68 -0
- package/skills/cursor/references/audit-workflow.md +65 -0
- package/skills/cursor/references/doc-template.md +67 -0
- package/skills/cursor/references/exploration-strategies.md +289 -0
- package/skills/cursor/references/init-workflow.md +123 -0
- package/skills/cursor/references/manifest-schema.json +16 -0
- package/skills/cursor/vdoc-command.md +3 -13
- package/skills/gemini/GEMINI.md +17 -143
- package/skills/gemini/references/audit-workflow.md +65 -0
- package/skills/gemini/references/doc-template.md +67 -0
- package/skills/gemini/references/exploration-strategies.md +289 -0
- package/skills/gemini/references/init-workflow.md +123 -0
- package/skills/gemini/references/manifest-schema.json +16 -0
- package/skills/gemini/vdoc.toml +3 -9
- package/skills/jetbrains-ai/references/audit-workflow.md +65 -0
- package/skills/jetbrains-ai/references/doc-template.md +67 -0
- package/skills/jetbrains-ai/references/exploration-strategies.md +289 -0
- package/skills/jetbrains-ai/references/init-workflow.md +123 -0
- package/skills/jetbrains-ai/references/manifest-schema.json +16 -0
- package/skills/jetbrains-ai/vdoc.md +17 -143
- package/skills/junie/guidelines.md +17 -143
- package/skills/junie/references/audit-workflow.md +65 -0
- package/skills/junie/references/doc-template.md +67 -0
- package/skills/junie/references/exploration-strategies.md +289 -0
- package/skills/junie/references/init-workflow.md +123 -0
- package/skills/junie/references/manifest-schema.json +16 -0
- package/skills/vscode/SKILL.md +39 -0
- package/skills/vscode/references/audit-workflow.md +65 -0
- package/skills/vscode/references/doc-template.md +67 -0
- package/skills/vscode/references/exploration-strategies.md +289 -0
- package/skills/vscode/references/init-workflow.md +123 -0
- package/skills/vscode/references/manifest-schema.json +16 -0
- package/skills/vscode/vdoc.instructions.md +30 -146
- package/skills/vscode/vdoc.prompt.md +5 -15
- package/skills/windsurf/SKILL.md +67 -0
- package/skills/windsurf/resources/audit-workflow.md +65 -0
- package/skills/windsurf/resources/doc-template.md +67 -0
- package/skills/windsurf/resources/exploration-strategies.md +289 -0
- package/skills/windsurf/resources/init-workflow.md +123 -0
- package/skills/windsurf/resources/manifest-schema.json +16 -0
- package/skills/windsurf/vdoc-workflow.md +3 -13
- package/skills/cursor/vdoc.mdc +0 -176
- package/skills/windsurf/vdoc.md +0 -94
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vdoc
|
|
3
|
+
description: "Use when user says /vdoc, 'document this project', 'audit docs', or asks questions about existing project documentation, stale docs, undocumented features, or documentation coverage gaps"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# vdoc — Documentation Generator
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Documentation must be feature-centric, plan-approved, and grounded in source code. Never generate docs from assumptions.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
- User says `/vdoc`, "document this project", "audit docs", or asks about documentation
|
|
14
|
+
- Docs are stale, missing, or out of sync with code (documentation drift, undocumented features, coverage gaps)
|
|
15
|
+
- After significant feature work that changed codebase behavior
|
|
16
|
+
|
|
17
|
+
## When NOT to Use
|
|
18
|
+
- API reference docs (use JSDoc/TSDoc)
|
|
19
|
+
- README files or contribution guides
|
|
20
|
+
- Inline code comments
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
Three modes: **init**, **audit**, **query**. All docs live in `vdocs/`. Manifest at `vdocs/_manifest.json` is the semantic index.
|
|
25
|
+
|
|
26
|
+
## Init (`/vdoc init`)
|
|
27
|
+
|
|
28
|
+
Read the detailed workflow at `resources/init-workflow.md`.
|
|
29
|
+
|
|
30
|
+
Summary: Explore codebase → Plan docs → User approves → Generate using template → Build manifest → Self-review.
|
|
31
|
+
|
|
32
|
+
## Audit (`/vdoc audit`)
|
|
33
|
+
|
|
34
|
+
Read the detailed workflow at `resources/audit-workflow.md`.
|
|
35
|
+
|
|
36
|
+
Summary: Read manifest → Detect stale/gaps/dead docs → Check cross-refs → Report → Patch with approval.
|
|
37
|
+
|
|
38
|
+
## Query (any documentation question)
|
|
39
|
+
|
|
40
|
+
1. Read `vdocs/_manifest.json`
|
|
41
|
+
2. Match question against `description` and `tags` fields
|
|
42
|
+
3. Read matching doc(s)
|
|
43
|
+
4. Answer from documented knowledge
|
|
44
|
+
5. If no match, suggest running an audit
|
|
45
|
+
|
|
46
|
+
## Rules
|
|
47
|
+
|
|
48
|
+
1. **Feature-centric, not file-centric.** One doc per logical feature, not per source file.
|
|
49
|
+
2. **Mermaid over prose.** Diagram flows. Max 7-9 nodes per diagram.
|
|
50
|
+
3. **Constraints are gold.** Always fill "Constraints & Decisions".
|
|
51
|
+
4. **Rich manifest descriptions.** Pack with specific terms for semantic routing.
|
|
52
|
+
5. **No hallucination.** Only document what exists in code.
|
|
53
|
+
6. **Plan first, always.** Never generate without user-approved plan.
|
|
54
|
+
|
|
55
|
+
## Common Mistakes
|
|
56
|
+
- **File-centric instead of feature-centric** — Don't create one doc per source file. Group by logical feature.
|
|
57
|
+
- **Documenting aspirations** — Only document what the code actually does today, not planned work.
|
|
58
|
+
- **Skipping the plan** — Generating without user approval leads to rework and coverage gaps.
|
|
59
|
+
- **Oversized diagrams** — Keep Mermaid to 7-9 nodes; split if larger.
|
|
60
|
+
- **Shallow constraints** — "Constraints & Decisions" is the most valuable section. Dig for non-obvious choices.
|
|
61
|
+
|
|
62
|
+
## Red Flags — STOP
|
|
63
|
+
- Generating docs without an approved plan
|
|
64
|
+
- Documenting something you haven't verified in source code
|
|
65
|
+
- Creating one doc per file instead of per feature
|
|
66
|
+
- Skipping Mermaid diagrams in "How It Works"
|
|
67
|
+
- Writing manifest descriptions too vague for semantic routing
|
|
@@ -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}*
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
# Exploration Strategies
|
|
2
|
+
|
|
3
|
+
Smart, targeted codebase exploration. Two phases: fingerprint the project, then follow the right archetype playbook.
|
|
4
|
+
|
|
5
|
+
## Phase 1 — Fingerprint
|
|
6
|
+
|
|
7
|
+
Read these high-signal files first (whichever exist) to classify the project. **3-5 reads max.**
|
|
8
|
+
|
|
9
|
+
### Package / Config Files (read 1-2)
|
|
10
|
+
|
|
11
|
+
| File | Ecosystem |
|
|
12
|
+
|------|-----------|
|
|
13
|
+
| `package.json` | Node.js / JavaScript / TypeScript |
|
|
14
|
+
| `pyproject.toml` / `setup.py` / `requirements.txt` | Python |
|
|
15
|
+
| `go.mod` | Go |
|
|
16
|
+
| `Cargo.toml` | Rust |
|
|
17
|
+
| `Gemfile` | Ruby |
|
|
18
|
+
| `pom.xml` / `build.gradle` | Java / Kotlin |
|
|
19
|
+
| `composer.json` | PHP |
|
|
20
|
+
| `*.csproj` / `*.sln` | .NET |
|
|
21
|
+
| `pubspec.yaml` | Dart / Flutter |
|
|
22
|
+
|
|
23
|
+
### Structure Scan
|
|
24
|
+
|
|
25
|
+
- List root directory
|
|
26
|
+
- List `src/` or `app/` or `lib/` (whichever exists)
|
|
27
|
+
|
|
28
|
+
### Entry Points (read 1-2)
|
|
29
|
+
|
|
30
|
+
- README.md (first 50 lines)
|
|
31
|
+
- Main entry file (e.g., `src/index.ts`, `main.py`, `cmd/main.go`)
|
|
32
|
+
|
|
33
|
+
### Determine
|
|
34
|
+
|
|
35
|
+
1. **Primary language(s)** and framework(s)
|
|
36
|
+
2. **Project archetype** — match to a playbook below
|
|
37
|
+
3. **Rough scope** — small (< 20 files), medium (20-100), large (100+)
|
|
38
|
+
|
|
39
|
+
If the project spans multiple archetypes (e.g., monorepo with frontend + API), apply multiple playbooks.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Phase 2 — Archetype Playbooks
|
|
44
|
+
|
|
45
|
+
Match the detected archetype and follow its playbook. Each defines:
|
|
46
|
+
- **Glob patterns** — files to read, in priority order
|
|
47
|
+
- **What to extract** — what each file category reveals
|
|
48
|
+
- **Feature signals** — patterns that indicate documentable features
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### Web API
|
|
53
|
+
|
|
54
|
+
**Signals:** Express, FastAPI, Django REST, Rails, Spring Boot, Gin, Actix, Phoenix, Hono, NestJS
|
|
55
|
+
|
|
56
|
+
| Priority | Glob Pattern | What to Extract |
|
|
57
|
+
|----------|-------------|-----------------|
|
|
58
|
+
| 1 | `**/routes/**`, `**/router.*`, `**/urls.py` | Endpoints, HTTP methods, URL structure |
|
|
59
|
+
| 2 | `**/middleware/**`, `**/middleware.*` | Auth, CORS, rate limiting, logging, error handling |
|
|
60
|
+
| 3 | `**/models/**`, `**/schema*`, `**/migrations/**` | Data model, entities, relationships |
|
|
61
|
+
| 4 | `**/controllers/**`, `**/handlers/**`, `**/views/**` | Business logic per endpoint |
|
|
62
|
+
| 5 | `**/services/**`, `**/lib/**` | Shared logic, external integrations |
|
|
63
|
+
| 6 | `**/config/**`, `.env*`, `**/settings*` | Environment config, feature flags |
|
|
64
|
+
| 7 | `**/tests/**` (skim 2-3) | What's tested reveals what matters |
|
|
65
|
+
|
|
66
|
+
**Feature signals:**
|
|
67
|
+
- Auth routes/middleware → Authentication doc
|
|
68
|
+
- Payment/billing routes → Payments doc
|
|
69
|
+
- File upload handlers → File Management doc
|
|
70
|
+
- WebSocket/SSE handlers → Real-time doc
|
|
71
|
+
- Background jobs/queues → Background Processing doc
|
|
72
|
+
- Email/notification services → Notifications doc
|
|
73
|
+
- Search endpoints → Search doc
|
|
74
|
+
- Admin routes → Admin Panel doc
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### Frontend SPA
|
|
79
|
+
|
|
80
|
+
**Signals:** React (CRA/Vite), Vue, Svelte, Angular, Solid
|
|
81
|
+
|
|
82
|
+
| Priority | Glob Pattern | What to Extract |
|
|
83
|
+
|----------|-------------|-----------------|
|
|
84
|
+
| 1 | `**/pages/**`, `**/views/**`, `**/routes*` | Page tree, routing structure |
|
|
85
|
+
| 2 | `**/store/**`, `**/context/**`, `**/state/**`, `**/*slice*` | State shape, data flow |
|
|
86
|
+
| 3 | `**/api/**`, `**/services/**`, `**/hooks/use*` | API integration, data fetching |
|
|
87
|
+
| 4 | `**/components/**` (skim top-level) | Component architecture, shared vs feature |
|
|
88
|
+
| 5 | `**/types/**`, `**/interfaces/**`, `**/*.d.ts` | Data contracts, shared types |
|
|
89
|
+
| 6 | `**/utils/**`, `**/helpers/**` | Shared utilities |
|
|
90
|
+
| 7 | `**/config/**`, `.env*` | Feature flags, API URLs, build config |
|
|
91
|
+
|
|
92
|
+
**Feature signals:**
|
|
93
|
+
- Auth context/store + login pages → Authentication doc
|
|
94
|
+
- Form components + validation → Forms doc
|
|
95
|
+
- Data tables with pagination → Data Display doc
|
|
96
|
+
- Charts/dashboards → Analytics doc
|
|
97
|
+
- Theming/i18n files → Theming / Internationalization doc
|
|
98
|
+
- File upload components → Media Management doc
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### Full-Stack Framework
|
|
103
|
+
|
|
104
|
+
**Signals:** Next.js, Nuxt, SvelteKit, Remix, RedwoodJS, Blitz, Astro (SSR)
|
|
105
|
+
|
|
106
|
+
| Priority | Glob Pattern | What to Extract |
|
|
107
|
+
|----------|-------------|-----------------|
|
|
108
|
+
| 1 | `**/app/**/page.*`, `**/pages/**`, `**/routes/**` | UI pages AND API routes — the router is the architecture |
|
|
109
|
+
| 2 | `**/api/**`, `**/server/**`, `**/actions/**` | Server-side logic, server actions |
|
|
110
|
+
| 3 | `**/models/**`, `**/schema*`, `**/prisma/**`, `**/drizzle/**` | Data layer, ORM config |
|
|
111
|
+
| 4 | `**/middleware.*`, `**/middleware/**` | Request pipeline, auth, redirects |
|
|
112
|
+
| 5 | `**/components/**` (skim top-level) | Shared UI components |
|
|
113
|
+
| 6 | `**/lib/**`, `**/utils/**`, `**/services/**` | Shared server + client utilities |
|
|
114
|
+
| 7 | `**/config/**`, `.env*`, `next.config.*`, `nuxt.config.*` | Framework and environment config |
|
|
115
|
+
|
|
116
|
+
**Feature signals:**
|
|
117
|
+
- All Web API signals + all Frontend SPA signals
|
|
118
|
+
- Server actions / mutations → Data Mutation doc
|
|
119
|
+
- ISR/SSG configuration → Rendering Strategy doc
|
|
120
|
+
- Edge functions / middleware → Edge Computing doc
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### CLI Tool
|
|
125
|
+
|
|
126
|
+
**Signals:** Commander, Yargs, Click, Typer, Cobra, Clap, oclif, Argparse
|
|
127
|
+
|
|
128
|
+
| Priority | Glob Pattern | What to Extract |
|
|
129
|
+
|----------|-------------|-----------------|
|
|
130
|
+
| 1 | `**/commands/**`, `**/cmd/**`, `**/cli.*` | Command tree, subcommands |
|
|
131
|
+
| 2 | Main entry (`bin/*`, `src/index.*`, `src/main.*`) | Argument parsing, top-level flow |
|
|
132
|
+
| 3 | `**/config*`, `**/*rc*`, `**/settings*` | Config file formats, defaults |
|
|
133
|
+
| 4 | `**/utils/**`, `**/lib/**`, `**/core/**` | Core logic behind commands |
|
|
134
|
+
| 5 | `**/output*`, `**/format*`, `**/display*` | Output formatting (JSON, table, etc.) |
|
|
135
|
+
| 6 | `**/templates/**`, `**/scaffolds/**` | Code generation templates |
|
|
136
|
+
|
|
137
|
+
**Feature signals:**
|
|
138
|
+
- Multiple subcommands → one doc per command group
|
|
139
|
+
- Config file handling → Configuration doc
|
|
140
|
+
- Plugin/extension system → Plugin Architecture doc
|
|
141
|
+
- Interactive prompts → User Interaction doc
|
|
142
|
+
- File I/O operations → File Processing doc
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### Library / SDK
|
|
147
|
+
|
|
148
|
+
**Signals:** Published package with `main`/`exports` in package.json, `lib/` with clear public API, type declarations
|
|
149
|
+
|
|
150
|
+
| Priority | Glob Pattern | What to Extract |
|
|
151
|
+
|----------|-------------|-----------------|
|
|
152
|
+
| 1 | Main export (`src/index.*`, `lib/index.*`, `__init__.py`) | Public API surface |
|
|
153
|
+
| 2 | `**/*.d.ts`, `**/types.*`, `**/interfaces.*` | Type contracts, input/output shapes |
|
|
154
|
+
| 3 | `**/core/**`, `**/lib/**` | Internal implementation |
|
|
155
|
+
| 4 | `**/utils/**`, `**/helpers/**` | Supporting utilities |
|
|
156
|
+
| 5 | `**/examples/**`, `**/demo/**` | Usage patterns |
|
|
157
|
+
| 6 | `**/plugins/**`, `**/adapters/**`, `**/providers/**` | Extension points |
|
|
158
|
+
| 7 | `**/tests/**` (skim 2-3) | Edge cases, expected behavior |
|
|
159
|
+
|
|
160
|
+
**Feature signals:**
|
|
161
|
+
- Multiple exported classes/functions → Core API doc
|
|
162
|
+
- Plugin/adapter pattern → Extension Architecture doc
|
|
163
|
+
- Multiple output formats → Serialization doc
|
|
164
|
+
- Caching layer → Performance doc
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### Mobile App
|
|
169
|
+
|
|
170
|
+
**Signals:** React Native, Flutter, SwiftUI, Jetpack Compose, Expo, Ionic, Capacitor
|
|
171
|
+
|
|
172
|
+
| Priority | Glob Pattern | What to Extract |
|
|
173
|
+
|----------|-------------|-----------------|
|
|
174
|
+
| 1 | `**/screens/**`, `**/pages/**`, `**/views/**` | Screen tree, navigation structure |
|
|
175
|
+
| 2 | `**/navigation/**`, `**/router*` | Navigation graph, deep linking |
|
|
176
|
+
| 3 | `**/store/**`, `**/state/**`, `**/providers/**` | State management, data flow |
|
|
177
|
+
| 4 | `**/api/**`, `**/services/**`, `**/network/**` | Backend communication, offline sync |
|
|
178
|
+
| 5 | `**/components/**` (skim) | Shared UI components |
|
|
179
|
+
| 6 | `**/native/**`, `**/platform/**`, `**/ios/**`, `**/android/**` | Platform-specific code, native modules |
|
|
180
|
+
| 7 | `**/assets/**` (list only) | Bundled resources |
|
|
181
|
+
|
|
182
|
+
**Feature signals:**
|
|
183
|
+
- Push notification setup → Notifications doc
|
|
184
|
+
- Camera/media access → Media Capture doc
|
|
185
|
+
- Offline storage (SQLite, Realm, AsyncStorage) → Data Persistence doc
|
|
186
|
+
- Deep linking / universal links → Navigation doc
|
|
187
|
+
- Platform-specific native modules → Platform Integration doc
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
### Data Pipeline / ML
|
|
192
|
+
|
|
193
|
+
**Signals:** Airflow, dbt, Prefect, Dagster, Luigi, Pandas, Spark, TensorFlow, PyTorch, scikit-learn, Jupyter notebooks
|
|
194
|
+
|
|
195
|
+
| Priority | Glob Pattern | What to Extract |
|
|
196
|
+
|----------|-------------|-----------------|
|
|
197
|
+
| 1 | `**/dags/**`, `**/pipelines/**`, `**/flows/**`, `**/workflows/**` | Pipeline definitions, DAGs, task graph |
|
|
198
|
+
| 2 | `**/models/**` (ML or dbt) | Model definitions, training logic or SQL transforms |
|
|
199
|
+
| 3 | `**/sources/**`, `**/extractors/**`, `**/connectors/**` | Data sources, ingestion logic |
|
|
200
|
+
| 4 | `**/transforms/**`, `**/processors/**` | Data transformation logic |
|
|
201
|
+
| 5 | `**/schemas/**`, `**/contracts/**` | Data contracts, validation |
|
|
202
|
+
| 6 | `**/notebooks/**`, `*.ipynb` | Exploratory analysis, experiments |
|
|
203
|
+
| 7 | `**/config/**`, `**/profiles*` | Connection strings, environment config |
|
|
204
|
+
|
|
205
|
+
**Feature signals:**
|
|
206
|
+
- Multiple DAGs/pipelines → one doc per pipeline
|
|
207
|
+
- ML model training → Model Training doc
|
|
208
|
+
- Feature engineering → Feature Store doc
|
|
209
|
+
- Data validation (Great Expectations, Pandera) → Data Quality doc
|
|
210
|
+
- Scheduled runs → Orchestration doc
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### Monorepo
|
|
215
|
+
|
|
216
|
+
**Signals:** Turborepo, Nx, Lerna, Rush, Bazel, pnpm workspaces — has `packages/`, `apps/`, or `workspace` config
|
|
217
|
+
|
|
218
|
+
| Priority | Glob Pattern | What to Extract |
|
|
219
|
+
|----------|-------------|-----------------|
|
|
220
|
+
| 1 | Root config (`turbo.json`, `nx.json`, `lerna.json`, `pnpm-workspace.yaml`) | Workspace structure, build pipeline |
|
|
221
|
+
| 2 | `packages/*/package.json` or `apps/*/package.json` | All packages/apps and their dependencies |
|
|
222
|
+
| 3 | `**/shared/**`, `**/common/**`, `**/core/**` | Shared packages that others depend on |
|
|
223
|
+
| 4 | Each app/package entry point (skim) | Purpose of each workspace member |
|
|
224
|
+
|
|
225
|
+
**Then apply the matching sub-archetype playbook** to each significant package/app (e.g., Web API for the backend, Frontend SPA for the frontend, Library for shared packages).
|
|
226
|
+
|
|
227
|
+
**Feature signals:**
|
|
228
|
+
- Shared packages → Shared Infrastructure doc
|
|
229
|
+
- Build/deploy pipeline → Build System doc
|
|
230
|
+
- Inter-package dependencies → Architecture Overview doc (dependency graph)
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
### Microservices
|
|
235
|
+
|
|
236
|
+
**Signals:** Docker Compose, Kubernetes manifests, multiple services with separate entry points, API gateway, service mesh
|
|
237
|
+
|
|
238
|
+
| Priority | Glob Pattern | What to Extract |
|
|
239
|
+
|----------|-------------|-----------------|
|
|
240
|
+
| 1 | `docker-compose*`, `**/k8s/**`, `**/helm/**`, `**/terraform/**` | Service topology, infrastructure |
|
|
241
|
+
| 2 | API gateway config, `**/gateway/**` | Routing, load balancing, auth gateway |
|
|
242
|
+
| 3 | Each service's entry point and routes (skim) | Service responsibilities, API surface |
|
|
243
|
+
| 4 | `**/proto/**`, `**/graphql/**`, `**/schemas/**` | Inter-service contracts (gRPC, GraphQL) |
|
|
244
|
+
| 5 | `**/queues/**`, `**/events/**`, `**/messaging/**` | Async communication, event bus |
|
|
245
|
+
| 6 | `**/shared/**`, `**/common/**` | Shared libraries across services |
|
|
246
|
+
|
|
247
|
+
**Then apply the Web API playbook** to each significant service.
|
|
248
|
+
|
|
249
|
+
**Feature signals:**
|
|
250
|
+
- Service discovery → Service Mesh doc
|
|
251
|
+
- Event-driven communication → Event Architecture doc
|
|
252
|
+
- Shared vs per-service database → Data Architecture doc
|
|
253
|
+
- Health checks / circuit breakers → Resilience doc
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### Infrastructure / IaC
|
|
258
|
+
|
|
259
|
+
**Signals:** Terraform, Pulumi, CloudFormation, Ansible, CDK, Serverless Framework
|
|
260
|
+
|
|
261
|
+
| Priority | Glob Pattern | What to Extract |
|
|
262
|
+
|----------|-------------|-----------------|
|
|
263
|
+
| 1 | `**/main.tf`, `**/stacks/**`, `**/lib/**` (CDK) | Resource definitions, stack structure |
|
|
264
|
+
| 2 | `**/variables*`, `**/inputs*`, `**/config*` | Parameterization, environment configs |
|
|
265
|
+
| 3 | `**/modules/**`, `**/constructs/**` | Reusable infrastructure modules |
|
|
266
|
+
| 4 | `**/environments/**`, `**/stages/**` | Environment-specific overrides |
|
|
267
|
+
| 5 | `**/outputs*`, `**/exports*` | Cross-stack references |
|
|
268
|
+
| 6 | CI/CD config (`.github/workflows/`, `Jenkinsfile`) | Deployment pipeline |
|
|
269
|
+
|
|
270
|
+
**Feature signals:**
|
|
271
|
+
- Networking (VPC, subnets, security groups) → Networking doc
|
|
272
|
+
- Compute (ECS, Lambda, EC2) → Compute Architecture doc
|
|
273
|
+
- Data stores (RDS, DynamoDB, S3) → Data Infrastructure doc
|
|
274
|
+
- CI/CD pipeline → Deployment Pipeline doc
|
|
275
|
+
- Monitoring (CloudWatch, Datadog) → Observability doc
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Fallback — Unknown Archetype
|
|
280
|
+
|
|
281
|
+
If the project doesn't clearly match any archetype:
|
|
282
|
+
|
|
283
|
+
1. List the root directory and `src/` (or equivalent)
|
|
284
|
+
2. Read the top 5 largest files by line count
|
|
285
|
+
3. Read any files with "main", "app", "server", "index", or "core" in the name
|
|
286
|
+
4. Check test files — they reveal what developers think is important
|
|
287
|
+
5. Check CI/CD config (`.github/workflows/`, `Jenkinsfile`) — pipeline steps reveal build/deploy architecture
|
|
288
|
+
|
|
289
|
+
Then propose an archetype to the user: *"This looks like a [X] project. I'll explore it using the [X] playbook. Sound right?"*
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Init Workflow
|
|
2
|
+
|
|
3
|
+
## Step 1 — Explore
|
|
4
|
+
|
|
5
|
+
Follow the two-phase exploration strategy in `resources/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 `resources/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 `resources/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 `resources/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,6 +1,6 @@
|
|
|
1
1
|
# /vdoc — Documentation Generator
|
|
2
2
|
|
|
3
|
-
Run documentation workflows for this project.
|
|
3
|
+
Run documentation workflows for this project.
|
|
4
4
|
|
|
5
5
|
## Steps
|
|
6
6
|
|
|
@@ -14,18 +14,8 @@ The user may also specify: `/vdoc init` or `/vdoc audit`.
|
|
|
14
14
|
|
|
15
15
|
### Step 2a: Init Mode
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
2. **Plan** — Create `vdocs/_DOCUMENTATION_PLAN.md` listing proposed docs. Present to user. Wait for approval.
|
|
19
|
-
3. **Generate** — For each doc, read ALL relevant source files. Write `vdocs/FEATURE_NAME_DOC.md` following the template in `.windsurf/rules/vdoc.md`.
|
|
20
|
-
4. **Manifest** — Create `vdocs/_manifest.json` with rich semantic descriptions.
|
|
21
|
-
5. **Verify** — Every doc has mermaid diagrams, real paths, 2+ constraints, cross-references.
|
|
17
|
+
Read and follow the workflow at `.windsurf/skills/vdoc/resources/init-workflow.md`. Use `.windsurf/skills/vdoc/resources/doc-template.md` as the doc template and `.windsurf/skills/vdoc/resources/manifest-schema.json` for the manifest format.
|
|
22
18
|
|
|
23
19
|
### Step 2b: Audit Mode
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
2. **Stale** — git diff since `last_updated`, cross-ref with each doc's "Key Files" section
|
|
27
|
-
3. **Gaps** — undocumented features (new routes, services, models)
|
|
28
|
-
4. **Dead** — docs referencing deleted files
|
|
29
|
-
5. **Cross-refs** — verify Related Features links
|
|
30
|
-
6. **Report** — present findings, wait for user direction
|
|
31
|
-
7. **Patch** — update stale, generate gaps, fix cross-refs, update manifest
|
|
21
|
+
Read and follow the workflow at `.windsurf/skills/vdoc/resources/audit-workflow.md`.
|