What problem does it solve?
Legacy code often contains performance bottlenecks that are risky to change because there is no proof the optimized version behaves identically. This Skill reduces execution time, memory, and resource consumption only when the gain is measured and output equivalence is proven, rejecting premature optimization.
Core Features & Use Cases
- Evidence-Based Optimization: Identifies bottlenecks through declared asymptotic complexity and real benchmarks rather than intuition, recording baseline measurements before any change.
- Output Equivalence Proof: Requires a safety net of tests (including characterization tests when coverage is missing) and proves the optimized code produces identical output for the same inputs, including edge cases.
- Gated Transformations: Every code change passes through an approval gate with a diff, generates a self-contained plan.html, and persists transformation records with diffs and before/after evidence.
- Use Case: A legacy report generator takes 40 seconds per run. The agent measures the baseline, proposes an algorithmic improvement, proves equivalent output on edge cases, applies the change after gate approval, and confirms the measured gain.
Quick Start
Ask the agent to run /reversa-optimize on a slow function or module so it measures the bottleneck, proposes an optimization, and applies it only after your approval.