Get the FREE Ultimate OpenClaw Setup Guide →

vibe-coverage-enforcer

npx machina-cli add skill ash1794/vibe-engineering/coverage-enforcer --openclaw
Files (1)
SKILL.md
2.1 KB

vibe-coverage-enforcer

Coverage numbers don't guarantee quality, but low coverage guarantees surprise.

When to Use This Skill

  • Before claiming a feature is complete
  • After writing tests, to verify coverage meets standards
  • During periodic coverage health checks
  • When deciding "do I need more tests?"

When NOT to Use This Skill

  • Prototype/spike code that will be rewritten
  • Generated code (API clients, schema types)
  • Configuration files
  • When the user explicitly says coverage isn't a priority for this task

Tiered Standards

Not all code needs the same coverage:

TierTargetWhat's Included
Critical>=90%Security, authentication, authorization, payment/billing, data integrity, encryption
Business>=80%Core business logic, API handlers, state management, validation
General>=70%Utilities, formatting, UI components, logging
ExemptN/AGenerated code, test helpers, one-time scripts

Steps

  1. Run coverage for the project:

    • Go: go test -cover ./... or go test -coverprofile=coverage.out ./...
    • JS/TS: npm test -- --coverage
    • Python: pytest --cov
  2. Classify packages/modules into tiers

  3. Compare actual vs. target for each package

  4. Report gaps:

Output Format

Coverage Report

Overall: X% (target: varies by tier)

Package/ModuleTierActualTargetStatus
auth/Critical92%90%
handlers/Business75%80%✗ (-5%)
utils/General68%70%✗ (-2%)

Action Required

  1. handlers/ needs +5% coverage — suggest testing: [specific untested functions]
  2. utils/ needs +2% coverage — suggest testing: [specific untested functions]

Suggested Tests

[Specific test skeletons for uncovered code]

Source

git clone https://github.com/ash1794/vibe-engineering/blob/master/skills/coverage-enforcer/SKILL.mdView on GitHub

Overview

The vibe-coverage-enforcer ensures code meets tiered coverage targets: Critical >=90%, Business >=80%, General >=70%. It helps teams avoid releasing with hidden issues by requiring measurable coverage before considering work complete.

How This Skill Works

It reads coverage reports, maps packages to tiers, and compares actual vs. target coverage. When gaps exist, it surfaces them for remediation and records suggested tests to close the gaps.

When to Use It

  • Before claiming a feature is complete
  • After writing tests, to verify coverage meets standards
  • During periodic coverage health checks
  • When deciding 'do I need more tests?'
  • For ongoing risk-based auditing of critical paths

Quick Start

  1. Step 1: Run coverage for the project: Go: go test -cover ./...; JS/TS: npm test -- --coverage; Python: pytest --cov
  2. Step 2: Classify packages into Critical, Business, General, and Exempt tiers
  3. Step 3: Review the report, address gaps with targeted tests, and re-run to confirm

Best Practices

  • Prioritize Critical tier coverage first for security, data integrity, and auth paths
  • Exclude Exempt tier (generated code, test helpers, one-time scripts) from targets
  • Document gaps with suggested tests and the intended coverage uplift
  • Automate tier classification and comparison in CI to catch drift early
  • Reclassify packages as code evolves and features change to keep targets relevant

Example Use Cases

  • auth/ achieves Critical coverage at or above 92%, validating security and access controls
  • handlers/ falls short on Business target (e.g., 75%) and prompts API handler tests
  • utils/ sits near General target (around 68-70%), triggering minor utility/test enhancements
  • coverage job runs in CI and flags gaps with suggested test additions
  • generated clients and schema files are marked Exempt and excluded from targets

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers