generate-tests

Solid

Use when the user asks to generate, create, or write unit tests for code. Analyzes the target code, produces a structured test case list for review, then generates test code. Supports Java (JUnit 5, Mockito, AssertJ).

Testing & QA 49 stars 7 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 86/100

Stars 20%
57
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Generate Tests Skill You will analyze code and generate high-quality unit tests for a given target. **Target to test:** $ARGUMENTS ## Quality Standards - Take your time to analyze the code thoroughly before generating test cases. - Quality is more important than speed — read all relevant source files and rules carefully. - Do not skip any step in the workflow below. Every step exists for a reason. - Do not take shortcuts with test data — read the actual classes to use correct constructors and fields. --- ## Instructions ### Step 1: Read Rules and Analyze Context 1. **Read the relevant rules** from `./rules/tests/` based on code type (see Rules Reference below) 2. **Read the target** source file/class/method 3. **Read dependencies**: Follow imports to read DTOs, entities, enums, custom exceptions, and other types referenced by the target (as specified in `code-context-analysis` rule) 4. **Check for existing tests**: Search for `{ClassName}Test` or `{ClassName}Tests` in the test directory (as specified in `existing-test-awareness` rule) - If found, read fully — you will add missing tests to it, not create a new file - If not found, scan 2-3 neighboring test classes to learn project conventions ### Step 2: Generate Test Cases 1. Analyze ALL code branches, including: - Success paths - Error/exception paths - Validation logic - Private/protected methods called by the target - Security annotations (if present) 2. Apply the INCLUDE/EXCLUDE rules stri...

Details

Author
mavka-ai
Repository
mavka-ai/unit-tests-skills
Created
6 months ago
Last Updated
yesterday
Language
Shell
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category