Logo di Nuxt Nats

Nuxt Nats

Community
lithqube
nuxt-nats

Use this skill whenever working in a Nuxt 4 / Nitro project that uses the nuxt-nats module to talk to NATS JetStream — configuring the module in nuxt.config (the `nats:` key), publishing events with jsPublish or corePublish, registering durable pull consumers with defineNatsConsumer, building a dead-letter consumer with defineDeadLetterConsumer, streaming to the browser with useEphemeralConsumer (SSE), using KV/Object Store via useKV/useObj, exposing or calling AI agents with defineNatsAgent/useAgents, typing subjects via the NatsEvents interface, or the NUXT_NATS_WORKERS worker gate. Trigger on any of those symbols, on the env vars NUXT_NATS_SERVERS / NUXT_NATS_USER_JWT / NUXT_NATS_NKEY_SEED / NUXT_NATS_WORKERS, or when a Nuxt app needs server-side NATS messaging. Use this even if the user just says "add NATS to my Nuxt app". For raw @nats-io/* client code outside Nuxt use jetstream-architecture; for server/cluster deployment use jetstream-deployment; for the Synadia agent protocol details use nats-agent-fabric.

Panoramica

Autorelithqube
Repositorynats-jetstream-claude-skills
Nome della skillnuxt-nats
Stelle
28
Fork
2
File inclusi
7
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 7 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da lithqube su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Nuxt Nats in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/lithqube/nats-jetstream-claude-skills/tree/main/nuxt-nats
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lithqube/nats-jetstream-claude-skills.git /tmp/nats-jetstream-claude-skills
mkdir -p .claude/skills
cp -r /tmp/nats-jetstream-claude-skills/nuxt-nats .claude/skills/nuxt-nats
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Nuxt Nats in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Nuxt Nats non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Nuxt Nats non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

nuxt-nats

nuxt-nats is a Nuxt 4 / Nitro server-side module (config key nats) that owns the NATS JetStream connection lifecycle and gives you auto-imported server utilities for publishing, consuming, KV/Object Store, and the Synadia agent fabric. It wraps the modular @nats-io/* v3 client — you almost never call @nats-io/* directly in a nuxt-nats app.

It is server-only (Nitro): there are no browser composables (ADR-002). Publish and consume from server/ — plugins, API routes, and Nitro tasks.

What it gives you (auto-imported in server/)

UtilityPurpose
useNats() / useJetStream() / useJetStreamManager()raw connection / JS client / JSM, when you need to drop down
useJetStreamIfAvailable()non-throwing useJetStream() — returns null before the connection is ready (see SSR lifecycle)
jsPublish(subject, data, opts?)durable JetStream publish, typed via NatsEvents, with msgId dedup + client retry
corePublish(subject, payload)fire-and-forget core NATS publish (no PubAck)
defineNatsConsumer(opts)register a durable pull consumer (worker)
defineDeadLetterConsumer(opts)build a DLQ by consuming max-deliver / terminated advisories from a stream
useEphemeralConsumer(opts)request-scoped ordered ephemeral consumer (SSE)
useKV(bucket, opts?) / useObj(bucket, opts?)KV bucket / Object Store, cached per process
defineNatsAgent(opts) / useAgents()host or call AI agents on the Synadia Agent Protocol

Reference files

Read the one you need — don't load them all:

  • references/configuration.md — the full nats: module option reference, env-var overrides, the auth priority chain, TLS, JetStream domain/prefix, and the provisioning stance (provision). Read when setting up or debugging module config.
  • references/publishing.md — jsPublish vs corePublish, the NatsEvents typed-subject augmentation, msgId dedup, and publish retry. Read when producing events.
  • references/consumers.md — defineNatsConsumer, the NUXT_NATS_WORKERS gate, ack/nak/term handling, defineDeadLetterConsumer, and useEphemeralConsumer for SSE. Read when consuming.
  • references/kv-object.md — useKV / useObj, and their real gotchas (Object Store wants a ReadableStream, KV TTL units). Read for state/blob storage.
  • references/agents.md — defineNatsAgent / useAgents on the Synadia Agent Protocol. Read when building an agent; defer to the nats-agent-fabric skill for the wire protocol itself.
  • references/gotchas.md — the SSR/Nitro lifecycle race, reconnect-storm status semantics, Nitro externals, provisioning races, and testing with Testcontainers. Read this before shipping to production; it's where the non-obvious failures live.

Minimal setup

ts
// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-nats'],
  nats: {
    servers: ['nats://localhost:4222'],   // override in prod via NUXT_NATS_SERVERS (all cluster nodes)
    // auth is normally injected via env: NUXT_NATS_USER_JWT + NUXT_NATS_NKEY_SEED
    streams: [                             // DESCRIBE streams; do not let the app own them in prod
      { name: 'ORDERS', subjects: ['orders.>'], provision: 'never' },
    ],
  },
})
ts
// server/api/orders.post.ts — publish
export default defineEventHandler(async (event) => {
  const body = await readBody(event)
  await jsPublish('orders.created', body, { msgId: body.id })  // msgId => Nats-Msg-Id dedup
  return { ok: true }
})
ts
// server/plugins/order-worker.ts — consume (runs only when NUXT_NATS_WORKERS=true)
export default defineNitroPlugin(() => {
  defineNatsConsumer({
    stream: 'ORDERS',
    durable: 'order-processor',       // binds an EXISTING durable by default (IaC owns its config)
    async handler(data, msg) {
      await process(data)
      // handler return = ack; throw = nak with backoff; see references/consumers.md
    },
  })
})

Core principles

  • Server-side only. Publish/consume from server/. There are no client composables; don't try to useNats() in a Vue component.
  • The worker gate is deliberate. Consumers and agents run only when NUXT_NATS_WORKERS=true. Serverless/edge deployments publish fine but must not run long-lived pull loops. The recommended topology is a serverless publisher + a separate persistent worker process. If your consumer "never fires", check this first.
  • provision: 'never' in production. A stream/consumer config is server-side state that belongs in IaC (an idempotent streams.sh or Helm), not in N racing app replicas. provision: 'startup' is for dev; 'update' races on rolling deploys. The streams: block in config is best read as documentation of a stream some other process owns.
  • defineNatsConsumer binds; it does not enforce. By default it binds an existing durable — filterSubjects/ackPolicy you pass are not sent to the broker unless the durable is being created (provision: 'startup'). The live durable's config wins; a drift test against a real broker is the only thing that catches a mismatch.
  • NATS has no dead-letter queue. maxDeliver = retry then stop, not "route to a DLQ". Use defineDeadLetterConsumer() (advisory capture) if you need one — see references/consumers.md. Never write a comment claiming redelivery auto-routes to dlq.*; it doesn't.
  • Type your subjects. Augment NatsEvents in a server/**/*.d.ts so every jsPublish is checked. See references/publishing.md.
  • Respect the SSR lifecycle race. Nitro doesn't await async server plugins in order, so the connection may not be ready when a later plugin runs. Use useJetStreamIfAvailable() / the module's readiness wait, never a bare useJetStream() at plugin top level. See references/gotchas.md.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Nuxt Nats?

Use this skill whenever working in a Nuxt 4 / Nitro project that uses the nuxt-nats module to talk to NATS JetStream — configuring the module in nuxt.config (the `nats:` key), publishing events with jsPublish or corePublish, registering durable pull consumers with defineNatsConsumer, building a dead-letter consumer with defineDeadLetterConsumer, streaming to the browser with useEphemeralConsumer (SSE), using KV/Object Store via useKV/useObj, exposing or calling AI agents with defineNatsAgent/useAgents, typing subjects via the NatsEvents interface, or the NUXT_NATS_WORKERS worker gate. Trigg...

Perché usare Nuxt Nats su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Nuxt Nats è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Nuxt Nats in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/lithqube/nats-jetstream-claude-skills/tree/main/nuxt-nats. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Nuxt Nats?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Nuxt Nats?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Nuxt Nats: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Nuxt Nats è gratuita?

Sì. È pubblicata su GitHub da lithqube con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇