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.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
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.
Coverage report exists from a runnable command for the detected stack (e.g., jest --coverage, pytest --cov, go test -cover).
Post-run total coverage is strictly higher than the pre-run baseline — no test additions that fail to move the metric.
New tests target previously-untested branches, error paths, or boundary values — not duplicates of existing assertions.
The full test suite passes locally before committing (npm test, pytest, go test ./..., etc.).
All new tests live on a feature branch (e.g., feat/test-coverage), never on main/master.
Commit message records the before/after coverage percentages and the files newly covered.
Edge Cases
No test framework detected: Skill checks 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.
Coverage tool not installed: Installs the appropriate tool (pytest-cov, nyc, cargo tarpaulin, etc.) and retries rather than failing silently.
Existing tests are already failing: Does not add new tests until existing failures are resolved; reports the failing tests to the user first.
100% coverage already reached: Reports this to the user and exits — no tests are added unnecessarily.
Generated code or vendored files in coverage report: Excludes auto-generated and third-party directories from analysis to avoid writing tests for code the project does not own.
Async / concurrent code paths: Uses framework-appropriate async test utilities (e.g., pytest-asyncio, jest fakeTimers) rather than bare sync wrappers.
Step Completion Reports
After completing each major step, output a status report in this format:
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