/unit-tests-skills:generate-test-cases <file-path-or-class>from Unit Test Skills
Analyzes code to list test cases needed for a method or class without generating test code. Reads source files, dependencies, and existing tests to identify coverage gaps.
Ships in Unit Test Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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
./rules/general/ directory (see Rules Reference below)code-context-analysis rule)existing-test-awareness rule) — if found, read it fully and focus only on behaviors not yet coveredgenerate-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 firstFor 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}
...
Test method name format: {testedMethod}_{givenState}_{expectedOutcome}
Examples:
calculateTotal_validProducts_returnsSumcalculateTotal_emptyList_throwsIllegalArgumentExceptiongetUser_unauthorized_returns401getUser_forbidden_returns403If the specified target does not exist, inform the user with the exact path you searched and ask for clarification.
If the target code is in a language without specific rules, apply only the general rules and inform the user.
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.
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
...
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 thegenerate-testsskill (which has copies inrules/tests/general/). When updating rules, keep both locations in sync.
./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 analyzingrules/general/cleanly-create-test-data.md (opens in a new tab)rules/general/code-context-analysis.md (opens in a new tab)rules/general/existing-test-awareness.md (opens in a new tab)rules/general/general-principles.md (opens in a new tab)rules/general/keep-cause-effect-clear.md (opens in a new tab)rules/general/keep-tests-focused.md (opens in a new tab)rules/general/naming-conventions.md (opens in a new tab)rules/general/no-logic-in-tests.md (opens in a new tab)rules/general/prefer-public-apis.md (opens in a new tab)rules/general/technology-stack-detection.md (opens in a new tab)rules/general/test-behaviors-not-methods.md (opens in a new tab)rules/general/test-case-generation-strategy.md (opens in a new tab)rules/general/verify-relevant-arguments-only.md (opens in a new tab)rules/general/what-makes-good-test.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mavka-ai/unit-tests-skills --plugin unit-tests-skills2 skills in this plugin
Other plugins' skills for the same job