test-gen

Generates unit, business-logic, and regression tests for Python and JavaScript/TypeScript codebases.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Ascenseurs-Menetrey-SA/amsa-claude-skills --skill test-gen-ascenseurs-menetrey-sa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-gen
Source: https://github.com/Ascenseurs-Menetrey-SA/amsa-claude-skills/tree/main/test-gen
Command: npx skills add https://github.com/Ascenseurs-Menetrey-SA/amsa-claude-skills --skill test-gen-ascenseurs-menetrey-sa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps teams reduce bugs and prevent regressions by generating consistent, behavior-focused tests that match a project's existing structure and chosen scope.

Core Features & Use Cases

  • Framework & test structure detection: Identifies the test framework (pytest or Jest/Vitest/etc.) and locates/infers the right place to write tests (tests/, tests/, spec/), optionally limited to a provided path.
  • Targeted test generation by type: Generates unit tests (isolated functions with full mocking), business tests (service/use-case workflows with mocked external layers), or regression tests (ticket/issue-referenced scenarios in tests/regression/).
  • Quality-oriented conventions: Enforces FIRST principles, AAA pattern, explicit naming conventions, and asks for required regression context (ticket + reproduction scenario).

Quick Start

Ask the assistant to run test-gen in unit mode for your API folder by saying: "Use /test-gen --unit src/api to generate the unit tests for the API code."

Frequently Asked Questions about test-gen

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

FAQPage Schema
How do I generate unit tests for an existing Python or JavaScript codebase?

To generate unit tests, the tool detects your existing test framework like pytest or Jest, locates the correct test directory, and creates isolated function tests with full mocking applied.

What is the best way to write regression tests referenced to a specific issue ticket?

Writing regression tests requires placing ticket-referenced reproduction scenarios into a dedicated tests/regression/ directory to prevent future bugs and ensure consistent behavior-focused testing.

Can I target test generation to a specific folder path in my project?

Yes, you can constrain test generation to a specific path, which limits the scope so the tool only scans and creates tests within the provided directory structure.

Does test generation work with both pytest and JavaScript frameworks like Jest or Vitest?

Yes, test generation supports common Python and JavaScript/TypeScript frameworks by identifying the active framework and enforcing the appropriate mocking rules and layout conventions.

How are business logic tests structured for service and use-case workflows?

Business logic tests structure service and use-case workflows by applying the AAA pattern and mocking external layers, ensuring tests remain isolated and focused on core behavior.