Automatically generates and improves code documentation across Python, JavaScript/TypeScript, Java, Go, and Rust...
Automatically generate and improve code documentation following language-specific standards.
This skill automates documentation generation for development teams. It detects your codebase language, applies appropriate docstring standards (Google/NumPy for Python, JSDoc/TSDoc for TypeScript, Javadoc for Java, godoc for Go, rustdoc for Rust), and validates documentation quality.
What it automates:
| Language | Supported Styles | Generator Tool |
|---|---|---|
| Python | Google, NumPy, Sphinx | Sphinx + Napoleon |
| JavaScript/TypeScript | JSDoc, TSDoc | TypeDoc |
| Java | Javadoc | javadoc |
| Go | godoc conventions | pkgsite |
| Rust | rustdoc (CommonMark) | cargo doc |
First, I'll scan your codebase to identify:
I'll check current documentation status:
For undocumented code, I'll generate:
I'll verify documentation meets quality standards:
Run this skill when:
After running, I'll provide:
User: Document the functions in src/utils/helpers.py
Assistant: Analyzing src/utils/helpers.py...
Found 5 public functions, 2 already documented.
Generating documentation for 3 functions using Google style:
def calculate_discount(price: float, percentage: float) -> float:
"""Calculate discounted price.
Args:
price: Original price in dollars.
percentage: Discount percentage (0-100).
Returns:
Final price after applying discount.
Raises:
ValueError: If percentage is not between 0 and 100.
"""
[Continues for remaining functions...]
Coverage: 100% (5/5 functions documented)
User: Check documentation coverage in src/components/
Assistant: Scanning TypeScript files in src/components/...
Documentation Report:
- Total exports: 24
- Documented: 18 (75%)
- Missing: 6
Missing documentation:
1. src/components/Button.tsx: ButtonProps interface
2. src/components/Modal.tsx: useModal hook
3. src/components/Form.tsx: validateField, submitForm, resetForm
Would you like me to generate TSDoc comments for these?
User: Help us establish documentation standards for our Python project
Assistant: I'll analyze your current codebase and recommend a standard.
Current state:
- 3 files use Google-style docstrings
- 2 files use NumPy-style docstrings
- 5 files have no docstrings
Recommendation: Standardize on Google style (most common in your codebase).
I'll create:
1. Documentation style guide (CONTRIBUTING.md section)
2. Pre-commit hook to validate docstring format
3. Generate missing docs in Google style
Proceed? (y/n)
When multiple styles are valid, I'll ask which you prefer:
| Language | Options |
|---|---|
| Python | google, numpy, sphinx |
| TypeScript | jsdoc, tsdoc |
| Option | Effect |
|---|---|
| Public only | Document exported functions/classes only |
| Include private | Document all functions including internal |
| Specific files | Target only specified files/directories |
Running multiple times is safe:
All changes are made through standard file edits:
git diff to review changesgit checkout to revert if neededBefore considering documentation complete: