Логотип Hor Agent Loop

Hor Agent Loop

Организация
openreachtech
hor-agent-loop

Build an LLM agent loop (iterative agent) in a backend repository with the three @openreachtech/mentsu-agent-loop packages — core (the transport-agnostic iteration engine), renchan-job (run a loop as a BullMQ/Redis job with progress publishing), and graphql (a mutation that launches the loop plus a subscription that streams its progress). Use whenever the user asks to add or edit an agent loop, an agent action, a composite agent, or to stream agent progress.

Обзор

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

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

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

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

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

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

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

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

Установка

Установите навык ИИ Hor Agent Loop в 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-agent-loop
  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-agent-loop .claude/skills/hor-agent-loop
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

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

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

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

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

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

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

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

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

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

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

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

Agent Loop (building agent loops with mentsu-agent-loop)

A skill for implementing an LLM agent's iteration ("loop") in a backend. The iteration engine, progress delivery, composition, job execution, and GraphQL integration are all provided by the three @openreachtech/mentsu-agent-loop-* packages. The app writes only the domain-specific actions and loops; iteration, stopping, compression, parallelism, and transport ride on the ready-made base classes.

This skill covers the libraries' specs and use cases, plus the integration patterns for renchan's GraphQL and renchan-job-bullmq. Always use these three packages (never hand-roll your own iteration engine, queue bridge, or progress channel). The details are split into the detail files at the end.

Grand principle: write actions and loops without knowing about AI, DB, queues, or GraphQL (one-way dependency)

The center of this package family's design is a one-way dependency direction (outer → core). The iteration logic the app writes (actions / loops) imports no business dependency and no transport; everything is reached through the context (an opaque DI seam) and through thin adapters.

LayerPackageResponsibilityDepends on
core@openreachtech/mentsu-agent-loop-coreIteration engine (Action / Loop / composition / Runner / Topic). Zero dependenciesimports nothing
job execution@openreachtech/mentsu-agent-loop-renchan-jobRun a loop as a renchan-job / BullMQ Redis job and publish progress→ core, renchan-job-bullmq
GraphQL@openreachtech/mentsu-agent-loop-graphqlLaunch mutation + progress-subscription→ core, renchan
app(this repository)Actions / loops / wiring→ all of the above
  • Why keep the dependency one-way: the moment core imports AI/DB/queue/transport, the iteration logic is bound to a specific backend and can no longer be tested in-process or switched between execution modes. Keeping core dependency-free and receiving dependencies from context means the same loop runs in-process or as a job, and tests just swap context for a stub.
  • Why write only actions and loops: the iteration body (the tail-recursive iterate), the progress seam (emitProgress), composition (parallel / sequential), the queue bridge, and channel naming are all shared machinery; writing them per app guarantees drift. Push them into the base classes and implement only the abstract hooks.
  • Why "always these three packages": hand-rolling an iteration engine or progress channel reintroduces known failures — publish/subscribe channel mismatch, no retry, untestable code. The packages prevent these by design (e.g. AgentTopic structurally matches the publish and subscribe channels).
  • Everything is an instance method, overridable via extends. No pure functions or static-only classes. Why: even if the library has a bug or a gap, the app can always work around it by extending and overriding the relevant method (there is no true final). Write the app's overrides in the same style.

Cross-cutting rules

  • Business dependencies and transport are always received through context. Do not directly import AI clients, DB, HTTP, or queues inside an action or loop (core.md). Why: a direct import breaks in-process execution and stub injection, collapsing the one-way dependency of the grand principle.
  • Return null / an empty array for missing values, not undefined. One property per line in object literals (applies to sample code too). Avoid single-character variables and for / forEach / switch / else if; write with map / filter / reduce and early return. Why: match the existing codebase style so review attention goes to the logic.
  • One class per file, one export default. The constructor only assigns; defaults live in the factory (static create); getters just return the field.
  • Comments in produced artifacts (.js) are English, and this skill is written entirely in English (prose, tables, and example-code comments).

Choosing modules (what to install)

Stack adapters onto core per the requirement. Core is always required; add an adapter only when that integration is needed.

What you wantPackages needed
Run a loop in-process (CLI / tests / synchronous work / Lambda)core only
Turn a long loop into a Redis job (horizontal scale, retry, rate limiting)core + renchan-job
Launch over GraphQL and subscribe to progress in realtimecore + renchan-job + graphql
  • Why stack incrementally: actions and loops written with core alone can be turned into a job or a GraphQL endpoint without any change (the adapter swaps only the transport step). Do not install everything up front; layer on only what you need.

End-to-end progress (the backbone of the realtime log)

"Launch with a mutation → return accepted immediately → stream progress over a subscription" is the typical shape for an agent on the web. Progress follows this single path. Because the publish side (the Worker) and the subscribe side (the Subscription) use the same AgentTopic, the channel names match structurally.

[core]        loop.run({ input, onProgress })
                └ iterate emits emitProgress → onProgress(event) each iteration
[renchan-job] BaseAgentJobWorker: onProgress → job.updateProgress(event)
                → onJobProgress → publish to the channel AgentTopic.create({ channel, scope }).value
[graphql]     BaseAgentProgressSubscriptionResolver: subscribes to the same channel + scope
[frontend]    receives it in realtime over a GraphQL Subscription
  • Why use AgentTopic on both sides: if the publish and subscribe channel names drift apart, you get a silent "progress never arrives" failure. Concentrating the naming in one core class, with both sides composing from the same channel + scope, makes drift impossible by design. To change the naming rule, extend AgentTopic and override get value() in one place.

Detail files

  • core.md — the core (@openreachtech/mentsu-agent-loop-core) spec and use cases: actions / registry, the two loop types (AI-driven / procedural), composition (parallel Composite / sequential Pipeline / ActionStage), Runners, AgentTopic / AgentProgressEvent, the state model (state / context / compression).
  • graphql-integration.md — the pattern for integrating with renchan's GraphQL: the launch mutation (BaseRequestAgentMutationResolver) and the progress subscription (BaseAgentProgressSubscriptionResolver), channel matching via AgentTopic.
  • renchan-job-integration.md — the pattern for integrating with renchan-job-bullmq: the Worker (BaseAgentJobWorker) / Dispatcher (BaseAgentJobDispatcher) / JobAgentRunner, Engine / Share / Context wiring, concurrency / limiter, and the full progress-publish flow.
  • testing.md — testing guidelines: the contract test kit (LoopContractAssertion / ActionContractAssertion) and the unit-test approach for actions / loops / composition / Worker / Dispatcher / Resolver (stub context, assert onProgress, assert abstract throws).

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

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

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

Что делает навык ИИ Hor Agent Loop?

Build an LLM agent loop (iterative agent) in a backend repository with the three @openreachtech/mentsu-agent-loop packages — core (the transport-agnostic iteration engine), renchan-job (run a loop as a BullMQ/Redis job with progress publishing), and graphql (a mutation that launches the loop plus a subscription that streams its progress). Use whenever the user asks to add or edit an agent loop, an agent action, a composite agent, or to stream agent progress.

Зачем использовать Hor Agent Loop в TypingMind?

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

Как установить Hor Agent Loop в TypingMind?

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

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

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

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

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

Бесплатен ли навык ИИ Hor Agent Loop?

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

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

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

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

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

Все

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

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