/quality-skills:code-coveragefrom quality-skills
Measures, interprets, and improves code coverage across languages and tools including line, branch, function, statement, condition, and MC/DC coverage. Helps integrate coverage into CI as a signal, not a goal.
Ships in quality-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in code coverage — how to measure it, what the numbers actually mean, and how to use them as a signal rather than a goal. Your goal is to help engineers integrate coverage into CI without falling into the trap of treating coverage percentage as a quality metric. Don't fabricate tool features, coverage formats, or threshold conventions. When uncertain, point the reader to the tool's docs.
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
If the file does not exist, ask: language, current coverage baseline, how it's being used, whether there's pressure on the number.
| Type | What it measures |
|---|---|
| Line | Did any test execute this line? |
| Statement | Did any test execute this statement? (Lines can have multiple statements.) |
| Function / method | Did any test call this function? |
| Branch | For each if / switch / ?:, did tests cover both outcomes? |
| Condition | For a && b, did tests cover all combinations of a true/false × b true/false? |
| MC/DC (Modified Condition / Decision Coverage) | Most rigorous; each condition must independently affect the outcome. Required by DO-178B for aerospace. |
| Path | Did tests cover every execution path? (Combinatorial explosion in practice.) |
Line coverage is the easiest to game. Branch coverage is meaningfully more useful. MC/DC is rigorous but rare outside regulated industries.
When tools report "% coverage" they almost always mean line or statement coverage by default. Specify branch coverage explicitly if you want the stronger signal.
| Language | Tool | Notes |
|---|---|---|
| JS / TS | Istanbul (nyc), c8 (V8 native) | Default. Vitest uses V8 by default; Jest uses Istanbul. |
| Python | coverage.py | Standard; pytest-cov for pytest integration. |
| Java / JVM | JaCoCo | De facto. Gradle / Maven plugins. |
| .NET | Coverlet | Standard. dotnet test --collect:"XPlat Code Coverage". |
| Go | Built-in (go test -coverprofile) | Native. go tool cover -html for HTML. |
| Ruby | SimpleCov | Standard. |
| Rust | cargo-tarpaulin / grcov | Two valid options. |
| PHP | PHPUnit + Xdebug (or pcov) | Built-in. |
| C / C++ | gcov / lcov | Compiler-driven; mature. |
| Swift | Xcode coverage | Built-in. |
| Kotlin | JaCoCo | Same as Java. |
For cross-language aggregation, the lcov / cobertura XML formats are widely understood — every major service (Codecov, Coveralls, SonarQube, Datadog) accepts one of them.
A test like assert thing is not None gives 100% line coverage on the function it calls, but tells you nothing about correctness. Coverage measures execution, not assertion strength.
Consequences of treating coverage as a goal:
Coverage is most valuable as a gap-finder: "we never test this branch — is that intentional or an oversight?"
For real test quality signal, use mutation testing (cross-reference mutation-testing).
// jest.config.js
module.exports = {
collectCoverage: true,
coverageProvider: 'v8',
coverageReporters: ['text', 'lcov', 'html'],
collectCoverageFrom: [
'src/**/*.{ts,tsx,js,jsx}',
'!src/**/*.d.ts',
'!src/index.ts',
],
};
Vitest:
// vitest.config.ts
export default defineConfig({
test: {
coverage: { provider: 'v8', reporter: ['text', 'lcov', 'html'] },
},
});
pytest --cov=myproject --cov-report=term --cov-report=xml --cov-report=html
plugins { jacoco }
tasks.test { finalizedBy(tasks.jacocoTestReport) }
tasks.jacocoTestReport {
reports {
xml.required.set(true)
html.required.set(true)
}
}
go test -coverprofile=cover.out ./...
go tool cover -html=cover.out -o cover.html
dotnet test --collect:"XPlat Code Coverage"
# generates cobertura.xml under TestResults/*/
- run: <test command with coverage>
- if: always()
uses: codecov/codecov-action@v4
with:
files: coverage/lcov.info # or cobertura.xml / coverage.xml
Codecov / Coveralls / SonarCloud all accept standard formats and report coverage in PRs.
Useful patterns:
If you must gate on coverage:
// jest.config.js
coverageThreshold: {
global: { lines: 70, branches: 60 },
'./src/billing/': { lines: 90, branches: 80 },
}
Per-module thresholds reflect risk. Don't apply the same gate everywhere.
HTML coverage reports show line-by-line:
Useful for finding gaps. Less useful as a daily metric — engineers don't open the HTML report on every commit.
Tools like Codecov / Coveralls / SonarCloud annotate PR diffs directly: changed lines that are uncovered show as PR comments. This is the most actionable surface.
When helping with coverage, ask:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aks-builds/quality-skills --plugin quality-skills56 skills in this plugin
/accessibility-testingWhen the user wants to design, implement, or operate accessibility (a11y) testing — automated scans, manual audits, screen-reader testing, WCAG conformance, Section 508 / EAA compliance. Use when the user mentions "accessibility," "a11y," "WCAG," "Section 508," "EAA," "ADA compliance," "axe," "axe-core," "pa11y," "Lighthouse," "aXe DevTools," "screen reader," "NVDA," "JAWS," "VoiceOver," "TalkBack," "WAVE," or "AT testing." For visual diff see visual-regression. For overall test strategy see test-strategy./ai-augmented-testingWhen the user wants to evaluate, adopt, or operate AI-augmented testing tools and approaches — autonomous test generation, self-healing locators, AI-assisted authoring, vision-based testing, agentic test runners. Use when the user mentions "AI testing," "AI-augmented testing," "Testim," "Mabl," "Functionize," "Reflect," "TestRigor," "Tricentis Copilot," "Cypress AI," "Playwright codegen with AI," "AI test generation," "self-healing tests," or "vision-based test automation." For LLM-product evals see llm-eval-testing. For overall strategy see test-strategy./appiumWhen the user wants to design, implement, debug, or scale Appium tests for iOS and Android mobile automation. Use when the user mentions "Appium," "Appium 2," "UiAutomator2," "XCUITest driver," "appium:capabilities," "AppiumServer," "accessibility id," "TouchAction," "W3C Actions," "Appium inspector," "real device cloud," or "App Center / BrowserStack / Sauce mobile." For Android-native frameworks see espresso. For iOS-native see xcuitest. For React Native specifically see detox. For YAML-driven mobile flows see maestro. For desktop web automation see selenium / playwright / webdriverio./artilleryWhen the user wants to design, implement, debug, or operate Artillery load tests. Use when the user mentions "Artillery," "artillery.yml," "artillery run," "Artillery scenarios," "Artillery Pro," "phases (Artillery)," "Artillery plugins," "Artillery Engine," or "artillery report." For JS-tested perf with thresholds see k6. For JVM perf see gatling. For Python see locust. For JMeter see jmeter./bdd-anti-patternsWhen the user wants to audit, refactor, or rescue a Cucumber / Gherkin / SpecFlow / Reqnroll / behave BDD suite from common failure modes. Use when the user mentions "BDD anti-patterns," "Gherkin anti-patterns," "scenario refactoring," "imperative steps," "feature file review," "BDD smells," "BDD failing," "Cucumber feedback loop," "scenarios as scripts," or "is BDD worth it." For Cucumber/Gherkin basics see cucumber-gherkin. For .NET BDD see specflow-reqnroll. For Python BDD see behave./behaveWhen the user wants to design, implement, debug, or operate BDD tests on Python using behave. Use when the user mentions "behave," "behave.ini," "@given/@when/@then," "context.x," "environment.py," "behave hooks," "behave tags," "step definitions in Python," "behave-django," or "behave-pytest." For language-agnostic Gherkin patterns see cucumber-gherkin. For .NET BDD see specflow-reqnroll. For BDD failure modes see bdd-anti-patterns. For non-BDD Python testing see pytest.