testdoc-writelisted
Install: claude install-skill vivekbhange-hub/test-doctor-skill
# testdoc-write: tests that can actually fail
Most weak tests were written fast and never seen red. This procedure has one non-negotiable
step: every test is shown to fail when the code is wrong, then the code is put back.
## Inputs
- The target: a function, class, module, or a bug report with steps to reproduce.
- The project's test framework and where its tests live. Look at 2 existing tests and copy their
style, fixtures and naming.
- Commands below say `python3`; on Windows use `python` (or `py -3`). Use the project's own runner
(`python3 -m pytest`, `npx jest`, `go test`, `mvn test`).
## Outputs
- New tests next to the existing ones, one behaviour per test, named after the behaviour.
- A short table in your reply: test name, behaviour, how you proved it can fail.
- Any bug found in the code, reported rather than silently pinned.
## Steps
1. **Confirm permission.** Write tests and run the code only in a repository the user owns or is
authorized to change. Do not run code that touches production systems or real credentials.
2. **Read before writing.** Read the target and everything it calls that affects the result.
Note inputs, outputs, side effects (files, network, database, clock, randomness) and the
errors it raises. Read the docstring and callers for the intended behaviour.
3. **Enumerate behaviours.** Write the list first, in plain sentences, before any test code:
- the main path with typical input;
- each branch (every `if`, `else`, early