Clean AI Code Slop
Remove low-signal AI-generated patterns from branch changes while preserving intended behavior and repository conventions.
Priorities
- •Safety: no destructive operations unless explicitly requested.
- •Style: terse, ASCII-only, no emojis, prefer repository-local templates.
- •Workflow: minimal diffs, no broad reformatting, follow existing patterns.
- •Minimalism: avoid over-engineering and unnecessary abstractions.
Scope
- •Analyze branch changes against base.
- •Remove AI-generated slop in changed files.
- •Keep changes tightly scoped to cleanup.
- •Do not commit, push, or open PRs.
- •Preserve legitimate functionality.
Workflow
- •Analyze branch changes.
- •Resolve base branch from
origin/HEADwhen available:git rev-parse --abbrev-ref origin/HEAD. - •If unavailable, use a sensible default base (
main, thenmaster). - •Inspect commits:
git log --oneline <base>..HEAD. - •Inspect changed files:
git diff <base>...HEAD --stat. - •Inspect full patch:
git diff <base>...HEAD.
- •Identify and remove slop.
- •Excessive comments: remove comments that restate obvious code or conflict with file style.
- •Over-defensive code: remove redundant guards and try/catch blocks in trusted internal paths.
- •Type hacks: remove
anycasts used to bypass type errors; use concrete types. - •Style inconsistencies: align naming, control flow, and error style with nearby code.
- •Emoji and novelty text: remove from code and comments.
- •Verbose errors: trim over-detailed messages that do not match repository patterns.
- •Redundant validation: remove duplicate validation in already-validated paths.
- •Over-engineering: inline one-off abstractions/helpers that do not improve reuse.
- •Backward-compat clutter: remove stale
_vars, no-op re-exports, and "removed" comments after deletion. - •General cleanup: remove dead code, unused imports, and speculative branches.
- •Execute cleanup edits.
- •Edit only files in scope unless user expands scope.
- •Keep interfaces and behavior stable unless user asks for functional changes.
- •Prefer deleting noise over introducing new abstractions.
- •Verify.
- •Review final diff with
git diff. - •Run focused tests/checks for affected areas when available.
- •Report any unrun or unavailable validation.
- •Report results.
- •Return a 1-3 sentence summary listing which slop categories were removed and which files changed.
- •Call out remaining risks or deferred cleanup.
Hard Constraints
- •Never commit changes automatically.
- •Never push or create PRs.
- •Never use destructive Git operations unless explicitly requested.