شعار Hor Type Interface

Hor Type Interface

مؤسسة
openreachtech
hor-type-interface

Define TypeScript type interfaces in .d.ts declaration files: model interfaces (one file per model/table under types/models/, in the global `model` namespace) and resolver input/output types (all in types/graphql.d.ts, in the global `graphql.<category>` namespace, as <Resolver>Input and <Resolver>Result). Use this skill whenever the user asks to add or change a model interface, a resolver's Input/Result types, or another shared global type.

نظرة عامة

الناشرopenreachtech
المستودعhora-skills-ort-renchan
اسم المهارةhor-type-interface
النجوم
32
التفريعات
0
الملفات المرفقة
تعليمات فقط
الترخيصApache-2.0
الروابط
  • تعليمات بصيغة Markdown

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

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

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

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

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

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

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

التثبيت

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

1

التثبيت في TypingMind

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

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-type-interface
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/openreachtech/hora-skills-ort-renchan.git /tmp/hora-skills-ort-renchan
mkdir -p .claude/skills
cp -r /tmp/hora-skills-ort-renchan/kit/skills/hor-type-interface .claude/skills/hor-type-interface
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

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

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

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

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

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

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

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

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

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

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

Type Interface Definition

A skill for the .d.ts type declarations that describe an app's data shapes: the model interfaces (one per table) and the resolver input/output types (a pair per resolver). Both are declared as ambient global namespaces, so any JSDoc can reference them (model.User, graphql.user.CreateOrderInput) without an import. Each model gets its own file, merged into one namespace by TypeScript's declaration merging, and every resolver type lives in the one file types/graphql.d.ts.

This skill states a general, project-independent rule — a refined best practice, not a description of any one project's code, so it need not match a given repo's existing notation. The directory names, namespaces (model, graphql.<category>), and example type names (User, Order, CreateOrderInput, …) are the recommended convention with illustrative fakes; use your project's own model and resolver names and never bake its domain concepts or file paths into the rule.

Grand principle: one file per model, one file for resolver types, all in global namespaces

Every model gets its own .d.ts file, and every resolver type goes into the single file types/graphql.d.ts. Each file declares types into a shared global namespace. TypeScript's declaration merging combines the same-named namespace blocks into one, so the split costs nothing at the access site.

  • Why one file per model. A monolithic model.d.ts is a constant merge-conflict point, because every model change touches the same file. Splitting to types/models/<ModelName>.d.ts means two changes collide only when they touch the same model. Adding a model = adding a file.
  • Why one file for resolver types. A resolver's Input / Result pair mirrors the schema (SDL) one-to-one, so it is written in the same change as the SDL and read beside the other resolver types of its category. One file, types/graphql.d.ts, is the place to look, and there is no per-resolver path to keep in step with the resolver's own file name.
  • Why it still reads as one namespace. declare global { namespace model { … } } in User.d.ts and the same block in Order.d.ts merge into a single model namespace. Consumers write model.User / model.Order regardless of which file declared them — the file split is invisible to readers.
  • Why global (ambient). Declared under declare global, the types need no import to be used in a JSDoc annotation anywhere in the codebase. That is the point of the namespaces — a resolver's JSDoc just writes @returns {Promise<graphql.user.CreateOrderResult>}.
  • Wiring: the project's tsconfig / jsconfig include must cover the types/** directory so these ambient declarations are picked up project-wide.

Sample code follows the project's lint style: .d.ts uses no semicolons, 2-space indent, and interface members are one-per-line (no trailing comma or semicolon). Comments in the files you generate are English for structural notes; domain notes match the surrounding language.

1. The .d.ts scaffold

Every declaration file has the same three-line envelope: an export {} module marker, then a declare global block, then the namespace. The interfaces go inside the namespace.

ts
export {}

declare global {
  namespace model {
    // interfaces here
  }
}
  • export {} makes the file a module (so declare global is legal). It exports nothing itself.
  • declare global { … } puts the namespace in the ambient global scope — visible everywhere with no import.
  • The namespace name is fixed by kind: model for model interfaces (§2), graphql.<category> for resolver types (§3).

2. Model interfaces (one file per table)

A model interface maps 1:1 to a table. Put each in its own file types/models/<ModelName>.d.ts, declaring one interface <ModelName> into namespace model.

ts
// types/models/User.d.ts
export {}

declare global {
  namespace model {
    interface User {
      id: number
      email: string
      displayName: string | null
      registeredAt: Date
      OrganizationId: number
    }
  }
}
ts
// types/models/Order.d.ts — a second model, its own file, same namespace
export {}

declare global {
  namespace model {
    interface Order {
      id: number
      UserId: number
      totalAmount: number
      placedAt: Date
      canceledAt: Date | null
    }
  }
}
  • One interface per file, named exactly for the model, so it is reachable as model.User / model.Order.
  • Fields mirror the table's columns. Use the precise scalar type (number / string / Date / boolean); a nullable column is <type> | null.
  • A field holding another model's id starts with an uppercase initial (UserId, OrganizationId), mirroring how the ORM's associations are named — this distinguishes a foreign-key field from a plain scalar at a glance.
  • Optionally, a model interface may extend a framework base-model interface (if the architecture provides one for the common columns); keep that base generic, not a hard-coded app path.

3. Resolver input/output types (in types/graphql.d.ts)

Every resolver's types go into the one file types/graphql.d.ts, declared into namespace graphql.<category>, where <category> is the API/endpoint group (user, admin, portal, …). Each resolver declares its <Resolver>Input and its <Resolver>Result (the output / response), written as a pair.

ts
// types/graphql.d.ts
export {}

declare global {
  namespace graphql.user {
    interface CreateOrderInput {
      productId: number
      quantity: number
    }

    interface CreateOrderResult {
      order: model.Order
    }
  }

  namespace graphql.admin {
    interface OrdersInput {
      limit: number
      offset: number
    }

    interface OrdersResult {
      orders: model.Order[]
    }
  }
}
  • Input is the resolver's argument shape; Result is what it returns (the response). A query uses the same Input / Result pairing.
  • One namespace graphql.<category> block per category, inside the single declare global. Keep a resolver's Input and Result next to each other.
  • Reuse model interfaces in the output — a Result field is typed as model.<ModelName> (order: model.Order). The model and graphql.<category> namespaces are both global, so one references the other with no import.
  • Resolver-local helper types (a nested filter input, a row sub-shape) sit in the same block, beside the pair they belong to, named so they cannot collide with another resolver's.
  • Category = the resolver's endpoint group. The same resolver name under a different endpoint is a different namespace (graphql.user.FooInput vs graphql.admin.FooInput), in the same file.

4. Accessing the types

Because the namespaces are global, JSDoc references them directly — no import:

js
/**
 * @param {{
 *   variables: {
 *     input: graphql.user.CreateOrderInput
 *   }
 * }} params
 * @returns {Promise<graphql.user.CreateOrderResult>}
 */
async resolve ({
  variables: {
    input,
  },
}) {
  // input is typed as graphql.user.CreateOrderInput
}
  • Model shapes are referenced the same way: @param {model.User} user.
  • This global access is the reason the types are ambient — the split into many files never forces an import.

5. Naming & placement (quick reference)

KindFileNamespaceInterface namesAccess
Modeltypes/models/<ModelName>.d.tsmodel<ModelName>model.<ModelName>
Resolvertypes/graphql.d.tsgraphql.<category><Resolver>Input, <Resolver>Resultgraphql.<category>.<Resolver>Input
  • A model's file base name is <ModelName> (PascalCase); resolver types share the one file.
  • Avoid the denied vague identifiers in field names (data / info / list / …); name a field for what it holds.

Finishing checklist

  • The type lives in the right file: one model → its own types/models/<ModelName>.d.ts; a resolver's types → types/graphql.d.ts (§1).
  • File envelope is export {} → declare global → the correct namespace (model or graphql.<category>).
  • Model interface is 1:1 with a table; fields mirror columns; nullable is | null; a foreign-key field starts uppercase (§2).
  • types/graphql.d.ts declares <Resolver>Input + <Resolver>Result in the resolver's graphql.<category> block, reuses model.<ModelName> in outputs, and keeps resolver-local helper types beside the pair (§3).
  • The types/** directory is included in the project's TS config so the ambient declarations resolve.

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

ماذا تفعل مهارة الذكاء الاصطناعي Hor Type Interface؟

Define TypeScript type interfaces in .d.ts declaration files: model interfaces (one file per model/table under types/models/, in the global `model` namespace) and resolver input/output types (all in types/graphql.d.ts, in the global `graphql.<category>` namespace, as <Resolver>Input and <Resolver>Result). Use this skill whenever the user asks to add or change a model interface, a resolver's Input/Result types, or another shared global type.

لماذا تستخدم Hor Type Interface على TypingMind؟

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

كيف أثبّت Hor Type Interface في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-type-interface. يقرأ TypingMind ملف SKILL.md الخاص بها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Hor Type Interface؟

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

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Hor Type Interface؟

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

هل مهارة الذكاء الاصطناعي Hor Type Interface مجانية؟

نعم. نشرها openreachtech على GitHub بموجب ترخيص Apache-2.0. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

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

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

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

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

عرض الكل

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

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