What problem does it solve?
Surgeon enables disciplined, low-risk refactoring when a codebase needs improvement but cannot afford broad or speculative changes. It keeps the work constrained to one module per session, so changes stay understandable, testable, and reversible.
Core Features & Use Cases
- Single-module refactoring: Focuses on one target module and refuses to exceed a five-file blast radius.
- Safety-first workflow: Requires preexisting safeguard coverage, runs tests after every edit, and stops immediately if tests fail.
- Pattern-guided changes: Supports Strangler Fig, Branch by Abstraction, Expand-Migrate-Contract, and Extract & Simplify depending on the refactor shape.
- Production-ready follow-through: Ends with review, commit, and journal updates so the session leaves a clear audit trail.
- Use case: A team can use this Skill to break apart a fragile legacy module incrementally while preserving behavior and keeping each step shippable.
Quick Start
Use surgeon to safely refactor the target module in a single, test-validated session without exceeding the five-file blast radius.