rune-surgeon

Refactors one module per session using Strangler Fig, Branch by Abstraction, and Expand-Migrate-Contract patterns.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Legacy code refactoring often breaks working systems because changes are too large, untested, or poorly scoped. This Skill performs incremental, safe refactoring of one module at a time with strict blast radius limits, mandatory test verification after every edit, and proven refactoring patterns. ## Core Features & Use Cases - Pattern-Based Refactoring: Selects from Strangler Fig, Branch by Abstraction, Expand-Migrate-Contract, or Extract & Simplify based on module size, coupling, and complexity. - Safety Gates: Enforces a maximum 5-file blast radius, requires safeguard characterization tests before any edit, and runs tests after every single change. - Proposal Payload Execution: Consumes YAML proposals from architecture analysis specifying target scores, seams, adapters, and tests to replace. - Use Case: A 600-line legacy module with many consumers needs modernization. The Skill applies Strangler Fig, migrating one consumer at a time with tests passing after each commit, until the legacy code is fully replaced. ## Quick Start Ask the agent to refactor the legacy payment module using the surgeon workflow after safeguard tests are in place.

Frequently Asked Questions about rune-surgeon

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

FAQPage Schema
How do I refactor a large legacy module safely?

Use the Strangler Fig pattern for modules over 500 lines with many consumers: grow new code alongside the legacy implementation and migrate consumers one at a time. Run tests after every edit and commit each working increment separately.

What is the Branch by Abstraction refactoring pattern?

Branch by Abstraction introduces an interface over a tightly coupled module, wraps the legacy code behind it, builds the new implementation, then flips the switch. Each phase is a separate commit, requiring at least four commits.

How many files can be changed in one refactoring session?

A maximum of 5 files per session. The blast radius is counted before starting, and if the scope exceeds 5 files the work must be split into multiple smaller surgery sessions.

Why must characterization tests exist before refactoring?

Characterization tests capture the module's current external behavior so refactoring can change structure without changing behavior. Editing without this safety net risks silently breaking consumers, so the workflow hard-blocks edits until safeguard tests and a rollback tag exist.

When should I use Expand-Migrate-Contract instead of Strangler Fig?

Use Expand-Migrate-Contract when changing a function signature or data shape: add the new API alongside the old, migrate callers one commit at a time, then remove the old API. Strangler Fig suits whole large modules with many consumers.