This skill helps implement real-time collaboration with Velt CRDT by guiding setup, integration, and debugging across editors and stores.
npx playbooks add skill velt-js/agent-skills --skill velt-crdt-best-practices
Comprehensive best practices guide for implementing real-time collaborative editing with Velt CRDT (Yjs), maintained by Velt. Contains 71 rules across 6 categories, prioritized by impact to guide automated code generation and debugging.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Core CRDT | CRITICAL | core- |
| 2 | Tiptap Integration | CRITICAL | tiptap- |
| 3 | BlockNote Integration | HIGH | blocknote- |
| 4 | CodeMirror Integration | HIGH | codemirror- |
| 5 | ReactFlow Integration | HIGH | reactflow- |
| 6 | Multiplayer Editor Integrations | HIGH | editors- |
core-install - Install correct CRDT packages for your frameworkcore-velt-init - Initialize Velt client, set document, authenticate before creating stores; v6 featureAllowList / preloadCrdt()core-store-v2-api - v2 Use useStore<T> + useAwareness React hooks; createVeltStore v2 config (forceResetInitialContent, contentKey, userId, collection, logLevel); reactive status/sync/errorcore-v1-to-v2-migration - Migration table: useVeltCrdtStore → useStore (id → storeId, new status/sync/error/onError, useAwareness)core-store-create-vanilla - Use createVeltStore for non-React (entry point unchanged in v2)core-store-types - Choose correct store type (text/array/map/xml/xmltext)core-store-array - Array store: useStore/createVeltStore with type:'array', Array.isArray() guard, add/remove item patternscore-store-map - Map store: useStore/createVeltStore with type:'map', object guard, key-level update/delete patternscore-store-text - Text store: useStore/createVeltStore with type:'text', textarea binding, null coalesce with ?? ''core-store-xml - XML store: NEVER call update(); mutate via store.getXml() (Y.XmlFragment) + Yjs APIs; requires npm i yjscore-store-subscribe - Subscribe to store changes for remote updatescore-store-lifecycle - Call store.destroy() in non-React code; Yjs accessors (getDoc, getProvider, getText, getXml, getAwareness)core-store-update - Use update() method to modify valuescore-version-save - Save named version checkpointscore-encryption - Use custom encryption provider for sensitive datacore-webhooks - Enable the crdt.update_data webhook explicitly; debounce and payload shapecore-event-subscription - Subscribe to on('updateData') Observables and unsubscribe on cleanupcore-crdt-utils-hooks - useCrdtUtils() and useCrdtEventCallback() React hookscore-rest-api - REST get/add/update CRDT data; match each editor's store type and content keycore-activity-debounce - Use setActivityDebounceTime() to control how frequently batched CRDT editor activities are flushedcore-activity-action-types - Use CrdtActivityActionTypes constant for type-safe CRDT activity filtering instead of raw stringscore-message-stream - Use CrdtElement message-stream methods (pushMessage, onMessage, getMessages, getSnapshot, saveSnapshot, pruneMessages) for Yjs-backed collaborative editorscore-debug-storemap - Use VeltCrdtStoreMap for runtime debuggingcore-debug-testing - Test with multiple browser profilescore-store-create-react - (v1 — DEPRECATED) useVeltCrdtStore for React; see core-v1-to-v2-migrationtiptap-install - Install Tiptap CRDT v2 packagestiptap-collaboration-manager - v2 Use useCollaboration / createCollaboration + CollaborationManager APItiptap-v1-to-v2-migration - Migration table: useVeltTiptapCrdtExtension → useCollaborationtiptap-disable-history - Disable Tiptap history to prevent conflictstiptap-editor-id - Use unique editorId per instancetiptap-cursor-css - Add CSS for collaboration cursorstiptap-initial-content - Use HTML string format for initialContenttiptap-comments-integration - Integrate Velt Comments with Tiptaptiptap-nextjs-ssr - Next.js SSR considerationstiptap-testing - Test collaboration with multiple userstiptap-setup-react - (v1 — DEPRECATED) useVeltTiptapCrdtExtension for React; see migration ruletiptap-setup-vanilla - (v1 — DEPRECATED) createVeltTipTapStore for non-React; see migration ruleblocknote-install - Install BlockNote CRDT v2 packagesblocknote-collaboration-manager - v2 Use useCollaboration / createCollaboration + CollaborationManager APIblocknote-v1-to-v2-migration - Migration table: useVeltBlockNoteCrdtExtension → useCollaborationblocknote-editor-id - Use unique editorId per instanceblocknote-testing - Test collaboration with multiple usersblocknote-setup-react - (v1 — DEPRECATED) useVeltBlockNoteCrdtExtension; see migration rulecodemirror-install - Install CodeMirror CRDT v2 packagescodemirror-collaboration-manager - v2 Use useCollaboration / createCollaboration + CollaborationManager APIcodemirror-v1-to-v2-migration - Migration table: useVeltCodeMirrorCrdtExtension → useCollaborationcodemirror-ycollab - Wire yCollab extension with manager.getCollaborationPrimitives()codemirror-editor-id - Use unique editorId per instancecodemirror-testing - Test collaboration with multiple userscodemirror-setup-react - (v1 — DEPRECATED) useVeltCodeMirrorCrdtExtension for React; see migration rulecodemirror-setup-vanilla - (v1 — DEPRECATED) createVeltCodeMirrorStore for non-React; see migration rulereactflow-install - Install ReactFlow CRDT packagereactflow-setup-react - Use useVeltReactFlowCrdtExtensionreactflow-handlers - Use CRDT handlers for node/edge changesreactflow-editor-id - Use unique editorId per instancereactflow-testing - Test collaboration with multiple userseditors-integration-lifecycle - Shared lifecycle: Velt ready + auth + document, editor first, one manager and one binding path, uncontrolled content, ordered teardowneditors-choose-package - Package / React entry-point matrix, shared data model, and merge granularity per editoreditors-lexical - editorState: null, no HistoryPlugin, composer hook or plugin, REST-to-editor limitationeditors-slate - Create the editor once; manager applies withYjs/withYHistory/withCursors; Descendant[] seededitors-draftjs - Route every change through handleChange() with ref-backed EditorState; snapshot modeleditors-prosemirror - autoInitialize: false, attach the view before initialize(), Velt undo/redo, stable schemaeditors-quill - Register quill-cursors before new Quill(); use manager undo()/redo()editors-tinymce - Keep TinyMCE uncontrolled; destroy the manager before tinymce.remove()editors-ckeditor - Create CKEditor first, keep data uncontrolled, forward onAfterDestroyeditors-superdoc - Manager first; same { ydoc, provider } in documents[] and modules.collaboration; one cursor renderereditors-monaco - One binding path, no value/defaultValue, y-monaco cursor CSS, client-only renderingeditors-ace - Real Ace Range factory, collaborative undo, one binding patheditors-apryse - XFDF annotation sync around an app-owned WebViewer; dispose after the managereditors-nutrient - Pass overlayContainer, flush Instant JSON, unload after manager.destroy()editors-spreadjs - Pass GC.Spread.Sheets.Events; snapshot model; destroy the manager before the workbookRead individual rule files for detailed explanations and code examples:
rules/shared/core/core-install.md
rules/shared/tiptap/tiptap-disable-history.md
rules/shared/editors/editors-integration-lifecycle.md
rules/react/editors/editors-slate.md
Each rule file contains:
AGENTS.md — Compressed index of all rules with file paths (start here)AGENTS.full.md — Full verbose guide with all rules expanded inlineWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.