Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Gates test coverage using xccov against a committed baseline that only rises.
Use this skill ↓36% 91%+55 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 8 of 22 without it.
3 of 3 safety checks passed
98 agent runs
2 forksA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
A build/test gate proves the tests that exist pass. It says nothing about whether tests were written — a phase with no test task ships green on build success alone. The coverage ratchet closes that hole deterministically: line coverage is measured on every verify, compared against a committed baseline, and may never drop. It only rises.
An absolute threshold ("80%") fails one of two ways on a real codebase: it fails day one (so it gets disabled), or it gets set below current reality (so it gates nothing). A ratchet starts from wherever the project actually is and only tightens. Nobody argues with "don't get worse."
Use this skill when:
testing/fitness-functions/ and swift/code-size/)templates/coverage-gate.sh into the project (e.g. Scripts/coverage-gate.sh), make it executable, and fill in the config block (scheme, destination, app target name).Scripts/coverage-gate.sh --init # runs tests with coverage, writes .coverage-baseline
.coverage-baseline..coverage-baseline holds a single decimal fraction (e.g. 0.6231) — the app target's line coverage. Trailing whitespace ignored; nothing else in the file.
Scripts/coverage-gate.sh # exit 0 = pass, exit 1 = coverage dropped
xccov JSON report.current < baseline − 0.0025 (the epsilon absorbs measurement jitter from unchanged code).current > baseline + 0.01: update .coverage-baseline to the new number in the same commit as the tests that earned it. That's the ratchet clicking forward.Ratchet-up etiquette: raising the baseline is routine and encouraged; lowering it requires a written reason in the commit message (e.g. deleting a well-covered module) — treat it like widening a fitness-function allowlist.
Next to this one in the catalogue, plus more from the same author.