# Code Health

Use when the user asks about code health, code quality, complexity, technical debt...

- Repository: https://github.com/repowise-dev/repowise (8087 stars)
- Category: Engineering
- License: AGPL-3.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add repowise-dev/repowise --skill code-health -g -a claude-code -y`
Codex: `npx skills add repowise-dev/repowise --skill code-health -g -a codex -y`
Cursor: `npx skills add repowise-dev/repowise --skill code-health -g -a cursor -y`
Gemini CLI: `npx skills add repowise-dev/repowise --skill code-health -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add repowise-dev/repowise`

## Description

Use when the user asks about code health, code quality, complexity, technical debt, which files are risky or hard to maintain, what to refactor next, untested hotspots, or coverage gaps in a Repowise-indexed codebase (.repowise/ directory exists). Also use to get a before/after health read when planning or finishing a refactor.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Code Health with Repowise

Repowise scores **every file 1, 10** from deterministic markers, McCabe
complexity, deep nesting, brain methods, class cohesion (LCOM4), god classes,
clone detection, untested hotspots, function-level churn, ownership dispersion,
and more. Zero LLM calls; pure local analysis. The weights are calibrated
against a real defect corpus, so a low score means *more likely to harbour bugs*,
not just *bigger*.

## Pick the mode by what you pass

- **Dashboard**: `get_health()` (no targets): `fix_first`, the ranked list of
  what to fix first, then repo-level KPIs and the lowest-scoring files. Start here for "how
  healthy is this codebase?" or "what should we clean up?".
- **Targeted**, `get_health(targets=["src/x.py", "src/y.py"])`: per-file score
  and the specific marker findings driving it. Use before/after a refactor,
  or to explain *why* a file is flagged.

## Useful `include` flags

`get_health(targets=[...], include=[...])`:
- `"biomarkers"`, always return the findings list (what's wrong, where).
- `"refactoring"`, deterministic, ranked refactoring suggestions (by impact/effort).
- `"coverage"`, surface coverage data when it's been ingested.
- `"trend"`, recent health snapshots + declining / predicted-decline signal.

`include` adds blocks; `only=[...]` subtracts them.

## How to use the results

The rest: https://github.com/repowise-dev/repowise/blob/HEAD/plugins/claude-code/skills/code-health/SKILL.md
