remove-ai-slops
Was er macht
Dieses Tool entfernt überflüssigen oder aufgeblähten Code, den künstliche Intelligenz in deinen Änderungen erzeugt hat. Dabei sorgt es sicher dafür, dass das Programm weiterhin genauso funktioniert wie vorher.
Wann du ihn nutzt
- ✓Wenn du bittest, unnötigen Code aus einem Update zu 'putzen' oder zu entfernen.
- ✓Nachdem du eine KI Code hast generieren lassen und ihn prüfen willst.
- ✓Wenn du sicherstellen willst, dass KI-generierter Code Best Practices folgt.
Link zum Skill
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/remove-ai-slops/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Räume den KI-generierten Code in meinen letzten Commits auf.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Das Tool erstellt zuerst Tests, damit sichergestellt ist, dass der Code funktioniert. Dann analysiert es Code-Muster, die als 'aufgebläht' gelten, und entfernt sie. Zum Schluss prüft es noch einmal mit den Tests, ob nichts kaputtgegangen ist.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Remove AI Slops Skill
Inputs
- Default scope: branch diff vs
merge-base main(no arguments needed) - Optional scope: explicit file list passed by the caller (e.g., a Ralph workflow's changed-files set)
What this skill does
Cleans AI-generated slop from a bounded set of changed files while strictly preserving behavior. Locks behavior with regression tests first, then runs a categorized multi-pass cleanup, then verifies with quality gates and a critical review. Reverts and direct-edits when verification fails.
The core safety invariant: behavior is locked by green tests before a single line is removed. A checklist alone is not safety; a passing regression test is.
Categories (what counts as slop)
The agent looks for these nine categories. The first three are stylistic, the next three are structural, the next two are about hidden cost, and the last is about behavior coverage.
Stylistic
Obvious comments — comments restating code, trivial docstrings, section dividers, commented-out code, vague TODOs/Notes.
- KEEP: comments explaining WHY (business logic, edge cases, workarounds), ticket links, regex/algorithm explanations.
- KEEP: BDD markers (
# given,# when,# then,# when/then).
Over-defensive code — null checks for guaranteed values, try/except around code that cannot raise, isinstance checks for statically typed params, default values for required params, backward-compat shims, redundant validation duplicated at multiple layers, broad exception catching (
except Exception/except BaseExceptionin Python, emptycatch {}orcatch (e) { console.error(e) }without narrowing in TypeScript/JavaScript).- KEEP: validation at system boundaries (user input, external APIs), I/O error handling, nullable DB fields. Top-level boundary catch-all (CLI
main(), HTTP handler) with explicit logging + re-raise is acceptable. - REFACTOR:
except Exception→ catch the specific exception you expect. Emptycatch {}→ addinstanceofnarrowing or re-throw.catch (e) { log(e) }→ narrow withinstanceof, handle known cases, re-throw unknown. - PROOF REQUIRED: before deleting any validation or error handling at a trust boundary, Phase 2 must include an adversarial regression (malformed or hostile input) that fails if the guard is removed. No adversarial test → the guard stays. Redundant defense to remove is a duplicate of a check that already runs inside the boundary; a guard with no proof of redundancy is load-bearing.
- KEEP: validation at system boundaries (user input, external APIs), I/O error handling, nullable DB fields. Top-level boundary catch-all (CLI
Excessive complexity — deep nesting (>3 levels), nested ternaries, complex boolean expressions (combine 4+ predicates), long parameter lists (>5 args without a struct/dataclass/object), god functions (>50 lines doing many things), overly clever one-liners that sacrifice readability,
if/elif/elsechains for type/enum/literal discrimination (must bematch/case+assert_never),objectused as a type annotation (must beProtocol,TypeVar, or explicit union).- KEEP: established complexity patterns in this codebase, performance-critical hot paths that intentionally use a complex idiom.
if/elsefor boolean conditions and range checks (not variant discrimination). - REFACTOR: nested if-chains → guard clauses / early returns. Complex ternaries → explicit if/else. isinstance/enum if/elif chains →
match/casewithassert_neveron the wildcard.objectannotations →Protocol(structural),TypeVar(generic), or union (known variants).
- KEEP: established complexity patterns in this codebase, performance-critical hot paths that intentionally use a complex idiom.
Structural
Needless abstraction — pass-through wrappers, single-use helpers, speculative indirection ("we might need this later"), interfaces with one implementer where the interface adds no testability win, factory functions that just call a constructor.
- KEEP: abstractions that provide a real seam (testability, multiple implementers, framework-required boundaries).
Boundary violations — wrong-layer imports (UI importing DB driver), leaky responsibilities (handler doing business logic that belongs in a service), hidden coupling (module A reads module B's private state), side effects in pure-named functions.
- KEEP: pragmatic short-circuits already established as a pattern in this codebase. Flag for human judgment if unsure.
Dead code — unused imports, unused private functions/methods, unreachable branches, stale feature flags, debug leftovers (
console.log,print(...),dbg!), removed-but-still-referenced code.
…
Häufige Fragen
Was sind 'AI Slops'?
Das sind Code-Muster, die KIs manchmal erzeugen und die nicht ideal sind, zum Beispiel offensichtliche Kommentare, übertrieben defensiver Code oder unnötige Komplexität.
Kann dieses Tool meinen Code kaputt machen?
Nein, das Tool ist auf Sicherheit ausgelegt. Es entfernt Code erst, wenn die Tests bestätigen, dass sich das Verhalten des Programms nicht geändert hat.
Entfernt es auch nützliche Kommentare?
Nein. Es behält Kommentare, die das 'Warum' erklären, Ticket-Links oder Erklärungen komplexer Algorithmen. Entfernt werden nur Kommentare, die lediglich wiederholen, was der Code ohnehin macht.
Details
Originalbeschreibung des Autors
Removes AI-generated code smells from branch changes or an explicit file list behind regression tests. Use when the user asks to clean up, deslop, or remove AI-slop patterns from recent changes.
Beliebtheit
- GitHub-Sterne
- 70k
- Platz im Ranking
- #3138
- Lizenz
- NOASSERTION
- Aktualisiert
- 15.10.2026
Kommentare
- …
Weitere Skills aus diesem Repository
comment-checker
70kHilft deinem Agenten, auf Feedback automatischer Prüfprogramme zu reagieren. Nützlich, um Ergebnisse aus automatisierten Code- oder Inhaltsprüfungen zu verarbeiten.
lcx-contribute-bug-fix
70kHilft deinem Agenten, Bugfixes für LazyCodex-Projekte beizutragen. Erstellt Issues oder Pull Requests, um die Codequalität zu sichern.
lcx-doctor
70kLässt deinen Agenten den Zustand von LazyCodex- und Codex-CLI-Installationen prüfen. Nützlich, wenn das System nach Updates oder Änderungen merkwürdig reagiert.
lcx-report-bug
70kHilft deinem Agenten, Bugs für LazyCodex-Projekte ausführlich zu melden. Erstellt Issues mit nützlichen Informationen, damit Entwickler das Problem beheben können.
Ähnliche Skills
diffs
394kLässt deinen Agenten einen echten, teilbaren Diff seiner Änderungen als Viewer-Link oder Bilddatei erstellen, statt einer handgeschriebenen Zusammenfassung.
coding-agent
394kHilft deinem Agenten, eine größere Programmieraufgabe als Hintergrund-Worker an Codex, Claude Code oder OpenCode zu übergeben und danach den Fortschritt zu prüfen.
gh-issues
394kHilft deinem Agenten, GitHub-Issues zu finden, die zu bearbeitenden auszuwählen und Pull Requests mit Korrekturen zu öffnen, einschließlich der Nacharbeit an Review-Kommentaren.