minimal-code-discipline
ما الذي تفعله
ترشد هذه المهارة الوكيل إلى إبقاء تغييرات الكود صغيرة قدر الإمكان مع الحفاظ على صحتها. وهي موجهة إلى من يريدون تغييرات مركّزة دون تضخم أو إضافات افتراضية.
متى تستخدمها
- ✓عندما تطلب تغييراً صغيراً أو بسيطاً أو بأصغر حجم ممكن.
- ✓عندما تبدأ الخطة أو التغيير بالتوسع أكثر مما طُلب.
- ✓عندما تريد مراجعة تغيير مقترح بحثاً عن حجم غير ضروري قبل بنائه.
رابط المهارة
https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/minimal-code-discipline/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أضف زر تصدير بسيطاً إلى صفحة التقرير. اجعل التغيير أصغر ما يمكن، وأعد استخدام ما لدينا.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يسأل الوكيل أولاً إن كان التغيير مطلوباً أصلاً، ويفحص قاعدة الكود بحثاً عن المساعدات الموجودة، ويفضّل أبسط أداة تؤدي العمل. يبقي التغيير قصيراً مع الحفاظ على فحوص الأمان.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Minimal Code Discipline
Use this skill to apply a minimal-code (YAGNI-ladder) discipline while planning and writing code changes. It keeps diffs small and obviously correct without sacrificing the checks that keep users safe.
This skill complements ai-slop-cleaner: that skill cleans slop after it lands; this one keeps it from being written.
When to Use
Use this skill when:
- the user asks for a minimal, lean, YAGNI, or smallest-possible-diff implementation
- a plan or in-flight change is growing beyond the stated request
- writing new code where scope creep, reinvented helpers, or speculative generality are likely
- reviewing a proposed diff for size before implementation
When Not to Use
Do not use this skill when:
- the user explicitly asks for a broad, feature-rich, or future-proofed build (their explicit scope wins)
- the task is exploratory scaffolding the user has marked as throwaway
- minimization pressure would touch protected behavior (see Non-Negotiables)
The Discipline
Existence first. Ask whether the change needs to exist at all; skip work that serves only a speculative future need.
Reuse before writing. Search the codebase for an existing helper, type, or pattern before writing anything new. Never copy a helper that already lives a few files away — reuse it or extract it to one shared location.
Dependency ladder. Reach for the standard library first, then platform-native capability, then an already-installed dependency. Hand-written code is the last resort. Do not introduce a new dependency when a few lines of code suffice, unless the user explicitly requested or approved it.
Understand before minimizing. Read the affected code and follow its execution path first. Ship the shortest correct diff once the problem is understood — code you never write never breaks.
Boring over clever. Prefer boring, obviously-correct code over clever code.
Mark the ceiling. Record deliberate simplifications with a short comment naming the accepted limit and what would justify replacing it.
Root cause, not symptoms. Fix bugs at the root cause shared by every caller, not with a separate patch for each reported symptom.
Non-Negotiables
Never minimize away:
- validation wherever a trust boundary is crossed
- error handling that guards against data loss
- security controls
- accessibility fundamentals
- scope the user explicitly requested
Verification
Before reporting completion, confirm:
- every added line earns its place (no speculative generality, no duplicate helpers)
- the diff is the shortest one that correctly solves the stated problem
- non-negotiables are intact
- tests still pass and behavior is unchanged except as requested
الأسئلة الشائعة
هل ستحذف فحوص الأمان لتبقى قصيرة؟
لا. السلوك المحمي وفحوص الأمان لا تُقلَّص أبداً لمجرد توفير أسطر.
هل تتجاوز طلباً لميزة كبيرة؟
لا. إذا طلبت صراحةً بناءً واسعاً أو مستقبلياً، فنطاقك هو الذي يسود.
ما الفرق بينها وبين مهارة تنظيف الكود؟
هذه تمنع كتابة الكود الزائد من البداية، بينما تنظّف مهارة التنظيف الكود بعد إضافته.
التفاصيل
الوصف الأصلي من المؤلف
YAGNI-ladder coding discipline for writing changes — existence-first, reuse before writing, dependency ladder, shortest correct diff, with non-negotiables that must never be minimized away
الشعبية
- نجوم GitHub
- 41k
- الترتيب
- #7010
- الترخيص
- MIT
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
agent-doc-discipline
41kيعلّم وكيلك كتابة تعليمات يستطيع وكلاء ذكاء اصطناعي آخرون اتباعها وحدهم، بقواعد قابلة للفحص ومع سبب واضح وراء كل قاعدة.
ai-slop-cleaner
41kيساعد وكيلك على تنظيف الكود الذي كتبه الذكاء الاصطناعي، وهو يعمل لكنه منتفخ أو مكرر، فيحذف الكود الزائد دون تغيير ما يفعله.
architecture-survey
41kيساعد وكيلك على مراجعة بنية الكود وسرد الأجزاء التي تصبح أصعب في التغيير، مع الأدلة، دون أن يغيّر أي شيء بنفسه.
ask-navigator
41kيساعد وكيلك على تحويل مشروع غامض إلى خريطة من أسئلة قرار واضحة، ثم العمل عليها واحداً تلو الآخر حتى يتضح الطريق.
مهارات مشابهة
diffs
394kيتيح لوكيلك إنتاج فرق تعديلات حقيقي يمكن مشاركته، كرابط عرض أو ملف صورة، بدلاً من ملخص مكتوب يدوياً.
coding-agent
394kيساعد وكيلك على تسليم مهمة برمجة كبيرة إلى Codex أو Claude Code أو OpenCode كعامل في الخلفية، ثم متابعة تقدمها.
gh-issues
394kيساعد وكيلك على إيجاد مشكلات GitHub واختيار ما ستعمل عليه، وفتح طلبات سحب بالإصلاحات، ومتابعة تعليقات المراجعة.