From cleancode
This skill should be used when the user asks for "project health", "code health", "clean code score", "cleanliness score", "how bad is my code", "show metrics", "code quality dashboard", or wants a top-level view of the codebase's cleanliness. Produces a read-only dashboard of violation counts, worst offenders, and a 0-100 cleanliness score. Read-only by design — for fixing, use the specific skills.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cleancode:healthThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Print a short dashboard summarizing the project's clean code health. This skill is **read-only by design** — it reports, it does not change code. To fix what it reports, the user runs a specific skill (`/cleancode:untangle fix`, `/cleancode:safety fix`, `/cleancode:fix`).
Print a short dashboard summarizing the project's clean code health. This skill is read-only by design — it reports, it does not change code. To fix what it reports, the user runs a specific skill (/cleancode:untangle fix, /cleancode:safety fix, /cleancode:fix).
Source: The Art of Clean Code, Principle 16 — Use Metrics.
/cleancode:health # print dashboard, don't save
/cleancode:health save # print + write .cleancode-health.md (for tracking over time)
Glob all source files (exclude node_modules, .git, dist, build, generated code).
For each file, measure:
Aggregate across the project:
Score is 100 minus weighted penalty for each violation. See references/metric-definitions.md for the exact formula. Summary:
| Violation type | Penalty per occurrence |
|---|---|
| Critical file size | 5 |
| Critical function size | 3 |
| Warning file size | 2 |
| Warning function size | 1 |
| Deep nesting (> 4) | 2 |
| High fan-out (> 15 imports) | 3 |
| Missing interface [TS] | 1 |
| Duplication block | 2 |
| Hidden error (Rule 12) | 3 |
Clamp to [0, 100]. Round to nearest integer.
═══════════════════════════════════════════════════════════
cleancode health — [Project Name]
═══════════════════════════════════════════════════════════
Cleanliness Score: 72/100 🟡 Needs attention
── Totals ──────────────────────────────
Total LOC: 14,320
Total files: 182
Average file length: 79 lines
Average function length: 14 lines
Max nesting depth: 6
── Violations ──────────────────────────
🔴 Critical: 12
• 3 files > 300 lines
• 9 functions > 40 lines
🟡 Warning: 38
• 11 files > 200 lines
• 22 functions > 20 lines
• 5 method chains > 2
🔵 Style: 124 (naming, magic numbers, unused code)
── Top 10 Worst Files ──────────────────
1. src/App.tsx 487 lines 🔴
2. src/services/userService.ts 412 lines 🔴
3. src/utils/helpers.ts 378 lines 🔴
...
── Top 10 Longest Functions ───────────
1. processOrder() src/order.ts 98 lines 🔴
2. validateInput() src/validator.ts 72 lines 🔴
...
── TypeScript Coverage ─────────────────
Interface coverage: 64% (32/50 public classes)
── Suggested Next Actions ──────────────
• Start with /cleancode:fix src/App.tsx
• Run /cleancode:analyze src/services/userService.ts
• Run /cleancode:untangle . to find coupling issues
═══════════════════════════════════════════════════════════
If the user passed save:
Write the dashboard text + raw metrics (JSON block) to <project root>/.cleancode-health.md.
If the file already exists, append today's run to a history section:
# Clean Code Health
Last run: 2026-04-15
## Current
[dashboard as above]
## History
| Date | Score | Critical | Warning | Style |
|---|---|---|---|---|
| 2026-04-15 | 72 | 12 | 38 | 124 |
| 2026-04-01 | 68 | 15 | 42 | 131 |
| 2026-03-15 | 61 | 19 | 48 | 144 |
The history table is how teams track progress over time.
/cleancode:analyze <file> for that.metric-definitions.md should not drift between runs — re-running on unchanged code must produce the same score.references/metric-definitions.md — exact scoring formula, metric calculations, and tuning notesProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub dinoquinten/claude-plugins --plugin cleancode