test-retrofit

Retrofit characterization tests for legacy code with missing coverage.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Pyl-Tech/stream-coding --skill test-retrofit
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-retrofit
Source: https://github.com/Pyl-Tech/stream-coding/tree/main/.agents/skills/test-retrofit
Command: npx skills add https://github.com/Pyl-Tech/stream-coding --skill test-retrofit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you add tests to existing codebases that already exist without coverage, reducing the risk of refactoring by turning undocumented behavior into verifiable expectations.

Core Features & Use Cases

  • Scope high-risk gaps first: Prioritizes the most dangerous untested modules (including ones flagged by sentrux) so you get maximum safety per test-writing session.
  • Discover intended behavior before asserting: Uses specs/design docs, callers, comments, commit history, and existing integration/E2E tests to establish what the code is supposed to do.
  • Characterize intended behavior truthfully: Writes characterization tests that pass for intended behavior and explicitly labels known bugs or assumptions when behavior is inconsistent or unclear.
  • Guardrails that stick: Ensures the retrofitted tests can run cleanly and documents coverage status, known bugs, and next actions for CI integration.

Quick Start

Use the test-retrofit skill when you’re told “this module has no tests” and you need a safety net before touching it.

Frequently Asked Questions about test-retrofit

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

FAQPage Schema
How do I add characterization tests to legacy code before refactoring?▼

Characterization tests capture actual legacy code behavior by analyzing specs, callers, and commit history, then writing minimal-mocking tests that lock in current behavior to provide CI-ready guardrails for safe refactoring.

What is the best way to test untested legacy modules with no specifications?▼

The best way to test untested legacy modules is reverse-spec behavior locking: inferring intended behavior from integration tests and history, separating intended versus actual behavior, and explicitly documenting known bugs.

How do I prioritize which untested files need a safety net before a dependency upgrade?▼

Prioritize untested files for safety nets by applying risk-based testing to scope high-risk gaps first, targeting modules flagged as dangerous so you gain maximum safety per test-writing session before dependency upgrades.

Can characterization tests handle known bugs in existing legacy code?▼

Yes, characterization tests can handle known bugs by explicitly labeling them and separating intended versus actual behavior, ensuring the tests pass for intended behavior while documenting inconsistencies for CI integration.

How do I create CI-ready guardrails for legacy code with missing test coverage?▼

Create CI-ready guardrails for legacy code by retrofitting automated characterization tests, documenting coverage status, separating intended versus actual behavior, and logging next actions for continuous integration.