Quick health check for documentation issues. Verifies content against actual source files.
Run a quick audit of documentation health.
First, read .devdoc/context.json if it exists:
{
"product": { "name": "..." },
"terminology": {
"glossary": { "term": "definition" },
"avoidTerms": [{ "wrong": "...", "correct": "..." }],
"brandNames": { "ProductName": "ProductName" }
},
"api": { "style": "REST", "authentication": { "type": "api_key" } }
}
Use context for additional checks:
avoidTermsapi.conventionsFor each doc page, search for corresponding source files:
# For auth docs, find auth source
git ls-files | grep -iE "auth"
rg -l "export.*login" --type ts
# For API docs, find route handlers
git ls-files | grep -iE "(route|api|controller)"
Flag docs without verifiable sources:
⚠️ UNVERIFIED DOCS (no matching source files)
- docs/legacy/old-api.mdx - No source found
- docs/guides/advanced.mdx - No source found
Options:
1. 🔄 Remove these docs
2. ❓ Ask for source locations
3. 📝 Mark as needs-review
Read docs.json for docType field:
{ "docType": "api" } // "internal" | "api" | "product"
If not set, detect from structure:
architecture/, development/ → "internal"api-reference/, sdks/ → "api"features/, tutorials/ → "product"This helps tailor the checks:
avoidTermsbrandNamesproduct.nameapi.conventionsDocumentation Health Check
==========================
Context: Using .devdoc/context.json ✓
DocType: api
Summary: X issues found
## Critical Issues
### Broken Links (count)
file.mdx:line → /path (page not found)
### Missing Pages (count)
docs.json references 'page' but file not found
### Source Verification Failed (count)
docs/api/auth.mdx → No source file found
Searched: src/**/*auth*.ts, lib/**/*auth*.ts
Options:
1. 🔄 Remove doc
2. ❓ Ask for path
3. 📝 Mark as TODO
### Signature Mismatch (count)
docs/api/users.mdx → createUser signature wrong
Documented: createUser(name, email)
Source: createUser(options: CreateUserInput)
File: src/lib/users.ts:45
## Warnings
### Terminology Issues (count)
file.mdx:line → Uses "charge" instead of "payment"
### Brand Name Issues (count)
file.mdx:line → "productname" should be "ProductName"
### Outdated Code (count)
file.mdx:line → import { oldFunc } from 'pkg'
### Orphan Pages (count)
path/to/file.mdx (not in navigation)
## Passed
✓ All version numbers current
✓ All internal links resolve
✓ No syntax errors in code blocks
✓ Product name used consistently
✓ All docs have verified source files
For each documentation page:
# 1. Extract topic from doc path
# docs/api/auth.mdx → topic: "auth"
# 2. Search for source files
git ls-files | grep -iE "auth"
rg -l "export.*(login|authenticate)" --type ts
# 3. Read source and doc, compare:
# - Function signatures
# - Parameter types
# - Return types
# - Error codes
If source not found:
⚠️ UNVERIFIED: docs/api/auth.mdx
No source file found for authentication documentation.
Options:
1. 🔄 Auto-correct IA - Remove this doc
2. ✏️ Rename doc - Match what exists
3. 📝 Mark as TODO - Keep with warning
4. ❓ Ask for path - Where is it implemented?
href="/path")href="#section")avoidTerms usedAfter running check, common fixes: