velt-crdt-best-practices
0
总安装量
9
周安装量
安装命令
npx skills add https://github.com/velt-js/agent-skills --skill velt-crdt-best-practices
Agent 安装分布
cursor
9
claude-code
8
opencode
6
gemini-cli
6
github-copilot
6
codex
6
Skill 文档
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
Compiled Documents
AGENTS.mdâ Compressed index of all rules with file paths (start here)AGENTS.full.mdâ Full verbose guide with all rules expanded inline