Логотип Hor External Api Client

Hor External Api Client

Организация
openreachtech
hor-external-api-client

Implement a client for an external HTTP/REST API using `@openreachtech/mentsu-rocket-client` (the Launcher / Payload / Capsule three-class structure). Use this skill whenever the user asks to add or change an external API integration — a new service client, a new API operation, request/response key conversion, authorization headers, or wrapping a vendor SDK — under `app/<serviceName>Client/`. For the raw source guide see the doc linked at the bottom.

Обзор

Издательopenreachtech
Репозиторийhora-skills-ort-renchan
Название навыкаhor-external-api-client
Звёзды
32
Форки
0
Встроенные файлы
9
ЛицензияApache-2.0
Ссылки
  • Инструкции в формате Markdown

    Файл SKILL.md, который модель загружает по необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 9

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Опубликовано на GitHub: openreachtech. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Hor External Api Client в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать 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-external-api-client
  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-external-api-client .claude/skills/hor-external-api-client
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Hor External Api Client в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Hor External Api Client, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Hor External Api Client не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими API-ключами.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

External API Client

How to implement a client for an external HTTP/REST API with @openreachtech/mentsu-rocket-client (rocket-client from here on). One external request is split across three classes — Launcher / Payload / Capsule. The conventions are divided into the detail files listed at the bottom; read the one that matches what you are doing.

First principle: confine every difference from the external API to Payload / Capsule (anti-corruption layer)

Every convention in this skill follows from one goal: an external API's interface differences must stay out of application code. Key names, value formats, paths, authentication and response shapes of an external API can all change, and they disagree with our own naming conventions anyway. Confine those differences to a single layer (the anti-corruption layer) so the caller (a resolver or a job) never has to know about them.

  • Differences on the way in (key names, value formats, path, query, authentication) belong to Payload.
  • Differences on the way out (response key names, nesting, missing fields) belong to Capsule's extractXxx().
  • The caller only builds a Payload and pulls values out of a Capsule. If the external API's raw shape reaches the caller, this layer has failed.
  • Why: without this layer — or with a thin one — every change to the external API forces edits in resolvers and jobs, and the reach of a change becomes impossible to see. Collecting the differences in one place is what keeps a spec change contained to Payload / Capsule. When an individual rule leaves you unsure, decide it by extending this principle: which class owns this difference?

Cross-cutting rules (they apply to every layer)

HTTP goes through the native fetch only — no axios, no HTTP client of your own

In the direct-HTTP pattern, communication is handled by the Node.js native fetch built into BaseLauncher. Do not add another HTTP client module such as axios, and do not implement an HTTP client or Fetcher class of your own. Wrap an SDK only when the vendor publishes an official one (sdk-wrapper.md — an interim implementation).

  • Why: because the transport is centralized in BaseLauncher, retries, error conversion and swapping in a stub for tests all take effect in one place. If each client brings its own axios, that benefit is gone and the transport ends up implemented differently per operation.

Decide failure with capsule.hasError(), not try-catch

launchRequest() catches fetch exceptions and body-parse failures internally and returns the Capsule for the corresponding error kind. The caller writes no try-catch and decides failure from the returned capsule.hasError().

  • Why: funnelling missing authentication, invalid input, network failure, parse failure and a status >= 400 into one path — the "error Capsule" — is this module's design. A caller that adds try-catch on top handles errors through two channels, the caught exception and the Capsule, and a case will fall through the gap.

Return null (or an empty array) for a missing value, never undefined

When an extractXxx() or a getter cannot produce a value, return null — or an empty array for something that returns an array, or whatever the intended default is — not undefined.

  • Why: undefined cannot be told apart from "undefined behaviour / not implemented yet". null (or an empty array) states the intent: the value was looked for and was not there. Details in capsule.md.

Write comments in code in English

Comments in the real code you generate (.js) — //, /* */, JSDoc — are written in English, to match the rest of the codebase. The js blocks in this skill are real code too, so their JSDoc and comments are shown in English as well.

Naming, and one class per file

One class per file, with a single export default. Name a derived launcher <Operation>Launcher, and the payload and capsule <Operation>Payload / <Operation>Capsule, so the operation is readable from the name. Pick the verb of a retrieval method by where the value comes from (fetch~ = external API, find~ = the database, extract~ = pulled out of a Capsule). The remaining general coding conventions are in conventions.md.

Detail files

  • architecture.md — the whole picture (the three classes, the data flow, directory layout, the classes the module provides)
  • launcher.md — Launcher (base and derived / direct HTTP, the members of BaseLauncher)
  • payload.md — Payload (input definition, method/pathname, schema, key conversion)
  • capsule.md — Capsule (the response wrapper, extractXxx(), null guards)
  • authorization.md — authentication (AuthorizationBuilderCtor / authorizationApiKey)
  • sdk-wrapper.md — the SDK-wrapping pattern (an interim implementation that overrides launchRequest())
  • usage.md — the implementation steps, and use from the caller (resolver / job), DI and hooks
  • testing.md — unit tests for Payload / Capsule / Launcher
  • conventions.md — the naming and coding convention checklist

This skill was made from the repository's external API client implementation guide. For reference material — rocket-client's own export list, its type definitions, examples of existing clients — see the "reference files" section at the end of that guide.

Встроенные файлы

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Hor External Api Client?

Implement a client for an external HTTP/REST API using `@openreachtech/mentsu-rocket-client` (the Launcher / Payload / Capsule three-class structure). Use this skill whenever the user asks to add or change an external API integration — a new service client, a new API operation, request/response key conversion, authorization headers, or wrapping a vendor SDK — under `app/<serviceName>Client/`. For the raw source guide see the doc linked at the bottom.

Зачем использовать Hor External Api Client в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Hor External Api Client — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Hor External Api Client в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-external-api-client. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Hor External Api Client?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Hor External Api Client?

С любым количеством. Если модель поддерживает навыки, вы можете использовать с ней Hor External Api Client: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama и другие — всё в TypingMind с вашими собственными ключами API.

Бесплатен ли навык ИИ Hor External Api Client?

Да. Навык опубликован на GitHub автором openreachtech по лицензии Apache-2.0. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это многоразовый набор инструкций, который объясняет модели ИИ, как выполнять конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты для вызова — код, который где-то выполняется и возвращает результат. Навык ИИ вместо этого даёт модели знания и порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇