شعار Codebase Design

Codebase Design

المجتمع
Dark-Alex-17
codebase-design

مصطلحات ومبادئ مشتركة لتصميم الوحدات العميقة: الوحدة، والواجهة، والعمق، ونقطة الفصل، والمحوّل، والاستفادة، والمحلية؛ إضافةً إلى اختبار الحذف، وفئات التبعيات التي تتيح تعميق الوحدات بأمان، ونمط «صمّم مرتين» لاستكشاف واجهات بديلة. حمّل هذه المهارة عند تصميم واجهة وحدة أو تحسينها، أو تحديد موضع نقطة فصل، أو تسهيل اختبار الشيفرة، أو عندما تحتاج مهارة أخرى أو وكيل إلى مصطلحات الوحدات العميقة.

نظرة عامة

الناشرDark-Alex-17
المستودعcoyote
اسم المهارةcodebase-design
النجوم
56
التفريعات
2
الملفات المرفقة
تعليمات فقط
الترخيصAGPL-3.0
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها Dark-Alex-17 على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Codebase Design في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/Dark-Alex-17/coyote/tree/main/assets/skills/codebase-design
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Dark-Alex-17/coyote.git /tmp/coyote
mkdir -p .claude/skills
cp -r /tmp/coyote/assets/skills/codebase-design .claude/skills/codebase-design
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Codebase Design في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Codebase Design تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Codebase Design بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Design deep modules: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Use this language and these principles wherever code is being designed or restructured. The aim is leverage for callers, locality for maintainers, and testability for everyone.

Glossary (use these terms exactly)

Consistent language is the point — don't substitute "component", "service", "API", or "boundary".

  • Module: anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice.
  • Interface: everything a caller must know to use the module correctly — the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. ("API"/"signature" are too narrow: they name only the type-level surface.)
  • Implementation: what's inside a module.
  • Depth: leverage at the interface — how much behaviour a caller (or test) can exercise per unit of interface they must learn. Deep = lots of behaviour behind a small interface. Shallow = an interface nearly as complex as the implementation.
  • Seam (Feathers): a place where you can alter behaviour without editing in that place; the location where a module's interface lives. Where the seam goes is its own design decision, distinct from what goes behind it. (Avoid "boundary" — overloaded with DDD's bounded context.)
  • Adapter: a concrete thing that satisfies an interface at a seam. Names role (what slot it fills), not substance.
  • Leverage: what callers get from depth — more capability per unit of interface learned. One implementation pays back across N call sites and M tests.
  • Locality: what maintainers get from depth — change, bugs, knowledge, and verification concentrate in one place. Fix once, fixed everywhere.

Principles

  • Depth is a property of the interface, not the implementation. A deep module can be internally composed of small, mockable parts; they just aren't part of the interface. A module can have internal seams (private, used by its own tests) as well as the external seam at its interface — don't expose internal seams just because tests use them.
  • The deletion test. Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep. Apply this to anything you suspect is shallow.
  • The interface is the test surface. Callers and tests cross the same seam. Wanting to test past the interface means the module is probably the wrong shape.
  • One adapter means a hypothetical seam. Two adapters means a real one. Don't introduce a seam unless something actually varies across it (typically production + test). A single-adapter seam is just indirection.
  • When designing an interface, ask: can I reduce the number of methods? simplify the parameters? hide more complexity inside?

Designing for testability

  1. Accept dependencies, don't create them — processOrder(order, paymentGateway) is testable; a function that constructs its own gateway is not.
  2. Return results, don't produce side effects — calculateDiscount(cart): Discount beats applyDiscount(cart): void.
  3. Small surface area — fewer methods = fewer tests needed; fewer params = simpler setup.

Dependency categories (for safe deepening)

When deepening a cluster of shallow modules, classify its dependencies — the category determines how the deepened module is tested across its seam:

  1. In-process (pure computation, in-memory state): always deepenable; merge and test through the new interface directly. No adapter needed.
  2. Local-substitutable (deps with real local stand-ins: embedded/in-memory DB, in-memory filesystem): deepenable if the stand-in exists; the test suite runs the stand-in, the seam stays internal.
  3. Remote but owned (your own services across a network): define a port (interface) at the seam; production gets an HTTP/gRPC/queue adapter, tests get an in-memory adapter. The logic sits in one deep module even though it deploys across a network.
  4. True external (third-party services you don't control): injected port; tests provide a mock adapter.

Testing strategy: replace, don't layer. Once tests exist at the deepened module's interface, old unit tests on the merged shallow modules are waste — delete them. New tests assert observable outcomes through the interface and survive internal refactors; a test that must change when the implementation changes is testing past the interface.

Design it twice

Your first interface idea is unlikely to be the best (Ousterhout). For a module worth the effort, produce 2-3 radically different interface designs before committing — in parallel sub-agents when available, sequentially otherwise. Give each a different constraint:

  • Minimise the interface: 1-3 entry points, maximum leverage per entry point.
  • Maximise flexibility: many use cases, room for extension.
  • Optimise for the most common caller: make the default case trivial.
  • (When cross-seam dependencies dominate) design around ports & adapters.

Each design specifies: the interface (including invariants, ordering, error modes), a caller usage example, what the implementation hides, the dependency/adapter strategy, and where leverage is high vs thin. Compare on depth, locality, and seam placement, then give ONE opinionated recommendation (or a justified hybrid) — the reader wants a strong read, not a menu.

Anti-patterns

  • Measuring depth as implementation-lines over interface-lines — rewards padding. Depth is leverage, not a ratio.
  • Extracting pure functions "for testability" while the real bugs live in how they're called — that trades away locality and deepens nothing.
  • Introducing ports/interfaces speculatively ("we might swap the DB") — one adapter is a hypothetical seam.
  • Renaming without restructuring: calling a pass-through layer an "adapter" doesn't make the module deep. Apply the deletion test.
  • Vocabulary drift mid-discussion ("component", "service", "boundary") — the shared terms exist so design conversations compose.

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

ماذا تفعل مهارة الذكاء الاصطناعي Codebase Design؟

مصطلحات ومبادئ مشتركة لتصميم الوحدات العميقة: الوحدة، والواجهة، والعمق، ونقطة الفصل، والمحوّل، والاستفادة، والمحلية؛ إضافةً إلى اختبار الحذف، وفئات التبعيات التي تتيح تعميق الوحدات بأمان، ونمط «صمّم مرتين» لاستكشاف واجهات بديلة. حمّل هذه المهارة عند تصميم واجهة وحدة أو تحسينها، أو تحديد موضع نقطة فصل، أو تسهيل اختبار الشيفرة، أو عندما تحتاج مهارة أخرى أو وكيل إلى مصطلحات الوحدات العميقة.

لماذا تستخدم Codebase Design على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Codebase Design عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Codebase Design في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/Dark-Alex-17/coyote/tree/main/assets/skills/codebase-design. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Codebase Design؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Codebase Design؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Codebase Design معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Codebase Design مجانية؟

نعم. نشرها Dark-Alex-17 على GitHub بموجب ترخيص AGPL-3.0. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇