remove-ai-slops
यह क्या करती है
यह टूल आपके कोड बदलावों में AI द्वारा बनाए गए बेवजह के या फालतू कोड को हटाता है। ऐसा करते हुए यह सुनिश्चित करता है कि प्रोग्राम पहले की तरह ही चलता रहे।
कब इस्तेमाल करें
- ✓जब आप अपने नए अपडेट से 'साफ़ करने' या 'बेवजह कोड हटाने' को कहें।
- ✓AI से कोड बनवाने के बाद उसकी समीक्षा करना चाहें।
- ✓यह पक्का करने के लिए कि AI का बनाया कोड बेस्ट प्रैक्टिस को माने।
Skill का लिंक
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/remove-ai-slops/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे नवीनतम कमिट्स में AI द्वारा बनाए गए कोड को साफ़ करो।”
हर हफ़्ते 5 नई skills, 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 slops' क्या होते हैं?
ये वे कोड पैटर्न हैं जो 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
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
comment-checker
70kयह आपके एजेंट को automatic comment checkers के feedback को समझने और उस पर जवाब देने में मदद करता है। automated code या content reviews के नतीजों को प्रोसेस करने में उपयोगी है।
lcx-contribute-bug-fix
70kयह आपके एजेंट को LazyCodex से जुड़े projects में bug fixes देने में मदद करता है। code की गुणवत्ता बनाए रखने के लिए यह issues या pull requests बनाता है।
lcx-doctor
70kयह आपके एजेंट को LazyCodex और Codex CLI installations की स्थिति जांचने देता है। updates या बदलावों के बाद system अजीब व्यवहार करे, तब यह उपयोगी है।
lcx-report-bug
70kयह आपके एजेंट को LazyCodex projects के bugs विस्तार से रिपोर्ट करने में मदद करता है। यह ऐसे issues बनाता है जिनमें developers के लिए समस्या ठीक करने की काम की जानकारी होती है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।