Sponsor Suno AI Music arrow_forward
Slash Command

Gen Doubles

Generate test doubles (mocks, stubs, spies, fakes) for unit testing

Type
Slash Command
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

  1. Download gen-doubles.md from the repository.
  2. 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.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. 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

  1. Analyze Dependencies
  • Identify external dependencies in code under test
  • Determine appropriate test double type for each
  • Generate test doubles with proper behavior
  1. Generate Mocks
  • Create mock implementations with verification
  • Set up method expectations and return values
  • Configure mock behavior for test scenarios
  1. Generate Stubs
  • Create stub implementations with predefined responses
  • Handle edge cases and error conditions
  • Provide test data fixtures
  1. Generate Spies
  • Wrap real implementations with call tracking
  • Capture arguments and return values
  • Enable behavior verification

Usage Pattern

When invoked, you should:

  1. Analyze the code file or function to be tested
  2. Identify all dependencies (APIs, databases, services, etc.)
  3. Recommend appropriate test double type for each dependency
  4. Generate test doubles with realistic behavior
  5. Provide example test cases using the doubles
  6. 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

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.