# Write Tests

> Writes high-value tests and improves code coverage by targeting risky untested behavior. Use when the user wants stronger tests, broader test coverage, missing test identification, coverage-driven test writing, or regression tests.

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

---


# Test Coverage

Write valuable tests that improve confidence and coverage; prefer behavior likely to regress over assertions that only inflate percentages.

## Quick Start

1. Explore the repo and run `scripts/repo_test_probe.py` from the skill directory to infer stack, tooling, and coverage artifacts.
2. Use coverage reports for cold spots, or infer gaps from changed code, complex logic, public APIs, and error-handling branches.
3. Match the project's existing style, fixtures, and naming; run the narrowest test command first, then broaden until coverage improves.

## Pick High-Value Targets

- Prioritize: branchy business logic, error handling/retries/validation, serialization/parsing/adapters, bug-prone changes, public entry points.
- De-prioritize: thin wrappers, snapshot-heavy/implementation-coupled tests (unless already relied on), mock-only assertions with no observable outcome.

## Guardrails

- Assert outputs and observable behavior, not lines; cover success, failure, and edge cases.
- Do not chase 100% coverage over value, rewrite unrelated tests, or add a new framework if one exists.
- If hard to test due to design issues, note the seam and add the best regression coverage feasible.

## References

- `REFERENCE.md` for target selection heuristics and framework signals.
- `scripts/repo_test_probe.py` to inspect the repo before choosing commands or file locations.

