home / skills / greyhaven-ai / claude-code-config / test-generation
This skill automatically generates thorough tests for existing code, including unit, integration, edge cases, and error handling to improve coverage.
npx playbooks add skill greyhaven-ai/claude-code-config --skill test-generationReview the files below or copy the command above to add this skill to your agents.
---
name: grey-haven-test-generation
description: "Comprehensive test suite generation with unit tests, integration tests, edge cases, and error handling. Use when generating tests for existing code, improving coverage, or creating systematic test suites. Triggers: 'generate tests', 'add tests', 'test coverage', 'write tests for', 'create test suite'."
# v2.0.43: Skills to auto-load for test generation subagents
skills:
- grey-haven-code-style
- grey-haven-testing-strategy
# v2.0.74: Restrict tools for test generation work
allowed-tools:
- Read
- Write
- MultiEdit
- Bash
- Grep
- Glob
- TodoWrite
---
# Test Generation Skill
Comprehensive test suite generation with unit tests, integration tests, edge cases, and error handling.
## Description
Automated test generation analyzing code structure and generating thorough test coverage for existing implementations.
## What's Included
- **Examples**: Unit test generation, integration tests, edge cases
- **Reference**: Test patterns, coverage strategies
- **Templates**: Test suite templates for different frameworks
## Use When
- Need test coverage for existing code
- Improving low coverage areas
- Systematic test creation
## Related Agents
- `test-generator`
**Skill Version**: 1.0
This skill generates comprehensive test suites for Python projects, including unit tests, integration tests, edge cases, and error-handling scenarios. It analyzes existing code to produce runnable tests and templates tailored to common frameworks. Use it to raise coverage, automate systematic test creation, and standardize testing patterns across a codebase.
The skill parses the target code to identify functions, classes, API boundaries, and external dependencies. It generates unit tests that assert expected behavior, integration tests that exercise component interactions, and negative tests for error paths and edge cases. Output includes ready-to-run test files, mock scaffolding, and coverage-focused templates you can drop into your repository.
Which testing frameworks are supported?
The skill produces templates and tests compatible with common Python frameworks like pytest and unittest; you can choose the flavor when generating tests.
Can it mock external services and databases?
Yes. The generator includes mock scaffolding and fixture examples to simulate external APIs, databases, and I/O so integration tests remain deterministic.