Logo de Hor Subscription Resolver

Hor Subscription Resolver

Organização
openreachtech
hor-subscription-resolver

Implement a GraphQL subscription resolver — a class extending the framework's base subscription resolver that declares the subscription operation, scopes its channel per subscriber, and gates who may subscribe. Use this skill whenever the user asks to add or change a subscription, scope or authorize a subscription channel, or wire the publish side that pushes events to subscribers.

Visão geral

Publicado poropenreachtech
Repositóriohora-skills-ort-renchan
Nome da habilidadehor-subscription-resolver
Estrelas
32
Forks
0
Arquivos incluídos
3
LicençaApache-2.0
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    Habilidades de IA são Markdown simples, não código específico de um provedor, por isso funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • 3 arquivos incluídos

    Scripts, modelos de documentos e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente leitura e nunca são executados.

  • Código aberto

    Publicada por openreachtech no GitHub. Leia o conteúdo-fonte antes de instalar.

Instalação

Instale a habilidade de IA Hor Subscription Resolver no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL da pasta da habilidade exibida abaixo e confirme.
    https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-subscription-resolver
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Nova habilidade → Via URL GitHub, depois cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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-subscription-resolver .claude/skills/hor-subscription-resolver
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Hor Subscription Resolver em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Hor Subscription Resolver automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Hor Subscription Resolver não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

Subscription Resolver

A skill for GraphQL subscription resolvers: the class that lets a client subscribe to a channel and receive a stream of pushed events. It declares the operation, decides which channel a caller listens on, and whether they may. The events themselves are published by whatever changes state (a mutation or a background worker), through a PubSub broker — the subscription resolver and the publisher meet on a named channel, never calling each other directly.

This overview maps each topic to a section; the details are in the detail files under references/.

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 class and field names (OnReceiveMessageSubscriptionResolver, onReceiveMessage, roomId, …) are illustrative fakes; use your project's own names and never bake its domain or file paths into the rule. The framework base is shown as BaseSubscriptionResolver; treat it as "your framework's base subscription resolver". Sample code follows the project's lint style (no semicolons, 2-space indent, a space before the parameter parenthesis, trailing commas).

Grand principle: the resolver owns the channel; the state-changer publishes to it

A subscription resolver is a read-only push endpoint. It does two things: name and scope the channel a subscriber listens on, and decide if that subscriber is allowed. It never mutates state and it does not produce the events — a mutation or worker publishes them onto the same channel, and the broker fans them out to every matching subscriber.

  • The subscription resolver is the single source of truth for the channel contract. The channel name is derived from the resolver's schema (the prefix) plus its generateChannelQuery (the scope). The publisher builds its message via the same class (buildTopic), so the two sides can never disagree on the channel — that is why a publisher imports the subscription resolver.
  • The broker decouples the two sides. Subscriber and publisher share only a channel string; they can live in different processes (e.g. a background worker publishes; the API process serves the subscription).
  • Keep it thin. Scope, authorize, unwrap. No business logic, no writes.

1. Basic notation

A subscription resolver extends the framework base and overrides a small, fixed set of members. Every per-call method receives the same four arguments — { variables, context, information, parent } (destructure what you need). The essential members:

MemberOverride?Role
static get schema ()requiredthe subscription operation name — also the channel prefix and the message key
generateChannelQuery ({ variables, context, … })usuallykey/value hash that scopes the channel per subscriber; default {} = broadcast to all
async canSubscribe ({ variables, context, … })for auth (§2)boolean subscribe-time gate; default true
static get errorCodeHash ()when adding authmerge ...super.errorCodeHash + the subscribe-denied code
resolve (payload)rarelymaps the published message to the returned value; the base unwraps payload[schema]
static get operation / channelPrefix / subscribe / buildTopic / publishTopicnoprovided by the base — the subscribe flow, channel building, and publish helpers

The class skeleton, the common-arguments table, the full example, and the @typedef shapes are in basic-notation.md.

2. Adding authentication

Authorization happens once, at subscribe time, in canSubscribe — a boolean gate. Returning false makes the base throw the subscribe-denied error, so also declare that error code in errorCodeHash. Authenticated-only is return context.hasAuthenticated(); resource-scoped access combines the principal with the input; private streams are additionally scoped by principal in generateChannelQuery.

The full canSubscribe / errorCodeHash example, the authenticated / resource-scoped / identity patterns, and the once-per-subscribe note are in authentication.md.

3. Design philosophy

  • Read-only push; the state-changer publishes. The resolver opens a scoped, authorized channel; the mutation/worker that changes state publishes to it after the change commits.
  • One channel contract, one owner. Both sides derive the channel from the same subscription resolver class — the subscriber via generateChannelQuery, the publisher via buildTopic — so the prefix and scope can never drift.
  • Scoping = per-subscriber isolation, and the broker lets the publisher run in a separate process from the API. Keep the payload minimal and resolve thin.

The publish-side example and the full rationale are in design-philosophy.md.

Finishing checklist

  • static get schema returns the subscription operation name (= channel prefix = message key) (§1).
  • generateChannelQuery scopes the channel per subscriber (or {} only for a true broadcast).
  • The resolver does no writes and no business logic — it scopes, authorizes, and unwraps.
  • If access is restricted: canSubscribe returns the boolean gate and errorCodeHash declares the subscribe-denied code (§2); private channels are also scoped by principal.
  • The publisher (mutation/worker) builds its topic via this class's buildTopic and publishes through the broker — no hand-written channel string (§3).
  • The published payload is minimal; resolve is left to the base unless a reshape is needed.

Detail files

  • basic-notation.md — the class skeleton, the common { variables, context, information, parent } arguments, the member table in full, the example, and the @typedef input/response shapes (§1)
  • authentication.md — canSubscribe as the boolean gate, errorCodeHash, the authenticated / resource-scoped / identity-scoping patterns, subscribe-time timing (§2)
  • design-philosophy.md — read-only push, the single channel contract and the publish-side example, per-subscriber isolation, broker decoupling, minimal payload (§3)

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Hor Subscription Resolver faz?

Implement a GraphQL subscription resolver — a class extending the framework's base subscription resolver that declares the subscription operation, scopes its channel per subscriber, and gates who may subscribe. Use this skill whenever the user asks to add or change a subscription, scope or authorize a subscription channel, or wire the publish side that pushes events to subscribers.

Por que usar Hor Subscription Resolver no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. Hor Subscription Resolver é escrito em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. O TypingMind usa suas próprias chaves de API, então o pagamento é feito diretamente aos provedores, em vez de uma assinatura por licença de usuário, e suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Hor Subscription Resolver no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-subscription-resolver. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Hor Subscription Resolver?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Hor Subscription Resolver?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Hor Subscription Resolver com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Hor Subscription Resolver é gratuita?

Sim. A habilidade é publicada no GitHub por openreachtech sob a licença Apache-2.0. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, modelos de documento ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas para chamar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA fornece conhecimento e um processo ao modelo: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇