DocCoverage -- Documentation Coverage & Quality Analyzer
DocCoverage scans codebases for undocumented public functions, missing JSDoc/docstrings/godoc/Javadoc/YARD, incomplete parameter descriptions, outdated README sections, missing CHANGELOG entries, and documentation quality gaps. It uses regex-based pattern matching against 85+ documentation patterns across JS/TS, Python, Go, Java, and Ruby. Lefthook integration for git hooks, markdown coverage reports with doc quality scoring.
Commands
Free Tier (No license required)
doccoverage scan [file|directory]
One-shot documentation coverage scan of files or directories.
How to execute:
bash "<SKILL_DIR>/scripts/doccoverage.sh" scan [target]
What it does:
- Accepts a file path or directory (defaults to current directory)
- Auto-detects language from file extensions (JS/TS, Python, Go, Java, Ruby)
- Finds all source files with public/exported functions, classes, and types
- Runs 85+ documentation coverage patterns against each file
- Calculates a documentation coverage score (0-100) per file and overall
- Outputs findings with: file, line number, check ID, severity, description, recommendation
- Exit code 0 if passing (score >= 70), exit code 1 if issues found
- Free tier limited to 5 files per scan
Example usage scenarios:
- "Check my code for missing documentation" -> runs
doccoverage scan . - "Are my exported functions documented?" -> runs
doccoverage scan src/ - "Scan this file for missing JSDoc" -> runs
doccoverage scan src/utils.ts - "Check documentation coverage of my Python module" -> runs
doccoverage scan mymodule/
Pro Tier ($19/user/month -- requires DOCCOVERAGE_LICENSE_KEY)
doccoverage hooks install
Install git pre-commit hooks that scan staged files for documentation gaps before every commit.
How to execute:
bash "<SKILL_DIR>/scripts/doccoverage.sh" hooks install
What it does:
- Validates Pro+ license
- Copies lefthook config to project root
- Installs lefthook pre-commit hook
- On every commit: scans all staged files for missing documentation, blocks commit if critical/high findings, shows remediation advice
doccoverage hooks uninstall
Remove DocCoverage git hooks.
bash "<SKILL_DIR>/scripts/doccoverage.sh" hooks uninstall
doccoverage report [directory]
Generate a markdown documentation coverage report with findings, severity breakdown, and remediation steps.
bash "<SKILL_DIR>/scripts/doccoverage.sh" report [directory]
What it does:
- Validates Pro+ license
- Runs full scan of the directory
- Generates a formatted markdown report from template
- Includes per-file breakdowns, coverage scores, language-specific guidance
- Output suitable for documentation reviews and team standards audits
doccoverage coverage [directory]
Calculate documentation coverage percentage across the codebase.
bash "<SKILL_DIR>/scripts/doccoverage.sh" coverage [directory]
What it does:
- Validates Pro+ license
- Identifies all public/exported functions, classes, types, and interfaces
- Checks each for presence of documentation (JSDoc, docstring, godoc, etc.)
- Calculates per-file and overall documentation coverage percentages
- Reports coverage by language, by category, and overall
Team Tier ($39/user/month -- requires DOCCOVERAGE_LICENSE_KEY with team tier)
doccoverage policy [directory]
Enforce organization-specific documentation policies on codebases.
bash "<SKILL_DIR>/scripts/doccoverage.sh" policy [directory]
What it does:
- Validates Team+ license
- Loads custom policies from ~/.openclaw/openclaw.json (doccoverage.config.customPolicies)
- Enforces organization-specific rules (e.g., all public APIs must have @example, all @param must include type)
- Combines custom policies with built-in patterns for comprehensive scanning
- Outputs SARIF-compatible results
doccoverage sarif [directory]
Generate SARIF JSON output for CI/CD integration.
bash "<SKILL_DIR>/scripts/doccoverage.sh" sarif [directory]
What it does:
- Validates Team+ license
- Runs full scan of the directory
- Outputs findings in SARIF 2.1.0 JSON format
- Compatible with GitHub Code Scanning, Azure DevOps, and other SARIF consumers
doccoverage changelog [directory]
Verify CHANGELOG completeness and consistency.
bash "<SKILL_DIR>/scripts/doccoverage.sh" changelog [directory]
What it does:
- Validates Team+ license
- Scans CHANGELOG.md or HISTORY.md for completeness
- Checks for missing version entries, empty sections, broken date formats
- Verifies recent git tags have corresponding changelog entries
- Reports changelog health with specific remediation suggestions
doccoverage status
Show license and configuration information.
bash "<SKILL_DIR>/scripts/doccoverage.sh" status
Detected Documentation Gaps
DocCoverage detects 85+ documentation quality patterns across 6 categories:
| Category | Examples | Severity |
|---|---|---|
| Missing Function/Method Docs | Exported functions without JSDoc, public methods without docstrings, Go exported functions without godoc, Java public methods without Javadoc, Ruby public methods without YARD | Critical/High |
| Incomplete Documentation | JSDoc missing @param tags, docstrings missing Args section, @deprecated without replacement, missing @returns, generic placeholder docs | High/Medium |
| README & Project Docs | Missing README.md, README without installation section, missing CONTRIBUTING.md, missing LICENSE, outdated badges, empty README sections | High/Medium |
| API Documentation | REST endpoints without docs, GraphQL types without descriptions, OpenAPI missing descriptions, missing error response docs | High/Medium |
| Type & Interface Docs | Exported TypeScript interfaces without docs, enum values without descriptions, generic type parameters without docs | Medium/Low |
| Comment Quality | Obvious/redundant comments, commented-out code blocks, outdated comments, TODO without ticket reference, FIXME older than threshold | Medium/Low |
Configuration
Users can configure DocCoverage in ~/.openclaw/openclaw.json:
{
"skills": {
"entries": {
"doccoverage": {
"enabled": true,
"apiKey": "YOUR_LICENSE_KEY_HERE",
"config": {
"severityThreshold": "high",
"customPolicies": [],
"excludePatterns": ["**/test/**", "**/examples/**", "**/vendor/**"],
"reportFormat": "markdown"
}
}
}
}
}
Important Notes
- Free tier works immediately with no configuration
- All scanning happens locally -- no code is sent to external servers
- License validation is offline -- no phone-home or network calls
- Pattern matching only -- no AST parsing, no external dependencies
- Supports scanning multiple languages in a single pass
- Git hooks use lefthook which must be installed (see install metadata above)
- Exit codes: 0 = passing (score >= 70), 1 = issues found (for CI/CD integration)
- Scoring: critical=25, high=15, medium=8, low=3 point deductions from 100
Error Handling
- If lefthook is not installed and user tries
hooks install, prompt to install it - If license key is invalid or expired, show clear message with link to https://doccoverage.pages.dev/renew
- If a file is binary, skip it automatically with no warning
- If no scannable files found in target, report clean scan with info message
- If language cannot be determined from extension, skip the file gracefully
When to Use DocCoverage
The user might say things like:
- "Check my code for missing documentation"
- "Are my public functions documented?"
- "Scan for missing JSDoc comments"
- "What is the documentation coverage of my project?"
- "Check if my Python docstrings are complete"
- "Scan for undocumented exported functions"
- "Generate a documentation coverage report"
- "Set up pre-commit hooks for doc coverage"
- "Check my README for missing sections"
- "Verify my CHANGELOG is up to date"
- "Are there any TODO comments without ticket references?"
- "Find commented-out code in my project"
- "Check TypeScript interfaces for missing docs"