test-gen

Generate unit, integration, and end-to-end tests with arrange–act–assert structure.

13|3|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/heaptracetechnology/heaptrace-skills --skill test-gen-heaptracetechnology
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-gen
Source: https://github.com/heaptracetechnology/heaptrace-skills/tree/main/test-gen
Command: npx skills add https://github.com/heaptracetechnology/heaptrace-skills --skill test-gen-heaptracetechnology

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing robust tests that catch real bugs is time-consuming and error-prone. This skill guides you to generate meaningful tests for a file, function, API endpoint, or feature, covering unit tests, integration tests, and edge cases to lock in existing behavior after writing code or before refactoring.

Core Features & Use Cases

  • Generate well-structured tests that cover happy paths, edge cases, and failure modes across unit and integration layers.
  • Enforce a deterministic arrange–act–assert pattern with clear setup and teardown guidance to improve reliability.
  • Use cases include validating new code, writing regression tests before refactors, and ensuring critical paths remain stable across modules and services.

Quick Start

Provide a concise prompt to generate tests for a given module that follow the arrange–act–assert pattern and include edge-case coverage.

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 and integration tests that catch real bugs?

To generate unit and integration tests that catch real bugs, provide a code artifact like a file or API endpoint. The output follows the arrange-act-assert workflow, covering happy paths, failure modes, and edge cases to lock in behavior before refactoring.

What is the arrange-act-assert pattern for structuring test code?

The arrange-act-assert pattern structures tests into three deterministic phases: setting up dependencies, executing the target function, and verifying outcomes. This workflow improves test reliability by clearly separating setup from behavior verification.

Can I use this to write regression tests before refactoring a module?

Yes, you can generate regression tests before refactoring a module. By covering critical paths and edge cases across frontend, backend, and API layers, the generated tests lock in existing behavior to ensure structural stability.

Does this test generation approach work for both frontend and backend APIs?

Yes, this test generation approach works for frontend, backend, APIs, and libraries. It applies deterministic structures and edge-case coverage to verify behavior across these distinct application layers.

What is the best way to ensure edge-case coverage when writing tests?

The best way to ensure edge-case coverage is to apply a deterministic arrange-act-assert workflow with clear setup and teardown guidance. This method systematically identifies failure modes alongside happy paths.