← ClaudeAtlas

write-testslisted

Writes tests for existing code following Arrange/Act/Assert. Covers the happy path, edge cases, and error paths; mocks only at I/O boundaries, never the unit under test. Closes the loop that testability-review opens.
janmarkuslanger/skills · ★ 1 · Testing & QA · score 73
Install: claude install-skill janmarkuslanger/skills
# Write Tests When this skill is activated, write tests for a specified unit, module, or feature. The goal is meaningful coverage of *behavior* — not coverage numbers, and not tests that merely restate the implementation. **When to use this skill vs. related ones:** - `testability-review` — run it first if the code is *hard* to test; it identifies missing seams and hidden dependencies. This skill assumes the code is testable (or has just been made testable). - **this skill (`write-tests`)** — produces the actual test files. ## Clarifying Questions Before writing tests, ask the engineer the following. Skip any already clearly answered in the conversation. **Wait for the answers before proceeding.** 1. What is the scope — a specific function/class, a module, or a feature end-to-end? 2. What test framework and runner does the project use, and where do existing tests live? (If none exist, which framework should be introduced — this needs explicit approval.) 3. What level of test is wanted — unit, integration, or both? 4. Are there known edge cases, failure modes, or past bugs that must be covered? 5. Are there I/O boundaries (network, DB, filesystem, clock, randomness) that must be stubbed, and is there an existing test-double convention to follow? ## Steps 1. Read the code under test and identify every distinct behavior, branch, and error path. 2. Inspect existing tests to match the project's framework, file layout, naming, and assertion style — consistency over personal