health

Code quality dashboard with weighted scoring. Runs type checker, linter, test suite with coverage, and dead code detection in parallel, then computes a 0-10 quality score. Tracks trends over time. Use when user says "health check", "code quality", "project health", "quality score", "how healthy is this project", or wants a quick quality snapshot. Do NOT use for code review (use /review), running tests alone (use /test), or security audit (use /audit).

Report-only quality dashboard that computes a weighted score from multiple quality signals. Never auto-fixes anything.

Arguments

  • No arguments: run the full health check on the current project.
  • --no-trend: skip trend tracking, report only.

Process

1. Detect Project Tools

Read the project's package manager config, lockfile, and scripts to identify:

SignalDetection method
Type checkertsc, mypy, pyright, go vet in scripts or devDependencies
Lintereslint, ruff, golangci-lint, clippy in scripts or devDependencies
Test runnerjest, vitest, pytest, go test, cargo test in scripts or devDependencies
Coverage tool--coverage flag, c8, nyc, coverage.py in scripts or devDependencies
Formatterprettier, black, gofmt, rustfmt in scripts or devDependencies

If a tool is not present, skip that signal and redistribute its weight proportionally across the remaining signals.

2. Run Checks in Parallel

Execute all detected tools simultaneously:

  • Type checker: run with no-emit flag. Count errors.
  • Linter: run in report mode. Count errors and warnings separately.
  • Test suite: run with coverage enabled. Capture pass/fail counts and coverage percentages for statements, branches, functions, and lines.
  • Dead code detection: grep for exported symbols and check if they are imported elsewhere. Count unused exports.

3. Compute Scores

Each signal produces a 0-10 sub-score:

SignalWeightScoring
Tests30%10 if all pass, subtract 1 per failure, floor at 0
Coverage25%coverage percentage divided by 10, e.g. 95% = 9.5
Lint20%10 minus 0.5 per warning minus 1 per error, floor at 0
Types15%10 if zero errors, subtract 1 per error, floor at 0
Dead code10%10 minus 0.5 per unused export, floor at 0

Composite score: weighted sum of sub-scores, rounded to one decimal.

4. Report

Present results as a summary table:

SignalRaw ResultScoreWeightWeighted
Tests142 pass, 0 fail10.030%3.00
Coverage87.3% avg8.725%2.18
Lint2 warnings, 0 errors9.020%1.80
Types0 errors10.015%1.50
Dead code3 unused exports8.510%0.85
Total9.3

Include a one-line assessment:

Score rangeAssessment
9.0 - 10.0Healthy. No action needed.
7.0 - 8.9Acceptable. Minor issues to address.
5.0 - 6.9Degraded. Schedule cleanup.
0.0 - 4.9Critical. Prioritize remediation.

5. Track Trends

Unless --no-trend is passed:

  1. Identify the project by its git remote URL or directory name.

  2. Append a JSON line to ~/.claude/telemetry/health-<project>.jsonl:

    {"timestamp":"2026-04-04T12:00:00Z","score":9.3,"tests":{"pass":142,"fail":0},"coverage":87.3,"lint":{"warnings":2,"errors":0},"types":{"errors":0},"deadCode":{"unused":3}}
    
  3. If previous entries exist, compare the current score against the last entry. Report the delta: "+0.3 since last check" or "-1.2 since last check".

  4. Create the ~/.claude/telemetry/ directory if it does not exist.

Rules

  • Report only. Never modify source files, configs, or dependencies.
  • Show raw tool output excerpts when a sub-score is below 7.0 so the user can see what needs attention.
  • When a tool is missing, state which signal was skipped and note that the score reflects fewer dimensions.
  • All timestamps in GMT.
  • Trend files are append-only. Never truncate or rewrite them.

Related Skills

  • /review -- Detailed code review for specific changes.
  • /test -- Run the test suite with full output.
  • /audit -- Security-focused audit.