From aj-geddes-useful-ai-prompts-4
Implements real-time functionality using WebSockets, SSE, or long polling for chat, live dashboards, collaborative editing, and notifications.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:real-time-featuresThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Implement real-time bidirectional communication between clients and servers for instant data synchronization and live updates.
Minimal working example:
// server.ts
import WebSocket, { WebSocketServer } from "ws";
import { createServer } from "http";
interface Message {
type: "join" | "message" | "leave" | "typing";
userId: string;
username: string;
content?: string;
timestamp: number;
}
interface Client {
ws: WebSocket;
userId: string;
username: string;
roomId: string;
}
class ChatServer {
private wss: WebSocketServer;
private clients: Map<string, Client> = new Map();
private rooms: Map<string, Set<string>> = new Map();
constructor(port: number) {
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| WebSocket Server (Node.js) | WebSocket Server (Node.js) |
| WebSocket Client (React) | WebSocket Client (React) |
| Server-Sent Events (SSE) | Server-Sent Events (SSE) |
| Socket.IO (Production-Ready) | Socket.IO (Production-Ready) |
npx claudepluginhub aj-geddes/useful-ai-promptsImplements real-time features with WebSockets (Socket.io, ws), SSE, Supabase Realtime, Firebase, Pusher. Covers presence indicators, live cursors, CRDT collaboration (Yjs, Automerge), chat, notifications, Redis scaling. For live updates, chat, collaboration.
Builds real-time features using WebSockets and SSE. Covers connection management, reconnection strategies, pub/sub scaling, presence, and typing indicators.
Guides real-time communication implementation using WebSocket, SSE, Socket.io, Redis pub/sub, presence/typing indicators, CRDT collaboration with Yjs, and scaling setups.