Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add velt-js/agent-skills --skill "velt-crdt-best-practices"
Install specific skill from multi-skill repository
# Description
Velt CRDT (Yjs) collaborative editing best practices for real-time applications. This skill should be used when implementing collaborative features using Velt CRDT stores, integrating with editors like Tiptap, BlockNote, CodeMirror, or ReactFlow, or debugging sync issues. Triggers on tasks involving real-time collaboration, multiplayer editing, CRDT stores, or Velt SDK integration.
# SKILL.md
name: velt-crdt-best-practices
description: Velt CRDT (Yjs) collaborative editing best practices for real-time applications. This skill should be used when implementing collaborative features using Velt CRDT stores, integrating with editors like Tiptap, BlockNote, CodeMirror, or ReactFlow, or debugging sync issues. Triggers on tasks involving real-time collaboration, multiplayer editing, CRDT stores, or Velt SDK integration.
license: MIT
metadata:
author: velt
version: "2.0.0"
Velt CRDT Best Practices
Comprehensive best practices guide for implementing real-time collaborative editing with Velt CRDT (Yjs), maintained by Velt. Contains 33 rules across 5 categories, prioritized by impact to guide automated code generation and debugging.
When to Apply
Reference these guidelines when:
- Setting up Velt client and CRDT stores
- Integrating with Tiptap, BlockNote, CodeMirror, or ReactFlow
- Implementing real-time synchronization
- Managing version history and checkpoints
- Debugging collaboration or sync issues
- Testing multi-user collaboration
Rule Categories by Priority
| 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- |
Quick Reference
1. Core CRDT (CRITICAL)
core-install- Install correct CRDT packages for your frameworkcore-velt-init- Initialize Velt client before creating storescore-store-create-react- Use useVeltCrdtStore hook for Reactcore-store-create-vanilla- Use createVeltStore for non-Reactcore-store-types- Choose correct store type (text/array/map/xml)core-store-subscribe- Subscribe to store changes for remote updatescore-store-update- Use update() method to modify valuescore-version-save- Save named version checkpointscore-encryption- Use custom encryption provider for sensitive datacore-debug-storemap- Use VeltCrdtStoreMap for runtime debuggingcore-debug-testing- Test with multiple browser profiles
2. Tiptap Integration (CRITICAL)
tiptap-install- Install Tiptap CRDT packagestiptap-setup-react- Use useVeltTiptapCrdtExtension for Reacttiptap-setup-vanilla- Use createVeltTipTapStore for non-Reacttiptap-disable-history- Disable Tiptap history to prevent conflictstiptap-editor-id- Use unique editorId per instancetiptap-cursor-css- Add CSS for collaboration cursorstiptap-testing- Test collaboration with multiple users
3. BlockNote Integration (HIGH)
blocknote-install- Install BlockNote CRDT packageblocknote-setup-react- Use useVeltBlockNoteCrdtExtensionblocknote-editor-id- Use unique editorId per instanceblocknote-testing- Test collaboration with multiple users
4. CodeMirror Integration (HIGH)
codemirror-install- Install CodeMirror CRDT packagescodemirror-setup-react- Use useVeltCodeMirrorCrdtExtension for Reactcodemirror-setup-vanilla- Use createVeltCodeMirrorStore for non-Reactcodemirror-ycollab- Wire yCollab extension with store's Yjs objectscodemirror-editor-id- Use unique editorId per instancecodemirror-testing- Test collaboration with multiple users
5. ReactFlow Integration (HIGH)
reactflow-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 users
How to Use
Read individual rule files for detailed explanations and code examples:
rules/shared/core/core-install.md
rules/shared/tiptap/tiptap-disable-history.md
Each rule file contains:
- Brief explanation of why it matters
- Incorrect code example with explanation
- Correct code example with explanation
- Verification checklist
- Source pointer to Velt documentation
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.