refactor-safely

Plan behavior-preserving legacy code refactoring using characterization tests and incremental patterns.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit --skill refactor-safely-serpro-workshop-fortaleza
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactor-safely
Source: https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit/tree/main/.github/skills/refactor-safely
Command: npx skills add https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit --skill refactor-safely-serpro-workshop-fortaleza

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Refactoring legacy code without tests is risky: a single change can silently break behavior, and reviewers cannot distinguish safe transformations from behavior changes. This Skill provides a disciplined workflow for modernizing legacy systems while proving that behavior is preserved at every step. ## Core Features & Use Cases - Characterization Testing Guidance: Write tests that pin down current behavior, including quirks and preserved bugs, before making any change. - Proven Refactoring Patterns: Apply the Strangler Fig pattern for systems, the Mikado Method for code dependencies, and Branch by Abstraction to avoid long-lived branches. - Structured Output Template: Produce a refactoring plan with safety net, ordered reversible steps, Mikado prerequisites, and per-commit change records. - Use Case: When extracting a payment service from a 29-year-old Natural/Adabas monolith into Java 21, use this Skill to characterize the legacy behavior, route traffic through a facade, and migrate incrementally with green tests after each step. ## Quick Start Ask the AI to create a safe refactoring plan for extracting a service from the legacy module, using characterization tests and the Strangler Fig pattern.

Frequently Asked Questions about refactor-safely

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

FAQPage Schema
What are the limitations of manual testing during refactoring?▼

Manual verification of only the happy path is an antipattern because it misses edge cases that commonly fail. Characterization tests observing external behavior such as HTTP, CLI, or database state provide a durable safety net that survives internal restructuring.