Skillpedia
برمجة عامة15k · #10981

principle-minimize-reader-load

ما الذي تفعله

تمنح هذه المهارة وكيلك قاعدة لإبقاء الكود سهل القراءة للبشر. وهي للفرق التي يصعب تتبع كودها بسبب الأغلفة أو التحويلات غير المباشرة أو الحالة المشتركة.

متى تستخدمها

  • ✓عندما يصعب تتبع الكود من السؤال إلى الجواب.
  • ✓عندما يكون لغلاف مستدعٍ واحد فقط، أو لمحوِّل لا يوجد له استخدام ثانٍ.
  • ✓عندما تجعل الحالة العامة أو القابلة للتغيير السلوك غير متوقع.

رابط المهارة

https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-minimize-reader-load/SKILL.md

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

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

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

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

استخدم هذه المهارة لمساعدتي: https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-minimize-reader-load/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

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

“في هذه الوحدة خمس طبقات من الأغلفة تفعل الشيء نفسه. بسّطها حتى يستطيع مطوّر جديد متابعتها.”

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

كيف تعمل

يعدّ وكيلك الطبقات بين السؤال والجواب، والحالة الخفية التي يجب على القارئ تتبعها. ويدمج الأغلفة التي تكلّف أكثر مما توفّر، ويفضّل الدوال النقية، ويضيّق الحالة إلى أصغر نطاق مفيد.

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

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

Minimize Reader Load

Maintainability is the work a reader must do to understand code. Track two axes: layers to trace (indirections between the question and the answer) and state to hold (hidden or mutable context the reader must keep in their head). LOC, cyclomatic complexity, and "clean architecture" are proxies. Reader load is the thing that matters. The two axes are independent. A flat file with 50 globals can be as hard to reason about as a 6-layer adapter stack. Guard both. This is the human analog of Guard the Context Window. Working memory is finite for readers too.

  • Collapse layers that cost more than they save: wrappers with one caller, adapters with no second implementation, speculative indirection that was never needed. Inline them.
  • Make adjacent layers change the abstraction. A layer that repeats the same methods and arguments adds reader load without compression. Collapse pass-through layers.
  • Demand interface compression. A broad interface that hides little complexity makes readers learn both the surface and the implementation. Prefer boundaries that hide meaningful decisions.
  • Shrink state scope: prefer pure functions (returns over mutations), locals over fields, fields over module state, and module state over globals. Derive instead of sync.
  • Name the invariant at the boundary, not in every consumer, so the reader learns it once.
  • Before adding a layer or a piece of state, ask: does it reduce reader load elsewhere by at least as much?

The test: can a new reader answer "where does X come from?" and "what can change X?" in under 30 seconds? If not, cut layers or cut state.

الأسئلة الشائعة

هل عدد الأسطر هو الهدف؟

لا. تقول المهارة إن جهد القارئ أهم من عدد الأسطر أو درجات التعقيد.

متى تُحذف الطبقة؟

عندما تضيف جهدًا على القارئ دون فائدة حقيقية، مثل غلاف له مستدعٍ واحد.

ماذا عن الحالة؟

فضّل الدوال النقية والقيم المحلية على الحقول وحالة الوحدة والمتغيرات العامة.

التفاصيل

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

Apply when reviewing or shaping code that's hard to trace. Count layers between question and answer, and hidden state in the reader's head; collapse one-caller wrappers and shrink mutable scope.

repo: cursor/plugins

الشعبية

نجوم GitHub
15k
الترتيب
#10981
الترخيص
—
آخر تحديث
31‏/10‏/2026

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

0

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

التعليقات

  • …

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

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