characterization-test-generator

Generate characterization tests documenting runtime behavior of existing Swift code.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/jtvaris/sunday-night-dynasty --skill characterization-test-generator-jtvaris
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: characterization-test-generator
Source: https://github.com/jtvaris/sunday-night-dynasty/tree/main/.agents/skills/testing/characterization-test-generator
Command: npx skills add https://github.com/jtvaris/sunday-night-dynasty --skill characterization-test-generator-jtvaris

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate tests that document what existing code actually does — a safety net before refactoring or modifying legacy code.

Core Features & Use Cases

  • Discovers code under test using file pattern globbing and API surface detection.
  • Generates characterization tests that freeze current behavior for regression safety.
  • Provides templates for common behaviors (pure computation, state mutation, async, side effects, errors, and edge cases) and a phased process.

Quick Start

Run the generator against your Swift project to produce characterization tests for the targeted module.

Frequently Asked Questions about characterization-test-generator

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

FAQPage Schema
How do I generate characterization tests for existing Swift code before refactoring?

To generate characterization tests for existing Swift code, you use a tool that discovers your code via glob patterns and public API surface, then produces test templates that freeze the current runtime behavior as a safety net. This captures pure computations, state mutations, and async operations.

What is a characterization test and when do I need it for legacy code?

A characterization test documents the actual runtime behavior of existing code rather than its intended design. You need it when refactoring legacy codebases or planning AI-assisted changes, providing a regression safety net by freezing current behaviors before modifications.

Can I use characterization tests to freeze async operations and side effects in Swift?

Yes, characterization tests can freeze async operations and side effects in Swift. The generator provides specific templates for these behaviors, alongside patterns for pure computations, state mutations, error paths, and edge cases, ensuring comprehensive behavior capture.

What's the best way to create a regression safety net for AI-assisted code changes?

The best way to create a regression safety net for AI-assisted changes is to generate characterization tests that document current behavior. By discovering code through file globbing and API surface detection, you freeze existing logic across multiple behavior templates before applying modifications.

Does this characterization test generator work without external dependencies?

Yes, the characterization test generator works without external dependencies. It operates independently to discover your Swift codebase, classify behaviors, and generate test templates for pure computation, state mutation, async operations, side effects, errors, and edge cases.

What types of behavior templates are generated for edge cases and error paths?

The templates generated for edge cases and error paths document specific runtime behaviors to prevent regressions. The generator classifies and provides templates covering pure computation, state mutation, async operations, side effects, error paths, and edge cases for comprehensive legacy code coverage.