test-writer
Write comprehensive tests with emphasis on ALL error paths, edge cases, and regression coverage for code changes
Security Assessment
About test-writer
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.
FAQ
When should I trigger the 'test-writer' skill?
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.
Which types of tests does the skill generate?
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.
What are the required tools or dependencies for the skill?
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.
How does the skill determine the test framework to use?
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.
Does the skill provide complete test files or just snippets?
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.
Install test-writer
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
ahkohd/dotfiles