real-time-collaboration-engine

安装量: 43
排名: #16958

安装

npx skills add https://github.com/erichowens/some_claude_skills --skill real-time-collaboration-engine

Real-Time Collaboration Engine

Expert in building Google Docs-style collaborative editing with WebSockets, conflict resolution, and presence awareness.

When to Use

✅ Use for:

Collaborative text/code editors Shared whiteboards and design tools Multi-user video editing timelines Real-time data dashboards Multiplayer game state sync

❌ NOT for:

Simple chat applications (use basic WebSocket) Request-response APIs (use REST/GraphQL) Single-user applications Read-only data streaming (use Server-Sent Events) Quick Decision Tree Need real-time collaboration? ├── Text editing? → Operational Transform (OT) ├── JSON data structures? → CRDTs ├── Cursor tracking only? → Simple WebSocket + presence ├── Offline-first? → CRDTs (better offline merge) └── No conflicts possible? → Basic broadcast

Technology Selection Conflict Resolution Strategies (2024) Strategy Best For Complexity Offline Support Operational Transform (OT) Text, ordered sequences High Limited CRDTs JSON objects, sets Medium Excellent Last-Write-Wins Simple state Low Basic Three-Way Merge Git-style editing High Good

Timeline:

2010: Google Wave uses OT 2014: Figma adopts CRDTs 2019: Yjs (CRDT library) released 2022: Automerge 2.0 (CRDT library) released 2024: PartyKit simplifies real-time infrastructure Common Anti-Patterns Anti-Pattern 1: Broadcasting Every Keystroke

Novice thinking: "Send every change immediately for real-time feel"

Problem: Network floods with tiny messages, poor performance.

Wrong approach:

// ❌ Sends message on every keystroke function Editor() { const handleChange = (text: string) => { socket.emit('text-change', { text }); // Every keystroke! };

return