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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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
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.
…
자주 묻는 질문
‘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.
인기도
- GitHub 스타
- 70k
- 순위
- #3138
- 라이선스
- NOASSERTION
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
comment-checker
70k에이전트가 자동 댓글 검사기의 피드백을 이해하고 응답하도록 돕습니다. 자동화된 코드나 콘텐츠 검토 결과를 처리하는 데 유용합니다.
lcx-contribute-bug-fix
70k에이전트가 LazyCodex 관련 프로젝트에 버그 수정을 기여하도록 이슈나 PR을 만들어 코드 품질을 높이도록 돕습니다.
lcx-doctor
70k에이전트가 LazyCodex와 Codex CLI 설치 상태를 점검하도록 돕습니다. 업데이트나 변경 후 시스템이 이상하게 동작할 때 유용합니다.
lcx-report-bug
70k에이전트가 LazyCodex 프로젝트의 버그를 자세히 보고하도록 돕습니다. 개발자가 문제를 고칠 수 있도록 유용한 정보를 담은 이슈를 만듭니다.