Test Quality Maintenance
Use this skill for test work where the goal is behavior confidence, not line-count padding. Use implementation and existing tests with failure or coverage evidence to produce validated test changes and identify remaining test gaps.
Inputs
implementation and existing tests - The public behavior, source, tests, fixtures, mocks, helpers, and project conventions in scope.
failure or coverage evidence - Reproduced failures, coverage reports, error paths, or risk evidence that justifies the work.
Outputs
validated test changes - Focused tests or root-cause fixes with relevant commands passing.
remaining test gaps - Intentionally untested behavior, residual risks, and reasons.
Shared Workflow
- Inspect the implementation, public API, existing tests, fixtures, mocks, helpers, and project conventions.
- Reproduce failing output when available.
- Fix root causes rather than updating assertions to match broken behavior.
- Add tests for real behavior: normal cases, edge cases, invalid input, async paths, failure paths, cleanup/rollback, integration boundaries, fixers, public API contracts, and user-facing messages.
- Keep mocks faithful to real behavior and avoid brittle sleeps or snapshots unless the project intentionally uses them.
- Run targeted tests first, then broader test, coverage, lint, typecheck, or build commands when warranted.
Coverage Work
Use coverage reports to prioritize high-risk and under-tested files. Aim for configured thresholds, but do not add empty assertions or tests that only execute lines. Document any intentional untested paths with a clear reason.
Playwright E2E
Inspect app structure, existing Playwright config, fixtures, selectors, auth helpers, and CI constraints. Cover the user journey end to end with stable selectors and deterministic setup. Include meaningful failure, loading, permission, and responsive states when they are part of the workflow.
Error Handling
Cover validation errors, external service failures, filesystem or network failures, auth failures, cleanup/rollback, retry behavior, logging, UI error boundaries, and user-facing messages. Assert that sensitive data is not logged or exposed.
Performance
Only add benchmarks when the project already supports them or the user explicitly wants a benchmark harness. Reuse existing thresholds and CI patterns. Measure latency, allocation, scaling, render time, I/O count, or query count as appropriate. Avoid noisy CI blockers unless the project already has stable budgets.
Reporting
Finish with scenarios covered, bugs fixed, files changed, commands run, coverage result when relevant, and any remaining test gaps.
1---2name: test-quality-maintenance3description: Generates, repairs, and improves tests and coverage. Use when writing unit tests, fixing failures, improving meaningful coverage, testing error handling, adding Playwright E2E tests, or creating focused benchmarks.4---56# Test Quality Maintenance78Use this skill for test work where the goal is behavior confidence, not line-count padding. Use `implementation and existing tests` with `failure or coverage evidence` to produce `validated test changes` and identify `remaining test gaps`.910## Inputs1112- `implementation and existing tests` - The public behavior, source, tests, fixtures, mocks, helpers, and project conventions in scope.13- `failure or coverage evidence` - Reproduced failures, coverage reports, error paths, or risk evidence that justifies the work.1415## Outputs1617- `validated test changes` - Focused tests or root-cause fixes with relevant commands passing.18- `remaining test gaps` - Intentionally untested behavior, residual risks, and reasons.1920## Shared Workflow21221. Inspect the implementation, public API, existing tests, fixtures, mocks, helpers, and project conventions.232. Reproduce failing output when available.243. Fix root causes rather than updating assertions to match broken behavior.254. Add tests for real behavior: normal cases, edge cases, invalid input, async paths, failure paths, cleanup/rollback, integration boundaries, fixers, public API contracts, and user-facing messages.265. Keep mocks faithful to real behavior and avoid brittle sleeps or snapshots unless the project intentionally uses them.276. Run targeted tests first, then broader test, coverage, lint, typecheck, or build commands when warranted.2829## Coverage Work3031Use coverage reports to prioritize high-risk and under-tested files. Aim for configured thresholds, but do not add empty assertions or tests that only execute lines. Document any intentional untested paths with a clear reason.3233## Playwright E2E3435Inspect app structure, existing Playwright config, fixtures, selectors, auth helpers, and CI constraints. Cover the user journey end to end with stable selectors and deterministic setup. Include meaningful failure, loading, permission, and responsive states when they are part of the workflow.3637## Error Handling3839Cover validation errors, external service failures, filesystem or network failures, auth failures, cleanup/rollback, retry behavior, logging, UI error boundaries, and user-facing messages. Assert that sensitive data is not logged or exposed.4041## Performance4243Only add benchmarks when the project already supports them or the user explicitly wants a benchmark harness. Reuse existing thresholds and CI patterns. Measure latency, allocation, scaling, render time, I/O count, or query count as appropriate. Avoid noisy CI blockers unless the project already has stable budgets.4445## Reporting4647Finish with scenarios covered, bugs fixed, files changed, commands run, coverage result when relevant, and any remaining test gaps.