home / skills / eddiebe147 / claude-settings / test-generator

test-generator skill

/skills/test-generator

This skill helps generate comprehensive unit, integration, and E2E tests to catch bugs before production and boost confidence in shipping.

npx playbooks add skill eddiebe147/claude-settings --skill test-generator

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.3 KB
---
name: Test Generator
slug: test-generator
description: Generate comprehensive test suites including unit tests, integration tests, and E2E tests
category: technical
complexity: intermediate
version: "1.0.0"
author: "ID8Labs"
triggers:
  - "generate tests"
  - "write tests"
  - "test coverage"
tags:
  - testing
  - test-generation
  - quality
---

# Test Generator

Generate comprehensive test suites that catch bugs before production. From unit tests to E2E scenarios, create tests that give you confidence to ship.

## Core Workflows

### Workflow 1: Unit Test Generation
1. **Analyze Code** - Understand function inputs/outputs
2. **Happy Path** - Test expected behavior
3. **Edge Cases** - Test boundary conditions
4. **Error Cases** - Test failure scenarios
5. **Mocking** - Create mocks for dependencies

### Workflow 2: E2E Test Generation
1. **User Flows** - Identify critical paths
2. **Test Scenarios** - Write step-by-step tests
3. **Selectors** - Define robust element selectors
4. **Assertions** - Verify expected outcomes
5. **Data Setup** - Handle test data

## Quick Reference

| Action | Command |
|--------|---------|
| Generate unit tests | "Generate tests for [function]" |
| E2E tests | "Create E2E tests for [flow]" |
| Coverage report | "Analyze test coverage" |

Overview

This skill generates comprehensive test suites across unit, integration, and end-to-end (E2E) levels so you catch bugs before they reach production. It produces clear, runnable tests with mocks, data setup, selectors, and assertions to increase confidence in releases. Use it to automate test creation and speed up developer workflows.

How this skill works

The skill inspects source code and user-provided descriptions to identify functions, inputs, outputs, and critical user flows. For unit tests it generates happy-path, edge-case, and error-case tests and scaffolds mocks for dependencies. For E2E tests it maps user flows to step-by-step scenarios, robust selectors, assertions, and test data setup. It can also suggest commands to run coverage analysis.

When to use it

  • When adding tests for a new function or module
  • When increasing coverage before a release
  • When building E2E suites for critical user flows
  • When converting manual QA steps into automated tests
  • When you need mocks for external dependencies quickly

Best practices

  • Start with happy-path unit tests, then add edge and error cases
  • Prefer deterministic selectors and avoid brittle DOM paths in E2E tests
  • Mock external services and network calls to keep unit tests fast
  • Include data setup and teardown to keep tests isolated and repeatable
  • Run coverage reports and prioritize tests for uncovered logic

Example use cases

  • Generate unit tests for a payment processing function including failure modes
  • Create E2E tests for user signup and onboarding flows with robust selectors
  • Produce integration tests that verify API responses and database interactions
  • Scaffold mocks for a service client so unit tests run offline
  • Build a test suite skeleton to achieve target coverage before deployment

FAQ

Can the skill mock external APIs?

Yes. It suggests and scaffolds mocks for external services so unit tests remain fast and deterministic.

Does it support E2E test selectors for different frameworks?

It generates robust selector strategies and can adapt suggestions for common frameworks; specify the target framework for tailored output.