Skip to content
Back to skills

Generate Tests

ASecurity

Generate comprehensive tests for specified code

  • 6,113 stars
  • 0 votes
  • 0 copies
  • 7 views
  • Added May 27, 2026
developmenttypescriptgoapidatabase

Works with

  • api

Security analysis

A100/100

Scanned October 1, 2026

npx -y skills add FlorianBruniaux/claude-code-ultimate-guide --skill generate-tests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Generate Tests?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Generate Tests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/florianbruniaux-generate-tests/badge)](https://www.skillsdirectory.com/skills/florianbruniaux-generate-tests)

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

Download with Pro
SKILL.md
---
name: generate-tests
description: Generate comprehensive tests for specified code
argument-hint: "<file_or_module> [--framework jest|vitest|pytest]"
effort: medium
when_to_use: "Use when adding test coverage for a function, module, or feature."
disable-model-invocation: true
---

# Generate tests

Generate comprehensive tests for specified code.

## Instructions

1. Read the target file(s)
2. Identify testable units (functions, classes, methods)
3. Generate tests following project conventions
4. Ensure high coverage of edge cases

## Test generation process

### 1. Analyze target
- Identify public interfaces
- Understand dependencies
- Note edge cases and boundaries

### 2. Detect test framework
Check for:
- `jest.config.js` → Jest
- `vitest.config.ts` → Vitest
- `pytest.ini` → pytest
- `mocha` in package.json → Mocha

### 3. Generate tests
Follow the detected framework conventions.

## Test categories

### Happy path
Normal expected behavior with valid input.

### Edge cases
- Empty inputs
- Null/undefined values
- Boundary values (0, -1, MAX_INT)
- Single item vs multiple items

### Error cases
- Invalid input types
- Missing required parameters
- Network/IO failures
- Timeout scenarios

### Integration points
- Database interactions
- External API calls
- File system operations

## Output format

```typescript
describe('[ComponentName]', () => {
  describe('[methodName]', () => {
    // Happy path
    it('should [expected behavior] when [condition]', () => {
      // Arrange
      // Act
      // Assert
    });

    // Edge cases
    it('should handle empty input', () => {});
    it('should handle null values', () => {});

    // Error cases
    it('should throw when [invalid condition]', () => {});
  });
});
```

## Conventions

- One assertion per test (when practical)
- Descriptive test names
- AAA pattern (Arrange-Act-Assert)
- No test interdependence
- Mock external dependencies

## Usage

```
/generate-tests src/utils/calculator.ts
/generate-tests src/services/
```

$ARGUMENTS

Attribution

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

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.