| name | create-tests |
| description | Create tests for recent code changes — analyzes the diff, identifies what needs coverage, and writes appropriate tests |
| agents | ["all"] |
| workflow | project-tools |
Create Tests
Write tests for recent implementation work. Analyzes changes and produces appropriate test coverage.
Process
-
Identify scope: Run git diff main...HEAD --stat to see what changed. If the user specifies files or a feature, scope to that instead.
-
Check for existing tests: Changed files may already have test files. Read them first — add new test cases to existing files rather than creating duplicates.
-
Analyze and write tests:
- Focus on logic, branching, edge cases, error handling
- Skip trivial getters/setters/CRUD
- Mock external dependencies — don't require running services
- Follow the project's existing test conventions (framework, file organization, mocking patterns)
-
Verify: Run the project's test command to confirm all tests pass.
-
Commit: Commit test files with message test: add tests for <feature>
What to Test
- Business logic and branching paths
- Error handling and edge cases
- Integration points (with mocked dependencies)
- Anything that would break silently without tests
What NOT to Test
- Pure configuration files
- Simple type definitions
- Trivial pass-through functions
- Generated code