.claude/skills/integration-test-coverage/SKILL.md
Deterministic integration test coverage analysis using off-the-shelf tooling. Use this skill whenever the user asks about test coverage, coverage gaps, untested code, what needs testing, or wants to improve integration test coverage. Also trigger when the user says 'run coverage', 'check coverage', 'coverage report', 'what's untested', 'find gaps', or has just implemented a feature and wants to know what integration tests are missing. This skill runs real tools and produces data-driven reports — not guesswork.
npx skillsauth add agentdevsl/agentpane integration-test-coverageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use off-the-shelf tools to produce reproducible, data-driven coverage gap reports. The model is already good at writing tests — the skill's value is in deterministic DETECTION of what's missing.
Generate a coverage report scoped to integration tests only. This tells you exactly which source lines are exercised by integration tests.
# Check for vitest config with project definitions
grep -l "projects\|workspace" vitest.config.* vite.config.* 2>/dev/null
If the project has an integration test project:
npx vitest run --project integration --coverage --coverage.reporter=json-summary --coverage.reporter=json --coverage.reportsDirectory=coverage/integration
If no separate project, filter by test directory:
npx vitest run tests/integration/ --coverage --coverage.reporter=json-summary --coverage.reporter=json --coverage.reportsDirectory=coverage/integration
For Jest:
npx jest --testPathPattern='integration|__integration__' --coverage --coverageDirectory=coverage/integration --coverageReporters=json-summary --coverageReporters=json
cat coverage/integration/coverage-summary.json | head -100
The json-summary report has per-file stats:
{
"src/services/task.service.ts": {
"lines": { "total": 500, "covered": 320, "pct": 64 },
"branches": { "total": 80, "covered": 45, "pct": 56.25 },
"functions": { "total": 40, "covered": 28, "pct": 70 }
}
}
Files with 0% line coverage have zero integration test coverage — these are the priority gaps.
Parse the coverage summary to find uncovered source files:
# List source files with 0% integration test line coverage
node -e "
const s = require('./coverage/integration/coverage-summary.json');
Object.entries(s).filter(([f,d]) => f !== 'total' && d.lines.pct === 0)
.forEach(([f,d]) => console.log(f));
"
For a broader view of low-coverage files:
# Files under 20% line coverage from integration tests
node -e "
const s = require('./coverage/integration/coverage-summary.json');
Object.entries(s)
.filter(([f,d]) => f !== 'total' && d.lines.pct < 20)
.sort((a,b) => a[1].lines.pct - b[1].lines.pct)
.forEach(([f,d]) => console.log(d.lines.pct.toFixed(0).padStart(3) + '% ' + f));
"
Run coverage for unit tests separately, then compare. Source files covered by unit tests but NOT integration tests are prime candidates for new integration tests.
# Unit test coverage
npx vitest run --project unit --coverage --coverage.reporter=json-summary --coverage.reportsDirectory=coverage/unit
# Find files covered by unit tests but not integration tests
node -e "
const unit = require('./coverage/unit/coverage-summary.json');
const integ = require('./coverage/integration/coverage-summary.json');
Object.entries(unit)
.filter(([f,d]) => f !== 'total' && d.lines.pct > 0)
.filter(([f]) => !integ[f] || integ[f].lines.pct === 0)
.forEach(([f,d]) => console.log('UNIT-ONLY: ' + f + ' (' + d.lines.pct.toFixed(0) + '% unit)'));
"
Use Vitest's built-in related command to find which integration tests touch a file:
# Which integration tests cover task.service.ts?
npx vitest related src/services/task.service.ts --project integration --reporter=verbose --run
If no tests are found, that file has an integration coverage gap.
Coverage tells you which lines were executed. Mutation testing tells you which lines were actually verified — a test that calls a function but never checks the return value shows 100% coverage but 0% mutation kill rate.
# Install if not present
npm install -D @stryker-mutator/core @stryker-mutator/vitest-runner @stryker-mutator/typescript-checker
# Run mutation testing on a specific service
npx stryker run --mutate 'src/services/task.service.ts'
Surviving mutants = code that tests execute but don't verify. These are the highest-value gaps to fill.
Map service-to-service dependencies to find untested integration points.
# Install
npm install -D dependency-cruiser
# Visualize service dependencies
npx depcruise src/services --include-only "^src/services" --output-type text
# Find circular dependencies (hard to integration test)
npx depcruise src --include-only "^src" --output-type err --no-config
# JSON output for programmatic analysis
npx depcruise src/services --include-only "^src" --output-type json > deps.json
Cross-reference the dependency edges against integration test files to find untested service-to-service interactions.
After running the tools, present a structured report:
## Integration Test Coverage Report
### Source files with ZERO integration coverage
| File | Unit Coverage | Status |
|------|-------------|--------|
| src/services/foo.service.ts | 85% | No integration tests |
| src/services/bar.service.ts | 72% | No integration tests |
### Low integration coverage (< 30%)
| File | Integration % | Lines Covered/Total |
|------|--------------|-------------------|
| src/services/baz.service.ts | 12% | 15/125 |
### Surviving mutants (tested but not verified)
| File | Survived | Total | Kill Rate |
|------|----------|-------|-----------|
| src/services/task.service.ts | 8 | 45 | 82% |
### Recommended actions (priority order)
1. Add integration tests for `foo.service.ts` — 0% coverage, high-traffic service
2. Add assertions for `task.service.ts` lines 120-135 — 8 surviving mutants
3. Add integration tests for `bar.service.ts` — only covered by unit tests
Then write tests for the identified gaps, following the project's existing test patterns and conventions.
development
AWS security assessment domains, risk rating framework, CIS/NIST reference baselines, and evidence-based finding format. Use when reviewing AWS security posture, assessing risk, or applying CIS/NIST baselines to Terraform configurations.
testing
--- name: "tf-runtask" description: "Retrieve and display Terraform Cloud/Enterprise run task results for a given run. Use this skill whenever the user asks about run task results, run task checks, task stage statuses, or wants to inspect what run tasks reported for a Terraform Cloud/Enterprise run. Triggers on phrases like "check the run tasks", "what did the run tasks say", "show run task results", "get task results for run-xxx", or any reference to run task outcomes on a specific run." source
devops
Research strategies for AWS documentation, provider docs, and public registry patterns. Use when researching AWS services, investigating provider resources, or studying public registry modules for design patterns.
development
Validation results summary template for Phase 4 output. Provides the format for reporting terraform test, validate, fmt, tflint, pre-commit, trivy, and security checklist results.