/code-health
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
$ npx -y skills add repowise-dev/repowise --skill code-health --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/code-health
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
SKILL.md
code-health.SKILL.mdname: code-health
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.
user-invocable: false
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): a `directive` naming 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
1. For "what should I refactor?" → dashboard mode, lead with `directive`, then `get_health(targets=[worst files], include=["refactoring"])` and present the ranked plans, not just the scores. 2. Rank by `weighted_deficit`, not `score` — the score floors at 1.0. 3. For a specific file → report the score, the top 2–3 marker findings, and what each one means in plain language. Avoid dumping the raw payload. 4. Check `unresolved` before calling a file clean: a target listed there matched nothing, and `not_indexed` means run `repowise update`. 5. Before editing a flagged file → cross-check `get_risk(targets=[...])`; a file that is both low-health *and* a churn hotspot deserves the most care. 6. Untested-hotspot / coverage questions → tell the user coverage markers light up once they ingest a report: `repowise coverage add cov.lcov` (LCOV / Cobertura / Clover; a coverage.py `.coverage` also builds the per-test map), then re-run `repowise health`.
CLI equivalents
- `repowise health` — KPIs + lowest-scoring files
- `repowise health --refactoring-targets` — ranked by impact / effort
- `repowise health --trend` — snapshots + declining alerts
- `repowise coverage add <file>` — ingest coverage, light up untested-hotspot
Error handling
If `get_health` reports no repository, suggest `/repowise:init`. Code health is computed even with a template-rendered wiki (no LLM needed), so it should be available whenever the repo is indexed.
Read more
name: code-health 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. user-invocable: false
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): a `directive` naming 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
1. For "what should I refactor?" → dashboard mode, lead with `directive`, then `get_health(targets=[worst files], include=["refactoring"])` and present the ranked plans, not just the scores. 2. Rank by `weighted_deficit`, not `score` — the score floors at 1.0. 3. For a specific file → report the score, the top 2–3 marker findings, and what each one means in plain language. Avoid dumping the raw payload. 4. Check `unresolved` before calling a file clean: a target listed there matched nothing, and `not_indexed` means run `repowise update`. 5. Before editing a flagged file → cross-check `get_risk(targets=[...])`; a file that is both low-health *and* a churn hotspot deserves the most care. 6. Untested-hotspot / coverage questions → tell the user coverage markers light up once they ingest a report: `repowise coverage add cov.lcov` (LCOV / Cobertura / Clover; a coverage.py `.coverage` also builds the per-test map), then re-run `repowise health`.
CLI equivalents
- `repowise health` — KPIs + lowest-scoring files
- `repowise health --refactoring-targets` — ranked by impact / effort
- `repowise health --trend` — snapshots + declining alerts
- `repowise coverage add <file>` — ingest coverage, light up untested-hotspot
Error handling
If `get_health` reports no repository, suggest `/repowise:init`. Code health is computed even with a template-rendered wiki (no LLM needed), so it should be available whenever the repo is indexed.
Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Repo: repowise-dev/repowise
Other skills on repowise.
- /architectural-decisions
Use when encountering questions about WHY code is built a certain way, when about to make architectural changes (new patterns, restructuring, choosing between approaches), or when the user asks about design rationale in a Repowise-indexed codebase (.repowise/ directory exists).
Open skill - /change-review
Use when reviewing a set of changes before they merge — a PR, a branch diff, or the working-tree changes you just made — in a Repowise-indexed codebase (.repowise/ directory exists). Activates for "review this PR", "is this safe to merge", "what's the blast radius of these
Open skill - /codebase-exploration
Use when exploring, understanding, or answering questions about a codebase that has Repowise indexed (a .repowise/ directory in the project root). Activates for "how does X work", "explain the architecture", "where is Y implemented", "what does this module do", or any task that
Open skill - /dead-code-cleanup
Use when the user asks about cleanup, removing unused code, refactoring, reducing bundle size, or identifying dead code in a Repowise-indexed codebase (.repowise/ directory exists). Also activates when discussing technical debt, code hygiene, or repository maintenance.
Open skill - /pre-modification
Use before modifying, refactoring, or deleting files in a codebase that has Repowise indexed (indicated by a .repowise/ directory). Activates when Claude is about to edit code, especially shared utilities, core modules, or files the user didn't explicitly mention. Helps assess
Open skill - /architectural-decisions
Use when a task asks why code is built a certain way, proposes architectural changes, compares implementation approaches, or mentions decision markers such as WHY, DECISION, TRADEOFF, or ADR in a Repowise-indexed repository.
Open skill

