generate-tests

Generate Vitest test suites with mocks and edge case coverage.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/cbemister/claude-code --skill generate-tests-cbemister
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-tests
Source: https://github.com/cbemister/claude-code/tree/main/.claude/skills/generate-tests
Command: npx skills add https://github.com/cbemister/claude-code --skill generate-tests-cbemister

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of comprehensive test suites for new or existing code, reducing manual testing effort and ensuring consistent quality across the codebase.

Core Features & Use Cases

  • Generate Vitest test files following project conventions for API routes, utilities, components, and hooks.
  • Enforce AAA testing patterns, including edge cases, error handling, and mocks.
  • Use-case: after implementing a feature, run the skill to scaffold tests automatically to validate behavior and regressions.

Quick Start

Use the generate-tests skill to create tests for a target file or feature, e.g., /generate-tests lib/utils.ts.

Frequently Asked Questions about generate-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I auto-generate Vitest tests for an existing TypeScript file?

To auto-generate Vitest tests, provide a target file path. The skill analyzes the TypeScript code, applies proper mocking, and scaffolds test suites covering input validation, success paths, and edge cases following AAA patterns.

What testing patterns does this skill use to structure generated test suites?

This skill uses AAA (Arrange, Act, Assert) testing patterns. It generates test suites that cover input validation, error handling, success and failure paths, and essential edge cases with proper mocking.

Does the generated test scaffolding work for different file types like API routes and hooks?

Yes, the generated test scaffolding works for API routes, utilities, components, and hooks. The skill analyzes target code by file type to determine appropriate test patterns and scaffolds tests in the repo's standard structure.

Can I automate mocking and edge case coverage when generating tests for my codebase?

Yes, you can automate mocking and edge case coverage. The skill analyzes your codebase and generates comprehensive Vitest test suites that include proper mocks and validate essential edge cases automatically.

What is the best way to ensure consistent test quality across new TypeScript features?

The best way to ensure consistent test quality is to auto-generate tests after implementing a feature. The skill enforces project conventions and AAA patterns to validate behavior and catch regressions across your codebase.