Remove AI Slops
Use for a bounded cleanup of AI-generated code, not a general refactor. Keep behavior,
public APIs, type hints, dependencies, and project conventions intact.
Scope and safety
- Use the caller's explicit file list. Otherwise inspect the branch diff against its merge-base
Exclude deleted, binary, generated, vendored, and lock files.
- Read
references/cleanup-playbook.md before making a cleanup plan or judging a diff
- Lock observable behavior with existing or narrow regression tests before edits. A prose-only
file has no behavioral seam: do not add wording-pinning tests.
- Establish a green relevant baseline. If it cannot be established, stop and report it;
cleanup on unverified ground is reckless garbage.
- Prefer deletion, reuse, or a platform/standard-library capability before simplifying code
Make only behavior-obvious changes. When uncertain, keep the code.
Execution
- Write a per-file plan: deletion-ladder result, applicable categories, order, and risk
- Work safest to riskiest: comments, dead code, defensive code, duplication, complexity,
abstraction/boundaries, performance, coverage, then module size.
- For a multi-file pass, delegate independent files only through the runtime's currently exposed
agent tools. Give each worker the exact file, scope, constraints, and required category review;
batch only within available concurrency. The owner integrates and verifies every change.
- Use project-native tests, lint, type checks, and scanners. Do not invent unavailable tools or
silently skip a gate; report genuinely inapplicable gates as
N/A with the reason.
- If a change fails validation, revert only the faulty hunk, fix it if safety is evident, and rerun
the affected validation. Escalate after three failed attempts on one file.
Review output
Report scope, baseline/behavior lock, cleanup plan, per-file results and deliberate skips, each
quality gate, safety/behavior/quality review, issues fixed, net impact, and deferred risks.
Never claim a passing gate without its observed output.
Required follow-up reads
| Need |
Read |
When |
| Category definitions, keep/refactor rules, deletion ladder, and validation |
references/cleanup-playbook.md |
Before planning, modifying, or reviewing a cleanup |
1---2disable-model-invocation: true3name: remove-ai-slops4description: "Use when asked to deslop, review, or clean AI-generated code in a bounded diff without changing behavior."5license: AGPL-3.0-or-later6---78# Remove AI Slops910Use for a bounded cleanup of AI-generated code, not a general refactor. Keep behavior,11public APIs, type hints, dependencies, and project conventions intact.1213## Scope and safety14151. Use the caller's explicit file list. Otherwise inspect the branch diff against its merge-base16 Exclude deleted, binary, generated, vendored, and lock files.172. Read `references/cleanup-playbook.md` before making a cleanup plan or judging a diff183. Lock observable behavior with existing or narrow regression tests before edits. A prose-only19 file has no behavioral seam: do not add wording-pinning tests.204. Establish a green relevant baseline. If it cannot be established, stop and report it;21 cleanup on unverified ground is reckless garbage.225. Prefer deletion, reuse, or a platform/standard-library capability before simplifying code23 Make only behavior-obvious changes. When uncertain, keep the code.2425## Execution2627- Write a per-file plan: deletion-ladder result, applicable categories, order, and risk28- Work safest to riskiest: comments, dead code, defensive code, duplication, complexity,29 abstraction/boundaries, performance, coverage, then module size.30- For a multi-file pass, delegate independent files only through the runtime's currently exposed31 agent tools. Give each worker the exact file, scope, constraints, and required category review;32 batch only within available concurrency. The owner integrates and verifies every change.33- Use project-native tests, lint, type checks, and scanners. Do not invent unavailable tools or34 silently skip a gate; report genuinely inapplicable gates as `N/A` with the reason.35- If a change fails validation, revert only the faulty hunk, fix it if safety is evident, and rerun36 the affected validation. Escalate after three failed attempts on one file.3738## Review output3940Report scope, baseline/behavior lock, cleanup plan, per-file results and deliberate skips, each41quality gate, safety/behavior/quality review, issues fixed, net impact, and deferred risks.42Never claim a passing gate without its observed output.4344## Required follow-up reads4546| Need | Read | When |47| --- | --- | --- |48| Category definitions, keep/refactor rules, deletion ladder, and validation | `references/cleanup-playbook.md` | Before planning, modifying, or reviewing a cleanup |