reversa-refactor

Inventories legacy code improvement opportunities, prioritizes by ROI, and routes them to refactoring specialists.

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/Ruggery/OCR_Cartorio --skill reversa-refactor-ruggery
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: reversa-refactor
Source: https://github.com/Ruggery/OCR_Cartorio/tree/main/.agents/skills/reversa-refactor
Command: npx skills add https://github.com/Ruggery/OCR_Cartorio --skill reversa-refactor-ruggery

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Legacy codebases accumulate technical debt, but teams struggle to decide where refactoring effort pays off. This Skill analyzes working legacy code, catalogs concrete improvement opportunities, ranks them by real return on investment (hotpath impact, coupling, change frequency) rather than aesthetics, and routes each one to the right specialist — without ever modifying the code itself. ## Core Features & Use Cases - Opportunity Inventory: Scans code and classifies each finding by specialist verb: restructure, modularize, decouple, optimize, simplify, standardize, or prune, recording each as a structured YAML+Markdown artifact. - ROI-Based Prioritization: Ranks opportunities by impact, cost, and risk with confidence levels (green/yellow/red) tied to test coverage, so hotpath code is tackled before cosmetic cleanup. - Context-Organized Registry: Groups all opportunities and transformations under _reversa_refactor/<context>/ folders per feature or module, with generated index views and full audit traceability to specs. - Use Case: A developer inherits a monolithic shipping-cost module that is hard to test. They invoke the Skill, which resolves the context, detects a god class and a dependency cycle, ranks them by ROI, and presents a menu routing each finding to /reversa-restructure or /reversa-decouple for gated, reversible transformation. ## Quick Start Ask the agent to analyze the legacy code in a specific module and list which refactorings are worth doing, using the reversa-refactor workflow.

Frequently Asked Questions about reversa-refactor

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

FAQPage Schema
How do I decide which parts of legacy code are worth refactoring?▼

This Skill ranks opportunities by real return: impact times cost times risk, prioritizing hotpath code with high coupling, high execution frequency, or high change rate in git history. Each finding gets a confidence level based on test coverage before routing to a specialist.

How to prioritize technical debt by ROI instead of aesthetics?▼

The Skill applies a hotpath heuristic: code that runs frequently or changes often outranks large but dormant code. Each opportunity records impact, cost, and expected return in a structured YAML schema, then presents a prioritized menu for user decision.

Does this Skill modify or refactor my code automatically?▼

No. It never applies transformations — it only inventories, prioritizes, and routes. Actual changes are performed by separate specialist skills (restructure, decouple, prune, etc.), each with its own approval gate and reversible diffs.

What code smells does the refactoring analysis detect?▼

It detects long methods, god classes, nested conditionals, duplication, mixed responsibilities, concrete dependencies and cycles, unnecessary resource cost, overly complex logic, style deviations, and dead code candidates, each mapped to a specialist verb.

Can refactoring happen without test coverage on legacy code?▼

Opportunities without behavioral proof are marked red confidence. The default safety-net policy requires characterization tests green before and after any structural transformation; unproven changes are downgraded and flagged in the registry.