← Zurück zu Entwickler interner Systeme

Skill · Version 1.0.0

Gemeinsames Bearbeiten

Integriert gleichzeitige Bearbeitung mit gemeinsamen Zustandsmodellen, lokalem Rückgängig und autorisierter Wiederverbindung statt Dokumentüberschreibung.

collaborative-editing-integration

Teammitglieder mit diesem Skill

Entdecke, wie der Skill hilft

Wann ist der Skill hilfreich?

Nutze dies, wenn gleichzeitige Dokumentänderungen zusammengeführt werden sollen, ohne fremde Arbeit zu überschreiben.

Wobei hilft er dir?

  • Verbindet ein bewährtes Kollaborationsmodell mit unterstützten Editorintegrationen.
  • Trennt dauerhafte Inhalte von vorübergehenden Cursorn und Anwesenheitsdaten.
  • Begrenzt Rückgängig auf lokale Änderungen und prüft Rechte beim Wiederverbinden.

Das könntest du fragen

Plane gleichzeitige Absatzbearbeitung mit Offline-Rückkehr und Rückgängig ausschließlich für eigene Änderungen. Zwei Personen bearbeiten benachbarten Text, eine verliert die Verbindung. Nach Wiederverbindung bleiben beide Änderungen erhalten; lokales Rückgängigmachen löscht keine fremde Arbeit.

Ausführliche Dokumentation

Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.

Details…Weniger anzeigen

Collaborative Editing Integration

Use this skill when real-time multi-user editing, live cursors/presence, or concurrent conflict-free document synchronization is explicitly required.

Core Collaborative Architecture Principles

  1. Do Not Bolt Real-Time Sync Onto an Ad-Hoc State Model:
    • Never attempt multi-user real-time editing by broadcasting full JSON snapshots over WebSockets—concurrent edits will overwrite each other and reset peers' cursors.
    • Use a proven collaborative model matched to the editor engine:
      • CRDTs (Yjs, Automerge) with official editor bindings (y-prosemirror, @tiptap/extension-collaboration, @lexical/yjs).
      • Operational Transformation / Authority Step Stream (prosemirror-collab) where a central authority orders steps and clients rebase unconfirmed local steps.
  2. Strictly Separate Shared Document CRDT from Ephemeral Awareness:
    • Shared Document (Y.Doc / Y.XmlFragment / Y.Map): Stores persistent blocks, text, marks, and canvas shapes.
    • Ephemeral Presence (Awareness protocol): Stores live cursor coordinates, text selection ranges, active user name/color, and viewport focus. Never write cursor movements or hover states into the persistent CRDT document, which would bloat history and storage permanently.

Local-Scoped Undo/Redo & Relative Cursors

  • User-Scoped Collaborative UndoManager:
    • In collaborative sessions, disable the single-user history plugin and use the CRDT's local-origin UndoManager (trackedOrigins) so pressing Cmd/Ctrl+Z undoes only the local user's own operations, never reverting a teammate's concurrent edits.
  • Relative Positions for Selections and Anchors:
    • Represent comments, annotations, and remote cursors using CRDT Relative Positions (Y.RelativePosition) rather than raw integer indices so anchors stay attached to the intended text/block when remote peers insert or delete content above them.
  • Reconnection, Initial Sync & Authorization:
    • Gate document room access and write vs. read/comment-only permissions on the server before accepting CRDT updates, and handle offline buffering and reconnection merge cleanly without duplicating initial template content.

Checklist

  • Is real-time sync backed by a proper CRDT/OT binding rather than whole-document WebSocket overwrites?
  • Are live cursors and selections broadcast via ephemeral Awareness rather than persisted in the document CRDT?
  • Is UndoManager scoped to local user origins so Undo never reverts another collaborator's edits?
  • Are initial template seeding and reconnect merges idempotent so two users opening a new doc do not duplicate initial blocks?

Enthaltene Dateien 1

  • SKILL.md