implementing-realtime-sync

Implement real-time communication using SSE, WebSocket, WebRTC, and CRDTs.

1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/masermediagroup-stack/maser-media --skill implementing-realtime-sync-masermediagroup-stack
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: implementing-realtime-sync
Source: https://github.com/masermediagroup-stack/maser-media/tree/main/.cursor/skills/community/ai-design-components/skills/implementing-realtime-sync
Command: npx skills add https://github.com/masermediagroup-stack/maser-media --skill implementing-realtime-sync-masermediagroup-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires websockets, and includes scripts (resource) and references (resource) components.

What problem does it solve? Building live features like chat, collaborative editing, LLM token streaming, and presence awareness requires choosing the right transport protocol and handling reconnection, scaling, and conflict resolution, which is error-prone without proven patterns. ## Core Features & Use Cases - Protocol Selection Framework: Decision tree for choosing SSE (one-way streams), WebSocket (bidirectional), WebRTC (peer-to-peer media), or CRDTs (collaborative editing) based on communication patterns. - Multi-Language Implementations: Production patterns in Python (FastAPI, sse-starlette), Rust (axum, tokio-tungstenite), Go (gorilla/websocket), and TypeScript (ws, Socket.io, Yjs). - Collaboration & Offline Support: Yjs/Automerge CRDT integration, presence awareness with cursor tracking, and IndexedDB-based offline sync with automatic reconnection. - Use Case: Stream LLM responses token-by-token to a React frontend using FastAPI SSE endpoints, then add multi-user collaborative editing with Yjs and a WebSocket provider. ## Quick Start Ask the agent to implement a FastAPI SSE endpoint that streams LLM tokens to a React frontend using the EventSource API.

Frequently Asked Questions about implementing-realtime-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stream LLM responses to a frontend in real time?▼

Use Server-Sent Events (SSE) with an async generator that yields each token as an event. FastAPI's sse-starlette EventSourceResponse pairs with the browser's native EventSource API, which handles reconnection automatically.

Should I use SSE or WebSocket for real-time updates?▼

Use SSE for one-way server-to-client streams like notifications, live feeds, and LLM tokens since it reconnects automatically. Use WebSocket for bidirectional communication like chat, games, and collaborative editing.

Yjs vs Automerge for collaborative editing?▼

Yjs is best for text editing with a mature ecosystem supporting ProseMirror, Monaco, and Quill, plus built-in awareness. Automerge suits JSON-like data structures and offers time-travel history, with a Rust-first implementation.

How do I scale WebSocket connections across multiple servers?▼

Use Redis pub/sub to broadcast messages across backend instances so any server can deliver events to connected clients. You also need a WebSocket-compatible load balancer with sticky sessions or a Redis backplane.

How do I add offline support to a collaborative app?▼

Combine Yjs with y-indexeddb for local persistence and y-websocket for server sync. Changes apply instantly to IndexedDB, queue while offline, and merge conflict-free via CRDTs when the connection is restored.

Why does my WebSocket connection keep dropping?▼

Connections drop without heartbeat ping/pong keepalive messages or when proxies buffer traffic. Implement exponential backoff with jitter for reconnection and send heartbeats every 30-60 seconds to keep connections alive.