Coverage Ratcheting
Enforce that test coverage never decreases — compare current coverage against baseline, flag regressions, and track per-package coverage trends
Best use case
Coverage Ratcheting is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Enforce that test coverage never decreases — compare current coverage against baseline, flag regressions, and track per-package coverage trends
Teams using Coverage Ratcheting should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/coverage-ratcheting/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Coverage Ratcheting Compares
| Feature / Agent | Coverage Ratcheting | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Enforce that test coverage never decreases — compare current coverage against baseline, flag regressions, and track per-package coverage trends
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Coverage Ratcheting Skill Enforce a coverage ratchet: coverage for each package must never decrease from its high-water mark. ## Trigger Conditions - Test suite run completes with coverage data - PR is submitted for review - Coverage thresholds are checked in CI - User invokes with "coverage check" or "coverage-ratcheting" ## Input Contract - **Required:** Current coverage data (from `go test -cover`) - **Optional:** Previous coverage baseline for comparison ## Output Contract - Per-package coverage percentages - Coverage delta from baseline (improved / unchanged / regressed) - Packages below minimum threshold per rule 123 - Ratchet violations (packages that decreased from high-water mark) - Recommended test additions to close gaps ## Tool Permissions - **Read:** Test files, coverage reports, source files - **Write:** Coverage baseline file (if updating) - **Shell:** Run `go test -coverprofile` - **Search:** Grep for untested functions ## Execution Steps 1. **Run tests with coverage**: Execute `go test -coverprofile=coverage.out ./...` 2. **Parse coverage**: Extract per-package and per-function coverage 3. **Compare to baseline**: Check each package against its previous high-water mark 4. **Check thresholds**: Verify each package meets minimum thresholds per rule 123 5. **Identify regressions**: Flag any package where coverage decreased 6. **Recommend**: For packages below threshold, identify the uncovered functions 7. **Update baseline**: If coverage improved, update the high-water mark ## Minimum Thresholds (from rule 123) - `internal/service/` — 90% - `internal/repository/` — 85% - `internal/handler/` — 80% - `internal/middleware/` — 80% - `internal/models/` — 75% ## References - `.cursor/rules/123-test-requirement-matrix.mdc`
Related Skills
ln-634-test-coverage-auditor
Coverage Gaps audit worker (L3). Identifies missing tests for critical paths (Money 20+, Security 20+, Data Integrity 15+, Core Flows 15+). Returns list of untested critical business logic with priority justification.
analyze-test-coverage
Analyze test coverage gaps and report findings
acc-analyze-test-coverage
Analyzes PHP codebase for test coverage gaps. Detects untested classes, methods, branches, exception paths, and edge cases. Provides actionable recommendations.
analyzing-test-coverage
Creates and analyzes tests using Vitest and MSW patterns. Generates test builders, mocks repositories, and configures integration tests. Triggers on: write tests, test coverage, Vitest, MSW mock, vi.fn, vi.mock, unit test, integration test, test builder, mock setup, test failure.
agent-coverage-check
Check agent configuration coverage across hierarchy levels and phases. Use to ensure complete agent system coverage.
add-test-coverage
Analyze recent changes and add test coverage for HEAD commit
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
Load Test Designer
Design load tests with realistic workload models and performance criteria
ln-523-auto-test-planner
Plans automated tests (E2E/Integration/Unit) using Risk-Based Testing after manual testing. Calculates priorities, delegates to ln-301-task-creator. Worker for ln-520.
legal-compliance-agent
Generate legally compliant privacy policies, terms of service, HIPAA documentation, and compliance pages for healthcare SaaS platforms. Ensures Google Play/App Store approval and GDPR/HIPAA compliance.
lc-test
Test a Rust solution file against LeetCode's test cases (project)
laravel-security-audit
Security auditor for Laravel applications. Analyzes code for vulnerabilities, misconfigurations, and insecure practices using OWASP standards and Laravel security best practices.