Configure coverage

From laurigates/claude-plugins · View interactive version

Configure coverage is an AI agent skill from the GitHub repository laurigates/claude-plugins. Code coverage: thresholds and reporters for Vitest, Jest, pytest, Rust. Use when setting thresholds, adding Codecov/Coveralls, or wiring lcov/HTML reports.

How to use this skill

Skill file

/configure:coverage

Check and configure code coverage thresholds and reporting for test frameworks.

When to Use This Skill

| Use this skill when... | Use another approach when... |

|------------------------|------------------------------|

| Setting up coverage thresholds for Vitest, Jest, pytest, or Rust | Running tests with coverage (/test:full) |

| Configuring coverage reporters (text, JSON, HTML, lcov) | Configuring the test framework itself (/configure:tests) |

| Adding Codecov or Coveralls integration to CI/CD | Analyzing test failures (test-runner agent) |

| Auditing coverage configuration compliance across a project | Writing individual test cases |

| Adjusting coverage threshold percentages | Configuring general CI/CD workflows (/configure:workflows) |

Context

Parameters

Parse from command arguments:

Default threshold: 80% (lines, branches, functions, statements)

Supported frameworks:

Execution

Execute this code coverage compliance check:

Step 1: Detect test framework and coverage configuration

Check for framework indicators:

| Indicator | Framework | Coverage Tool |

|-----------|-----------|---------------|

| vitest.config.* with coverage | Vitest | @vitest/coverage-v8 |

| jest.config.* with coverage | Jest | Built-in |

| pyproject.toml [tool.coverage] | pytest | pytest-cov |

| .cargo/config.toml with coverage | Rust | cargo-llvm-cov |

Use WebSearch or WebFetch to verify latest versions of coverage tools before configuring.

Step 2: Analyze current coverage state

For the detected framework, check configuration completeness:

Vitest:

Jest:

pytest:

Rust (cargo-llvm-cov):

Step 3: Generate compliance report

Print a formatted compliance report:

Code Coverage Compliance Report
================================
Project: [name]
Framework: [Vitest 2.x | pytest 8.x | cargo-llvm-cov 0.6.x]

Coverage Configuration:
  Provider                @vitest/coverage-v8        [CONFIGURED | MISSING]
  Reporters               text, json, html, lcov     [ALL | PARTIAL]
  Output directory        coverage/                  [CONFIGURED | DEFAULT]
  Exclusions              node_modules, dist, tests  [CONFIGURED | INCOMPLETE]

Thresholds:
  Lines                   80%                        [PASS | LOW | NOT SET]
  Branches                80%                        [PASS | LOW | NOT SET]
  Functions               80%                        [PASS | LOW | NOT SET]
  Statements              80%                        [PASS | LOW | NOT SET]

CI/CD Integration:
  Coverage upload         codecov/coveralls          [CONFIGURED | MISSING]
  Artifact upload         coverage reports           [CONFIGURED | MISSING]

Overall: [X issues found]

If --check-only, stop here.

Step 4: Configure coverage (if --fix or user confirms)

Apply coverage configuration based on detected framework. Use templates from REFERENCE.md:

  1. Install coverage provider (e.g., @vitest/coverage-v8, pytest-cov)
  2. Update config file with thresholds, reporters, exclusions
  3. Add scripts to package.json or pyproject.toml
  4. Configure CI/CD with Codecov upload and artifact storage

Step 5: Update standards tracking

Update .project-standards.yaml:

standards_version: "2025.1"
last_configured: "[timestamp]"
components:
  coverage: "2025.1"
  coverage_threshold: 80
  coverage_provider: "[v8|istanbul|pytest-cov|llvm-cov]"
  coverage_reporters: ["text", "json", "html", "lcov"]
  coverage_ci: "codecov"

Step 6: Print final report

Print a summary of changes applied, scripts added, and next steps for verifying coverage.

For detailed configuration templates, see REFERENCE.md.

Agentic Optimizations

| Context | Command |

|---------|---------|

| Quick compliance check | /configure:coverage --check-only |

| Auto-fix all issues | /configure:coverage --fix |

| Custom threshold | /configure:coverage --fix --threshold 90 |

| Check coverage config exists | find . -maxdepth 1 -name 'vitest.config.*' -o -name 'jest.config.*' 2>/dev/null |

| Verify coverage directory | test -d coverage && echo "EXISTS" |

Flags

| Flag | Description |

|------|-------------|

| --check-only | Report status without offering fixes |

| --fix | Apply all fixes automatically without prompting |

| --threshold <percentage> | Set coverage threshold (default: 80) |

Examples

# Check compliance and offer fixes
/configure:coverage

# Check only, no modifications
/configure:coverage --check-only

# Auto-fix with custom threshold
/configure:coverage --fix --threshold 90

Error Handling

See Also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.