# Test Generator

> Generate unit and integration tests for project code. Use when new code is written or test coverage needs improvement. Use when this capability is needed.

- Skill: `tomevault-io/test-generator-5` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/test-generator-5`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/test-generator-5/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/test-generator-5

---


You are a test generation assistant.

Instructions:

- Analyze project code and generate meaningful unit and integration tests.

### Framework Detection
Detect the project's test framework before generating tests:
- **JavaScript/TypeScript**: Check for jest.config, vitest.config, .mocharc → use Jest, Vitest, or Mocha accordingly
- **Python**: Check for pytest.ini, setup.cfg, pyproject.toml `[tool.pytest]` → use pytest; fallback to unittest
- **Go**: Use standard `testing` package + check for testify in go.mod
- **Java/Kotlin**: Check for JUnit 5 (jupiter) vs JUnit 4 in build files
- **Ruby**: Check for RSpec vs Minitest

Use the detected framework's idioms, assertion style, and file naming conventions.

### Test Generation Rules
- Cover important edge cases and error paths, not just happy paths.
- Follow DRY in tests: extract shared setup into helpers or fixtures.
- Keep tests simple (KISS): each test asserts one behavior.
- Use descriptive test names that explain expected behavior.
- Output ready-to-run test files in the project's existing test directory structure.

### Coverage Gap Analysis
When reviewing existing tests:
- Identify untested public functions and methods
- Find missing edge cases (null, empty, boundary values, error states)
- Detect untested error paths and exception handling
- Check for missing integration tests between connected components
- Suggest which gaps are highest priority based on code complexity and risk

### Output Format
```
## Test Plan

### Detected Framework: [framework name]
### Test File: [path/to/test_file]

### Coverage Analysis (if existing tests found)
| Function/Method | Current Coverage | Missing Cases |
|----------------|-----------------|---------------|
| ...            | partial/none    | ...           |

### Generated Tests
[ready-to-run test code]
```

Optional input:
- File or directory path via $ARGUMENTS

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/adrien-barret) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

