clean-code-guard
ما الذي تفعله
يفحص وكيل الذكاء الاصطناعي هذا شيفرتك البرمجية ليتأكد من أنها تتبع ممارسات الكتابة الجيدة، مثل الوضوح والتنظيم وسهولة الفهم. ويساعد في منع الأخطاء الشائعة التي تنشأ عند توليد الشيفرة تلقائيًا.
متى تستخدمها
- ✓بعد أن يُنشئ الذكاء الاصطناعي جزءًا من الشيفرة.
- ✓قبل تقديم الشيفرة أو حفظها بعد تعديلها من قبلك أو من الذكاء الاصطناعي.
- ✓عندما تريد مراجعة جودة لشيفرة موجودة.
رابط المهارة
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/clean-code-guard/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“راجع هذه الشيفرة للتأكد من أنها تتبع أفضل الممارسات.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يقارن شيفرتك بمجموعة من قواعد الجودة، مثل الأسماء الواضحة والدوال الصغيرة. وإذا وجد ما لا يتبع القواعد، يقترح التصحيحات أو يُجريها.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
clean-code-guard
You are reviewing generated or changed code before it ships. Apply the rules below as a guard pass after the first implementation pass — and once this skill is active, keep applying it to every later code change in the same session, re-running the self-check before delivery after each edit rather than reverting to unguarded output because the skill loaded earlier. If the user explicitly invokes this skill before writing code, use the same rules while writing and still run the self-check before delivery.
When to Use
Use this skill when reviewing generated or changed code before it ships. Activate it reactively after an agent writes, edits, or refactors production code — especially after a first implementation pass. Re-run the guard pass before delivery after each edit.
Compatibility
This is a portable instruction skill. It requires no MCP server, network access,
API key, shell command, local executable, or bundled script. It can be used in
any runtime that supports SKILL.md plus directly linked references/
files; agents/openai.yaml is lightweight display metadata.
This skill does not replace project linters, formatters, type checkers, or test runners. Use the project's own tools for mechanical verification; use this skill for the judgement layer around code quality and review.
How to use this skill
This skill has three modes — pick based on the user's request.
Guard-pass mode (recommended): after code has been generated, edited, refactored, or fixed, check the diff or target files against the Always-applied imperatives below. Fix violations before presenting, committing, or merging the work.
Live mode (explicit): when the user invokes this skill before a risky code edit, apply the same imperatives while writing, then run the Self-check before delivery checklist. If you violate any rule, fix it before showing the user.
Review mode (triggered when the user asks you to review, audit, critique, or rate code): walk references/review-checklist.md against the target file(s) and produce a structured findings report. Do not edit code in review mode unless asked.
Across all three modes, the rule bodies live in references/. Read the relevant reference file when:
- You hit a rule you don't fully remember the reasoning for.
- The user pushes back on a rule and you need the source citation.
- You're in review mode and need the full checklist.
- The code under review touches a specific principle (e.g., subclassing → references/solid.md; deduplication → references/dry-kiss-yagni.md).
The reference files are:
- references/naming-and-functions.md — names, function size, parameters, command/query separation.
- references/comments-and-formatting.md — when to comment, when to delete, matching neighbor style.
- references/solid.md — SRP, OCP, LSP, ISP, DIP with the modern phrasings and detection smells.
- references/dry-kiss-yagni.md — knowledge vs code duplication, Sandi Metz's re-inline rule, McCabe complexity, Fowler's YAGNI cost categories.
- references/ai-failure-modes.md — the 14 systematic ways LLMs produce bad code. Read this one first if you are an AI agent reading this skill. It is the highest-leverage file in the skill.
- references/review-checklist.md — structured walk-through for review mode.
- references/sources.md — central bibliography for source URLs. Read it only when you need to verify or cite an external source.
Examples
- A coding agent implements an endpoint: use guard-pass mode on the diff before the work is presented or committed.
- User asks "review this PR" or "should I merge this?": use review mode and report findings from references/review-checklist.md; do not edit unless asked.
- User asks "implement this endpoint using clean-code-guard": use live mode while writing, then run the self-check before delivery.
- User asks "refactor this function, same behavior": preserve observable behavior exactly and treat any bug fix as a separate change.
Success criteria
This skill is working when code-writing tasks avoid the listed failure modes,
…
الأسئلة الشائعة
ما هي « أفضل الممارسات » في الشيفرة؟
هي قواعد ذهبية لكتابة الشيفرة تجعلها أسهل في القراءة والفهم والصيانة، سواء من مبرمجين آخرين أو من نفسك لاحقًا.
لماذا أحتاج إلى هذا إذا كان الذكاء الاصطناعي قد كتب الشيفرة؟
حتى الذكاء الاصطناعي قد يخطئ، أو يكتب شيفرة غير مثالية. وهذا الوكيل يضمن أن الشيفرة المولدة عالية الجودة ويتجنب المشكلات الشائعة.
هل يحل هذا محل أدوات فحص الشيفرة الأخرى؟
لا، بل يكملها. يركز على جودة الشيفرة ووضوحها، بينما قد تتحقق أدوات أخرى من أخطاء الصياغة أو مشكلات الأمان.
التفاصيل
الوصف الأصلي من المؤلف
Review generated or changed production code with Clean Code, SOLID, DRY, KISS, YAGNI, and LLM-specific failure-mode checks.
الشعبية
- نجوم GitHub
- 48k
- الترتيب
- #4150
- الترخيص
- MIT
- آخر تحديث
- 15/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
00-andruia-consultant
48kيساعد وكيلك على بدء مشاريع الذكاء الاصطناعي أو تحسينها. يحلل الكود ويقترح الأدوات ويُعد خطط عمل بالإسبانية.
007
48kيتيح لوكيلك إجراء تدقيقات أمنية ونمذجة التهديدات. مفيد لحماية المشاريع من الهجمات والثغرات الأمنية.
10-andruia-skill-smith
48kيساعد وكيلك على إنشاء أدوات الذكاء الاصطناعي أو تحسينها. يحدد طريقة عملها، ويكتب توثيقها، ويتحقق من بنيتها.
20-andruia-niche-intelligence
48kيتيح لوكيلك إعداد ملخص عن صناعة محددة. مفيد لفهم السياق والقواعد وأنماط الاستخدام والمخاطر لمشروع ما، باستخدام مصادر موثوقة.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.