remove-ai-slops
ما الذي تفعله
تزيل هذه المهارة الكود «الزائد» أو غير الضروري الذي يولّده الذكاء الاصطناعي في تعديلات الكود. تفعل ذلك بأمان، لتبقى البرامج تعمل كما كانت من قبل.
متى تستخدمها
- ✓عندما تطلب تنظيف الكود أو إزالة الكود غير الضروري من تحديث ما.
- ✓بعد استخدام الذكاء الاصطناعي لتوليد كود وتريد مراجعته.
- ✓للتأكد من أن الكود المولّد بالذكاء الاصطناعي يتبع أفضل الممارسات.
رابط المهارة
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/remove-ai-slops/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“نظّف الكود المولّد بالذكاء الاصطناعي في آخر الحفظات (commits) التي أجريتها.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تنشئ المهارة أولًا اختبارات للتأكد من أن الكود يعمل. ثم تحلل أنماط الكود التي تعتبرها «زائدة» من الذكاء الاصطناعي وتزيلها. وأخيرًا تعيد الاختبارات للتأكد من عدم كسر شيء.
المحتوى التقني (ملف 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»؟
هي أنماط كود يولّدها الذكاء الاصطناعي أحيانًا، وليست مثالية، مثل التعليقات الواضحة جدًا، أو الكود الدفاعي الزائد، أو التعقيد غير الضروري.
هل يمكن أن يكسر هذا الكود الذي لدي؟
لا، فالمهارة مصممة لتكون آمنة. فهي لا تزيل الكود إلا بعد التأكد بالاختبارات من أن سلوك البرنامج لم يتغير.
هل تزيل التعليقات المفيدة؟
لا، تحتفظ بالتعليقات التي تشرح «لماذا» في أمر ما، وروابط التذاكر، وشرح الخوارزميات المعقدة. وتزيل فقط التعليقات التي تكرر ما يفعله الكود.
التفاصيل
الوصف الأصلي من المؤلف
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
التعليقات
- …
المزيد من المهارات من هذا المستودع
comment-checker
70kيساعد وكيلك على فهم الملاحظات التي تصدرها أدوات فحص التعليقات الآلية والرد عليها. مفيد لمعالجة نتائج المراجعات الآلية.
lcx-contribute-bug-fix
70kيساعد وكيلك على المساهمة بإصلاحات الأخطاء في مشاريع LazyCodex. ينشئ بلاغات أو طلبات دمج لضمان جودة الكود.
lcx-doctor
70kيتيح لوكيلك فحص سلامة تثبيتات LazyCodex وCodex CLI. مفيد عندما يتصرف النظام بشكل غريب بعد التحديثات أو التغييرات.
lcx-report-bug
70kيساعد وكيلك على الإبلاغ عن الأخطاء بالتفصيل في مشاريع LazyCodex. ينشئ بلاغات تتضمن معلومات مفيدة للمطورين لإصلاح المشكلة.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.