bestdeejay-design/agent-skills/skills/coverage-analyzer/SKILL.md
coverage-analyzer
Parse coverage.py XML reports (coverage.xml) into a human-readable coverage analysis: total line/branch percent, files with zero coverage, worst-10 ranking, delta vs a stored JSON baseline, and a PASS/FAIL verdict against an optional threshold. Stdlib-only Python script (xml.etree.ElementTree, json, argparse) that closes the loop after test-generator.
- Source repository stars
- 5
- Declared platforms
- 0
- Static risk flags
- 1
- Last source update
- 2026-08-23
- Source checked
- 2026-08-25
Decision brief
What it does: where it fits
Load this skill when you need to turn a coverage.xml report into a human-readable coverage analysis: overall line/branch percent, files with zero coverage, the 10 worst-covered files, a delta vs a previously stored baseline, and a PASS/FAIL verdict against a threshold for CI.
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/bestdeejay-design/agent-skills --skill "skills/coverage-analyzer"Inspect the Agent Skill "coverage-analyzer" from https://github.com/bestdeejay-design/agent-skills/blob/cb4108bbfc3fedca92f9d1b9693a008660210cfa/skills/coverage-analyzer/SKILL.md at commit cb4108bbfc3fedca92f9d1b9693a008660210cfa. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Usage example (typical)
Review the “Usage example (typical)” section in the pinned source before continuing.
Review and apply the “Usage example (typical)” source section. - 02
Baseline tracking workflow
1. First run — --save-baseline baseline.json writes {"files": [{"name": "...", "linerate": 0.42}, ...], "total": 0.42}. Commit the baseline file so it is reviewable. 2. Later runs — --baseline baseline.json prints a per-file before → after → Δ table. A file that appears in the c…
First run — --save-baseline baseline.json writesLater runs — --baseline baseline.json prints a per-fileTrend — the total row shows the overall delta in percentage points, - 03
The analyzer script
scripts/coverageanalyzer.py — pure Python 3 stdlib (no dependencies).
Total — line-rate (and branch-rate when branches were actuallyWorst 10 files — lowest line-rate first, ascendingDelta vs baseline — per-file before → after → Δ table plus a total - 04
Output sections
Total — line-rate (and branch-rate when branches were actually
Total — line-rate (and branch-rate when branches were actuallyWorst 10 files — lowest line-rate first, ascendingDelta vs baseline — per-file before → after → Δ table plus a total - 05
Exit codes
Review the “Exit codes” section in the pinned source before continuing.
Review and apply the “Exit codes” source section.
Permission review
Static risk signals and limitations
Runs scripts
The documentation asks the agent to run terminal commands or scripts.
python3 coverage_analyzer.py --xml coverage.xmlRuns scripts
The documentation asks the agent to run terminal commands or scripts.
python3 coverage_analyzer.py --xml coverage.xml --save-baseline baseline.jsonEvidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 5 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- bestdeejay-design/agent-skills
- Skill path
- skills/coverage-analyzer/SKILL.md
- Commit
- cb4108bbfc3fedca92f9d1b9693a008660210cfa
- License
- MIT
- Collected
- 2026-08-25
- Default branch
- main
View the original SKILL.md
Coverage Analyzer — coverage.py XML → readable analysis
Load this skill when you need to turn a coverage.xml report into a
human-readable coverage analysis: overall line/branch percent, files with
zero coverage, the 10 worst-covered files, a delta vs a previously stored
baseline, and a PASS/FAIL verdict against a threshold for CI.
The analyzer is pure Python 3 stdlib (xml.etree.ElementTree, json,
argparse) — no dependencies, no network. It reads the exact XML format that
coverage.py emits via coverage xml
(Cobertura-style DTD), so it works with any tool that produces that format
(pytest-cov --cov-report=xml, coverage run -m pytest && coverage xml).
The analyzer script
scripts/coverage_analyzer.py — pure Python 3 stdlib (no dependencies).
| Mode | Command |
|---|---|
| Basic analysis | python3 coverage_analyzer.py --xml coverage.xml |
| Delta vs stored baseline | python3 coverage_analyzer.py --xml coverage.xml --baseline baseline.json |
| Threshold gate (CI) | python3 coverage_analyzer.py --xml coverage.xml --threshold 80 |
| Store current totals as baseline | python3 coverage_analyzer.py --xml coverage.xml --save-baseline baseline.json |
Output sections
- Total —
line-rate(andbranch-ratewhen branches were actually measured; abranch-rate="0"withbranches-valid="0"is treated as "not measured", not as 0%), file count,files_with_zero_lines(files with line-rate == 0) with their names - Worst 10 files — lowest line-rate first, ascending
- Delta vs baseline — per-file
before → after → Δtable plus atotalrow; files absent from the baseline are markednew - Verdict —
PASS/FAILwhen--thresholdis given
Exit codes
| Code | Meaning |
|---|---|
0 | analysis succeeded (threshold PASS, or no threshold) |
1 | parse/read error, or threshold FAIL |
2 | internal error |
Usage example (typical)
# 1. Produce the XML (coverage.py installed):
coverage run -m pytest && coverage xml
# 2. Analyze:
python3 coverage_analyzer.py --xml coverage.xml
# 3. Store a baseline on the first run:
python3 coverage_analyzer.py --xml coverage.xml --save-baseline baseline.json
# 4. On later runs, diff against the baseline and gate CI:
python3 coverage_analyzer.py --xml coverage.xml --baseline baseline.json --threshold 80
Baseline tracking workflow
- First run —
--save-baseline baseline.jsonwrites{"files": [{"name": "...", "line_rate": 0.42}, ...], "total": 0.42}. Commit the baseline file so it is reviewable. - Later runs —
--baseline baseline.jsonprints a per-filebefore → after → Δtable. A file that appears in the current report but not in the baseline is markednew; a file that disappeared is simply absent from the table. - Trend — the
totalrow shows the overall delta in percentage points, so a regression (e.g.-5.0 pp) is visible at a glance.
Threshold gate for CI
python3 coverage_analyzer.py --xml coverage.xml --threshold 80
echo "exit=$?" # 0 = PASS, 1 = FAIL
Use it as the last step of a test job: the script exits 1 when the total
line-rate percent is below the threshold, failing the pipeline. This closes
the loop after test-generator — generate tests, measure coverage, gate on
the result.
Do NOT use
- If you don't have a
coverage.xml— this skill only parses the coverage.py XML format; it does not run your tests or measure coverage itself. Runcoverage run -m pytest && coverage xml(orpytest --cov) first. - If you want branching visualization (branch-by-branch coverage maps,
HTML reports with per-line coloring) — use coverage.py's own
coverage html/coverage reportor a dedicated coverage UI. This tool is a text/markdown summary + CI gate, not a visualizer. - If your report is in a different format (lcov, JaCoCo, Cobertura from other tools) — the parser targets the coverage.py XML schema; other Cobertura-style files may parse but attribute names differ.
Canonical patterns
Full deep dive with upstream sources in references/canonical-patterns.md.
Key canons:
- coverage.py XML schema (Ned Batchelder) — the
line-rate/branch-rateattribute semantics this tool parses verbatim - Cobertura DTD — the XML shape coverage.py emits (
<coverage>,<packages>,<classes>,<lines>) - pytest-cov — the
--cov-report=xmlpipeline that produces the input - codecov / coveralls — the baseline-diff + threshold-gate CI model
- coverage-badge — the "percent → verdict" rendering idea (we stay text)
Files
SKILL.md— this fileskill.json— manifestscripts/coverage_analyzer.py— the stdlib analyzer (XML parse + baseline diff + threshold gate)references/canonical-patterns.md— coverage.py/pytest-cov/codecov/ coveralls/coverage-badge deep dive with sources
Canonical analogues
Full source depth — in references/canonical-patterns.md. Backbone:
Installation
# For opencode
cp -r skills/coverage-analyzer ~/.config/opencode/skills/
# For other agents
# Copy the skill folder to your skills directory; requires Python 3.
Note: this tool analyzes, it does not generate tests or coverage. It expects a real
coverage.xmlproduced by coverage.py (or a compatible tool) and reports what the numbers mean — including a CI exit-code gate so coverage regressions fail the build.
Frequently asked questions
What to verify before installation and use
What does the coverage-analyzer source document cover?
Load this skill when you need to turn a coverage.xml report into a human-readable coverage analysis: overall line/branch percent, files with zero coverage, the 10 worst-covered files, a delta vs a previously stored baseline, and a PASS/FAIL verdict against a threshold for CI.
How do I install coverage-analyzer?
The source record exposes this install command: npx skills add https://github.com/bestdeejay-design/agent-skills --skill "skills/coverage-analyzer". Inspect the command and pinned source before running it.
Which permission-related actions were detected?
Static rules flagged exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
Compare before choosing
dotnet/skills
test-tagging
Analyzes test suites in any language and tags each test with standardized traits (positive, negative, critical-path, boundary, smoke, regression, integration, performance, security). Use when the user wants to categorize, audit, or label tests with traits. Works across .NET (MSTest/xUnit/NUnit/TUnit), Python (pytest), TS/JS (Jest/Vitest), Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, and C++ — auto-editing when the framework has canonical tag syntax, otherwise report-only. Do not use for writ
trailofbits/skills
vector-forge
Mutation-driven test vector generation. Finds implementations of a cryptographic algorithm or protocol, runs mutation testing to identify escaped mutants, then generates new test vectors that deliberately exercise the uncovered code paths. Compares before/after mutation kill rates to prove vector effectiveness. Use when generating cryptographic test vectors, measuring Wycheproof coverage gaps, finding escaped mutants via mutation testing, creating cross-implementation test suites, or improving t
travisjneuman/.claude
test-specialist
This skill should be used when writing test cases, fixing bugs, analyzing code for potential issues, or improving test coverage for JavaScript/TypeScript applications. Use this for unit tests, integration tests, end-to-end tests, debugging runtime errors, logic bugs, performance issues, security vulnerabilities, and systematic code analysis.
K-Dense-AI/scientific-agent-skills
simpy
Build, inspect, test, and analyze bounded process-based discrete-event simulations with SimPy, including events, resources, interrupts, monitoring, replications, warm-up, and reproducible output analysis.