Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Test Doubles Generator

ASecurity

This skill uses the test-doubles-generator plugin to automatically create mocks, stubs, spies, and fakes for unit testing. It analyzes dependencies in the code and generates appropriate test doubles based on the chosen testing framework, such as Jest, Sinon, or others. Use this skill when you need to generate test doubles, mocks, stubs, spies, or fakes to isolate units of code during testing. Trigger this skill by requesting test double generation or using the `/gen-doubles` or `/gd` command.

21 stars
0 votes
0 copies
0 views
Added 2/7/2026
testingtestingapi

Works with

api

Security Analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned 2/12/2026

$npx -y skills add BbgnsurfTech/claude-skills-collection --skill test-doubles-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Doubles Generator?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Test Doubles Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bbgnsurftech-test-doubles-generator/badge)](https://www.skillsdirectory.com/skills/bbgnsurftech-test-doubles-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: generating-test-doubles
description: |
  This skill uses the test-doubles-generator plugin to automatically create mocks, stubs, spies, and fakes for unit testing. It analyzes dependencies in the code and generates appropriate test doubles based on the chosen testing framework, such as Jest, Sinon, or others. Use this skill when you need to generate test doubles, mocks, stubs, spies, or fakes to isolate units of code during testing. Trigger this skill by requesting test double generation or using the `/gen-doubles` or `/gd` command.
---

## Overview

This skill empowers Claude to streamline unit testing by automatically generating test doubles (mocks, stubs, spies, and fakes). It analyzes the code under test, identifies dependencies, and creates the necessary test doubles, significantly reducing the time and effort required to write effective unit tests.

## How It Works

1. **Dependency Analysis**: Claude analyzes the code to identify dependencies that need to be replaced with test doubles.
2. **Test Double Generation**: Based on the dependencies and specified testing framework, Claude generates appropriate test doubles (mocks, stubs, spies, or fakes).
3. **Code Insertion**: Claude provides the generated test double code, ready for integration into your unit tests.

## When to Use This Skill

This skill activates when you need to:
- Create mocks for external API calls in a unit test.
- Generate stubs for service dependencies to control their behavior.
- Implement spies to track interactions with real objects during testing.

## Examples

### Example 1: Generating Mocks for API Calls

User request: "Generate mocks for the `fetchData` function in `dataService.js` using Jest."

The skill will:
1. Analyze the `dataService.js` file to identify the `fetchData` function and its dependencies.
2. Generate a Jest mock for `fetchData`, allowing you to simulate API responses.

### Example 2: Creating Stubs for Service Dependencies

User request: "Create stubs for the `NotificationService` in `userService.js` using Sinon."

The skill will:
1. Analyze `userService.js` and identify the `NotificationService` dependency.
2. Generate a Sinon stub for `NotificationService`, enabling you to control its behavior during testing of `userService.js`.

## Best Practices

- **Framework Selection**: Specify the testing framework you are using (e.g., Jest, Sinon) for optimal test double generation.
- **Code Context**: Provide the relevant code snippets or file paths to ensure accurate dependency analysis.
- **Test Double Type**: Consider the purpose of the test double. Use mocks for behavior verification, stubs for controlled responses, and spies for interaction tracking.

## Integration

This skill integrates directly with your codebase by providing generated test double code snippets that can be easily copied and pasted into your unit tests. It supports popular testing frameworks and enhances the overall testing workflow.

Attribution

BbgnsurfTechBbgnsurfTech
View sourceSee grades on GitHubMore from BbgnsurfTech →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Screen Reader Testing

Practical guide to testing web applications with screen readers for comprehensive accessibility validation.

401991 votes

Tdd Workflow

在编写新功能、修复错误或重构代码时使用此技能。强制执行测试驱动开发,包含单元测试、集成测试和端到端测试,覆盖率超过80%。

2456590 votes

Eval Harness

克劳德代码会话的正式评估框架,实施评估驱动开发(EDD)原则

2456590 votes

Python Testing

使用pytest、TDD方法、夹具、模拟、参数化和覆盖率要求的Python测试策略。

2456590 votes

Django Tdd

Django测试策略,包括pytest-django、TDD方法论、factory_boy、模拟、覆盖率以及测试Django REST Framework API。

2456590 votes
View all in testing →