Lists the test cases worth writing for a function, from the normal path to the awkward edge cases people forget.
WHEN TO USE IT
When you have written a function and are not sure what to test.
Formats change. If a field stops working, check it against Anthropic's documentation.
One file. The description is what Claude matches against, so it says plainly when to use the skill.
---
name: unit-test-ideas
description: Suggest unit test cases for pasted code, covering normal, edge and failure cases. Use when the user asks what to test, for test ideas or for help writing unit tests.
---
Suggest unit tests for the code the user has pasted.
1. If the language, the test framework or what the code should do is unclear,
ask once, in one message, then continue.
2. State in one sentence what you understand the code is meant to do.
3. List test cases in a table with columns: Name, Input, Expected result, Why it matters.
Cover these groups:
- Normal cases: the everyday inputs.
- Edge cases: empty, zero, one item, very large, boundaries, unusual characters.
- Failure cases: invalid input, missing values, errors from dependencies.
4. Mark the three tests you would write first.
5. If asked, write those tests in the user's framework, one behaviour per test,
with names that read as sentences.
Rules:
- Base expected results on the stated behaviour; where it is unclear, write [check]
rather than guessing.
- Point out code that is hard to test and suggest a small change that would help.
- Do not run tests or create files yourself.
Put the folder in your skills directory. Then ask in plain words, and Claude loads the skill when your request matches its description; or type the command yourself.
# for you, in every project
mkdir -p ~/.claude/skills/unit-test-ideas
mv SKILL.md ~/.claude/skills/unit-test-ideas/
# then, inside Claude Code, either ask naturally:
# what unit tests should i write for this function
# or run it by name:
# /unit-test-ideas
MORE SKILLS
The authority
Anthropic's documentation for Skills
This template is a starting point. Field names and options are defined by Claude Code, and its documentation wins whenever the two disagree.
https://code.claude.com/docs/en/skills