agentleFS
CaduS0uzaCaduS0uza/qa-supreme/skills/coverage-ratchet/SKILL.md

coverage-ratchet

Skill1 starsChanged 2 months agoMITView on GitHub

Use coverage as a one-way ratchet on changed lines instead of a vanity percentage — measure, set the floor at today's number, block regressions, and target uncovered risk rather than uncovered files. Use when asked to improve coverage or when a coverage gate is being configured.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never write a test whose purpose is to touch a line.

    line 42
  2. Very specific:

    Never chase 100%. The last 8% is generated code, error plumbing, and defensive branches.

    line 44
  3. Distinctive:

    Never report coverage as quality.

    line 46
  4. Very specific:

    Before/after numbers for changed lines, the new floor committed to the config, and the list of still-uncovered P0 lines carried into …

    line 50

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Coverage Ratchet

Coverage measures execution, not verification. A 95% suite of false positives is 95% theater (see false-positive-hunter). Used correctly it is still the cheapest map of what was never even run.

The ratchet

  1. Measure today's number. That is the floor — do not negotiate a target with the team.
  2. Gate on changed lines, not on the global percentage: new code must be covered at a high bar (90%+), legacy code is grandfathered.
  3. The floor only moves up. A PR that lowers it fails, with the specific uncovered lines named in the CI output.
# JS/TS
npx vitest run --coverage.enabled --coverage.thresholds.autoUpdate=false
# Python
pytest --cov=src --cov-report=term-missing --cov-fail-under=<floor>
# Go
go test ./... -coverprofile=c.out && go tool cover -func=c.out | tail -1

Diff coverage tools: diff-cover (Python), nyc + codecov patch status, or git diff --name-only origin/main | xargs piped into the reporter.

Reading the report correctly

  • Branch coverage over line coverage. A ternary counts as one line and two behaviors.
  • Sort uncovered lines by the risk tier from risk-map, then work top-down. An uncovered catch block in the payment path outranks an uncovered UI helper file entirely.
  • Uncovered catch and default branches are the classic production incident: they run exactly once, at the worst moment, and have never been executed.

What not to do

  • Never write a test whose purpose is to touch a line. It will be a FP-01/FP-14 and it will make the suite worse while making the number better.
  • Never chase 100%. The last 8% is generated code, error plumbing, and defensive branches; the effort belongs in mutation-proof on the first 30%.
  • Never report coverage as quality. Report it as "code we know at least ran".

Done means

Before/after numbers for changed lines, the new floor committed to the config, and the list of still-uncovered P0 lines carried into .qa-supreme/state.md as explicit debt.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.