codecontext health
Analyze and track your documentation health score
The health
command provides a comprehensive analysis of your documentation quality, coverage, and freshness. It helps you identify gaps and track improvements over time.
Coverage Analysis
Track which functions, classes, and modules have documentation
Quality Scoring
Measure completeness, clarity, and usefulness of docs
Progress Tracking
Monitor improvements and identify documentation debt
$ codecontext health
Interactive Demo
Health Score Components
Coverage (40% of score)
- • Function documentation coverage
- • Class and method documentation
- • Module-level README files
- • API endpoint documentation
- • Configuration documentation
Quality (35% of score)
- • Completeness of descriptions
- • Presence of examples
- • Parameter documentation
- • Return value documentation
- • Error handling documentation
Freshness (25% of score)
- • Last update timestamp
- • Sync with code changes
- • Breaking change documentation
- • Deprecated feature marking
- • Version accuracy
Options
--json
Output results in JSON format for CI/CD integration
$ codecontext health --json
--history
Show health score trends over time
$ codecontext health --history
--min-score
Set minimum score threshold (exits with error if below)
$ codecontext health --min-score 80
Understanding Scores
Excellent (90-100)
Comprehensive documentation with high coverage, quality examples, and up-to-date content.
Good (70-89)
Solid documentation with minor gaps. Most important areas covered well.
Needs Improvement (50-69)
Significant documentation gaps. Many functions or modules lack proper documentation.
Poor (Below 50)
Critical documentation missing. Immediate attention needed to improve developer experience.
CI/CD Integration
GitHub Actions Example
name: Documentation Health Check on: [pull_request] jobs: doc-health: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install CodeContext run: npm install -g codecontext - name: Check Documentation Health run: codecontext health --min-score 75 --json - name: Comment PR if: failure() uses: actions/github-script@v6 with: script: | github.rest.issues.createComment({ issue_number: context.issue.number, body: '⚠️ Documentation health check failed. Score below 75.' })
Pro Features
Advanced Health Analytics
Pro users get additional insights and tracking:
- • Team-wide health metrics across all repositories
- • Custom health rules and scoring
- • Documentation debt tracking and forecasting
- • Automated health reports via email/Slack
- • Historical trends with burndown charts
- • Export health data to monitoring tools
Best Practices
Regular monitoring
Run health checks weekly to catch documentation drift early. Set up CI/CD checks for PRs.
Set team goals
Establish a minimum health score (e.g., 80) and track progress in sprint retrospectives.
Focus on high-impact areas
Prioritize documenting public APIs, complex algorithms, and frequently-used utilities first.
See Also
- codecontext status - View usage and ROI metrics
- codecontext update - Improve documentation coverage
- Documentation Standards - Best practices for high-quality docs