skills/test-coverage/SKILL.md
Generate unit tests for untested branches and edge cases. Use when coverage is low, CI flags gaps, or a release needs hardening. Not for integration/E2E suites, framework migrations, or fixing production bugs.
npx skillsauth add luongnv89/skills 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.
Expand unit test coverage by targeting untested branches and edge cases.
Detect the project's language from its manifest file and use the matching commands throughout the Workflow below:
| Manifest | Stack | Coverage command | Test framework |
|---|---|---|---|
| package.json | JavaScript/TypeScript | npx jest --coverage or npx vitest --coverage | Jest, Vitest, Mocha |
| pyproject.toml | Python | pytest --cov=. --cov-report=term-missing | pytest, unittest |
| go.mod | Go | go test -coverprofile=coverage.out ./... | testing, testify |
| Cargo.toml | Rust | cargo tarpaulin or cargo llvm-cov | built-in test framework |
If none of these manifests is found, see Edge Cases — "No test framework detected".
Before creating/updating/deleting files in an existing repository, sync the current branch with remote:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"
If the working tree is not clean, stash first, sync, then restore:
git stash push -u -m "pre-sync"
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop
If origin is missing, pull is unavailable, or rebase/stash conflicts occur, stop and ask the user before continuing.
Before making any changes:
feat/, feature/, etc.)feat/test-coverageRun the coverage command for the detected Stack above.
From the report, identify:
Review code for:
Use the test framework for the detected Stack above.
Target scenarios:
Run coverage again and confirm measurable increase. Report:
After a successful run on a Python project, the final verification report shows:
Coverage before: 61% (47/77 statements)
Coverage after: 84% (65/77 statements)
New tests added: 9
Files improved:
- src/parser.py 52% → 91% (+7 tests: null input, empty string, unicode overflow)
- src/auth.py 71% → 88% (+2 tests: expired token, missing header)
All 56 tests passing. No regressions.
A run passes when all of the following are true:
jest --coverage, pytest --cov, go test -cover).npm test, pytest, go test ./..., etc.).feat/test-coverage), never on main/master.package.json, pyproject.toml, Cargo.toml, or go.mod for test dependencies; if none found, asks the user which framework to use before writing any tests.pytest-cov, nyc, cargo tarpaulin, etc.) and retries rather than failing silently.pytest-asyncio, jest fakeTimers) rather than bare sync wrappers.After completing each major step, output a status report in this format:
◆ [Step Name] ([step N of M] — [context])
··································································
[Check 1]: √ pass
[Check 2]: √ pass (note if relevant)
[Check 3]: × fail — [reason]
[Check 4]: √ pass
[Criteria]: √ N/M met
____________________________
Result: PASS | FAIL | PARTIAL
Adapt the check names to match what the step actually validates. Use √ for pass, × for fail, and — to add brief context. The "Criteria" line summarizes how many acceptance criteria were met. The "Result" line gives the overall verdict.
Branch Setup phase checks: Feature branch created, Base coverage measured
Analysis phase checks: Coverage report parsed, Gaps identified, Priority ranked
Test Writing phase checks: Tests written, Edge cases covered, Framework conventions followed
Verification phase checks: Tests pass, Coverage improved, No regressions
tools
Run Herdr loops for one open GitHub issue (resolve→review→fix) or an existing PR (review→lazy fixer) until CLEAN. Don't use for plain resolution without review, review-only/no-fix requests, backlog automation, or merging.
tools
Manage AI agent fleets in Herdr: split root + sub-agents into one tab as a tiled grid, message/wait/read via herdr CLI, steer any pane. Use for Herdr multi-agent fleets. Don't use for tmux, screen, or non-Herdr terminals.
development
Generate or update docs to match the code, citing each claim to path:line and asking on ambiguity; runbook docs also get a check-only validation script. Don't use for API-reference autogen (JSDoc/Sphinx), landing pages, or CLAUDE.md/AGENTS.md.
testing
Generate a diagram and route to the right engine — draw.io XML (precise, editable, C4, swimlanes) or Excalidraw JSON (hand-drawn, sketch, wireframes). One entry for flowcharts, architecture, ER, sequence, mind maps. Don't use for Mermaid or slides.