| name | documentation-consistency |
| description | Verify documentation is up-to-date and consistent across all files. Check for broken links, outdated references, deprecated content, and mismatched information. Use when auditing documentation, checking for stale content, verifying links, or ensuring docs match current codebase state. |
| summary_l0 | Verify documentation consistency with link checking, staleness detection, and sync audits |
| overview_l1 | This skill verifies documentation is up-to-date and consistent across all files, checking for broken links, outdated references, deprecated content, and mismatched information. Use it when auditing documentation, checking for stale content, verifying links, or ensuring docs match current codebase state. Key capabilities include broken link detection (internal and external), outdated reference identification, deprecated content flagging, cross-file information consistency checking, code-to-documentation synchronization verification, version number consistency checking, and documentation freshness scoring. The expected output is a documentation consistency report with broken links, outdated references, mismatches, and recommended fixes. Trigger phrases: documentation audit, broken links, stale docs, outdated documentation, doc consistency, verify documentation, documentation sync, docs match code. |
Documentation Consistency Check
Systematically audit all documentation to ensure consistency, accuracy, and alignment with the current state of the codebase.
When to Use This Skill
Use this skill when you need to:
- Audit documentation for accuracy
- Check for broken or outdated links
- Find references to non-existent files or functions
- Verify version numbers are consistent
- Remove deprecated or stale content
- Ensure documentation matches codebase structure
- Prepare for a release
Trigger phrases: "check documentation", "audit docs", "find broken links", "update documentation", "docs consistency", "stale documentation", "outdated references"
What This Skill Does
Consistency Audit Process
- Cross-Reference Validation - Verify all references point to existing files
- Version Consistency - Check version numbers match across files
- Structure Alignment - Ensure documented structure matches actual files
- Link Verification - Test all internal and external links
- Content Freshness - Identify potentially outdated content
- Deprecation Cleanup - Remove references to deleted/renamed items
Instructions
Step 1: Identify All Documentation Files
find . -name "*.md" -type f | grep -v node_modules | grep -v .venv | grep -v __pycache__
Step 2: Check Internal Links
Verify all markdown links point to existing files:
grep -oE '\[.*?\]\([^)]+\)' README.md
grep -oE '\[.*?\]\([^)]+\)' README.md | sed 's/.*(\([^)]*\))/\1/' | grep -v "^http"
for link in $(grep -oE '\[.*?\]\([^)]+\)' README.md | sed 's/.*(\([^)]*\))/\1/' | grep -v "^http"); do
if [ ! -f "$link" ] && [ ! -d "$link" ]; then
echo "BROKEN: $link"
fi
done
Step 3: Verify Version Consistency
Check that version numbers match across all files:
grep -rn "version" --include="*.md" --include="*.toml" --include="*.json" --include="*.yaml" .
Step 4: Validate Project Structure References
Compare documented structure to actual file system:
find . -type f -name "*.py" -o -name "*.js" -o -name "*.ts" | head -50
Step 5: Check for Deprecated References
Look for references to items that no longer exist:
Functions and Classes
grep -rE "(def |class |function )\w+" docs/ README.md
File References
grep -rE "(`[^`]+\.(py|js|ts|go|java|cs|cpp|c|h)`)" --include="*.md" .
Configuration Options
grep -rE "(config\.|settings\.|options\.)" --include="*.md" .
Step 6: Audit External Links
grep -rEoh "https?://[^)\"' >]+" --include="*.md" . | sort -u
Step 7: Check for Stale Content
Look for indicators of outdated documentation:
Date Markers
grep -rE "(January|February|March|April|May|June|July|August|September|October|November|December) 20[0-9]{2}" --include="*.md" .
grep -rE "202[0-3]-[0-9]{2}" --include="*.md" .
TODO/FIXME Comments
grep -rn "TODO\|FIXME\|XXX\|HACK" --include="*.md" .
Placeholder Text
grep -rE "\[.*?\]|\{.*?\}|<.*?>" --include="*.md" . | grep -v "http"
grep -rE "TBD|TBA|Coming soon|TODO" --include="*.md" .
Step 8: Generate Consistency Report
Create a summary of all issues found:
# Documentation Consistency Report
## Generated: YYYY-MM-DD
### Summary
- **Files Audited**: X
- **Issues Found**: Y
- **Critical**: Z
- **Warnings**: W
### Broken Links
| File | Line | Broken Link | Suggested Fix |
|------|------|-------------|---------------|
| README.md | 45 | [link](old/path.md) | Update to new/path.md |
### Version Mismatches
| File | Current | Expected |
|------|---------|----------|
| README.md | 1.0.0 | 1.2.0 |
### Deprecated References
| File | Line | Reference | Issue |
|------|------|-----------|-------|
| docs/api.md | 23 | `old_function()` | Function removed in v1.1.0 |
### Stale Content
| File | Section | Last Updated | Notes |
|------|---------|--------------|-------|
| docs/setup.md | Installation | 2023-06 | May need update |
### Missing Documentation
| Item | Type | Notes |
|------|------|-------|
| new_module.py | Module | No documentation found |
### Recommendations
1. **High Priority**: Fix broken links in README.md
2. **Medium Priority**: Update version references
3. **Low Priority**: Review stale content in docs/
Common Documentation Issues
Issue Categories
| Category | Examples | Severity |
|---|
| Broken Links | 404s, wrong paths | High |
| Version Mismatch | Old versions in badges/text | High |
| Missing Files | Referenced files deleted | High |
| Deprecated APIs | Old function names | Medium |
| Stale Content | Outdated instructions | Medium |
| Unfilled Placeholders | [TODO], TBD | Low |
| Typos | Misspelled file names | Low |
Fix Patterns
Broken Internal Link
# Before (broken)
See [installation guide](docs/install.md)
# After (fixed - file moved)
See [installation guide](guides/installation.md)
Version Update
# Before

# After

Deprecated Reference
# Before
Use `old_api_call()` to fetch data.
# After
Use `new_api_call()` to fetch data. (Note: `old_api_call()` was deprecated in v1.1.0)
Automation Script Template
"""Documentation consistency checker."""
import os
import re
from pathlib import Path
def find_markdown_files(root_dir: str) -> list[Path]:
"""Find all markdown files in project."""
excludes = {'node_modules', '.venv', '__pycache__', '.git'}
files = []
for path in Path(root_dir).rglob('*.md'):
if not any(ex in path.parts for ex in excludes):
files.append(path)
return files
def extract_internal_links(content: str) -> list[str]:
"""Extract internal links from markdown content."""
pattern = r'\[.*?\]\(([^)]+)\)'
links = re.findall(pattern, content)
return [l for l in links if not l.startswith(('http', '#', 'mailto'))]
def check_link_exists(link: str, base_path: Path) -> bool:
"""Check if linked file exists."""
target = base_path.parent / link
return target.exists()
def audit_documentation(root_dir: str) -> dict:
"""Run full documentation audit."""
results = {
'broken_links': [],
'version_mismatches': [],
'stale_content': [],
'todos': []
}
for md_file in find_markdown_files(root_dir):
content = md_file.read_text(encoding='utf-8')
for link in extract_internal_links(content):
if not check_link_exists(link, md_file):
results['broken_links'].append({
'file': str(md_file),
'link': link
})
if 'TODO' in content or 'FIXME' in content:
results['todos'].append(str(md_file))
return results
if __name__ == '__main__':
results = audit_documentation('.')
print(f"Broken links: {len(results['broken_links'])}")
print(f"Files with TODOs: {len(results['todos'])}")
Verification
Before completing documentation audit:
Common Rationalizations
| Rationalization | Reality |
|---|
| "The docs were correct when I wrote them, so they are still fine" | Code drifts away from prose silently; a renamed function or moved file leaves a dead link or a stale example that misleads the next reader who trusts the doc. |
| "Broken links are cosmetic, not worth an audit" | A broken install or API link in a README blocks a new user at the first step; the cost is a lost contributor, not a cosmetic blemish. |
| "Version numbers will be consistent because I bumped the main one" | Version strings live in many files (README, package manifest, docs headers); bumping one and missing the rest produces contradictory claims that erode trust in every number. |
Related Skills
- [[version-upgrade]] -- the version bump workflow whose cross-file edits this audit verifies for consistency
- [[code-commit-workflow]] -- commit hygiene that keeps doc changes atomic with the code they describe
- [[technical-documentation]] -- authoring the docs whose freshness and link integrity this skill checks
Version: 1.0.0
Last Updated: December 2025
Iterative Refinement Strategy
This skill is optimized for an iterative approach:
- Execute: Perform the core steps defined above.
- Review: Critically analyze the output (coverage, quality, completeness).
- Refine: If targets aren't met, repeat the specific implementation steps with improved context.
- Loop: Continue until the definition of done is satisfied.