Saltar al contenido
Skillpedia
Programación general70 mil · #3138

remove-ai-slops

Qué hace

Esta herramienta elimina el código 'sobrante' o innecesario que genera la inteligencia artificial en tus cambios de código. Lo hace con cuidado, para que el programa siga funcionando igual que antes.

Cuándo usarla

  • ✓Cuando pides 'limpiar' o 'quitar código innecesario' de una actualización.
  • ✓Después de usar una IA para generar código y querer revisarlo.
  • ✓Para asegurarte de que el código generado por IA sigue las buenas prácticas.

Link de la skill

https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/remove-ai-slops/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/remove-ai-slops/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Limpia el código generado por IA en mis últimos commits.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Primero, la herramienta crea pruebas para asegurarse de que el código funciona. Después, analiza y elimina los patrones de código que se consideran 'sobrantes' en el código de la IA. Por último, vuelve a comprobarlo con las pruebas para asegurarse de que no se ha roto nada.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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

  1. 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).
  2. 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 BaseException in Python, empty catch {} or catch (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. Empty catch {} → add instanceof narrowing or re-throw. catch (e) { log(e) } → narrow with instanceof, 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.
  3. 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/else chains for type/enum/literal discrimination (must be match/case + assert_never), object used as a type annotation (must be Protocol, TypeVar, or explicit union).

    • KEEP: established complexity patterns in this codebase, performance-critical hot paths that intentionally use a complex idiom. if/else for 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/case with assert_never on the wildcard. object annotations → Protocol (structural), TypeVar (generic), or union (known variants).

Structural

  1. 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).
  2. 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.
  3. Dead code — unused imports, unused private functions/methods, unreachable branches, stale feature flags, debug leftovers (console.log, print(...), dbg!), removed-but-still-referenced code.

…

Preguntas frecuentes

¿Qué son los 'AI slops'?

Son patrones de código que las IA generan a veces y que no son ideales, como comentarios obvios, código excesivamente defensivo o complejidad innecesaria.

¿Esto puede romper mi código?

No, la herramienta está diseñada para ser segura. Solo elimina código después de confirmar con las pruebas que el comportamiento del programa no ha cambiado.

¿Elimina los comentarios útiles?

No, conserva los comentarios que explican el 'porqué' de algo, los enlaces a tickets o las explicaciones de algoritmos complejos. Solo elimina los comentarios que repiten lo que ya dice el código.

Detalles

Descripción original del autor

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.

repo: code-yeongyu/oh-my-openagent

Popularidad

Estrellas en GitHub
70 mil
Posición en el ranking
#3138
Licencia
NOASSERTION
Actualizada
15/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas