Expand test coverage
A curated collection of practical, evidence-backed skills for coding agents.
npx -y skills add zacharygcook/agent-skills --skill expand-test-coverageAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 26 days oldThe repository was created 26 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Add meaningful tests for changed or recently committed code, run focused and full suites, and fix real implementation defects exposed by those tests. Use when asked to add tests, improve coverage, test new code, or make sure a change is well tested.
SKILL.md
2.3 KB, as published. Nobody here has run it
Expand Test Coverage
Add tests that increase confidence in reachable behavior, not just coverage percentages.
Establish Scope
- Prefer the user-named files, PR, branch, or commit.
- Otherwise inspect
git status,git diff, andgit diff --cached. - If the tree is clean, inspect the latest relevant commit.
- Read each changed file in full plus adjacent contracts and existing tests.
Before writing tests, identify the public behavior, critical invariants, error paths, state transitions, integration boundaries, and realistic edge cases. Follow the repository's existing framework, fixtures, naming, and command conventions.
Select Valuable Cases
Prioritize:
- critical happy paths and business invariants;
- realistic validation, authorization, not-found, and provider failures;
- boundary values and malformed external data;
- important state transitions and retry/idempotency behavior;
- regression cases for confirmed bugs;
- integration behavior where mocks would hide the risk.
Avoid tests that only restate implementation details, assert framework behavior, exercise unreachable branches, or preserve dead code. If a branch has no production path, simplify or delete it instead of inventing a test.
Iterate
- Write a small coherent batch.
- Run the narrowest relevant test command immediately.
- Diagnose every failure before editing.
- Fix production code when the test reveals a real defect; fix the test when its premise or setup is wrong.
- Repeat until the planned behavior passes.
- Run the broader affected suite, then the full suite when proportionate and practical.
Never weaken an assertion, over-mock a boundary, or change expected behavior merely to turn the suite green. When intent is ambiguous, use docs, call sites, and existing tests as evidence and report the uncertainty.
Handoff
Report:
- behavior covered and tests added;
- implementation bugs found and fixed;
- focused and full commands run with results;
- anything not run and why;
- remaining meaningful gaps, not raw uncovered-line counts.