simplify-code
Use when the user requests simplification, or when the model offers one completion-boundary pass before commit, PR, or handoff. Do not run automatically on every edit.
Narrating-comment, reader-load, behavior-pin, and subtraction-first cleanup principles are adapted from Cursor's
poteto-modeat commit93b00b89ef425a9c1bac0d0b317dfc49c930ac99(MIT, Copyright (c) 2026 Cursor).
Simplify Code
Refine a settled change without altering behavior. Three reviewers — Reuse, Quality, Efficiency — examine the same scope from different angles; you disposition their findings against approved scope, apply only accepted fixes, and verify. Zero findings is success, not a reason to keep searching.
The premise is exact functionality preservation. Never relax assertions, weaken type signatures, or skip tests to make checks pass. Never simplify away a safety check — input validation at trust boundaries, data-loss-preventing error handling, security checks, and accessibility affordances stay even when a finding frames them as removable boilerplate.
When to use / skip
Use: a feature is finished and settling, before PR/commit/handoff, or on AI-generated code that works but feels heavy (its highest-yield use).
Skip: mechanical diffs (formatting, dependency bumps, lint autofixes, generated artifacts); tiny diffs (a couple of lines — review overhead exceeds yield); code the user asked to keep as written.
1. Resolve the scope
Priority order — user-named scope is authoritative and never widened: