What problem does it solve?
Legacy codebases accumulate large code sections that mix multiple responsibilities, making them hard to maintain and risky to change. This Skill divides such sections into smaller, cohesive modules with well-defined responsibilities while guaranteeing that observable behavior never changes.
Core Features & Use Cases
- Responsibility Mapping: Analyzes the target code, maps mixed responsibilities, and proposes a module boundary with a single declared responsibility per part.
- Gated Refactoring: Every code-touching step passes through an approval gate with a full diff of moved files, created interfaces, and updated imports before anything is applied.
- Safety Net Enforcement: Requires test coverage of the affected behavior before moving code, offering characterization tests (Feathers-style) when coverage is missing, and reverts via diff if tests go red.
- Use Case: A legacy service class handles validation, persistence, and notification in one 800-line method. The Skill proposes three modules with clear interfaces, generates a self-contained HTML plan for approval, applies the moves after gate approval, and proves behavior preservation with a green test run.
Quick Start
Run /reversa-modularize with an opportunity ID or a target code section to split it into cohesive modules under an approved, test-protected plan.