/everything-copilot-cli:test-coveragefrom everything-copilot-cli
Identifies untested code paths and writes targeted unit or integration tests when coverage falls below target or new modules lack tests.
Ships in everything-copilot-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
# Node.js / Jest
npm test -- --coverage 2>&1 | Select-Object -Last 30
# With specific thresholds
npm test -- --coverage --coverageReporters="text" 2>&1
# Python / pytest
pytest --cov=src --cov-report=term-missing 2>&1
# Go
go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out
# Find files with lowest coverage (Jest text output)
npm test -- --coverage --coverageReporters="text" 2>&1 | Select-String "\d+\.\d+\s*\|" | Sort-Object { [double]($_ -split '\|')[1].Trim().TrimEnd('%') }
# Generate detailed HTML report for visual inspection
npm test -- --coverage --coverageReporters="html"
# Report is in coverage/lcov-report/index.html
Focus testing effort where it matters most:
| Priority | What to Cover | Why |
|---|---|---|
| 🔴 High | Business logic, calculations | Bugs here cost money |
| 🔴 High | Authentication, authorization | Security-critical |
| 🟡 Medium | Data transformations, parsers | Common source of bugs |
| 🟡 Medium | Error handling paths | Often untested, often broken |
| 🟢 Low | Simple getters/setters | Low risk |
| 🟢 Low | UI layout components | Better tested with E2E |
For each uncovered function or branch:
# View the uncovered code
# Coverage report shows line numbers — use view tool to see the code
# Find existing test file (or create one)
glob pattern="**/*moduleName*.test.*"
// Test the happy path
describe('calculateDiscount', () => {
it('applies 10% discount for orders over $100', () => {
expect(calculateDiscount(150)).toBe(135);
});
// Test edge cases and branches
it('returns original price for orders under $100', () => {
expect(calculateDiscount(50)).toBe(50);
});
it('handles zero amount', () => {
expect(calculateDiscount(0)).toBe(0);
});
// Test error paths
it('throws for negative amounts', () => {
expect(() => calculateDiscount(-10)).toThrow('Amount must be non-negative');
});
});
# Find conditional logic that may lack branch coverage
grep -n "if\|switch\|? .*:\|&&\|||" src/target-module.ts
Common branch gaps:
else clausescatch blocks&&, ||)# Run coverage again and compare
npm test -- --coverage --collectCoverageFrom="src/target-module.ts" 2>&1
# Verify overall coverage meets target
npm test -- --coverage 2>&1 | Select-String "All files|Statements|Branches"
Coverage can stay flat while the test suite keeps growing — each change brings its own new test, and CI gets slower without catching more bugs. Alongside the coverage number, chart how many lines the test code (including fixtures and helpers) has compared with the production code, and how many test lines each pull request adds on balance.
Set the warning level from this repository's own trend, and surface it in review rather than
failing the build; a blocking limit mostly produces denser, harder-to-read tests. A pull request
above the level should merge or remove tests that check the same behavior, or explain why it needs
the extra ones. (Idea adapted from mblode/agent-skills test-audit, MIT — see
THIRD-PARTY-NOTICES.md.)
// Source: src/api/client.ts has uncovered catch block
describe('apiClient.fetch', () => {
it('retries on network error', async () => {
const mockFetch = jest.fn()
.mockRejectedValueOnce(new Error('Network error'))
.mockResolvedValueOnce({ ok: true, json: () => ({ data: 'ok' }) });
const result = await apiClient.fetch('/endpoint', { fetch: mockFetch });
expect(mockFetch).toHaveBeenCalledTimes(2);
expect(result.data).toBe('ok');
});
it('throws after max retries', async () => {
const mockFetch = jest.fn().mockRejectedValue(new Error('Network error'));
await expect(apiClient.fetch('/endpoint', { fetch: mockFetch }))
.rejects.toThrow('Network error');
});
});
task agent_type: "task"
prompt: "Run 'npm test -- --coverage' and report the coverage summary. List any files below 80% line coverage."
| Rationalization | Reality |
|---|---|
| "80% coverage is good enough" | 80% is the minimum. What matters more is which 20% isn't covered. |
| "100% coverage is impractical" | Core business logic and security-critical code should still target 90%+ branch coverage. |
| "High coverage means high quality" | Coverage measures lines executed, not assertion quality. |
| "This file is hard to test" | Hard-to-test code is a signal of poor design. Improve the interface. |
expect(true).toBe(true))npm run coverage result meets or exceeds the baselineexplore agent to understand complex functions before writing testsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
test-coverage, unit-testing, integration-testing, coverage-gap
npx claudepluginhub drvoss/everything-copilot-cli --plugin everything-copilot-cli115 skills in this plugin
/actions-debuggingUse when a GitHub Actions workflow fails — diagnose the run log, identify the root cause, and apply a targeted fix/add-to-changelogUse when you've shipped a feature, fix, or breaking change and need to update CHANGELOG.md — follows Keep a Changelog format and syncs version numbers across package manifests./agent-governanceUse when designing or reviewing an AI agent system that needs policy-based access controls, intent classification, tool-level rate limiting, trust scoring for multi-agent workflows, or append-only audit trails.
Other plugins' skills for the same job