activates an explicit reviewer pass after the cleanup writer pass.
This mode exists to preserve writer/reviewer separation: the authoring pass changes code, the reviewer pass evaluates whether the cleanup actually reduced slop safely.
</Review_Mode>
<Steps>
1. **Lock behavior first**
- Identify the current behavior and add or strengthen regression tests before cleanup when practical
- If tests cannot be added first, record the verification plan explicitly before editing
-
Create a cleanup plan
- Do not start coding immediately
- List the targeted smells and the files likely involved
- Sequence cleanup passes from lowest-risk deletion to higher-risk consolidation
-
Categorize the slop
- Duplicate code
- Dead or unused code
- Needless abstraction / wrapper layers
- Boundary violations / misplaced responsibilities
- Missing or weak tests
-
Execute one smell-focused pass at a time
- Pass 1: Dead code deletion -- remove unused branches, helpers, exports, and stale comments
- Pass 2: Duplicate removal -- consolidate repeated logic into existing patterns where possible
- Pass 3: Naming and error-handling cleanup -- tighten naming, trim noisy plumbing, normalize obvious inconsistencies
- Pass 4: Test reinforcement -- fill any regression gaps revealed by the cleanup
-
Run quality gates
- Run the relevant lint, typecheck, unit/integration tests, and any static or security checks already present for the touched area
- If a gate fails, fix the underlying issue or revert the risky cleanup instead of forcing it through
-
- Run a distinct reviewer pass that checks duplication, dead code, boundary violations, test coverage, and needless abstractions
- If the reviewer finds issues, address them in a follow-up cleanup pass before closing the task
-
Report outcome
- Changed files
- Simplifications made
- Behavior locked by tests
- Remaining risks or slop intentionally left for a later pass
</Steps>
<Examples>
<Good>
User: "deslop this module -- too many wrappers, duplicate helpers, and dead code"
Why good: Explicit anti-slop intent with concrete cleanup smells.
</Good>
<Good>
User: "cleanup the AI slop in src/auth: remove dead code and tighten boundaries"
Why good: Cleanup/refactor request is clearly about simplification, not feature work.
</Good>
<Bad>
User: "refactor auth to support SSO"
Why bad: This is feature work disguised as refactoring, not anti-slop cleanup.
</Bad>
<Bad>
User: "clean up formatting"
Why bad: Formatting-only work does not need the full anti-slop workflow.
</Bad>
</Examples>