Real time features

From rnavarych/alpha-engineer · View interactive version

Real time features is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. Implement real-time features using WebSockets (Socket.io, ws), Server-Sent Events (SSE), Supabase Realtime, Firebase, or Pusher. Covers presence indicators, live cursors, CRDT-based collaborative editing (Yjs, Automerge), notifications with offline delivery, chat with optimistic rendering, and Redis

How to use this skill

Skill file

Real-Time Features

When to use

Core principles

  1. Transport matches use case — SSE for server-push feeds and dashboards; Socket.io for rooms, chat, and bidirectional events; managed services (Pusher, Ably) when infra ownership is not worth it
  2. Authenticate before accepting — validate JWT or session cookie in the Socket.io connection middleware; never allow anonymous socket joins to protected rooms
  3. Always clean up subscriptions — every eventBus.on and every socket.join needs a corresponding teardown on disconnect or component unmount
  4. Deltas over full state — emit only what changed; sending full document snapshots on every keystroke kills throughput and battery
  5. Redis backplane for multi-node — a single Socket.io Redis adapter call is all that stands between "works on one dyno" and "works on ten"

Reference Files

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.