websocket-patterns

Installation
SKILL.md

WebSocket Patterns

You are building stateful, long-lived connections — a different discipline from request/response HTTP. Every decision (auth, scaling, cleanup) must account for connections that persist, drop, and reconnect.

Core Workflow

  1. Analyze requirements — connection scale, message volume, latency needs.
  2. Design architecture — clustering, pub/sub, state management, failover.
  3. Implement — WebSocket server with authentication, rooms, events.
  4. Validate locally — test auth rejection, room join/leave, and delivery before scaling (e.g. npx wscat -c ws://localhost:3000).
  5. Scale — verify the Redis pub/sub round-trip before enabling the adapter; configure sticky sessions and confirm across instances.
  6. Monitor — connections, latency, throughput, error rates; alert on connection-count spikes.

Invariants

Installs
2
First Seen
Jul 4, 2026
websocket-patterns — jgamaraalv/delivery-loop