coverage-floor-lock
Skill0 starsChanged 4 months agoMITView on GitHub
Read-only guard that checks test coverage against a floor (lower-bound threshold) AND detects floor-lowering diffs — the anti-gaming case where the floor is quietly reduced so a dropping coverage number still passes. Exits 1 on below-floor or a lowered floor. Triggers: coverage floor, coverage lower bound, below floor, floor lowered, coverage gate, coverage guard.
In this repository46 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- a11y-standardsSkill
- a11y-static-gateSkill
- adversarial-refute-voteSkill
- antigravity-buildSkill
- architecture-parity-gateSkill
- ci-required-check-installerSkill
- codex-buildSkill
- codex-imagegenSkill
- codex-spark-delegateSkill
- commit-convention-gateSkill
- commit-msg-quality-scoreSkill
- consumer-finding-ledgerSkill
- context-bloat-trackerSkill
- destructive-env-guardSkill
- dev-standardsSkill
- eval-dataset-buildSkill
- eval-regression-guardSkill
- fanout-verify-synthSkill
- gate-forgeSkill
- hallucination-rate-meterSkill
- harness-kpi-ledgerSkill
- judge-rubric-voteSkill
- knowledge-citation-coverageSkill
- knowledge-dedup-scanSkill
- knowledge-index-guardSkill
- live-state-verify-guardSkill
- maker-checker-relaySkill
- memory-distillSkill
- mistake-rule-distillSkill
- oneshotSkill
- prompt-ab-evalSkill
- report-shapeSkill
- retry-failure-classifierSkill
- review-finding-reproSkill
- rule-dedup-scanSkill
- rule-promote-auditSkill
- rule-promotion-extractSkill
- secret-scan-hardeningSkill
- self-heal-ciSkill
- session-length-compact-auditSkill
- startSkill
- subagent-usage-analyzerSkill
- task-success-rate-trackSkill
- token-codegen-gateSkill
- trigger-vocab-dedupSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 75
stop primitive: scripts/goal-loop.sh (exit 0 = GOAL MET / 1 = CONTINUE / 2 = CAP REACHED)
≈ “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.
Files
coverage-floor-lock
Reads a coverage report (lcov / json / plain-text %) and:
- checks that coverage % is at or above the floor (below-floor detection), and
- checks that the floor itself was not lowered vs a baseline — the anti-gaming case where someone quietly drops the floor so a falling coverage number still "passes" (a floor-lowering diff).
It performs inspection (read) + a printed verdict only. It never changes the floor value, CI config, or branch protection.
Boundary (read-only)
- This skill and
${CLAUDE_PLUGIN_ROOT:-.}/scripts/coverage-floor-check.shonly inspect and print a verdict. They never write the floor value, wire it into CI, or touch branch protection. - Raising the floor / improving coverage is done by hand. Wiring a coverage floor into a
CI required check or branch protection is a high-risk (self-lockout) change — apply it
deliberately with human review (a
/reviewsession, the kit's read-onlydev-revieweragent, or a person). - It never calls git. The baseline (previous floor) is supplied by the caller via
--baseline-floor/--baseline-floor-file. In CI, the caller resolves it (e.g.git show HEAD~1:.coverage-floor) and passes it in.
How to run
- Generate a coverage report with your project's test runner (this skill does not generate it).
- Inspect (read-only):
bash "${CLAUDE_PLUGIN_ROOT:-.}/scripts/coverage-floor-check.sh" \ --coverage <file> --floor <N> [--baseline-floor <M>]--coverage: lcov (.info) / json (istanbul summary etc.) / text (NN.N%or a ratio0.NN).--format auto|lcov|json|text(defaultauto).--floor <N>: current lower bound (%). Or--floor-file <path>(extracts a bare number /{"coverage_floor":N}/floor: N).--baseline-floor <M>(optional): the previous lower bound. When set, current < previous → floor lowered = fail.--baseline-floor-file <path>also works.- exit 0 = coverage >= floor AND floor not lowered (pass).
- exit 1 = below floor or floor lowered (fail).
- exit 2 = missing/invalid arguments.
- exit 3 = coverage / floor unparseable → state UNKNOWN (an empty/missing report is not read as 0%).
- On exit 1, raise the floor or improve coverage by hand (CI-gate changes need human approval). On exit 3 (UNKNOWN), fix the report generation first — do not treat it as 0%.
Deterministic --check (self-test)
bash "${CLAUDE_PLUGIN_ROOT:-.}/scripts/coverage-floor-check.sh" --self-test- exit 0 = the verdict logic (at-or-above-floor → pass / below floor → fail / floor lowered → fail / unparseable → UNKNOWN) and the lcov/json/text parsers agree across all built-in fixtures.
- exit 1 = a case disagreed (broken logic).
- The self-test is gh/aws/git-independent and hermetic (temp
mktemp -dfixtures only; it writes nothing into the repo and cleans up). No hardcoded success — changing one expected value makes it FAIL.
Example config
examples/coverage-floor/coverage-floor.json— a minimal floor file ({"coverage_floor": 80}) you can pass via--floor-fileand version alongside the code so the baseline can be resolved from git history in CI.
Related
- backing script:
${CLAUDE_PLUGIN_ROOT:-.}/scripts/coverage-floor-check.sh - stop primitive:
scripts/goal-loop.sh(exit 0 = GOAL MET / 1 = CONTINUE / 2 = CAP REACHED)
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
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.

