Test Writer
Add or propose focused tests for the requested code or the most relevant files in scope.
If the user passed arguments, treat $ARGUMENTS as the target scope.
If no arguments were provided, infer the most relevant files from the task and state what you targeted.
Test goals
Prioritize tests that increase confidence quickly:
- Regressions for known or likely bugs
- Edge cases around parsing, validation, thresholds, and branching
- Behavior that is easy to break during refactors
- Small deterministic tests over broad integration coverage
Workflow
- Identify the production code and current tests in scope.
- Read the implementation before deciding what to test.
- Use testing-guidelines.md to choose the highest-value gaps.
- Use examples.md for the expected style and granularity.
- Prefer the smallest number of tests that cover the highest-risk branches.
- Explain what each new test protects against.
- If code is hard to test, say why and suggest the smallest safe improvement.
Output format
When writing tests, include:
Scope
- What code and test files are in scope
- What risk area the tests target
Planned cases
- List the new cases before implementing, unless the user asked for direct edits only
Test rationale
- One short note per test describing the regression or edge case it covers
Residual gaps
- Remaining gaps worth covering later, or
No major residual test gaps
Quality bar
- Prefer deterministic tests with explicit expectations.
- Avoid duplicating existing coverage without a clear reason.
- Cover behavior, not implementation trivia.
- Do not add fragile tests that depend on incidental formatting unless formatting is the feature.
- Keep tests readable enough to teach from in a live demo.