yjs-best-practices
Installation
SKILL.md
Yjs best practices
When to use this skill
Use this skill when implementing or debugging Yjs features.
Avoid importing Yjs twice
One of the most common issues when working with Yjs is accidentally importing it twice in your application. This often happens when mixing CommonJS (CJS) and ECMAScript Modules (ESM), or when certain bundlers bundle more than one version of Yjs.
When Yjs is imported twice, the two instances don't share the same class references, which can lead to synchronization issues and unexpected behavior. You'll see a Yjs warning in the Console if this happens.