generate-test-cases
/generate-test-cases
Use when the user asks to analyze code for test coverage, list what test cases are needed, or review testing strategy — WITHOUT generating actual test code.
- Author
- mavka-ai ↗
- Repository
- unit-tests-skills ↗
- Licence
- MIT
- Last repository change
- 23.09.2026
Assessment and security
- Files in this package
- 15
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 23.09.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when the user asks to analyze code for test coverage, list what test cases are needed, or review testing strategy — WITHOUT generating actual test code.
Arguments
/generate-test-cases <file-path-or-class>
Original author description
Use when the user asks to analyze code for test coverage, list what test cases are needed, or review testing strategy — WITHOUT generating actual test code.
How it works
- Quality Standards
- Instructions
- Output Format
- Troubleshooting
- Example
- Rules Reference
SKILL.md preview
---
name: generate-test-cases
description: "Use when the user asks to analyze code for test coverage, list what test cases are needed, or review testing strategy — WITHOUT generating actual test code."
allowed-tools: Read, Glob, Grep
argument-hint: "<file-path-or-class>"
---
# Generate Test Cases Skill
You will analyze code and generate a list of test cases that should be written for a given method/class. This skill outputs test case descriptions only — it does NOT generate actual test code.
**Target to analyze:** $ARGUMENTS
## Quality Standards
- Take your time to analyze the code thoroughly before listing test cases.
- Quality is more important than speed — read all relevant source files and rules carefully.
- Do not skip reading the dependency classes. Understanding the full context produces better test cases.
---
## Instructions
### Step 1: Read Rules and Analyze Context
1. **Read the rules** from `./rules/general/` directory (see Rules Reference below)
2. **Read the target** source file/class/method specified above
3. **Read dependencies**: Follow imports to read DTOs, entities, enums, and other types referenced by the target (as specified in `code-context-analysis` rule)
4. **Check for existing tests**: Search for existing test classes covering this target (as specified in `existing-test-awareness` rule) — if found, read it fully and focus only on behaviors not yet covered
### 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 strictly
3. Output the list of test cases in the specified format
4. Stop at the descriptions — the list itself is this skill's deliverable
5. Close by naming the next step: `generate-tests <target>` takes this list as its plan
and writes the code from it. Hand the list forward as it stands — the user can review
or amend it first
---
## Output Format
For each test case, provide:
```
## Test Cases for {ClassName}.{methodName}
### 1. {testMethodName}
- **Given:** {preconditions/input state}
- **When:** {action being tested}
- **Then:** {expected outcome}
- **Code branch:** {which code path this covers}
### 2. {testMethodName}
...
```
### Naming Convention
Test method name format: `{testedMethod}_{givenState}_{expectedOutcome}`
Examples:
- `calculateTotal_validProducts_returnsSum`
- `calculateTotal_emptyList_throwsIllegalArgumentException`
- `getUser_unauthorized_returns401`
- `getUser_forbidden_returns403`
---
## Troubleshooting
### Target file not found
If the specified target does not exist, inform the user with the exact path you searched and ask for clarification.
### Unsupported language
If the target code is in a language without specific rules, apply only the general rules and inform the user.
### All behaviors already covered
If the existing test class already covers all identified behaviors, output a summary stating that coverage is complete. List what is already tested. Do not invent additional test cases to justify the analysis.
---
## Example
```
User says: "/generate-test-cases src/main/java/com/example/service/OrderService.java"
Step 1: Agent reads rules, reads OrderService.java, reads OrderRequest.java,
Order.java (dependencies), checks for existing OrderServiceTest.java.
Step 2: Agent outputs:
## Test Cases for OrderService.createOrder
### 1. createOrder_validRequest_savesAndReturnsOrder
- **Given:** Valid OrderRequest with productId "product-1" and quantity 5
- **When:** createOrder is called
- **Then:** Order is saved to repository and returned with generated ID
- **Code branch:** Success path
### 2. createOrder_nullProductId_throwsIllegalArgumentException
- **Given:** OrderRequest with null productId
- **When:** createOrder is called
- **Then:** IllegalArgumentException is thrown
- **Code branch:** Validation — productId null check
...
```
---
## Rules Reference
**CRITICAL: You MUST read and apply all rules from the following files before generating test cases:**
> **Maintenance note:** General rules in `./rules/general/` are shared with the `generate-tests` skill (which has copies in `rules/tests/general/`). When updating rules, keep both locations in sync.
### General Rules (Always Apply)
- `./rules/general/test-case-generation-strategy.md` - INCLUDE/EXCLUDE criteria for test cases
- `./rules/general/naming-conventions.md` - Test naming format
- `./rules/general/general-principles.md` - Core testing principles
- `./rules/general/what-makes-good-test.md` - Clarity, Completeness, Conciseness, Resilience
- `./rules/general/keep-tests-focused.md` - One scenario per test
- `./rules/general/test-behaviors-not-methods.md` - Separate tests for behaviors
- `./rules/general/prefer-public-apis.md` - Test public APIs over private methods
- `./rules/general/cleanly-create-test-data.md` - Use helpers and builders for test data
- `./rules/general/keep-cause-effect-clear.md` - Effects follow causes immediately
- `./rules/general/no-logic-in-tests.md` - KISS > DRY, avoid logic in assertions
- `./rules/general/technology-stack-detection.md` - Detect language and framework
- `./rules/general/verify-relevant-arguments-only.md` - Only verify relevant mock arguments
- `./rules/general/existing-test-awareness.md` - Check for existing tests, avoid duplicates
- `./rules/general/code-context-analysis.md` - Read dependencies before analyzing
Files in this package (15)
- SKILL.md 5 KB
- rules/general/cleanly-create-test-data.md 3 KB
- rules/general/code-context-analysis.md 3 KB
- rules/general/existing-test-awareness.md 3 KB
- rules/general/general-principles.md 4 KB
- rules/general/keep-cause-effect-clear.md 2 KB
- rules/general/keep-tests-focused.md 3 KB
- rules/general/naming-conventions.md 2 KB
- rules/general/no-logic-in-tests.md 3 KB
- rules/general/prefer-public-apis.md 3 KB
- rules/general/technology-stack-detection.md 2 KB
- rules/general/test-behaviors-not-methods.md 3 KB
- rules/general/test-case-generation-strategy.md 5 KB
- rules/general/verify-relevant-arguments-only.md 3 KB
- rules/general/what-makes-good-test.md 4 KB
Versions
The database has no other skills named generate-test-cases.
Database snapshot: 13.11.2026 · package version 1cdec254e590 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 2 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100create-test-plan
Create a test plan when the user asks to plan testing, define test cases, create a QA strategy, write a test plan, or prepare for testing a feature - 90write-tests
WAY 4 — write test cases only, no execution. Use when the user says "write it", "write tests", "generate test cases" — requirements (text or a tracker issue), optional App/Spec/MR or PR → test files + test-plan issue. - 100generate
Generate SDK usability test cases by exploring source code. Use when creating benchmark test suites, generating test cases for an SDK, or when the user wants to create evaluation scenarios. - 100test-generation-patterns
Use this skill when generating tests with AI assistance. Activate when the user wants to create unit tests, integration tests, generate test cases, improve test coverage, write tests for existing code, or set up testing patterns for their project. - 93gvm-test-cases
Use when generating test cases from a requirements document produced by /gvm-requirements. Triggered by /gvm-test-cases command, requests to create acceptance tests, or requests to verify requirements coverage. - 100qa-test-design
Design and write QA test artifacts - test cases, test plans, acceptance criteria, API test specs, and PR testability reviews. Use this skill whenever a QA engineer or SDET needs to translate requirements, user stories, or feature specs into structured test documentation. Trigger…