What problem does it solve?
This Skill eliminates the risk of writing ineffective unit tests that are coupled to existing implementation, miss critical bug-catching coverage, or are written after code is already built. It enforces the TDD Red phase, ensuring all unit tests are written before implementation and fail for the correct reasons, so you catch design flaws and missing coverage early.
Core Features & Use Cases
- TDD Red Phase Enforcement: Guides you to write failing unit tests before any implementation code exists, preventing tests that simply rubber-stamp existing behavior.
- 2026 Testing Best Practices: Implements industry-standard patterns including Arrange-Act-Assert (AAA) structure, FIRST principles, fakes over mocks for domain logic, and table-driven parameterised tests.
- Cross-Language Coverage: Provides safe vs bad test examples for C#, Java, Python, C, C++, TypeScript, and SQL, with guidance on assertion libraries, mocking tools, and mutation testing for each stack.
- Anti-Pattern Detection: Flags common test flaws like silent failures, mock overuse, missing edge/error cases, and non-descriptive test names, with severity tiers and refinement loop integration.
- Use Case: For a developer building a user authentication service, use this Skill to write failing unit tests for the login function covering valid credentials, wrong passwords, empty inputs, and injection attempts before writing any implementation code.
Quick Start
Use the unit-test-writer skill to write failing TDD unit tests for your new feature, covering happy paths, edge cases, and error scenarios before you write any implementation code.