rescue

Orchestrate safe legacy codebase refactoring with characterization tests and rollback-aware sessions.

1|Updated May 18, 2026
One-click install
npx skills add https://github.com/linenoize/topia --skill rescue-linenoize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rescue
Source: https://github.com/linenoize/topia/tree/main/skills/rescue
Command: npx skills add https://github.com/linenoize/topia --skill rescue-linenoize

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rescue helps you modernize legacy, messy, or fragile codebases without breaking behavior by enforcing a cautious, evidence-driven refactoring workflow.

Core Features & Use Cases

  • Autopsy-first assessment: Measures code health, identifies risky modules, and orders work by impact instead of convenience.
  • Safety-net creation: Builds characterization tests and boundary markers before any surgery begins, so behavior can be verified and rolled back.
  • Incremental surgery: Refactors one module per session with explicit gates, review checks, git tags, and persistent session state.
  • Use case: A large old project with tangled dependencies can be rescued module by module while preserving current behavior and tracking progress across multiple sessions.

Quick Start

Use the rescue skill to analyze the legacy codebase, create a safety net, and refactor it one module at a time.

Frequently Asked Questions about rescue

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

FAQPage Schema
How do I safely refactor a legacy codebase without breaking existing behavior?

To safely refactor legacy code, you must first establish characterization tests that capture current behavior, then proceed with incremental module-by-module changes using rollback-aware git tags. This evidence-driven approach ensures behavior is verified before any surgery begins.

What's the best way to modernize messy code with tangled dependencies module by module?

Modernizing messy code with tangled dependencies requires an incremental surgery approach that refactors one module per session with explicit gates and review checks. Persistent session tracking maintains rescue state across multiple sessions for gradual modernization.

When do I need characterization tests for refactoring?

You need characterization tests before any refactoring surgery begins to build a safety net that verifies existing behavior. These boundary markers allow you to confirm behavior is preserved and safely rolled back during incremental module changes.

Can I track refactoring progress across multiple sessions for a large old project?

You can track refactoring progress across multiple sessions using persistent rescue state. This session tracking enforces blast-radius limits, review checks, and rollback-aware git tags, ensuring incremental modernization resumes safely.

How does an autopsy-driven assessment order legacy refactoring work?

An autopsy-driven assessment measures code health, identifies risky modules, and orders work by impact instead of convenience. This planning ensures the most critical legacy issues are addressed first during controlled modernization.