characterization-test-red

Capture legacy code behavior with characterization tests before refactoring.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/wendeus0/AI-dotfiles --skill characterization-test-red
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: characterization-test-red
Source: https://github.com/wendeus0/AI-dotfiles/tree/main/core/skills/characterization-test-red
Command: npx skills add https://github.com/wendeus0/AI-dotfiles --skill characterization-test-red

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests that capture the observed behavior of legacy code to serve as a safety net before refactoring, preserving functionality.

Core Features & Use Cases

  • Capture observed behavior of legacy modules to prevent regressions during refactors.
  • Document API boundaries and edge cases to guide safe, incremental changes.
  • Provide a baseline suite that supports both discovery and future green-refactor work.

Quick Start

Identify a legacy module and run characterization to generate tests that capture the current behavior of the target legacy module.

Frequently Asked Questions about characterization-test-red

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

FAQPage Schema
What are characterization tests for legacy code?

Characterization tests capture the current observed behavior of legacy modules lacking unit tests, creating a regression safety net before you refactor. They document existing API boundaries and edge cases without modifying production code.

How do I safely refactor legacy code without breaking existing behavior?

To safely refactor legacy code, first capture its current behavior with characterization tests across multiple edge cases. This generates a minimal baseline test suite that supports safe, behavior-preserving changes and prevents regressions.

When do I need to use characterization tests instead of standard unit tests?

You need characterization tests when refactoring legacy modules lacking existing test coverage. They are used to document and capture the actual observed behavior rather than testing intended design, ensuring regression safety during incremental changes.

Can I use this approach to test edge cases in untested modules?

Yes, this approach captures observed behavior across multiple edge cases in untested legacy modules. It guides you in creating minimal but comprehensive tests that document these boundaries, providing a baseline suite for future green-refactor work.

Does running characterization tests modify my production code?

No, running characterization tests strictly avoids production changes during the behavior capture process. The goal is to generate a baseline test suite that documents existing functionality, ensuring the legacy module remains untouched before the actual refactor begins.