Generate Tests
Generate comprehensive unit tests for source code files
- Type
- Slash Command
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
What Generate Tests is
Generate Tests is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”
A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.
Generate Tests gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install Generate Tests
Claude Code
- Download generate-tests.md from the repository.
- Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
- Run it by typing / followed by its name.
Claude Cowork
- Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
- In Customize → Skills, click +, then upload the ZIP.
- Run it from any task with / and the skill name.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/testing/unit-test-generator/commands/generate-tests.md, shared under the repository's MIT license. Read the full file on GitHub.
Generate comprehensive, production-ready unit tests for source code files.
Capabilities
You are a unit testing specialist that generates high-quality test cases covering:
- Happy paths - Normal execution scenarios
- Edge cases - Boundary conditions, limits, empty inputs
- Error handling - Exceptions, invalid inputs, failures
- Mock dependencies - External services, databases, APIs
- Assertions - Proper validation of expected outcomes
Supported Frameworks
Auto-detect and use the appropriate framework:
- JavaScript/TypeScript: Jest, Mocha, Vitest, Jasmine
- Python: pytest, unittest, nose2
- Java: JUnit 5, TestNG
- Go: testing package
- Ruby: RSpec, Minitest
- C#: xUnit, NUnit, MSTest
- PHP: PHPUnit
- Rust: cargo test
Process
When invoked with a file path or code snippet:
- Analyze the code to understand:
- Functions/methods to test
- Dependencies and external calls
- Input/output types
- Error conditions
- Detect testing framework from:
- Existing test files in project
- package.json, requirements.txt, etc.
- Ask user if unclear
- Generate test file with:
- Proper imports and setup
- Test suite organization
- Descriptive test names
- Arrange-Act-Assert pattern
- Mocks for external dependencies
- Code coverage considerations
- Include test cases for:
- Valid inputs (typical use cases)
- Invalid inputs (null, undefined, wrong types)
- Boundary conditions (min/max values, empty arrays)
- Error scenarios (exceptions, rejections)
- State changes (if applicable)
- Add helpful comments explaining:
- What each test validates
- Why certain mocks are needed
- Any setup/teardown requirements
Output Format
Create the test file with:
- File naming convention (e.g., foo.test.js, test_foo.py)
- Proper test structure and organization
- Clear test descriptions
- Mock setup and cleanup
- Assertion explanations
Example Usage
/generate-tests src/utils/validator.js
/generate-tests --framework pytest src/api/users.py
/gut models/UserModel.tsBest Practices Applied
- Use descriptive test names (what is being tested + expected outcome)
- One assertion per test when possible
- Test isolation (no shared state between tests)
- Proper setup/teardown
- Mock external dependencies
- Test both success and failure paths
- Include edge cases and boundary conditions
- Add comments for complex test scenarios
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Generate Tests?
Generate Tests is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Generate comprehensive unit tests for source code files
How do I install Generate Tests in Claude Code?
Download generate-tests.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.
Can I use Generate Tests in Claude Cowork?
Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.
Is Generate Tests safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Sop 002 Postgres Install Guide through SOP-002 PostgreSQL Installation & Configuration Slash Command · jeremylongshore/tons-of-skills-marketplace
- Sop 001 Vps Setup Guide through SOP-001 VPS Initial Setup & Hardening procedure Slash Command · jeremylongshore/tons-of-skills-marketplace
- Sprint Run the autonomous multi-agent sprint workflow with spec-driven development Slash Command · jeremylongshore/tons-of-skills-marketplace
- Spine Designs and implements backend systems contract-first — REST/gRPC/GraphQL APIs, distributed architecture, caching, auth, and rate limiting using boring technology that ships and stays simple. Use when designing a new API or fixing backend performance. Trigger with \"design this backend API\", \"build this service\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Github Actions Create Generate GitHub Actions workflow with best practices Slash Command · jeremylongshore/tons-of-skills-marketplace
- Generate Signal Generate trading signals from technical indicators Slash Command · jeremylongshore/tons-of-skills-marketplace
- Github Learn Interactive GitHub setup and hands-on git learning for any skill level. Slash Command · jeremylongshore/tons-of-skills-marketplace
- Generate Rest Api Generate production-ready RESTful APIs with best practices Slash Command · jeremylongshore/tons-of-skills-marketplace