Audit Coverage
Read coverage artifacts a build already wrote (lcov, Cobertura, coverage.py JSON, Go cover profile) to report line coverage and CRAP per file and function for…
от melodic-software★ 34 звезды на GitHub
Установить Audit Coverage в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Audit coverage
Pre-computed context
Current branch: !git branch --show-current 2>/dev/null || echo "unknown"
Purpose
Coverage is a dynamic measure. This skill reads it statically: it parses an artifact a test run already wrote and joins it to the functions in scope. Running the tests is the project's own job and stays there, so nothing here executes a test command, starts a runner, or installs a tool.
Two numbers come out. Line coverage per file and per function is read from the artifact. CRAP per
function is derived: comp^2 * (1 - cov/100)^3 + comp, where comp is the function's cyclomatic
complexity from the audit skill's audit-complexity.sh script, run over the same scope.
| Format | Written by | What the join gets from it |
|---|---|---|
lcov .info |
most JavaScript and C/C++ toolchains, coverage lcov |
line hits; function records in either lcov record shape, which is where a function end line can come from at all |
| Cobertura XML | gcovr, coverlet, kcov (which is how a Bash language gets an artifact) | line hits, <sources> prefixes, and <method> regions with their hit flag |
| coverage.py JSON | coverage json |
executed and missing lines, and per-function regions |
| Go cover profile | go test -coverprofile |
statement counts over line ranges, which is not a line table: the profile never says which lines carry the statements, so a Go file reports the statement ratio go tool cover -func prints, labels it cov_source: statement-ratio, and reports lines_executable and lines_hit as null. The format names no functions either, so a Go function reports coverage_pct and crap as null, and its line counts as null unless a line-measuring artifact also covered the file |
The record shape and version behind each format are its row under "Coverage artifacts" in
${CLAUDE_PLUGIN_ROOT}/reference/collectors.md, which carries each claim with its basis, date and
recheck trigger.
The SQLite data file coverage.py writes while measuring is never read; why is the coverage.py
SQLite row of that file. Run coverage json or coverage lcov and point this skill at the result.
Run it
"${CLAUDE_SKILL_DIR}/scripts/audit-coverage.sh" # the change, with the artifact auto-discovered
"${CLAUDE_SKILL_DIR}/scripts/audit-coverage.sh" --artifacts build/lcov.info src/ # an explicit artifact and an explicit scope
"${CLAUDE_SKILL_DIR}/scripts/audit-coverage.sh" --all --artifacts coverage.xml --artifacts cover.out
"${CLAUDE_SKILL_DIR}/scripts/audit-coverage.sh" --json --all # the code-metrics/v3 document instead of markdown
Append --user-file '${user_config.config_file}' to every script call, exactly as written:
it names the file holding your userConfig layer, and an empty or unsubstituted value means none
(${CLAUDE_PLUGIN_ROOT}/reference/config.md).
With no --artifacts and no coverage.artifacts in the config, the well-known names are looked
for under the repository root, at most two directory levels deep and never inside node_modules,
.git or vendor: coverage/lcov.info, lcov.info, coverage.xml, cobertura.xml,
coverage.json, coverage.out, cover.out. Each artifact's format is detected from its content,
not its extension.
A target form (--repo <repo> and the others) runs the script once per repository, as
${CLAUDE_PLUGIN_ROOT}/reference/several-repositories.md says, and never passes the form to the
script. Each repository reads its own artifacts under its own root: an --artifacts path must be
relative and is read from each root, so name artifacts only when every repository writes them to
that path.
Present the markdown report as printed: the scope, the "Coverage of this run" table, the
references with their provenance, then one row per file and per function. Keep the --json
document when the numbers feed a comparison: pass it to /verification:measure metrics (if enabled), treating status: empty on either side as INCONCLUSIVE;
otherwise keep the JSON beside your notes and compare by hand.
Getting a first artifact
A run that finds no artifact reports every language unavailable, lists the paths it searched, and
ends its markdown with a line saying so, because the remedy is the project's to apply: this skill
runs no test and installs nothing. The project's own test run writes the artifact, in one of the
formats above. Pass its path with --artifacts, or list it under coverage.artifacts, when it
does not land on one of the well-known names.
Reading the numbers
- A file row is the artifact's own line table:
coverage_pct,lines_executable,lines_hit. A file a Go cover profile covers is the exception: the profile weighs statements, so the percentage is its statement ratio,cov_sourcereadsstatement-ratio, and both line counts are null. - A function row exists for every function whose complexity collector reported a real end line.
It carries
coverage_pct,
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Bash(${CLAUDE_SKILL_DIR}/scripts/audit-coverage.sh:*) - 02
Bash(git branch --show-current:*)
Вложенные файлы
- evals/evals.json
- scripts/audit-coverage.sh
- scripts/audit-coverage.test.sh
- scripts/crap.py
- scripts/join.py
- scripts/test_crap.py
- scripts/test_join.py
FAQ
Что делает скилл Audit Coverage?
Read coverage artifacts a build already wrote (lcov, Cobertura, coverage.py JSON, Go cover profile) to report line coverage and CRAP per file and function for a change, path, or tree; runs no tests, never gates. Use when 'coverage per function', 'CRAP score', 'read the lcov report'. Not for complexity alone: /code-metrics:audit.
Как установить скилл Audit Coverage?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Audit Coverage запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…