Skip to content
Back to skills

Coverage Improvement

ASecurity

Use when working to raise code coverage, target specific uncovered lines, or close the gap against the workspace's configured coverage thresholds and aspirational targets.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
testing

Works with

  • mcp

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add spencerbeggs/vitest-agent --skill coverage-improvement --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coverage Improvement?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coverage Improvement
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/spencerbeggs-coverage-improvement/badge)](https://www.skillsdirectory.com/skills/spencerbeggs-coverage-improvement)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: coverage-improvement
description: Use when working to raise code coverage, target specific uncovered lines, or close the gap against the workspace's configured coverage thresholds and aspirational targets.
---

# Improving Code Coverage

Systematic approach to identifying and covering untested code using
MCP tools.

## Step 1: Identify Coverage Gaps

Use `test_coverage` to see project-wide coverage gaps:

- Files below threshold with exact uncovered line ranges
- Per-metric values (statements, branches, functions, lines)
- Current thresholds and targets

For a specific file, use `file_coverage({ filePath: "src/foo.ts" })`
to get per-metric values and uncovered line ranges.

## Step 2: Understand Existing Tests

Use `test (action: for_file)({ filePath: "src/foo.ts" })` to find which test
files already cover the source file. Then use
`test (action: get)({ fullName: "Suite > test name" })` to understand
individual test scope and history.

## Step 3: Write Targeted Tests

Focus on the uncovered lines from step 1:

1. Read the source file at the uncovered line ranges
2. Identify untested code paths (branches, error handlers, edge cases)
3. Write tests targeting those specific paths
4. Run with `run_tests({ files: ["path/to/test.ts"] })`

## Step 4: Verify Improvement

1. Use `file_coverage` to check the file's updated coverage
2. Use `test_coverage` to verify project-wide improvement
3. Use `test_trends` to confirm coverage direction is improving

## Prioritization

Focus on files with the largest coverage gaps first. Files near
the threshold ("at-risk" files) are the highest priority since
a small regression could push them below the threshold.

## Recording Progress

Use `note (action: create)` to document:

- Which files you improved and by how much
- Untested paths that were intentionally deferred
- Coverage targets agreed upon with the team

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.