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). Use when agent-written code needs a deterministic "tests were actually written" check.
npx skills add rshankras/claude-code-apple-skills --skill coverage-ratchet --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Coverage Ratchet 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. ## Why a Ratchet, Not a Target 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." ## When This Skill Activates Use this skill when: - A project has a test target but coverage has never been measured - Agent-written features keep arriving with build-passing, test-free code - Setting up the deterministic gauntlet (with `testing/fitness-functions/` and `swift/code-size/`) ## Setup 1. Copy `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). 2. Bootstrap the baseline: ```bash Scripts/cov
- Why a Ratchet, Not a Target
- When This Skill Activates
- Setup
- The Gate
- CRAP Report (Advisory)
- Common Pitfalls
- References
Scripts/coverage-gate.sh --init # runs tests with coverage, writes .coverage-baseline Scripts/coverage-gate.sh # exit 0 = pass, exit 1 = coverage dropped
What does the coverage-ratchet skill do?
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). Use when agent-written code needs a deterministic "tests were actually written" check.
How do I install it?
Run `npx skills add rshankras/claude-code-apple-skills --skill coverage-ratchet --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From rshankras/claude-code-apple-skills, a repository with 589 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
