← ClaudeAtlas

realtime-websocketslisted

Build production realtime servers over WebSockets and Server-Sent Events — connection lifecycle, the heartbeat/ping-pong + idle-timeout contract, automatic reconnection with exponential backoff and resume tokens, backpressure and per-connection send queues, horizontal scale-out via a Redis/NATS pub-sub fan-out, presence tracking, and auth on the upgrade handshake. Use when adding live updates (chat, notifications, collaborative cursors, live dashboards), choosing WebSocket vs SSE vs long-poll, debugging dropped or zombie connections, or scaling a socket server past one node. Boundary vs api-design — api-design owns request/response HTTP contracts (REST/GraphQL, idempotency, RFC 9457 errors) and stops at the protocol-upgrade boundary; this skill owns the persistent bidirectional connection after upgrade. Carries higher-level subscription protocols (e.g. graphql-ws) as transport but defers their payload schema to graphql.
kouroshez/coding-os · ★ 6 · API & Backend · score 77
Install: claude install-skill kouroshez/coding-os
# Realtime — WebSockets + Server-Sent Events A practical guide to running persistent realtime connections in production. Stack-agnostic; concrete patterns reference `ws`/Socket.IO (Node), `websockets`/Starlette (Python), `gorilla/websocket` + `melody` (Go), and Redis/NATS as the fan-out bus. ## When to Use This Skill - Adding live updates: chat, notifications, presence, collaborative editing, live dashboards, order/status streams. - Choosing between WebSocket, Server-Sent Events (SSE), and long-polling. - Debugging dropped connections, zombie sockets, or "the client thinks it's connected but messages stop arriving". - Implementing reliable reconnection (backoff, resume, missed-message replay). - Scaling a socket server beyond one process/node (fan-out across instances). - Authenticating and authorizing a connection at the upgrade handshake. Skip when: the interaction is request/response (use HTTP — that is api-design), or the question is the *schema* of subscription payloads (that is graphql for `graphql-ws`). ## Boundary — Realtime vs api-design vs graphql | Concern | Owner | |---|---| | REST/GraphQL request-response contracts, versioning, idempotency keys, RFC 9457 HTTP errors | **api-design** | | The persistent connection after upgrade: lifecycle, heartbeat, reconnect, backpressure, fan-out, presence | **realtime-websockets** (this skill) | | The schema/shape of messages flowing over a `graphql-ws` subscription | **graphql** | api-design governs everything up to (an