agentleFS
nuncaeslupusnuncaeslupus/literary-critic/.claude/skills/coverage-gaps/SKILL.md

coverage-gaps

Skill0 starsChanged 5 days agoMITView on GitHub

Ranks the most valuable missing tests from coverage.py's coverage.json. Use when the user asks which tests are missing. Not for non-Python code.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

coverage-gaps

Turns an existing coverage.py report into a ranked list of the tests worth writing next.

CANARY: coverage-gaps-loaded-2026-06-04-ea39c2b5-b32fe2b1b5ae5e96

When to load

Load when the question is which coverage gaps to fill first. This is the cheap, line-level pass; once line coverage is healthy and the question is whether tests assert behaviour, use the mutmut-report skill.

Step 1 — Ensure a JSON report exists

The script reads coverage.py's JSON export, not the .coverage database, and exits 2 without it. Regenerate it after a refactor, since old line numbers drift from the source.

coverage json                                    # after `coverage run -m pytest`
pytest --cov=PKG --cov-branch --cov-report=json  # or in one shot, with branches

Step 2 — Rank the gaps

python3 "${CLAUDE_SKILL_DIR}/scripts/analyze_coverage.py" --input coverage.json --limit 20

The JSON carries total_percent_covered, files_with_gaps, and a ranked gaps list with missing_count, percent_covered, missing_branches (populated only with branch coverage), largest_run and missing_runs (inclusive line ranges).

Step 3 — Propose tests

Open the source at each missing_runs range before recommending, because a long run can be a generated block, a __repr__ or an if TYPE_CHECKING: island; rank by what the code does, not by line count. Then report:

  1. The 2–3 tests worth writing now: which function, which input, which branch.
  2. Branch gaps in otherwise well-covered files, from missing_branches.
  3. Low-value gaps (scattered defensive raise or logging lines) that can wait or take # pragma: no cover.

Covered means executed, not asserted, so treat this ranking as the floor.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.