coverage

SKILL.md

Coverage Check

Context

Run in parallel:

  • git diff --name-only - get unstaged files
  • git diff -U0 --no-color - get changed line numbers

Commands

Sequential:

  1. npm run test:ci - vitest with coverage
  2. npm run coverage:report - generate lcov/text reports

Workflow

  1. Get unstaged files and line ranges (parallel):
    • git diff --name-only
    • git diff -U0 --no-color
  2. Run coverage:
    • npm run test:ci
    • npm run coverage:report
  3. Save diff to a temp file, then run:
    git diff -U0 --no-color > /tmp/changes.diff
    python3 scripts/parse-lcov.py --lcov coverage/lcov.info --diff /tmp/changes.diff
    
    See lcov-format.md for lcov format details.
  4. Report uncovered lines from stdout: file.ts:42
  5. Summary from stderr: X/Y changed lines covered

Rules

  • Only analyze unstaged changes (git diff)
  • Use sequential commands: test:ci then coverage:report
  • Use scripts/parse-lcov.py to parse lcov data and map to changed lines
  • Report uncovered lines: file.ts:42
  • Ignore files without coverage data (non-code files)

Error Handling

  • If npm run test:ci fails → report test failures and stop; coverage cannot be generated with failing tests
  • If coverage/lcov.info not found after test run → verify coverage.reporter includes lcov in the test runner config
  • If git diff returns no changes → report no unstaged changes to check
Weekly Installs
14
First Seen
Feb 13, 2026
Installed on
claude-code14
codex14
gemini-cli14
opencode14
trae-cn13
iflow-cli13