본문으로 건너뛰기
Skillpedia
일반 코딩70k · #3138

remove-ai-slops

하는 일

이 도구는 AI가 코드 변경에서 만들어 낸 불필요하고 군더더기인 코드를 제거합니다. 프로그램이 이전과 똑같이 동작하도록 안전하게 처리합니다.

사용하는 경우

  • ✓업데이트에서 ‘정리’하거나 ‘불필요한 코드를 제거’해 달라고 요청할 때.
  • ✓AI로 코드를 생성한 뒤 검토하고 싶을 때.
  • ✓AI가 만든 코드가 모범 사례를 따르게 하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/remove-ai-slops/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“최근 커밋에 있는 AI가 만든 코드를 정리해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 먼저 코드가 올바르게 동작하는지 확인하는 테스트를 만듭니다. 그다음 AI가 만든 군더더기 패턴을 찾아 제거합니다. 마지막으로 테스트를 다시 실행해 아무것도 깨지지 않았는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.

…

자주 묻는 질문

‘AI 슬롭’은 무엇인가요?

AI가 가끔 만들어 내는 바람직하지 않은 코드 패턴을 말합니다. 예를 들면 당연한 주석, 지나치게 방어적인 코드, 불필요한 복잡성 등이 있습니다.

이 도구가 코드를 망가뜨릴 수 있나요?

아니요, 이 도구는 안전하게 설계되었습니다. 프로그램의 동작이 바뀌지 않았다는 것을 테스트로 확인한 후에만 코드를 제거합니다.

유용한 주석도 제거하나요?

아니요, 이유를 설명하는 주석, 티켓 링크, 복잡한 알고리즘에 대한 설명은 남깁니다. 코드를 그대로 반복하는 주석만 제거합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
70k
순위
#3138
라이선스
NOASSERTION
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬