Install any skill in seconds. Free to start, no credit card required.
Get Started Free →rshankras/coverage-ratchet
Gate test coverage with a ratchet — a committed baseline that coverage may never drop below and only ever rises. Ships a coverage-gate script (xccov-based) plus an advisory CRAP report (complexity × uncovered).
Passed 20 of 22 test cases with the skill, and 8 of 22 without it.
and 12 more in the full report
13 fixed7 passed either way1 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 13 test cases the skill fixed. Same model, same prompt, with and without the skill.
When running the advisory risk script that combines function complexity and test coverage, how many top high-risk functions does the summary output print out for developer review?
| Checked | Without skill | With skill |
|---|---|---|
| States that the report outputs the top 20 functions | Missed | Passed |
The instructions your model reads when the skill loads.
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.
test cases passed, vs 8 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.