CO

Detects gaps in test coverage and generates targeted unit tests for critical code paths.

Install

mkdir -p .claude/skills/code-coverage && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12028" && unzip -o skill.zip -d .claude/skills/code-coverage && rm skill.zip

Installs to .claude/skills/code-coverage

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Analyzes test coverage, identifies untested code paths, and generates tests for the most critical uncovered areas. Use to improve test coverage before releases.
160 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Run project's coverage command
  • Perform static analysis for uncovered code
  • Generate a coverage report summary
  • List critical uncovered code paths
  • Generate missing tests for critical areas

How it works

This skill attempts to run the project's coverage tools or performs static analysis to identify untested code paths. It then generates a report and suggests or creates tests for critical uncovered areas.

Inputs & outputs

You give it
Project codebase or specific file/module
You get back
Coverage report, list of critical uncovered code, and generated test code

When to use code-coverage

  • Analyze test coverage report
  • Generate missing unit tests
  • Increase branch coverage

About this skill

Test Coverage Analysis

Detect Test Setup

!ls package.json jest.config.* vitest.config.* .nycrc* .c8rc* .coveragerc* setup.cfg pyproject.toml tox.ini 2>/dev/null !cat package.json 2>/dev/null | grep -E "jest|vitest|c8|nyc|istanbul|coverage" | head -5


Process

Step 1: Run Coverage (if configured)

Attempt to run the project's coverage command:

EcosystemCoverage Command
npm (Jest)npx jest --coverage --json 2>/dev/null
npm (Vitest)npx vitest run --coverage 2>/dev/null
npm (c8)npx c8 report --reporter=json 2>/dev/null
Python (pytest)python -m pytest --cov --cov-report=json 2>/dev/null
Gogo test -coverprofile=coverage.out ./... 2>/dev/null && go tool cover -func=coverage.out
Rustcargo tarpaulin --out json 2>/dev/null

If coverage tools aren't configured, proceed with static analysis.

Step 2: Static Analysis (if no coverage tool)

For the target file(s):

  1. Identify all public functions, methods, and classes
  2. Search for corresponding test files
  3. For each function, check if there's a test that calls it
  4. Map which code paths (branches, error handlers) have test coverage

Step 3: Coverage Report

Summary

MetricValue
Line coverageXX%
Branch coverageXX%
Function coverageXX%
Uncovered filesX

Uncovered Critical Code

List the most important uncovered code, prioritized by:

  1. Business logic — core features and workflows
  2. Error handling — catch blocks, error paths, edge cases
  3. Security-sensitive — auth, input validation, data access
  4. Complex logic — functions with high cyclomatic complexity

For each uncovered area:

  • File path and line numbers
  • What the code does
  • Why it's important to test
  • Suggested test cases

Step 4: Generate Missing Tests

For the top 5 most critical uncovered areas, generate test code following the project's test patterns (same structure as /write-tests).

Step 5: Coverage Improvement Plan

PriorityFileCurrentTargetTests Needed
1...XX%80%+...
2...XX%80%+...

Rules

  • Focus on meaningful coverage, not 100% — test behavior, not implementation
  • Prioritize business logic and error paths over boilerplate
  • Don't generate tests just to increase numbers — each test should validate something valuable
  • Respect existing test patterns and conventions

When not to use it

  • When 100% coverage is the only goal
  • When only boilerplate code needs testing
  • When test generation is not desired

Limitations

  • Focuses on meaningful coverage, not 100%
  • Does not generate tests for boilerplate code
  • Each generated test must validate something valuable

How it compares

This workflow prioritizes generating tests for critical business logic and error paths, rather than simply aiming for a high coverage percentage.

Compared to similar skills

code-coverage side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
code-coverage (this skill)04moReviewIntermediate
codeql12moReviewAdvanced
lint-and-validate66moReviewBeginner
coverage65moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

codeql

trailofbits

Runs CodeQL static analysis for security vulnerability detection using interprocedural data flow and taint tracking. Applicable when finding vulnerabilities, running a security scan, performing a security audit, running CodeQL, building a CodeQL database, selecting query rulesets, creating data extension models, or processing CodeQL SARIF output. NOT for writing custom QL queries or CI/CD pipeline setup.

12

lint-and-validate

davila7

Automatic quality control, linting, and static analysis procedures. Use after every code modification to ensure syntax correctness and project standards. Triggers onKeywords: lint, format, check, validate, types, static analysis.

68

coverage

alirezarezvani

Analyze test coverage gaps. Use when user says "test coverage", "what's not tested", "coverage gaps", "missing tests", "coverage report", or "what needs testing".

65

architecture-patterns

wshobson

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.

55214

auth-http-api-cloudbase

TencentCloudBase

Use when you need to implement CloudBase Auth v2 over raw HTTP endpoints (login/signup, tokens, user operations) from backends or scripts that are not using the Web or Node SDKs.

17

generating-grpc-services

jeremylongshore

Generate gRPC service definitions, stubs, and implementations from Protocol Buffers. Use when creating high-performance gRPC services. Trigger with phrases like "generate gRPC service", "create gRPC API", or "build gRPC server".

13

Search skills

Search the agent skills registry