real-time-collaboration-engine
This skill guides you through building multiplayer editing experiences like Google Docs, handling the full stack from WebSocket transport to conflict resolution strategies. It covers when to use Operational Transform versus CRDTs, how to batch updates efficiently, manage offline queues, and track user presence—plus common pitfalls like broadcasting every keystroke or losing concurrent edits.
Real-Time Collaboration Engine builds Google Docs-style collaborative editing with WebSocket sync, conflict resolution, and presence awareness.
AI-generated summary based on this skill's SKILL.md
Install
curiositech/some_claude_skills/real-time-collaboration-engine · repository language: TypeScript
git clone https://github.com/curiositech/some_claude_skills
cp -r some_claude_skills/.claude/skills/real-time-collaboration-engine ~/.claude/skills/real-time-collaboration-enginenpx skillfed install curiositech/some_claude_skills/real-time-collaboration-engineFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I build Google Docs style collaborative editing?
real-time-collaboration-engine guides you through the full stack: establish WebSocket connections for live sync, choose between Operational Transform (OT) and CRDTs based on your consistency needs, implement conflict resolution to merge concurrent edits, and add presence awareness for cursor tracking. The skill covers batching updates efficiently to avoid broadcasting every keystroke, which degrades performance, and handling offline queues so users can edit when disconnected then sync when reconnected.
What's the difference between CRDT and Operational Transform?
real-time-collaboration-engine explains that CRDTs (Conflict-free Replicated Data Types) guarantee convergence without a central server—each client can apply edits in any order and reach the same state. Operational Transform (OT) requires a central authority to transform concurrent operations into a consistent order. CRDTs suit peer-to-peer and offline-first apps; OT works well when you have a reliable server. The skill helps you evaluate trade-offs in complexity, latency, and architecture for your use case.
How do I sync edits between multiple users in real time?
real-time-collaboration-engine covers WebSocket sync with presence awareness: each client sends edits to a server or peers, which broadcasts changes back. Use optimistic updates—apply changes locally immediately, then reconcile if conflicts arise. Batch changes to reduce message overhead. For offline scenarios, queue edits locally and replay them when reconnected. The skill details conflict resolution strategies so concurrent edits don't overwrite each other, and how to track cursor positions and user presence.
What are best practices for handling concurrent edits?
real-time-collaboration-engine emphasizes choosing the right conflict resolution model upfront: OT transforms overlapping operations into a consistent sequence, while CRDTs assign unique identifiers so edits commute. Avoid broadcasting every keystroke—batch updates and send them periodically. Implement optimistic updates so the UI feels responsive. Handle reconnection gracefully by replaying queued changes. Test edge cases like simultaneous deletes, rapid insertions, and network partitions to catch lost edits before production.
How do I track cursor positions and presence awareness?
real-time-collaboration-engine shows how to send cursor metadata alongside edits: include user ID, position, and selection range in each message. Broadcast presence updates (join/leave/idle) over WebSocket so clients render remote cursors. Debounce cursor updates to reduce traffic. Store presence state on the server or use a CRDT to track it peer-to-peer. The skill covers rendering remote cursors with user colors and names, and cleaning up stale presence when users disconnect or timeout.
How should I handle offline sync and optimistic updates?
real-time-collaboration-engine advises queuing edits locally when offline, applying them optimistically to the UI immediately. When reconnected, replay the queue and let conflict resolution merge them with server changes. Use version vectors or timestamps to detect which edits succeeded. For CRDTs, offline edits naturally merge on reconnect. For OT, the server transforms queued ops against intervening changes. The skill warns against losing queued edits on page reload—persist them to localStorage or IndexedDB.
SKILL.md
rendered from the published skill — quoted content, verbatim
Real-Time Collaboration Engine
Expert in building Google Docs-style collaborative editing with WebSockets, conflict resolution, and
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 6 files
.claude/skills/real-time-collaboration-engine/SKILL.md
.claude/skills/real-time-collaboration-engine/references/ot-vs-crdt.md
.claude/skills/real-time-collaboration-engine/references/presence-patterns.md
.claude/skills/real-time-collaboration-engine/references/websocket-scaling.md
.claude/skills/real-time-collaboration-engine/scripts/collaboration_tester.ts
.claude/skills/real-time-collaboration-engine/scripts/latency_simulator.ts