Surface the lines you just changed that have zero test coverage — before the PR review does.
TL;DR:
/test-gap→ markdown table of files where your diff added lines that nothing tests yet.
Repo-wide coverage percentages are useless on a PR — what matters is whether the lines you just touched are covered. CI rarely tells you that, and "100% line coverage" isn't the target anyway. test-gap intersects your branch's diff with an existing coverage report and shows you the gap, sorted worst-first.
git clone https://github.com/mturac/pluginpool-test-gap ~/.claude/plugins/test-gapRestart Claude Code; the slash command /test-gap appears.
# After running your test suite with coverage:
python3 -m pytest --cov --cov-report=xml # produces coverage.xml
/test-gap # in Claude CodeOr directly:
python3 scripts/gap.py --format md
python3 scripts/gap.py --base develop --report build/lcov.info| Flag | Default | Description |
|---|---|---|
--base |
main (falls back to master) |
Diff against this branch |
--report |
auto-detect | Path to coverage.xml, lcov.info, or coverage.json |
--format |
json |
json or md |
| Format | Where it comes from |
|---|---|
Cobertura coverage.xml |
pytest-cov, pytest --cov-report=xml, coverage xml |
lcov.info |
jest --coverage, c8, Istanbul |
coverage.json |
coverage json |
| file | changed lines | uncovered | uncovered lines |
|---|---|---|---|
| src/auth/refresh.py | 42 | 11 | 81-83, 102, 117-122 |
| src/util/parse.py | 15 | 7 | 22-28 |
- Reads
git diff --unified=0 <base>..HEADand collects the added line numbers per file. - Parses the coverage report into a
{file: {covered_lines}}map. - Intersects: any added line not in the covered set is reported as a gap.
- Sorts the table by uncovered-count descending so the worst offenders surface first.
- Coverage is taken at face value — it doesn't know about branch coverage or test quality.
- Cobertura paths must match diff paths; configure your runner to emit project-relative paths.
- Empty diffs and no-test repos are handled gracefully (no output).
Step-by-step walkthroughs with real input fixtures and the helper's actual output live in examples/. Three or four scenarios per plugin — from the happy path to the edge cases the test suite guards.
Ten focused Claude Code plugins for everyday productivity: commit-narrator · pr-storyteller · test-gap · deps-doctor · env-lint · secret-guard · standup-gen · todo-harvest · flaky-detector · changelog-forge
MIT — see LICENSE. Contributions welcome.