legacy

Write characterization tests and create seams to safely refactor legacy code.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/Objective-Arts/lens-dist --skill legacy-objective-arts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: legacy
Source: https://github.com/Objective-Arts/lens-dist/tree/main/canon/legacy
Command: npx skills add https://github.com/Objective-Arts/lens-dist --skill legacy-objective-arts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to understanding, testing, and refactoring legacy code, enabling developers to safely make changes and add new features without introducing regressions.

Core Features & Use Cases

  • Characterization Tests: Learn to write tests that document existing behavior before making changes.
  • Seam Identification: Discover techniques to create testable "seams" in untestable code (Object Seams, Link Seams, Preprocessing Seams).
  • Refactoring Strategies: Apply methods like "Sprout Method/Class" and "Wrap Method" for safe code evolution.
  • Use Case: You've inherited a critical piece of code with no tests. Use this Skill to learn how to write characterization tests, identify seams, and refactor it safely.

Quick Start

Use the legacy skill to understand how to write characterization tests for untestable code.

Frequently Asked Questions about legacy

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

FAQPage Schema
How do I write characterization tests for legacy code with no existing coverage?

Characterization tests document the current behavior of legacy code before you make changes. You write tests that capture actual outputs to pin down existing logic, enabling safe refactoring without introducing regressions.

What is a seam in legacy code refactoring and how do I identify one?

A seam is a place in legacy code where you can alter behavior without editing in that exact location. You can identify object seams, link seams, or preprocessing seams to introduce testability and isolate dependencies safely.

What is the best way to add new features to untestable legacy code?

Use refactoring strategies like Sprout Method or Wrap Method to add new features safely. These techniques allow you to isolate new logic from the untested legacy code, ensuring manageable changes and preventing regressions.

Can I safely refactor critical legacy code without breaking existing behavior?

Yes, you can safely refactor critical legacy code by first applying characterization tests to pin down existing behavior. Once the current logic is documented by tests, you can identify seams and refactor with confidence.

When should I use Sprout Method versus Wrap Method for refactoring legacy code?

Use Sprout Method to create new code branches separately when adding features to legacy code. Use Wrap Method to intercept and modify existing calls. Both strategies enable safe code evolution without altering original untested logic.