rune-rescue

Orchestrates multi-session legacy code refactoring with autopsy, safety nets, and incremental surgery.

1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/dangvu008/VietTruyen --skill rune-rescue-dangvu008
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rune-rescue
Source: https://github.com/dangvu008/VietTruyen/tree/main/.agents/skills/rune-rescue
Command: npx skills add https://github.com/dangvu008/VietTruyen --skill rune-rescue-dangvu008

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Refactoring large legacy codebases is risky: without tests, rollback points, or a plan, one bad change can break everything. This Skill provides a structured, multi-session workflow that assesses codebase health, builds characterization tests as a safety net, and refactors one module at a time with verified rollback points. ## Core Features & Use Cases - Health Assessment (Autopsy): Scores the codebase 0-100 and builds a worst-first surgery queue of modules needing refactoring. - Safety Net (Safeguard): Generates characterization tests capturing current behavior and tags git rollback points before any surgery begins. - Incremental Surgery: Applies proven patterns (Strangler Fig, Branch by Abstraction, Expand-Migrate-Contract, Extract & Simplify) one module per session with a 5-file blast radius limit. - Cross-Session State Tracking: Maintains RESCUE-STATE.md so work can pause and resume across sessions without losing progress. - Use Case: You inherit a messy legacy project with no tests. Run the rescue workflow to get a health score, add characterization tests, then refactor the worst modules one at a time — each verified and committed with a rollback tag. ## Quick Start Ask the agent to rescue this legacy codebase by running a full health autopsy and starting the refactoring workflow.

Frequently Asked Questions about rune-rescue

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

FAQPage Schema
How do I safely refactor a legacy codebase with no tests?

Start with a full codebase health assessment, then write characterization tests that capture current behavior before changing any code. Refactor one module per session, run the test suite after each change, and tag git rollback points so you can revert if surgery fails.

What refactoring patterns work for large legacy modules?

Use Strangler Fig for modules over 500 lines to route traffic gradually, Branch by Abstraction when replacing implementations, Expand-Migrate-Contract for safe API transitions, and Extract & Simplify when cyclomatic complexity exceeds 10.

Can I refactor multiple coupled modules at the same time?

No. Refactoring two coupled modules simultaneously is a hard gate violation because changes in one module destabilize the other mid-surgery. Stabilize one module completely, verify tests pass, then move to the next in a separate session.

What is a characterization test in legacy code refactoring?

A characterization test captures the current behavior of legacy code, including buggy behavior, before refactoring begins. It acts as a rollback oracle: if these tests break during surgery, the refactoring changed observable behavior and must be reverted.

What is blast radius in code refactoring and why limit it?

Blast radius is the number of files affected by a refactoring change, measured by counting importers of the target module. Limiting it to 5 files per session keeps changes reviewable and revertible; larger scopes should be split using the Strangler Fig pattern.

How do I resume a refactoring project across multiple sessions?

Persist progress in a state file like RESCUE-STATE.md recording completed modules, health scores, and the current phase after every session. On resume, read the state file to restore the task list and continue from the last completed phase.