Write comprehensive tests with emphasis on ALL error paths, edge cases, and regression coverage for code changes
The 'test-writer' skill assists developers in generating comprehensive and robust tests for their code changes, with a strong emphasis on error paths, edge cases, and regression coverage. This skill ensures that the tests go beyond basic functionality by also covering less common scenarios, such as error handling and system edge cases. It is particularly useful for preventing bugs that may arise from overlooked conditions or refactoring changes. With its structured approach, the skill ensures high-quality testing that protects against unintended code regressions.
You can trigger the 'test-writer' skill when you want to write tests, add tests for new functionality, or if you're reviewing code with insufficient test coverage. It is particularly useful after implementing new features or identifying missing test cases during code reviews.
The skill can generate unit tests, integration tests, and end-to-end (E2E) tests, depending on the complexity of the functionality being tested. It helps to prioritize error paths, happy paths, edge cases, state changes, and concurrency/timing scenarios.
The skill requires access to the tools: Read, Write, Grep, Glob, and Bash. It is compatible with multiple testing frameworks like Jest, Vitest, pytest, RSpec, and cargo test, depending on the project's testing setup.
The skill automatically detects the testing framework based on the imports in the codebase. It will match the test style and patterns already in place and use the appropriate mocking/assertion libraries to maintain consistency with the project's conventions.
Yes, the skill generates complete test files or adds to existing tests, including necessary imports, setup, teardown, and grouping of related tests. It follows a structured approach, using the AAA (Arrange, Act, Assert) pattern and prioritizing error path tests.
Quick Setup:
.claude/skills/Repository
ahkohd/dotfiles