Agent skill
test-generator
Generate unit and integration tests for project code. Use when new code is written or test coverage needs improvement.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/test-generator-adeptmind-pr-emojis-in-slack
SKILL.md
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
testingpackage + 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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?