test-coverage

Write targeted tests and verify coverage for changed source files.

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/dwayneparton/claude --skill test-coverage-dwayneparton
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-coverage
Source: https://github.com/dwayneparton/claude/tree/main/skills/test-coverage
Command: npx skills add https://github.com/dwayneparton/claude --skill test-coverage-dwayneparton

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests from scratch is time-consuming, and it is easy to miss edge cases or duplicate existing coverage. This Skill analyzes your changed source files, finds gaps in existing test suites, and writes only the tests needed to close those gaps. ## Core Features & Use Cases - Gap Analysis: Detects recently changed files via git diff, reads existing tests, and identifies untested functions, branches, and edge cases. - Convention-Aware Test Writing: Reuses existing test utilities, fixtures, and mocks, and matches the repo's established testing style and patterns. - Coverage Verification: Runs the test suite and coverage tooling (e.g., go test -cover, pytest --cov) and reports results back to you. - Use Case: After modifying a payment processing module, invoke this Skill to generate table-driven tests for the new branches, run the suite, and confirm coverage of the changed code. ## Quick Start Write tests for the files I just changed and report the coverage results.

Frequently Asked Questions about test-coverage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write tests for recently changed code?

Use git diff to identify changed source files, read each file's public API and branches, then check existing tests for coverage gaps. Write only the tests needed to cover untested functions, error cases, and boundary conditions.

How to improve test coverage without writing redundant tests?

Analyze existing tests first to find uncovered branches, then write table-driven or parameterized tests where multiple inputs exercise the same code path. Each test should cover a distinct behavior, targeting the public interface rather than implementation details.

Does this work with Go, Python, and TypeScript test frameworks?

Yes, the workflow is language-agnostic and adapts to repo conventions such as foo_test.go, test_foo.py, or foo.test.ts. It runs coverage with the appropriate tooling like go test -cover, pytest --cov, or npm test.

Should I reuse existing test fixtures and mocks?

Yes, always check for shared utilities in locations like __tests__/, conftest.py, or __mocks__/ before writing new setup code. If a needed helper is missing, add it to the shared location rather than inline in the test file.

What code should not be covered by unit tests?

Skip generated code, third-party libraries, and trivial getters or setters, as testing them adds maintenance cost without meaningful coverage. Focus on business logic, error handling, and non-obvious branches.