write-tests
Systematically add test coverage for all local code changes using specialized review and development agents.
Purpose - Ensure comprehensive test coverage for new or modified code
Output - New test files covering all critical business logic
/tdd:write-tests ["focus area or modules"]Arguments
Optional focus area specification. Defaults to all uncommitted changes. If everything is committed, covers the latest commit.
How It Works
Preparation Phase
Discovers test infrastructure (test commands, coverage tools)
Runs full test suite to establish baseline
Reads project conventions and patterns
Analysis Phase (parallel)
Verifies single test execution capability
Analyzes local changes via
git statusor latest commitFilters non-code files and identifies logic changes
Assesses complexity to determine workflow path
Test Writing Phase
Simple changes (single file, straightforward logic): Writes tests directly
Complex changes (multiple files or complex logic): Orchestrates specialized agents
Coverage reviewer agents analyze each file for test needs
Developer agents write comprehensive tests in parallel
Verification agents confirm coverage completeness
Verification Phase
Runs full test suite
Generates coverage report if available
Iterates on gaps until all critical logic is covered
Complexity Decision:
1 simple file: Write tests directly
2+ files or complex logic: Orchestrate parallel agents
Usage Examples
Best practices
Run before committing - Ensure all changes have test coverage before commit
Be specific - Provide focus areas for more targeted test generation
Review generated tests - Verify tests actually test behavior, not implementation
Iterate on gaps - Re-run if coverage reviewer identifies missing cases
Prioritize critical logic - Not every line needs 100% coverage, focus on business logic
Last updated