.skills/coverage/SKILL.md
Run tests with coverage instrumentation, identify uncovered code, and produce kanban cards for coverage gaps. Use when the user says "coverage", "what's untested", "find coverage gaps", or wants to know what needs tests. Automatically delegates to a tester subagent.
npx skillsauth add swissarmyhammer/swissarmyhammer 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.
Run tests with coverage instrumentation, then identify gaps and produce a concrete work list.
You MUST run tests with real coverage tools. Do not guess or structurally deduce coverage — measure it.
When you have poor code coverage, it means you have inherited code that was not done with proper TDD. The goal is to fix that and get the test that SHOULD HAVE been written with TDD into place until we get to complete coverage.
** IMPORTANT ** Do not change, delete, modify, refactor the code under test. Improving coverage should only be done by writing new tests, never by changing the code under test. If you find failing tests, note them but do not fix them — that is a separate task.
Use code_context to detect the project:
{"op": "detect projects"}
Read the matching language-specific coverage guide bundled with this skill for exact commands, tool options, scoping flags, test locations, and what requires tests:
| Project type | Guide | | ------------------ | ----- | | Rust (Cargo) | RUST_COVERAGE.md | | JS/TS (npm/pnpm) | JS_TS_COVERAGE.md | | Python (pytest) | PYTHON_COVERAGE.md | | Dart/Flutter | DART_FLUTTER_COVERAGE.md |
Follow the guide's instructions for running coverage, installing tools, and scoping. The guide is authoritative — do not guess commands.
There are two modes — the user decides which one applies:
Explicit scope (user named specific files, directories, crates, or packages):
Default scope (user just said "coverage" with no target):
maingit with op: "get changes" to get the list:
{"op": "get changes"}
Run the coverage commands from the language guide. Use the shell tool for all commands. Produce LCOV output — the guide specifies the exact flags and output paths for each tool.
If the coverage tool is not installed, install it using the command in the guide.
If tests fail, note the failures but continue with coverage analysis on the passing tests. Do NOT stop to fix failing tests — that is a separate task.
Read the generated lcov.info file. LCOV format reference:
SF:<path> — source file pathDA:<line>,<hits> — line data: line number and execution countDA:<line>,0 means the line was never executed (uncovered)end_of_record — end of file blockFor each file in scope:
DA: lines to get per-line hit countsCompute per-file metrics:
DA: lines for the fileDA:<line>,N where N > 0Initialize the board and create a coverage-gap tag:
{"op": "init board"}
{"op": "add tag", "id": "coverage-gap", "name": "Coverage Gap", "color": "ff8800", "description": "Function or method lacking test coverage"}
Create a kanban card for each uncovered function or block:
{"op": "add task", "title": "Add tests for <function_name>", "description": "<file:lines>\n\nCoverage: <X>% (<covered>/<total> lines)\n\nUncovered lines: <line ranges>\n\n<function signature>\n\n<what it does and what to test>", "tags": ["coverage-gap"]}
Report:
research
Create a single, well-researched kanban task. Use when the user wants to add a task, track an idea, or capture work without entering full plan mode.
testing
Drive kanban tasks from ready to done by looping implement → test → review until each task is clean. Supports single-task mode (one task id) and scoped-batch mode (all ready tasks in a tag/project/filter). Uses ralph to prevent stopping between iterations.
tools
Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions
testing
Run tests and analyze results. Use when the user wants to run the test suite or test specific functionality. Test runs produce verbose output — automatically delegates to a tester subagent.