| name | test-generator |
| description | Generates test code from specifications, components, and API endpoints. Creates unit tests, integration tests, and E2E tests following project testing patterns and conventions. |
| version | 1.0.0 |
| model | sonnet |
| invoked_by | both |
| user_invocable | true |
| tools | ["Read","Write","Glob","Grep"] |
| best_practices | ["Analyze existing test patterns","Follow project testing conventions","Generate comprehensive test coverage","Include edge cases and error scenarios","Use appropriate testing framework"] |
| error_handling | graceful |
| streaming | supported |
| templates | ["unit-test","integration-test","e2e-test","api-test"] |
| verified | true |
| lastVerifiedAt | "2026-02-22T00:00:00.000Z" |
| source | builtin |
| trust_score | 100 |
| provenance_sha | 35a3ef4d4e3f2d26 |
Mode: Cognitive/Prompt-Driven — No standalone utility script; use via agent context.
Test Generator Skill - Generates test code from specifications, components, and API endpoints following project testing patterns and conventions.
- Generating tests for new components
- Creating tests for API endpoints
- Generating E2E tests for user flows
- Creating integration tests
- Adding test coverage for existing code
Step 1: Identify Test Type
Determine what type of test is needed:
- Unit Test: Component/function testing
- Integration Test: Service/API integration
- E2E Test: Full user flow testing
- API Test: Endpoint testing
Step 2: Analyze Target Code
Examine code to test (Use Parallel Read/Grep/Glob):
- Read component/function code
- Identify test cases
- Understand dependencies
- Note edge cases
Step 3: Analyze Test Patterns
Review existing tests:
- Read similar test files
- Identify testing patterns
- Note testing framework usage
- Understand mocking strategies
Step 4: Generate Test Code
Create test following patterns:
- Use appropriate testing framework
- Follow project conventions
- Include comprehensive coverage
- Add edge cases and error scenarios
Step 5: Coverage Analysis
After generating tests, analyze coverage:
-
Check that generated tests cover all requirements:
- Verify all functions/methods are tested
- Check all branches are covered (if/else, switch, etc.)
- Ensure all edge cases are tested
- Validate error scenarios are covered
-
Validate tests are runnable:
- Check test syntax is valid
- Verify imports are correct
- Ensure test framework is properly configured
- Validate test setup/teardown is correct
-
Report coverage percentage:
- Calculate line coverage (if possible)
- Calculate branch coverage (if possible)
- Report uncovered code paths
- Suggest additional tests for uncovered areas
-
Coverage Validation Checklist:
**Unit Test (React Component)**
**Integration with Developer Agent**:
- Generates tests during development
- Ensures test coverage
- Validates implementation
**Example Commands**: