home / skills / nickcrew / claude-cortex / test-generation
This skill helps generate targeted tests for Python code by analyzing paths, edge cases, and coverage goals to improve reliability.
npx playbooks add skill nickcrew/claude-cortex --skill test-generationReview the files below or copy the command above to add this skill to your agents.
---
name: test-generation
description: Use when generating tests for new or existing code to improve coverage - provides a structured workflow for analyzing code, creating tests, and validating coverage goals.
---
# Test Generation
## Overview
Generate tests systematically by analyzing code paths, covering edge cases, and validating coverage targets.
## When to Use
- Creating tests for new features
- Improving coverage in weak areas
- Building regression or integration test suites
Avoid when:
- The task is only running existing tests (use dev-workflows)
## Quick Reference
| Task | Load reference |
| --- | --- |
| Test generation workflow | `skills/test-generation/references/generate-tests.md` |
## Workflow
1. Identify target scope and test type.
2. Load the test generation reference.
3. Analyze code paths and edge cases.
4. Generate tests and validate coverage.
5. Summarize results and gaps.
## Output
- Generated tests
- Coverage report and follow-ups
## Common Mistakes
- Writing tests without understanding code paths
- Ignoring edge cases or failure modes
This skill helps generate tests for new or existing Python code to boost coverage and reduce regressions. It provides a structured workflow to analyze code paths, surface edge cases, and produce runnable test files plus coverage reports. Use it to create focused unit, integration, or regression tests with measurable coverage goals.
You define a target scope and test type, then load the test-generation reference to guide analysis. The skill inspects code paths, identifies edge cases and failure modes, generates test code, runs tests, and validates coverage against your targets. It produces test files, a coverage report, and a short summary of gaps and follow-ups.
Can this skill run tests or only generate them?
It generates tests and can run them to produce a coverage report so you can validate targets and iterate.
What test frameworks are supported?
The workflow targets common Python test frameworks; adjust generated boilerplate to match pytest, unittest, or your in-house conventions.