/install doccoverage
\r \r
DocCoverage -- Documentation Coverage & Quality Analyzer\r
\r 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.\r \r
Commands\r
\r
Free Tier (No license required)\r
\r
doccoverage scan [file|directory]\r
One-shot documentation coverage scan of files or directories.\r \r How to execute:\r
bash "\x3CSKILL_DIR>/scripts/doccoverage.sh" scan [target]\r
```\r
\r
**What it does:**\r
1. Accepts a file path or directory (defaults to current directory)\r
2. Auto-detects language from file extensions (JS/TS, Python, Go, Java, Ruby)\r
3. Finds all source files with public/exported functions, classes, and types\r
4. Runs 85+ documentation coverage patterns against each file\r
5. Calculates a documentation coverage score (0-100) per file and overall\r
6. Outputs findings with: file, line number, check ID, severity, description, recommendation\r
7. Exit code 0 if passing (score >= 70), exit code 1 if issues found\r
8. Free tier limited to 5 files per scan\r
\r
**Example usage scenarios:**\r
- "Check my code for missing documentation" -> runs `doccoverage scan .`\r
- "Are my exported functions documented?" -> runs `doccoverage scan src/`\r
- "Scan this file for missing JSDoc" -> runs `doccoverage scan src/utils.ts`\r
- "Check documentation coverage of my Python module" -> runs `doccoverage scan mymodule/`\r
\r
### Pro Tier ($19/user/month -- requires DOCCOVERAGE_LICENSE_KEY)\r
\r
#### `doccoverage hooks install`\r
Install git pre-commit hooks that scan staged files for documentation gaps before every commit.\r
\r
**How to execute:**\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/doccoverage.sh" hooks install\r
```\r
\r
**What it does:**\r
1. Validates Pro+ license\r
2. Copies lefthook config to project root\r
3. Installs lefthook pre-commit hook\r
4. On every commit: scans all staged files for missing documentation, blocks commit if critical/high findings, shows remediation advice\r
\r
#### `doccoverage hooks uninstall`\r
Remove DocCoverage git hooks.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/doccoverage.sh" hooks uninstall\r
```\r
\r
#### `doccoverage report [directory]`\r
Generate a markdown documentation coverage report with findings, severity breakdown, and remediation steps.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/doccoverage.sh" report [directory]\r
```\r
\r
**What it does:**\r
1. Validates Pro+ license\r
2. Runs full scan of the directory\r
3. Generates a formatted markdown report from template\r
4. Includes per-file breakdowns, coverage scores, language-specific guidance\r
5. Output suitable for documentation reviews and team standards audits\r
\r
#### `doccoverage coverage [directory]`\r
Calculate documentation coverage percentage across the codebase.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/doccoverage.sh" coverage [directory]\r
```\r
\r
**What it does:**\r
1. Validates Pro+ license\r
2. Identifies all public/exported functions, classes, types, and interfaces\r
3. Checks each for presence of documentation (JSDoc, docstring, godoc, etc.)\r
4. Calculates per-file and overall documentation coverage percentages\r
5. Reports coverage by language, by category, and overall\r
\r
### Team Tier ($39/user/month -- requires DOCCOVERAGE_LICENSE_KEY with team tier)\r
\r
#### `doccoverage policy [directory]`\r
Enforce organization-specific documentation policies on codebases.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/doccoverage.sh" policy [directory]\r
```\r
\r
**What it does:**\r
1. Validates Team+ license\r
2. Loads custom policies from ~/.openclaw/openclaw.json (doccoverage.config.customPolicies)\r
3. Enforces organization-specific rules (e.g., all public APIs must have @example, all @param must include type)\r
4. Combines custom policies with built-in patterns for comprehensive scanning\r
5. Outputs SARIF-compatible results\r
\r
#### `doccoverage sarif [directory]`\r
Generate SARIF JSON output for CI/CD integration.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/doccoverage.sh" sarif [directory]\r
```\r
\r
**What it does:**\r
1. Validates Team+ license\r
2. Runs full scan of the directory\r
3. Outputs findings in SARIF 2.1.0 JSON format\r
4. Compatible with GitHub Code Scanning, Azure DevOps, and other SARIF consumers\r
\r
#### `doccoverage changelog [directory]`\r
Verify CHANGELOG completeness and consistency.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/doccoverage.sh" changelog [directory]\r
```\r
\r
**What it does:**\r
1. Validates Team+ license\r
2. Scans CHANGELOG.md or HISTORY.md for completeness\r
3. Checks for missing version entries, empty sections, broken date formats\r
4. Verifies recent git tags have corresponding changelog entries\r
5. Reports changelog health with specific remediation suggestions\r
\r
#### `doccoverage status`\r
Show license and configuration information.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/doccoverage.sh" status\r
```\r
\r
## Detected Documentation Gaps\r
\r
DocCoverage detects 85+ documentation quality patterns across 6 categories:\r
\r
| Category | Examples | Severity |\r
|----------|----------|----------|\r
| **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 |\r
| **Incomplete Documentation** | JSDoc missing @param tags, docstrings missing Args section, @deprecated without replacement, missing @returns, generic placeholder docs | High/Medium |\r
| **README & Project Docs** | Missing README.md, README without installation section, missing CONTRIBUTING.md, missing LICENSE, outdated badges, empty README sections | High/Medium |\r
| **API Documentation** | REST endpoints without docs, GraphQL types without descriptions, OpenAPI missing descriptions, missing error response docs | High/Medium |\r
| **Type & Interface Docs** | Exported TypeScript interfaces without docs, enum values without descriptions, generic type parameters without docs | Medium/Low |\r
| **Comment Quality** | Obvious/redundant comments, commented-out code blocks, outdated comments, TODO without ticket reference, FIXME older than threshold | Medium/Low |\r
\r
## Configuration\r
\r
Users can configure DocCoverage in `~/.openclaw/openclaw.json`:\r
\r
```json\r
{\r
"skills": {\r
"entries": {\r
"doccoverage": {\r
"enabled": true,\r
"apiKey": "YOUR_LICENSE_KEY_HERE",\r
"config": {\r
"severityThreshold": "high",\r
"customPolicies": [],\r
"excludePatterns": ["**/test/**", "**/examples/**", "**/vendor/**"],\r
"reportFormat": "markdown"\r
}\r
}\r
}\r
}\r
}\r
```\r
\r
## Important Notes\r
\r
- **Free tier** works immediately with no configuration\r
- **All scanning happens locally** -- no code is sent to external servers\r
- **License validation is offline** -- no phone-home or network calls\r
- Pattern matching only -- no AST parsing, no external dependencies\r
- Supports scanning multiple languages in a single pass\r
- Git hooks use **lefthook** which must be installed (see install metadata above)\r
- Exit codes: 0 = passing (score >= 70), 1 = issues found (for CI/CD integration)\r
- Scoring: critical=25, high=15, medium=8, low=3 point deductions from 100\r
\r
## Error Handling\r
\r
- If lefthook is not installed and user tries `hooks install`, prompt to install it\r
- If license key is invalid or expired, show clear message with link to https://doccoverage.pages.dev/renew\r
- If a file is binary, skip it automatically with no warning\r
- If no scannable files found in target, report clean scan with info message\r
- If language cannot be determined from extension, skip the file gracefully\r
\r
## When to Use DocCoverage\r
\r
The user might say things like:\r
- "Check my code for missing documentation"\r
- "Are my public functions documented?"\r
- "Scan for missing JSDoc comments"\r
- "What is the documentation coverage of my project?"\r
- "Check if my Python docstrings are complete"\r
- "Scan for undocumented exported functions"\r
- "Generate a documentation coverage report"\r
- "Set up pre-commit hooks for doc coverage"\r
- "Check my README for missing sections"\r
- "Verify my CHANGELOG is up to date"\r
- "Are there any TODO comments without ticket references?"\r
- "Find commented-out code in my project"\r
- "Check TypeScript interfaces for missing docs"\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install doccoverage - 安装完成后,直接呼叫该 Skill 的名称或使用
/doccoverage触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
doccoverage 是什么?
Documentation coverage & quality analyzer — detects undocumented public functions, missing JSDoc/docstrings/godoc/Javadoc, incomplete parameter descriptions,... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 92 次。
如何安装 doccoverage?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install doccoverage」即可一键安装,无需额外配置。
doccoverage 是免费的吗?
是的,doccoverage 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
doccoverage 支持哪些平台?
doccoverage 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(darwin, linux, win32)。
谁开发了 doccoverage?
由 suhteevah(@suhteevah)开发并维护,当前版本 v1.0.1。