Gen Doubles
Generate test doubles (mocks, stubs, spies, fakes) for unit testing
- Type
- Slash Command
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
What Gen Doubles is
Gen Doubles 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.
Gen Doubles gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install Gen Doubles
Claude Code
- Download gen-doubles.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/test-doubles-generator/commands/gen-doubles.md, shared under the repository's MIT license. Read the full file on GitHub.
Generate appropriate test doubles (mocks, stubs, spies, fakes, dummies) for unit testing based on the testing framework and dependencies being tested.
What You Do
- Analyze Dependencies
- Identify external dependencies in code under test
- Determine appropriate test double type for each
- Generate test doubles with proper behavior
- Generate Mocks
- Create mock implementations with verification
- Set up method expectations and return values
- Configure mock behavior for test scenarios
- Generate Stubs
- Create stub implementations with predefined responses
- Handle edge cases and error conditions
- Provide test data fixtures
- Generate Spies
- Wrap real implementations with call tracking
- Capture arguments and return values
- Enable behavior verification
Usage Pattern
When invoked, you should:
- Analyze the code file or function to be tested
- Identify all dependencies (APIs, databases, services, etc.)
- Recommend appropriate test double type for each dependency
- Generate test doubles with realistic behavior
- Provide example test cases using the doubles
- Include setup and teardown code
Output Format
## Test Doubles Generated for: [Component]
### Dependencies Identified: [N]
#### Dependency: [Name]
**Type:** [API / Database / Service / File System]
**Test Double:** [Mock / Stub / Spy / Fake]
**Rationale:** [Why this type]
**Implementation:**
\`\`\`javascript
// Mock for [Name]
const mock[Name] = {
methodName: jest.fn()
.mockResolvedValueOnce([success response])
.mockRejectedValueOnce(new Error('[error]')),
…Test Double Types
Mock: Behavior verification, tracks calls and arguments Stub: State verification, returns predefined responses Spy: Wraps real object, tracks interactions Fake: Working implementation with shortcuts (in-memory DB) Dummy: Placeholder objects, not used in test
Framework Support
- Jest (JavaScript/TypeScript)
- Sinon.js (JavaScript)
- unittest.mock (Python)
- Mockito (Java)
- Moq (.NET)
- RSpec mocks (Ruby)
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 Gen Doubles?
Gen Doubles is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Generate test doubles (mocks, stubs, spies, fakes) for unit testing
How do I install Gen Doubles in Claude Code?
Download gen-doubles.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 Gen Doubles 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 Gen Doubles 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
- Fastapi Scaffold Generate production-ready FastAPI REST API with async and authentication Slash Command · jeremylongshore/tons-of-skills-marketplace
- Fairdb Ops Auditor Audits FairDB VPS instances at three depth levels against SOP-001 (security), SOP-002 (PostgreSQL config), and SOP-003 (backup integrity), producing a scored compliance report with remediation steps. Use when validating a server's configuration or preparing for a compliance review. Trigger with "audit this FairDB server", "run a compliance check". Subagent · jeremylongshore/tons-of-skills-marketplace
- Fathom Pack Claude Code skill pack for Fathom (18 skills) Plugin · jeremylongshore/tons-of-skills-marketplace
- Feat Transforms raw data into model-ready features — leakage audits, encoding strategies, feature stores, and reproducible pipeline design. Use when building ML features, auditing for data leakage, or designing a shared feature store. Trigger with \"build feature pipeline\", \"audit features for leakage\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Gen Report Generate comprehensive test reports with coverage and trends Slash Command · jeremylongshore/tons-of-skills-marketplace
- Fuzz Api Fuzz test APIs with malformed inputs and edge cases Slash Command · jeremylongshore/tons-of-skills-marketplace
- Generate Api Docs Generate comprehensive OpenAPI/Swagger documentation from existing APIs Slash Command · jeremylongshore/tons-of-skills-marketplace
- Firestore Setup Initialize Firebase Admin SDK, configure Firestore, and setup A2A/MCP Slash Command · jeremylongshore/tons-of-skills-marketplace