agentleFS
theamtheam/claude-dev-kit/skills/coverage-check/SKILL.md

coverage-check

Skill17 starsChanged 3 months agoApache-2.0View on GitHub

Run the repo's unit tests with coverage and verify that every file touched in the current change keeps line, branch, and function coverage at or above 95%. Language- and framework-agnostic. Use before committing, before PR creation, or when the user asks about coverage.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. SerhiiKorniienko/bullshit-detector★ 151same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository13 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    If you detect the command by inference (not from config), offer to persist it to .claude/dev-kit.json under test.coverageCommands so the …

    line 35
  2. Very specific:

    Run the command(s), then parse the produced report for per-file line/branch/function metrics.

    line 39
  3. Distinctive:

    If tests themselves fail, report the failures verbatim — never report coverage from a failing run as authoritative.

    line 55
  4. Distinctive:

    If a metric is genuinely unavailable for a stack (e.g.

    line 56

≈ “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 Check

Enforce the team's coverage gate: every touched file must stay ≥ 95% (line, branch, function). This skill is stack-agnostic — it runs whatever the consuming repo declares and parses whatever standard report the run produces.

1. Find the touched files

git diff --name-only against the base branch, plus staged and unstaged changes. Exclude, by convention: generated/vendored code, database migrations, and the test files themselves. Group the remaining files by the module/project they belong to so you can run the narrowest useful test set first.

2. Determine the coverage command(s)

In order of preference:

  1. Declared in config — read .claude/dev-kit.json (test.coverageCommands) and the consuming repo's CLAUDE.md. If a command is declared, use it verbatim.
  2. Declared by the repo's tooling — a test:coverage script in package.json, a Makefile/Taskfile target, a coverage task in the build file.
  3. From the stack profile — if .claude/dev-kit.json has stacks (or you detect one), read instructions/stacks/<id>.md for the stack's coverage command, report path, and format, plus any prerequisite (e.g. PHP needs Xdebug/PCOV; without it, report that rather than 0%).
  4. Detected from the stack — infer from the project files present, e.g.:

    Stack signalTypical coverage commandReport produced
    *.csproj / *.slndotnet test --collect:"XPlat Code Coverage"Cobertura XML
    package.json (jest/vitest)npm test -- --coveragelcov / json-summary
    angular.jsonng test --watch=false --code-coveragelcov
    pom.xml / build.gradlemvn test / gradle test jacocoTestReportJaCoCo XML
    pyproject.toml / setup.pypytest --cov --cov-report=xmlcoverage.py XML
    go.modgo test ./... -coverprofile=cover.outGo coverprofile
    Cargo.tomlcargo llvm-cov --lcovlcov

    A monorepo may need several commands (one per language/area). Run each and merge the per-file results.

If you detect the command by inference (not from config), offer to persist it to .claude/dev-kit.json under test.coverageCommands so the next run is deterministic.

3. Run and parse

Run the command(s), then parse the produced report for per-file line/branch/function metrics. Handle the common formats: Cobertura XML, lcov (lcov.info), JaCoCo XML, coverage.py XML, Go coverprofile, and json-summary. Map each report path back to the touched source files from step 1.

4. Verdict

Report a table, worst offenders first:

| File | Lines | Branches | Functions | Verdict |
|------|-------|----------|-----------|---------|
| src/payments/payment_service.<ext>      | 97.2% | 95.0% | 100%  | PASS |
| src/payments/payment-list.component.<ext> | 88.4% | 71.0% | 90.0% | FAIL |
  • The bar is the project's own (adaptive — see instructions/testing-standards.md). Use the project's configured threshold or gates.coverage.min in .claude/dev-kit.json; default ≥ 95% when none is set. Also FAIL on a regression (a touched file dropping below its pre-change coverage) even if it's above the bar.
  • N/A, not FAIL, when the project has no test/coverage setup. If there is no test suite or coverage tooling, report NOT APPLICABLE — no coverage setup with a recommendation to add tests (and offer to set it up) — do not invent a failure or a number. Only enforce a hard gate when gates.coverage is required.
  • FAIL (when the gate applies) if any touched file is below the bar or regresses; list the uncovered lines/branches and propose the specific missing test cases, and don't mark work complete / open a PR while it fails.
  • If tests themselves fail, report the failures verbatim — never report coverage from a failing run as authoritative.
  • If a metric is genuinely unavailable for a stack (e.g. a runner reports no branch coverage), state that plainly rather than reporting a fabricated number.

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.