unit-test-generator
Skill2 starsChanged 7 months agoMITView on GitHub
Generate comprehensive, isolated unit and integration tests for user-provided code. Use when sharing functions, classes, or modules and requesting test coverage, edge-case validation, or mock setups. Do NOT use for writing end-to-end UI tests, performance benchmarking suites, or generating test data without code context.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- 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
- srikanth-manivannan/claude-agent-factorytheir own version, first seen Jun 26, 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
- 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
- srikanth-manivannan/claude-agent-factory★ 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 repository20 other files it gives its agents.
- api-design-standardizerSkill
- api-documentation-generatorSkill
- cloud-infrastructure-architectSkill
- cobol-to-javaSkill
- code-reviewSkill
- compliance-policy-auditorSkill
- database-performance-auditorSkill
- data-cleanupSkill
- incident-post-mortem-generatorSkill
- kaggle-notebook-generatorSkill
- meeting-transcriberSkill
- pdf-extractSkill
- python-structure-generatorSkill
- python-type-hinterSkill
- refactor-simplifySkill
- github-repo-structure-builderSkill
- security-vulnerability-scannerSkill
- sql-query-optimizerSkill
- user-story-generatorSkill
- web-researchSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Do NOT use for E2E/UI testing, load/performance benchmarking, or writing test data generators without target code
- Distinctive: line 23
Do NOT use for documentation-only workflows or code that cannot be logically isolated
- Distinctive: line 38
IF external service calls exist → inject mocks/spies using the language's standard testing framework.
- Distinctive: line 39
IF stateful logic exists → setup/teardown hooks to reset state between tests.
- Distinctive: line 40
NEVER use real network/disk I/O in unit tests unless explicitly marked as integration.
- Distinctive: line 43
Write assertions first, then setup/teardown.
- Distinctive: line 46
Ensure 100% of generated tests pass syntactically.
- Distinctive: line 75
If the input lacks executable logic (e.g., configuration files, markdown, or incomplete snippets), respond with:
- Very specific: line 84
If the framework or language is unsupported by standard testing conventions, ask: "Which testing framework should I target?
- Distinctive: line 86
Never assume a framework if it cannot be inferred from imports or package manifests.
“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
Systematically creates production-ready test suites for executable code, prioritizing isolation, coverage, and maintainability.
🎯 When to Use
- User shares functions, classes, or modules and asks for tests
- User requests "increase coverage", "write edge cases", or "add mocks"
- Code lacks automated validation or exhibits untested branches
- Do NOT use for E2E/UI testing, load/performance benchmarking, or writing test data generators without target code
- Do NOT use for documentation-only workflows or code that cannot be logically isolated
🧠 Core Workflow
Step 1 — Analyze Contracts & Dependencies Extract function signatures, expected return types, input constraints, and external calls (DB, HTTP, FS). Identify pure vs impure functions.
Step 2 — Map Test Scenarios Generate test cases using the following matrix:
- Happy path → standard inputs matching documented behavior
- Edge cases → empty strings, nulls, boundary integers, max array lengths
- Error paths → invalid types, network failures, missing permissions
- Branch coverage → IF/ELSE, switch cases, early returns
Step 3 — Design Isolation Strategy
- IF external service calls exist → inject mocks/spies using the language's standard testing framework.
- IF stateful logic exists → setup/teardown hooks to reset state between tests.
- NEVER use real network/disk I/O in unit tests unless explicitly marked as integration.
Step 4 — Generate Test Code Write assertions first, then setup/teardown. Follow AAA (Arrange, Act, Assert) pattern. Use descriptive test names that state expected behavior, not implementation details.
Step 5 — Validate & Package Ensure 100% of generated tests pass syntactically. Verify mocks are scoped to specific tests. Return structured coverage matrix alongside test code.
📋 Output Format
Section 1 — Coverage & Strategy Report
{
"status": "success | partial | error",
"language": "string",
"framework": "string",
"functions_tested": 0,
"coverage_target": "0-100%",
"test_cases": [
{
"target": "function_or_method_name",
"scenario": "happy_path | edge_case | error_path",
"mocks_used": ["dep1", "dep2"],
"assertions_count": 0
}
]
}Section 2 — Test Suite
Provide the complete test file in a fenced code block. Use framework-conventional naming (e.g., describe/it/test, def test_). Include necessary imports and mock configurations.
⚠️ Fallback Behavior If the input lacks executable logic (e.g., configuration files, markdown, or incomplete snippets), respond with:
{
"status": "error",
"message": "Input does not contain testable executable code. Expected functions, methods, or classes.",
"suggestion": "Paste the source code block you want tested, or specify the entry points."
}If the framework or language is unsupported by standard testing conventions, ask:
"Which testing framework should I target? (e.g., Jest, Pytest, JUnit, Go testing, Vitest)"
Never assume a framework if it cannot be inferred from imports or package manifests.
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.

