remove-ai-slops

Removes AI-generated code smells from branch diffs using regression tests and parallel cleanup agents.

1|Updated Jan 27, 2025
One-click install
npx skills add https://github.com/KasimKaizer/nix-darwin-config --skill remove-ai-slops-kasimkaizer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: remove-ai-slops
Source: https://github.com/KasimKaizer/nix-darwin-config/tree/main/modules/home/agents/skills/remove-ai-slops
Command: npx skills add https://github.com/KasimKaizer/nix-darwin-config --skill remove-ai-slops-kasimkaizer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? AI-generated code often accumulates slop: obvious comments, over-defensive checks, dead code, needless abstractions, duplication, and oversized modules. Manually auditing a branch diff for these patterns is slow and error-prone, and careless cleanup risks silently changing behavior. ## Core Features & Use Cases - Behavior-locked cleanup: Writes regression tests first to pin current behavior before any line is removed, then verifies with quality gates (tests, lint, typecheck, security scan). - Ten categorized slop patterns: Covers stylistic, structural, hidden-cost, test-coverage, and sizing issues, including a mandatory modular refactor for files over 250 pure LOC. - Parallel batch processing: Dispatches deep worker agents in batches of 5 files, with retry and escalation handling for failed files. - Use Case: After an AI assistant generates a large feature branch, run this skill to strip slop from the diff while green tests guarantee no behavior changed, producing a structured removal report. ## Quick Start Ask the agent to remove AI slop from the current branch changes and verify the result with the project's test suite.

Frequently Asked Questions about remove-ai-slops

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up AI-generated code safely?▼

Lock behavior with regression tests before deleting anything, then remove slop by category in safest-to-riskiest order: comments, dead code, defensive checks, duplication, complexity, then performance. Verify with lint, typecheck, and the full test suite afterward.

What counts as AI code slop in a code review?▼

Ten categories: obvious comments, over-defensive code, excessive complexity, needless abstraction, boundary violations, dead code, duplication, performance equivalences, missing tests, and modules over 250 pure lines of code.

Does this work on languages other than Python?▼

Yes, the cleanup categories apply to Python, TypeScript, JavaScript, Rust, Go, and Nix. The bundled AST checker script only analyzes Python files, but the slop categories and quality gates are language-agnostic.

How does the skill prevent behavior changes during cleanup?▼

Phase 2 writes the narrowest regression test pinning current behavior before any edit, and cleanup only starts once tests are green. Failed gates trigger targeted reverts of only the problematic change, with escalation after three failures.

When should I not remove defensive code checks?▼

Keep validation at system boundaries like user input, external APIs, and I/O error handling. Removing a boundary guard requires an adversarial regression test proving redundancy; without that proof, the guard stays.

What happens to files over 250 lines of code?▼

Oversized modules trigger a mandatory modular refactoring: responsibilities are identified, a split plan is presented to the user, and code is extracted into concept-named modules. Catch-all files like utils or helpers are forbidden.