Skillpedia
برمجة عامة8.0k · #12648

antislop-code

ما الذي تفعله

يصفّي تعليقات الكود التي تبدو كتابة عامة من الذكاء الاصطناعي، مثل اللافتات الزخرفية والتعليقات التي تكرر الكود، ويُبقي ما يحمل معلومة حقيقية. وهو موجه إلى المطورين الذين يريدون تعليقات كود أنظف.

متى تستخدمها

  • ✓عندما يطلب مطور من وكيل الذكاء الاصطناعي كتابة تعليقات الكود في مشروع أو تعديلها.
  • ✓عندما يريد مطور إزالة اللافتات الزخرفية أو التعليقات البديهية من الكود.
  • ✓عندما يريد مطور الإبقاء فقط على التعليقات التي تعطي القارئ معلومة حقيقية.

رابط المهارة

https://github.com/miqdadbadjuber/anti-slop/blob/main/skills/antislop-code/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/miqdadbadjuber/anti-slop/blob/main/skills/antislop-code/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“نظّف التعليقات في هذا الملف. احذف الحشو وأبقِ الملاحظات المفيدة.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تفحص المهارة كل تعليق لتعرف إن كان له غرض حقيقي، ثم تحذف التعليقات الزخرفية أو المكررة أو المبالغ فيها. وهي مضبوطة لتغيير التعليقات فقط، لا الكود القابل للتنفيذ.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

antislop-code

Anti Slop: Rules for AI Coding Agents. Code Comments skill

Part of the antislop system. Read together with antislop.md (the core). This skill filters comments that read as generically AI (decorative, restating the obvious, stiff, loud) while preserving the comments that carry real information. It references core rules by number and never duplicates or renumbers them. Load it when the task writes or edits code comments.

How to use this skill

  • Load together with antislop.md whenever the task touches code comments. The core holds the mechanism (the purpose test, the three tiers, the Delivery Gate); this skill holds comment-specific depth.
  • Every entry has the same shape: Tell (the pattern), Why (why it reads as slop), Fix (what to do instead), with the governing core rule cited as R-XX.
  • Scope guardrail: this skill only modifies comments. Never modify executable code, identifiers, imports, formatting, indentation, whitespace, control flow, or logic. When in doubt, leave the code untouched.
  • The Delivery Gate in the core remains the gate. The "Code Comment Checklist" at the end of this file is the comment-specific supplement to run alongside it.

Comments That Add Nothing

Decorative Separators

  • Tell: banner comments built from repeated characters, ALL CAPS labels, or box drawing around a section name: // ======================= around Authentication, // -------- WORKFLOW --------, or a /* ---- ROUTES ---- */ header.
  • Why: the decoration is the message. A label wrapped in = or - signals "AI made this" without adding information, and ALL CAPS reads as shouting.
  • Fix: replace with a single plain line, or remove entirely if the label adds nothing (R-31).

Restating the Obvious

  • Tell: a comment that repeats what the next line or declaration already shows, like // Initialize the variable above let count = 0, // User class above class User {}, // Validate user above function validateUser(), or const userAge = 25; // User age is 25.
  • Why: it doubles the reading load without adding anything. The code already says it; the comment just repeats it.
  • Fix: remove and leave the line of code alone.

Workflow Narration

  • Tell: comments that narrate the flow step by step, like // Step 1: Validate input, // Step 2: Process request, // Step 3: Return response, or // First..., // Next..., // Finally....
  • Why: the control flow is visible in the code itself. Numbering it reads as a checklist, not an explanation.
  • Fix: remove. If the flow is genuinely hard to follow, that is a structure problem, not a missing comment problem.

Empty Labels

  • Tell: generic labels with no information behind them: // Main logic, // Core logic, // Business logic, // Helper function, // Entry point, // Error handling, or // Note: This is important. / // Important: Please read.
  • Why: the label names a category, not a fact. "Main logic" tells the reader nothing they could not infer from the code.
  • Fix: remove unless the label carries specific information. "Note: retries happen only on 5xx" earns its place; "Note: this is important" does not.

Vague Placeholders

  • Tell: comments that promise future work without saying what: // TODO: Improve this, // Future improvements, // Additional optimization can be added here, // Add more validation.
  • Why: a vague TODO is noise. It names a feeling (this could be better) instead of a task (what, and why).
  • Fix: remove. Keep a TODO only when it names a specific task with enough context to act on.

Signature Echo

  • Tell: documentation that only restates the signature, like a JSDoc block that repeats @param price The price. and @returns Total price. for a function whose name and parameters already say all of it.
  • Why: docs that echo the signature add length, not understanding. The reader learns nothing new.
  • Fix: simplify or remove the echo. Keep documentation that explains business rules, edge cases, assumptions, algorithms, limitations, side effects, API behavior, or security implications. Never strip real documentation.

Decorative Emoji

  • Tell: emoji used as decoration in comments, like // ✅ Validation or // 🚀 Performance.
  • Why: emoji is visual noise in code, and the specific set (✅, 🚀, 🔒) is the AI default vocabulary.
  • Fix: replace with plain English, or remove if the lab
الأسئلة الشائعة

هل ستغيّر كودي؟

لا. تقول المهارة إنها تعدّل التعليقات فقط، وتترك الكود والأسماء والاستيرادات والتنسيق كما هي.

هل تحتاج إلى الملف الأساسي لقواعد antislop؟

نعم. صُممت المهارة لتُستخدم مع الملف الرئيسي لـ antislop الذي يحتوي القواعد المشتركة.

أي التعليقات تبقيها؟

تبقي التعليقات التي تحمل معلومة حقيقية للقارئ، وتزيل ما لا يضيف شيئًا.

التفاصيل

الوصف الأصلي من المؤلف

Code comment hygiene for AI coding agents: remove generic AI-slop comments, keep the valuable ones, never touch the code.

repo: miqdadbadjuber/anti-slop

الشعبية

نجوم GitHub
8.0k
الترتيب
#12648
الترخيص
MIT
آخر تحديث
1‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة