Simplify

Reviews recently changed code for clarity, consistency, and maintainability — never changes behavior.

What it does

Pi-simplify reads every file that changed in your working tree, applies clarity and consistency improvements one at a time, then runs your test suite after each change to verify nothing broke. It operates on a strict constraint: it may only improve how the code reads, never what it does.

This means simplify is safe to run after any implementation pass. It won't introduce regressions because it won't change logic. What it will do is catch naming inconsistencies, overly complex expressions, unnecessary nesting, and other readability issues that are easy to miss when you're focused on getting the feature to work.

Why it's included

Implementation and cleanup are cognitively different tasks. Trying to do both at once usually means the cleanup doesn't happen. Simplify makes it a one-command step after implementation — run it, review the diff, and you're done.

Commands

CommandWhat it does
/simplify Review all uncommitted changes
/simplify --staged Review only staged changes
/simplify src/foo.ts src/bar.ts Review specific files
/simplify --ref=main Diff against a specific branch and review those changes