Agent skill · Testing & QA

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.

rshankrasgithub.com/rshankrasGitHub ↗
claude-codecan modify filesships scriptsMIT
Install
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.

Facts
Files in the skill folder: 3
SKILL.md size: 4 KB
Bundled scripts: yes
Allowed tools: ReadWriteEditGlobGrepBash
Path: skills/testing/coverage-ratchet/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 589
Language: Swift

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. Why a Ratchet, Not a Target
  2. When This Skill Activates
  3. Setup
  4. The Gate
  5. CRAP Report (Advisory)
  6. Common Pitfalls
  7. References
Ships with 2 files
  • templates/coverage-gate.sh
  • templates/crap-report.sh
Commands it runs
Scripts/coverage-gate.sh --init     # runs tests with coverage, writes .coverage-baseline
Scripts/coverage-gate.sh            # exit 0 = pass, exit 1 = coverage dropped
More from claude-code-apple-skills
All skills →
About this skill
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.

Keep going