Spotiarr sse

From mralexsaavedra/spotiarr · View interactive version

Spotiarr sse is an AI agent skill from the GitHub repository mralexsaavedra/spotiarr. Trigger: SSE, server-sent events, real-time, useServerEvents, live updates, EventSource. spotiarr SSE pattern: frontend EventSource hook, backend AppEventBus, 4 event types.

How to use this skill

Skill file

Activation Contract

Load when adding real-time updates, emitting new SSE events, or extending useServerEvents.

Hard Rules

Event Contracts

| Event name | Frontend reaction |

| -------------------------- | ------------------------------------------------------------------- |

| playlists-updated | invalidate playlists, downloadStatus, all tracks[*] |

| download-history-updated | invalidate downloadHistory |

| library-updated | invalidate libraryStats, libraryArtists, all libraryArtist[*] |

| feed-updated | invalidate releases, followedArtists |

Adding a New SSE Event

  1. Backend: emit via app-event-bus.ts with a new event name string
  2. Frontend: add a listener in useServerEvents.ts, invalidate the relevant query keys from queryKeys.ts
  3. Shared: if the event payload needs a typed shape, add it to packages/shared/src/index.ts

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.