unit-test-generator
Skill1 starsChanged 5 months agoMITView on GitHub
Use this to generate thorough unit tests for a unit of code, covering happy, edge, and failure cases.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- CreativeActtech/llm-skillstheir own version, first seen Oct 8, 2026
- BryceYuuu/open-workflow-skillstheir own version, first seen Sep 5, 2026
- cvsz/zomegatheir own version, first seen Sep 2, 2026
- BleckWolf25/AIToolkittheir own version, first seen Jul 4, 2026
- wangbinquan/skillstheir own version, first seen Apr 26, 2026
- santosomar/general-secure-coding-agent-skillstheir own version, first seen Mar 10, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- glincker/claude-code-marketplace★ 37same name
- CreativeActtech/llm-skills★ 2same name
- wangbinquan/skills★ 2same name
- BleckWolf25/AIToolkit★ 1same name
- BryceYuuu/open-workflow-skills★ 1same name
- cvsz/zomega★ 1same name
- santosomar/general-secure-coding-agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository37 other files it gives its agents.
- a11y-auditorSkill
- aria-annotatorSkill
- color-contrast-fixerSkill
- keyboard-nav-checkerSkill
- agent-scaffoldSkill
- prompt-engineerSkill
- migration-plannerSkill
- system-design-reviewerSkill
- tradeoff-analyzerSkill
- openapi-designerSkill
- rest-endpoint-scaffoldSkill
- cloud-resource-provisionerSkill
- index-advisorSkill
- migration-writerSkill
- query-optimizerSkill
- schema-designerSkill
- project-scaffolderSkill
- cd-deployment-builderSkill
- ci-pipeline-generatorSkill
- incident-runbook-builderSkill
- observability-instrumenterSkill
- release-automatorSkill
- changelog-generatorSkill
- doc-linterSkill
- doc-writerSkill
- client-perf-optimizerSkill
- component-scaffoldSkill
- code-review-coachSkill
- stakeholder-comms-writerSkill
- codebase-explorerSkill
- dependency-vuln-auditorSkill
- secret-scannerSkill
- security-headers-configurerSkill
- threat-modelerSkill
- coverage-gap-finderSkill
- load-test-designerSkill
- test-refactorerSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 53
Write isolated, deterministic tests: No reliance on time, order, network, or shared state.
- Distinctive: line 55
Assert behavior, not implementation: Test observable outcomes so tests survive refactors.
- Distinctive: line 71
Don't change the unit under test: If the code is untestable, report *why* and recommend a refactor rather than silently editing it.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unit Test Generator
Use this to generate thorough unit tests for a unit of code, covering happy, edge, and failure cases.
Tech profile — Technology: any · Language: any · Stack: any test framework · Toolchain: any · Domain: testing (Adapts to the target language/framework via the tech profile; the method is universal.)
When to use this skill
- Adding tests to new or untested code (a function, class, or module).
- Backfilling coverage before a refactor (
refactor-moduleworkflow). - Establishing a regression test for a bug (
fix-bugworkflow).
When NOT to use this skill
- End-to-end / integration flows — use
testing/e2e-test-builder/integration-test-builder. - Assessing existing test quality — use
testing/coverage-gap-finderor mutation testing.
Prerequisites
- The unit under test (code or a precise behavior spec).
- The target test framework (detected from the project, or stated).
Inputs
| Input | Required | Description |
unit | yes | The function/class/module to test |
framework | no | Test framework; inferred from the project if omitted |
behavior_spec | no | Intended behavior, if not obvious from the code |
Instructions
- Understand the contract. Identify the unit's inputs, outputs, side effects, and error conditions. If behavior is ambiguous, ask rather than assume.
- Enumerate cases across three mandatory classes (/standards/testing.md):
- Happy path — typical valid inputs → expected outputs.
- Edge / boundary — empty, max, min, null, unusual-but-valid inputs.
- Failure / refusal — invalid input handled gracefully (no silent failure).
- Detect the framework + conventions. Match the project's existing test style, naming, and assertion library. Don't introduce a new framework.
- Write isolated, deterministic tests. No reliance on time, order, network, or shared state; stub/mock external dependencies; use generated, non-real data.
- Assert behavior, not implementation. Test observable outcomes so tests survive refactors.
- Name tests by intent.
it("returns 0 for an empty list"), nottest1. - Report coverage intent. State which branches/cases are and are not covered, and why any are intentionally omitted.
Output
A test file (or files) in the project's framework: organized, named-by-intent tests covering happy/edge/failure classes, with mocks for external dependencies and a short note on coverage intent.
Constraints & safety
- No real PII/secrets in fixtures (/standards/security.md).
- No flaky tests — determinism is non-negotiable.
- Don't change the unit under test. If the code is untestable, report why and recommend a refactor rather than silently editing it.
Examples
Minimal below; full examples in EXAMPLES.md.
Given: a divide(a, b) function.
Produces: tests for normal division (happy), division by zero (failure), and large
/ negative / zero operands (edge), each named by intent and isolated.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

