coverage-mapper

Map source files to covering tests and rank uncovered code by risk.

3|2|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/robotijn/ctoc --skill coverage-mapper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coverage-mapper
Source: https://github.com/robotijn/ctoc/tree/main/skills/testing/coverage-mapper
Command: npx skills add https://github.com/robotijn/ctoc --skill coverage-mapper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the guesswork of test prioritization and test-to-source mapping, so you don't waste time writing tests for low-risk code while critical paths like authentication, payments, and security logic remain untested.

Core Features & Use Cases

  • Bidirectional file-test mapping: Builds and maintains maps of which tests cover which source files, enabling smart test selection to run only relevant tests for changed code and speed up CI pipelines.
  • Risk-ranked uncovered code inventory: Maps every uncovered code region to a risk score weighted by module criticality, code churn, cyclomatic complexity, and PR delta, so you know exactly where to add tests first instead of chasing overall coverage percentages.
  • Intelligent categorization: Automatically suppresses trivial uncovered code (getters, DTO fields, dead code with no callers) and surfaces high-risk gaps like untested error paths, security conditionals, and new PR code with no coverage to reduce noise for test writers.
  • Use Case: For a PR that adds new payment processing logic, the mapper flags untested error paths in the payment module as critical risk, lists existing tests that cover related code for fast validation, and suggests exact test cases to cover the gaps.

Quick Start

Use the coverage-mapper skill to generate a risk-ranked map of uncovered code regions for your current project, highlighting high-risk gaps in your open pull request and suggesting exactly where to add tests next.

Frequently Asked Questions about coverage-mapper

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prioritize tests for uncovered code based on risk instead of overall coverage percentage?

Risk-ranked uncovered code inventory maps every untested region to a risk score weighted by module criticality, code churn, cyclomatic complexity, and PR delta. This identifies high-risk gaps like untested security conditionals so you target test efforts to critical paths instead of chasing vanity coverage metrics.

Can I map which tests cover specific source files to run only relevant tests for changed code in CI?

Bidirectional file-test mapping builds and maintains relationships between source files and their covering tests. This enables smart test selection to run only relevant tests for changed code, speeding up CI/CD pipelines and pull request validation.

Does the coverage mapping output integrate with SonarQube and Codecov?

The coverage mapper delivers normalized JSON output compatible with Codecov, SonarQube, and custom refinement loops. This allows teams to import risk-weighted coverage data and uncovered code inventories directly into existing quality gates and reporting dashboards.

How do I suppress trivial uncovered code like getters and DTO fields when mapping test coverage gaps?

Intelligent categorization automatically suppresses trivial uncovered code including getters, DTO fields, and dead code with no callers. It surfaces high-risk gaps like untested error paths and new PR code with no coverage, reducing noise for test writers.

What is the best way to identify untested error paths in new pull request code?

The coverage mapper analyzes PR diffs to flag untested error paths and new code with no coverage as critical risk. It lists existing tests covering related code for fast validation and suggests exact test cases to cover the gaps.

When should I use risk-weighted coverage mapping for legacy codebase modernization?

Risk-weighted coverage mapping suits legacy codebase modernization when teams need to target test efforts to high-risk paths rather than chasing overall coverage percentages. It applies to CI/CD pipelines and pull request reviews by prioritizing tests based on module criticality and code churn.