test-generator
Installation
SKILL.md
Test Generator
Before generating any output, read config/defaults.md and adapt all patterns, imports, and code examples to the user's configured stack.
Process
- Read the source file to understand its exports, dependencies, and behavior.
- Identify the source type: API route, utility function, React component, or hook.
- Generate test cases covering: happy path, edge cases, error handling, boundary values.
- Write the test file using Vitest syntax (fall back to Jest if the project uses it).
- Include proper mocking, setup/teardown, and descriptive test names.
File Naming and Placement
- Place test file adjacent to source:
foo.ts→foo.test.ts,Foo.tsx→Foo.test.tsx. - If the project uses a
__tests__/directory convention, follow that instead. - For API route tests:
app/api/users/route.ts→app/api/users/route.test.ts.