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ファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    openreachtechがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルHor Type InterfaceをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-type-interface
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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で使用

TypingMindのチャットでHor Type Interfaceを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にHor Type Interfaceを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Hor Type Interfaceは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じ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.

よくある質問

AIスキル「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.

TypingMindでHor Type Interfaceを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Hor Type Interfaceはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにHor Type Interfaceをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-type-interfaceを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Hor Type Interfaceを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Hor Type Interfaceは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもHor Type Interfaceを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Hor Type Interface」は無料ですか?

はい。openreachtechがGitHubでApache-2.0ライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇