Skip to content
cccskills
FreePublished on GitHub

verifying-change-coverage

Verifies that the lines and branches a change actually touched are executed by tests, using LCOV or Cobertura diff coverage instead of whole-repo percentages, and escalates uncovered high-risk changes into a blocking finding. Use when a pull request needs a coverage gate that unrelated tests cannot satisfy, when total coverage looks healthy but the diff is untested, when wiring diff coverage into CI, or when someone claims a change is covered because the suite is green.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118 stars(GitHub 118 + cccskills 0)
Works withGitHubGitLab

Run score Not tested

See how to install

Files included (4)

  • SKILL.md10.3 KB
  • resources/ci-wiring.md4.6 KB
  • resources/coverage-artifacts.md6.5 KB
  • resources/exceptions-and-thresholds.md5.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Verifying Change Coverage

Use this skill to answer one question honestly: were the lines this change introduced actually executed by a test?

Repo-wide coverage cannot answer it. A repo at 84% can merge an untested payment path and stay at 84%, because a big denominator absorbs a small numerator. Diff coverage changes the denominator to the lines you just wrote, which is the only denominator that maps to the risk you just added.

The distinction that runs through this skill: configured is not verified. A test runner in package.json proves the practice exists. Executed lines prove this change was tested. Report which of the two you measured.

When to Use

  • a PR gate needs a coverage signal that cannot be gamed by unrelated tests
  • total coverage is stable but defects keep escaping in new code
  • diff coverage has to be wired into CI for the first time
  • a reviewer needs to know which specific new lines nothing executes
  • an agent wrote tests and someone needs to know whether they exercise the new code
  • coverage numbers are being quoted in a release decision and nobody knows what they measure

Operating Principles

  • Executed lines, not configured tools. The whole point. Say plainly which one you have.
  • No artifact, no verdict. Without a coverage report you have static linkage - "a test file exists that imports this module" - which is weaker evidence and must be labelled as such. Never present it as coverage.
  • Branches matter more than lines on changed code. New code is where new conditionals live. A line hit once with the if never taken is half-tested.
  • Uncovered is a question, not a verdict. Some uncovered lines are fine: logging, type guards, unreachable defaults. The output is a list of uncovered changed lines with a judgement per group, not a percentage with a pass stamp.
  • Coverage proves execution, never correctness. An assertion-free test covers everything and verifies nothing. Pair this with unslop-tests - a diff-coverage gate is exactly the pressure that produces coverage theatre.
  • Escalate by risk, not by count. Three uncovered lines in auth outrank thirty in a formatter.
  • The gate belongs on changed lines only. Demanding a repo-wide floor on a legacy codebase produces a permanently red gate that gets disabled within a month.

Workflow

Phase 0: Get the two inputs

The changed lines.

git diff <base>...HEAD --unified=0 -- '***.ts' '***.tsx'

--unified=0 gives added-line ranges with no context, which is what you want to intersect against coverage. Keep the file → line-numbers map; discard removed lines, generated files, and anything the contract excludes.

The coverage artifact. Produce one if it does not exist:

npx vitest run --coverage --coverage.reporter=lcov   # → coverage/lcov.info
npx jest --coverage --coverageReporters=lcov
npx playwright test    # + c8/istanbul instrumentation for E2E coverage

See ./resources/coverage-artifacts.md for the formats, the merge problem across suites, and the monorepo path pitfalls.

If no artifact can be produced: stop and say so. Report static linkage instead, labelled as static linkage, and state what it cannot tell you. Then make producing an artifact the first remediation item - this is the single highest-leverage change to a coverage story.

Phase 1: Intersect

For each changed source file, intersect its added-line numbers with the executed lines in the report. Produce, per file:

  • changed lines - added or modified executable lines (exclude blank lines, comments, pure type declarations, and import statements)
  • covered - changed lines the report marks as executed at least once
  • uncovered - changed lines with zero hits
  • partial branches - changed lines with branch data where at least one path was never taken

Diff coverage = covered ÷ changed executable lines, per file and overall. Compute branch coverage on changed lines separately; do not average it into the line number.

The exclusions matter and are the most common source of a wrong figure - see ./resources/coverage-artifacts.md for what counts as an executable line in TypeScript once it has been compiled or transformed.

Phase 2: Classify each uncovered group

Never hand over a raw list. Group contiguous uncovered lines and judge each group:

ClassWhat it isAction
Untested logicbranches, calculations, validation, error pathswrite the test - this is the finding
Untested integrationcode only reachable with a real dependencyintegration test, or a documented exception
Defensivedefault: on an exhaustive switch, never guards, invariant throwsacceptable; record why
Instrumentationlogging, metrics, tracing callsacceptable
Unreachabledead codedelete it rather than test it
Hard to reachneeds an exotic environment or a failure that cannot be simulatedexception with an owner and an expiry

The first two are findings. The rest are exceptions and must be recorded, not silently subtracted - see ./resources/exceptions-and-thresholds.md.

Phase 3: Set the verdict

Combine diff coverage with the risk tags from scoping-change-relevance:

ConditionVerdict
Changed lines below threshold and the file carries an escalation tag (auth, critical-path, db-migration, new-endpoint)BLOCK
Changed lines below threshold on ordinary sourceWARN
Threshold met but changed branches materially uncoveredWARN
Threshold met, uncovered lines all classified as acceptable exceptionsOK with the exceptions listed
No coverage artifact availableINFO - static linkage only, artifact required

The escalation rule is the reason this beats a flat percentage: 70% on a logging module and 70% on session handling are not the same result, and one number cannot say so.

Phase 4: Report

Report per file, worst first: changed lines, diff coverage, branch coverage on changed lines, and the uncovered groups with their class and a one-line judgement. Point at exact line ranges - src/pricing.ts:142-149 - so the fix needs no hunting.

Finish with the two sentences that make the report honest:

  1. What this measured: executed lines on the diff, from <artifact>, produced by <which suites>.
  2. What it did not measure: whether the executing tests assert anything meaningful.

Wiring It Into CI

./resources/ci-wiring.md has working GitHub Actions and GitLab CI jobs, the base-ref fetch depth that trips everyone up on the first attempt, artifact merging across suites, and the sticky-PR-comment pattern.

Three rules for the gate itself:

  • Gate on changed lines, never on a repo-wide floor.
  • Fail loudly or not at all. || true on a coverage step is worse than no gate, because it reports green.
  • Ship the gate as a warning for one iteration, then turn it blocking. A gate introduced blocking on a legacy repo gets removed; one introduced as a warning gets fixed.

Common Failure Modes

  • Quoting repo coverage in a change conversation. The single most common error, and the reason untested code merges into well-covered repos.
  • Counting non-executable lines. Imports, types, and interfaces inflate the denominator and hide real gaps.
  • One suite's artifact, many suites' tests. Unit-only LCOV makes integration-covered code look uncovered. Merge, or say which suites the number represents.
  • Monorepo path mismatch. Relative paths in the report that do not match the paths in the diff produce 0% coverage and a fake emergency.
  • Chasing the number. A gate met by asserting nothing. This is the predictable failure of any coverage gate; read unslop-tests before celebrating.
  • Silent /* istanbul ignore */. An exclusion with no reason and no owner is a waiver that skipped the register.
  • Treating uncovered as automatically bad. Uncovered logging lines are fine. Reporting them as findings trains people to ignore the report.

Resource Map

  • ./resources/coverage-artifacts.md - LCOV and Cobertura formats, generating them per runner, merging across suites, what counts as an executable line, monorepo path pitfalls
  • ./resources/exceptions-and-thresholds.md - thresholds by profile, legitimate exception classes, how to record an exclusion with an owner and an expiry
  • ./resources/ci-wiring.md - GitHub Actions and GitLab CI jobs, base-ref fetching, artifact merge, sticky PR comment, warn-then-block rollout

Related Skills

  • scoping-change-relevance - supplies the risk tags that turn a below-threshold result into BLOCK rather than WARN
  • unslop-tests - the necessary counterweight: coverage proves execution, this proves the tests assert something
  • writing-unit-tests - when the finding is untested logic and tests have to be written
  • deriving-a-quality-contract - where the diff-coverage threshold for this project is set
  • governing-quality-waivers - when an uncovered area needs a recorded, dated exception
  • analyzing-quality-metrics - for coverage's caveats as a metric and what to report alongside it

Definition of Done

This skill is complete when:

  • the changed-line set and the coverage artifact are both identified, with the suites the artifact represents
  • diff coverage is computed on executable changed lines only, per file and overall
  • branch coverage on changed lines is reported separately from line coverage
  • every uncovered group is classified and judged, not listed raw
  • the verdict accounts for the risk tags of the files involved, not only the percentage
  • exceptions are recorded with a reason and an owner, never silently excluded
  • the report states what was measured and, explicitly, that coverage does not prove correctness

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Defines, computes, and interprets test and quality metrics: pass rate, flake rate, suite duration, defect escape rate, time to detect, and coverage with its caveats. Use when building a QA dashboard, reporting suite health to stakeholders, comparing releases over time, or when a coverage percentage or a bug count is being treated as a measure of quality.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Analyzes diffs, changed files, hotfixes, and release candidates to identify where regression risk spreads and what must be retested first. Use when scoping retest after a change, reviewing QA impact for a pull request, or building a minimal confidence suite for release validation.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Writes and reviews API automation tests with Playwright Test, covering setup/teardown, assertions, data management, and hybrid API+UI flows. Use when creating backend API tests, contract checks, data-driven API coverage, API+UI hybrid workflows, or reviewing existing Playwright API suites.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Measures the risk that code shipped without anyone understanding it: a teach-back attestation on high-risk changes, a risk band from changed-code complexity, diff size and whether a human explanation accompanied it, and optional AI-authorship provenance. Findings stay advisory by design. Use when an AI-assisted codebase grows faster than the team reads it, when reviews are rubber-stamped, when nobody can explain a module that ships weekly, or when leadership asks how much of the code the team can actually maintain.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Produces an evidence-backed go/no-go recommendation: exit criteria status, open-defect risk profile, coverage against risk, environment parity, rollback readiness, and the residual risk stated plainly. Use when preparing a release sign-off, when someone asks whether a build is ready to ship, or when a decision to release is being made on impressions rather than evidence.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

Records human verification - code review, exploratory sessions, UAT, accessibility passes, UX and observability reviews - as dated, attributed attestations in a register, so human-centric practices stay in the quality contract without pretending to be automated checks. Use when a strategy requires verification no tool can prove, when sign-off evidence is scattered across chats and tickets, when a gap matrix needs to distinguish "attested" from "passed", or when an audit asks who verified what and when.

The English summary is being prepared. Showing the original description.

jaktestowac/awesome-copilot-for-testers118Updated Aug 27, 2026

See all skills by jaktestowac

Report a problem with this skill