Loading...
Loading...
Audit code comments and docstrings quality across 6 categories (WHY-not-WHAT, Density, Forbidden Content, Docstrings, Actuality, Legacy). Use when code needs comment review, after major refactoring, or as part of ln-100-documents-pipeline. Outputs Compliance Score X/10 per category + Findings + Recommended Actions.
npx skill4agent add levnikolaevich/claude-code-skills ln-610-code-comments-auditor| # | Category | What to Check |
|---|---|---|
| 1 | WHY not WHAT | Comments explain rationale, not obvious code behavior; no restating code |
| 2 | Density (15-20%) | Comment-to-code ratio within range; not over/under-commented |
| 3 | No Forbidden Content | No dates/authors; no historical notes; no code examples in comments |
| 4 | Docstrings Quality | Match function signatures; parameters documented; return types accurate |
| 5 | Actuality | Comments match code behavior; no stale references; examples runnable |
| 6 | Legacy Cleanup | No TODO without context; no commented-out code; no deprecated notes |
## Code Comments Audit Report - [DATE]
### Compliance Score
| Category | Score | Issues |
|----------|-------|--------|
| WHY not WHAT | X/10 | N obvious comments |
| Density (15-20%) | X/10 | X% actual (target: 15-20%) |
| No Forbidden Content | X/10 | N forbidden items |
| Docstrings Quality | X/10 | N mismatches |
| Actuality | X/10 | N stale comments |
| Legacy Cleanup | X/10 | N legacy items |
| **Overall** | **X/10** | |
### Critical Findings
- [ ] **[Category]** `path/file:line` - Issue description. **Action:** Fix suggestion.
### Recommended Actions
| Priority | Action | Location | Category |
|----------|--------|----------|----------|
| High | Remove author name | src/X:45 | Forbidden |
| Medium | Update stale docstring | lib/Y:120 | Actuality |shared/references/audit_scoring.md| Issue Type | Severity |
|---|---|
| Author names, dates in comments | CRITICAL |
| Commented-out code blocks | HIGH |
| Stale/outdated comments | HIGH |
| Obvious WHAT comments | MEDIUM |
| Density deviation >5% | MEDIUM |
| Minor density deviation | LOW |