reversa-simplify

Replaces complex code logic with simpler equivalent implementations verified by output-equivalence proofs.

Updated Jun 12, 2026
One-click install
npx skills add https://github.com/lacsousa/mediclaw-system --skill reversa-simplify-lacsousa
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: reversa-simplify
Source: https://github.com/lacsousa/mediclaw-system/tree/main/.agents/skills/reversa-simplify
Command: npx skills add https://github.com/lacsousa/mediclaw-system --skill reversa-simplify-lacsousa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Complex, deeply nested logic makes code hard to read and maintain, but simplifying it risks silently changing behavior. This Skill replaces convoluted logic with a simpler, clearer solution while proving the output stays identical, including edge cases. ## Core Features & Use Cases - Equivalence-Proof Simplification: Proposes a simpler algorithm and proves it produces the same output for the same inputs, covering empty, null, boundary, and concurrency edge cases. - Safety-Net Enforcement: Requires characterization tests before touching code; without coverage, it creates green characterization tests first or downgrades the risk level. - Gated Changes with Diffs: Every code modification goes through an approval gate showing before/after diffs, with automatic revert if the safety net turns red. - Use Case: A legacy function with five nested conditionals and redundant branches needs cleanup. The Skill documents why the complexity is accidental, proposes a flat equivalent, proves equivalence with a case table, and applies the change only after approval. ## Quick Start Run /reversa-simplify with an opportunity ID or a target function to simplify its logic with an equivalence proof.

Frequently Asked Questions about reversa-simplify

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

FAQPage Schema
How do I simplify complex code without changing its behavior?▼

Run /reversa-simplify on the target logic. It requires characterization tests that pin the current output, then proposes a simpler implementation and proves equivalence with a table of input-to-output cases, including edge cases, before applying any change.

What is the difference between reversa-simplify and reversa-optimize?▼

reversa-simplify targets cognitive complexity and readability, proving the simpler logic produces identical output. reversa-optimize targets measured resource performance. If the real goal is a measured speedup, the skill redirects you to /reversa-optimize.

Can I use reversa-simplify without running reversa-refactor first?▼

No. The skill reads control_mode and safety_net_policy from the _reversa_refactor directory created by /reversa-refactor. If that directory does not exist, it aborts and instructs you to run /reversa-refactor first.

What happens if there are no tests covering the code I want to simplify?▼

The skill requires a safety net before touching code. Without coverage, it offers to write green characterization tests that fix the current behavior first; if you refuse the safety net, the opportunity is downgraded and the lack of proof is recorded.

When should complexity not be simplified?▼

When the complexity is essential, meaning it encodes a confirmed business rule that exists for a reason. The skill checks confirmed specs before simplifying; essential complexity is documented rather than removed.