# Test Quality Maintenance

> 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.

- Skill: `nick2bad4u/test-quality-maintenance` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add nick2bad4u/test-quality-maintenance`
- Raw SKILL.md: https://api.skillmd.com/api/skills/nick2bad4u/test-quality-maintenance/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Nick2bad4u (https://skillmd.com/u/nick2bad4u)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/nick2bad4u/test-quality-maintenance

---


# 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

1. Inspect the implementation, public API, existing tests, fixtures, mocks, helpers, and project conventions.
2. Reproduce failing output when available.
3. Fix root causes rather than updating assertions to match broken behavior.
4. 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.
5. Keep mocks faithful to real behavior and avoid brittle sleeps or snapshots unless the project intentionally uses them.
6. 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.

