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.
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-coverageDetect the project's test runner and run the coverage report:
npx jest --coverage or npx vitest --coveragepytest --cov=. --cov-report=term-missinggo test -coverprofile=coverage.out ./...cargo tarpaulin or cargo llvm-covFrom the report, identify:
Review code for:
Use project's testing framework:
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
Solution: Check package.json, pyproject.toml, Cargo.toml, or go.mod for test dependencies. If none found, ask the user which framework to use and install it.
Solution: Install the appropriate coverage tool (nyc, pytest-cov, etc.) and retry.
Solution: Do not add new tests until existing failures are resolved. Report failing tests to the user first.
documentation
Manage software releases end-to-end: bump version, generate changelog, tag, push, GitHub release, publish to PyPI/npm. Use when user asks to ship, cut a release, tag a version, or list changes since last tag. Skip routine commits and marketplace publishing.
development
Review UI for usability issues using Steve Krug's principles and produce a scannable report. Use when asked for a usability audit, UX review, or UI feedback on screenshots, URLs, or code. Don't use for visual/brand design critique, accessibility (WCAG) audits, or backend/API review.
development
Validate app/startup ideas with market, feasibility, commercial, and open-source competitor analysis. Use when asked to evaluate, validate, or score a product idea. Don't use for PRDs, go-to-market plans, or investor decks.
testing
Install local-first security hardening: pre-commit secret detection, offline dependency scans, static analysis, reports, and gated free CI. Use when hardening repos or adding security hooks. Don't use for incident response or cloud security reviews.