Agent skill

Test Generator

by alirezarezvani in alirezarezvani/claude-code-tresor

Automatically suggest tests for new functions and components.

MITAuto-check passedTesting & QA

Install Test Generator

skills CLI
$ npx skills add alirezarezvani/claude-code-tresor --skill test-generator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alirezarezvani/claude-code-tresor test-generator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alirezarezvani/claude-code-tresor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/development/test-generator .claude/skills/test-generator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-generator
GitHub stars
777
Token cost
~1.6k tokens
SKILL.md length
278 words
Files
2
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Automatically suggest tests for new functions and components.

  • Works in 4 steps: You write a function → I auto-generate basic test structure → You want full suite → Invoke… → …
  • New code is written
  • SKILL.md covers When I Activate, What I Generate, Relationship with… and Examples, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Test Generator is an agent skill from alirezarezvani/claude-code-tresor. Automatically suggest tests for new functions and components. Use when new code is written, functions added, or user mentions testing. Creates test scaffolding with Jest, Vitest, Pytest patterns. Triggers on new functions, components, test requests, testing mentions.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `README.md`).

It sits in Testing & QA, covering Unit testing and Test generation. It works with Jest, pytest and Vitest. The repository describes itself as: A world-class collection of Claude Code utilities: autonomous skills, expert agents, slash commands, and prompts that supercharge your development workflow. The licence is MIT.

When your agent uses it

  • New code is written
  • Functions added
  • User mentions testing
  • Testing mentions

Example prompts

  • “/test-generator”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Edit

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. You write a function
  2. I auto-generate basic test structure
  3. You want full suite → Invoke @test-engineer sub-agent
  4. Sub-agent creates comprehensive tests

What it can do on your machine

Read from SKILL.md and the folder at commit 4b68050. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript, bash and python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Generator loads about 1.6k tokens when it runs. Until then it costs about 71 tokens; SKILL.md has 278 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alirezarezvani/claude-code-tresor at commit 4b68050, republished under its MIT licence (© alirezarezvani). 278 words, ~1,571 tokens.

Download SKILL.mdSave it as .claude/skills/test-generator/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
test-generator
description
Automatically suggest tests for new functions and components. Use when new code is written, functions added, or user mentions testing. Creates test scaffolding with Jest, Vitest, Pytest patterns. Triggers on new functions, components, test requests, testing mentions.
allowed-tools
Read, Write, Edit

Test Generator Skill

Auto-suggest tests when you write new code.

When I Activate

  • ✅ New function created
  • ✅ New component added
  • ✅ User mentions testing or tests
  • ✅ Test file missing for implementation
  • ✅ User asks "can you test this?"

What I Generate

Quick Test Scaffolding
  • Basic happy path tests
  • Null/undefined edge cases
  • Simple error scenarios
  • Framework-appropriate syntax (Jest/Vitest/Pytest)
What I Don't Do
  • Comprehensive test suites → Use @test-engineer sub-agent
  • Integration tests → Use @test-engineer sub-agent
  • E2E test design → Use @test-engineer sub-agent
  • Test strategy planning → Use @test-engineer sub-agent

Relationship with @test-engineer Sub-Agent

Me (Skill): Quick test scaffolding @test-engineer (Sub-Agent): Comprehensive testing strategy

Workflow
  1. You write a function
  2. I auto-generate basic test structure
  3. You want full suite → Invoke @test-engineer sub-agent
  4. Sub-agent creates comprehensive tests

Examples

JavaScript Function
javascript
// You write:
function calculateDiscount(price, percentage) {
  if (price <= 0) throw new Error('Invalid price');
  return price * (percentage / 100);
}

// I auto-generate:
describe('calculateDiscount', () => {
  it('calculates discount correctly', () => {
    expect(calculateDiscount(100, 10)).toBe(10);
  });

  it('throws error for invalid price', () => {
    expect(() => calculateDiscount(0, 10)).toThrow('Invalid price');
  });

  it('handles zero percentage', () => {
    expect(calculateDiscount(100, 0)).toBe(0);
  });

  // TODO: Add more edge cases
  // Consider: negative percentages, decimal values, very large numbers
});
React Component
jsx
// You write:
function UserCard({ user, onEdit }) {
  return (
    <div className="user-card">
      <h2>{user.name}</h2>
      <button onClick={() => onEdit(user.id)}>Edit</button>
    </div>
  );
}

// I auto-generate:
import { render, screen, fireEvent } from '@testing-library/react';

describe('UserCard', () => {
  const mockUser = { id: 1, name: 'John Doe' };
  const mockOnEdit = jest.fn();

  it('renders user name', () => {
    render(<UserCard user={mockUser} onEdit={mockOnEdit} />);
    expect(screen.getByText('John Doe')).toBeInTheDocument();
  });

  it('calls onEdit with user id when button clicked', () => {
    render(<UserCard user={mockUser} onEdit={mockOnEdit} />);
    fireEvent.click(screen.getByText('Edit'));
    expect(mockOnEdit).toHaveBeenCalledWith(1);
  });

  // TODO: Add tests for edge cases
  // - Missing user data
  // - Undefined onEdit
  // - Long names (UI testing)
});
Python Function
python
# You write:
def fetch_user_data(user_id: int) -> dict:
    if user_id <= 0:
        raise ValueError("Invalid user ID")
    return db.query("SELECT * FROM users WHERE id = ?", [user_id])

# I auto-generate:
import pytest

def test_fetch_user_data_success():
    """Test successful user data retrieval"""
    result = fetch_user_data(1)
    assert isinstance(result, dict)
    assert 'id' in result

def test_fetch_user_data_invalid_id():
    """Test with invalid user ID"""
    with pytest.raises(ValueError, match="Invalid user ID"):
        fetch_user_data(0)

def test_fetch_user_data_negative_id():
    """Test with negative ID"""
    with pytest.raises(ValueError):
        fetch_user_data(-1)

# TODO: Add integration tests with database
# TODO: Test database connection failures

Framework Detection

I automatically detect your testing framework:

  • JavaScript/TypeScript: Jest, Vitest, Mocha
  • Python: pytest, unittest
  • Java: JUnit
  • Go: testing package

Detection based on:

  • package.json dependencies
  • requirements.txt
  • Existing test files
  • Import statements

Test Patterns

Unit Tests
javascript
// Function testing
test('adds numbers correctly', () => {
  expect(add(2, 3)).toBe(5);
});
Component Tests
jsx
// React component testing
test('button click triggers callback', () => {
  const onClick = jest.fn();
  render(<Button onClick={onClick} />);
  fireEvent.click(screen.getByRole('button'));
  expect(onClick).toHaveBeenCalled();
});
Edge Cases
javascript
// Boundary testing
test('handles empty input', () => {
  expect(processData([])).toEqual([]);
});

test('handles null input', () => {
  expect(processData(null)).toBeNull();
});

When to Use Sub-Agent

Invoke @test-engineer for:

  • Complete test suites (20+ tests)
  • Integration test strategy
  • E2E test planning
  • Test coverage goals
  • Complex mocking scenarios

Example:

Me: "Generated 3 basic tests for calculateDiscount()"
You: "@test-engineer create comprehensive test suite with all edge cases"
Sub-agent: [Creates 25+ tests covering all scenarios]

Sandboxing Compatibility

Works without sandboxing: ✅ Yes Works with sandboxing: ✅ Yes

  • Filesystem: Writes test files to project
  • Network: None required
  • Configuration: None required

Customization

Edit test templates:

bash
cp -r ~/.claude/skills/development/test-generator \
      ~/.claude/skills/development/my-test-generator

# Edit SKILL.md to customize:
# - Test patterns
# - Framework preferences
# - Coverage expectations

Integration with Commands

/test-gen Command
bash
/test-gen --file utils.js --framework jest --coverage 90

# Combines:
# 1. My quick scaffolding
# 2. @test-engineer comprehensive tests
# 3. Full test file generation

Tips

  1. Let me scaffold first - Review before invoking sub-agent
  2. Add TODOs - I include TODO comments for complex cases
  3. Framework consistency - I match your project's testing style
  4. Quick iteration - Regenerate if not satisfied
  • @test-engineer: Comprehensive test suite creation
  • code-reviewer skill: Flags code that needs testing
  • /test-gen command: Full test generation workflow

© alirezarezvani, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/development/test-generator of alirezarezvani/claude-code-tresor.

  • SKILL.md
  • README.md

Open the folder on GitHubat commit 4b68050

Compare with similar skills

Test Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Generator this skillalirezarezvani/claude-code-tresor777—~1.6kAutomated safety check: PassMIT
MoAI TDD Workflowmodu-ai/moai-adk1.2k—~3.1kAutomated safety check: PassApache-2.0
Test Patternsrohitg00/skillkit1.5k—~1.8kAutomated safety check: PassApache-2.0
Accurate Testingtheexperiencecompany/gaia308—~3.4kAutomated safety check: PassCustom licence
TDD Guidealirezarezvani/claude-skills28k—~3.4kAutomated safety check: PassMIT
Code Testing Agentmicrosoft/testfx1k—~2.7kAutomated safety check: PassMIT

Similar skills

  • MoAI TDD Workflow

    modu-ai/moai-adk

    Drives test-first development through the RED, GREEN, REFACTOR cycle, with a config switch that selects between TDD and a DDD workflow for existing code.

    1.2k GitHub stars~3.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Test Patterns

    rohitg00/skillkit

    Applies proven testing patterns — Arrange-Act-Assert (AAA), Given-When-Then, Test Data Builders, Object Mother, parameterized tests, fixtures, spies, and test doubles — to help write maintainable…

    1.5k GitHub stars~1.8k tokensUpdated 4 mo ago
    Testing & QAAuto-check passed
  • Accurate Testing

    theexperiencecompany/gaia

    Write adversarial test cases that break production code instead of producing false confidence.

    308 GitHub stars~3.4k tokensUpdated today
    Testing & QAAuto-check passed
  • TDD Guide

    alirezarezvani/claude-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    28k GitHub stars~3.4k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Code Testing Agent

    microsoft/testfx

    Official

    Generates and writes new unit tests for any programming language — scaffolds .NET test projects, pytest suites, Vitest/Jest suites, Go test files, and JUnit suites, and configures coverage tooling…

    1k GitHub stars~2.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Test Tagging

    microsoft/testfx

    Official

    Analyzes test suites in any language and tags each test with a standardized set of traits (positive, negative, critical-path, boundary, smoke, regression, integration, performance, security).

    1k GitHub stars~4.3k tokensUpdated today
    Testing & QAAuto-check passed

More from alirezarezvani/claude-code-tresor

  • API Documenter

    alirezarezvani/claude-code-tresor

    Auto-generate API documentation from code and comments. An agent skill from alirezarezvani/claude-code-tresor.

    777 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Code Reviewer

    alirezarezvani/claude-code-tresor

    Automatic code quality and best practices analysis. An agent skill from alirezarezvani/claude-code-tresor.

    777 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • Dependency Auditor

    alirezarezvani/claude-code-tresor

    Check dependencies for known vulnerabilities using npm audit, pip-audit, etc.

    777 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check: notes
  • Git Commit Helper

    alirezarezvani/claude-code-tresor

    Generate conventional commit messages automatically. An agent skill from alirezarezvani/claude-code-tresor.

    777 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check: notes
  • Readme Updater

    alirezarezvani/claude-code-tresor

    Keep README files current with project changes. An agent skill from alirezarezvani/claude-code-tresor.

    777 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Secret Scanner

    alirezarezvani/claude-code-tresor

    Detect exposed secrets, API keys, credentials, and tokens in code.

    777 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check: warnings

Categories

Questions about Test Generator

What does Test Generator do?

Automatically suggest tests for new functions and components. Test Generator is an agent skill from alirezarezvani/claude-code-tresor. Automatically suggest tests for new functions and components.

When should I use Test Generator?

Test Generator fits situations like: new code is written; functions added; user mentions testing; testing mentions.

How do I install Test Generator in Claude Code?

Run `npx skills add alirezarezvani/claude-code-tresor --skill test-generator -a claude-code`. Or copy the skill folder (skills/development/test-generator in alirezarezvani/claude-code-tresor) into .claude/skills/test-generator in your project. Claude Code loads it when a task matches its description.

How do I install Test Generator in Codex?

Run `npx skills add alirezarezvani/claude-code-tresor --skill test-generator -a codex`. Or copy the skill folder (skills/development/test-generator in alirezarezvani/claude-code-tresor) into .agents/skills/test-generator in your project. Codex loads it when a task matches its description.

Can I use Test Generator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alirezarezvani/claude-code-tresor --skill test-generator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-generator, .gemini/skills/test-generator, .github/skills/test-generator and .opencode/skills/test-generator in your project.

What does Test Generator need to run?

SKILL.md names no scripts, command-line tools or credentials: Test Generator is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit.

Does Test Generator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Test Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Test Generator use?

Test Generator is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Generator use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Generator?

Skills that share tags, products or a category with Test Generator: MoAI TDD Workflow (modu-ai/moai-adk, 1.2k stars), Test Patterns (rohitg00/skillkit, 1.5k stars), Accurate Testing (theexperiencecompany/gaia, 308 stars) and TDD Guide (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Generator?

alirezarezvani (a GitHub user) maintains it in alirezarezvani/claude-code-tresor, which has 777 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on July 3, 2026.

Source: alirezarezvani/claude-code-tresor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.