मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग70k · #3138

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/remove-ai-slops/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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

  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 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.

repo: code-yeongyu/oh-my-openagent

लोकप्रियता

GitHub स्टार
70k
रैंकिंग में स्थान
#3138
लाइसेंस
NOASSERTION
अपडेट की गई
15/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस 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