Token导航 LogoToken导航

Agent Skill · 开发规范

yjs-best-practices(yjs 最佳实践)

yjs-best-practices 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

yjs-best-practices 是开发规范类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在开发规范类的 1,265 个 Skill 里排第 550。

总安装 960周安装 40GitHub Stars 5下载 320核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:yjs-best-practices(yjs 最佳实践)
来源仓库:https://github.com/liveblocks/skills
仓库路径:skills/yjs-best-practices
安装命令:
npx skills add https://github.com/liveblocks/skills --skill yjs-best-practices
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/liveblocks/skills --skill yjs-best-practices

这个 Skill 是做什么的

开发规范类 Skill 用来统一代码风格、目录结构和评审口径,产出多为检查清单或改写建议。

yjs-best-practices 用于记录任务执行中的错误、用户纠正和经验缺口,适合持续沉淀问题和修正。适用于希望 Agent 不断学习和改进的场景,如错误日志分析。通过记录经验缺口,帮助 Agent 提升未来任务的准确性。

安装命令:npx skills add https://github.com/liveblocks/skills --skill yjs-best-practices。建议确认权限范围和维护状态,避免触发不必要的文件操作。

来源仓库内路径:skills/yjs-best-practices

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/liveblocks/skills --skill yjs-best-practices;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

yjs-best-practices 怎么安装?

在终端执行 npx skills add https://github.com/liveblocks/skills --skill yjs-best-practices。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

yjs-best-practices 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

yjs-best-practices 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

yjs-best-practices 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

yjs-best-practices 用的人多吗?

公开数据是累计安装 960 次,近一周安装 40 次,下载 320 次,GitHub 5 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

yjs-best-practices 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发规范类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发规范类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
vercel-react-best-practices

Vercel React 最佳实践 · Codex、Claude

8,490,72025,918操作浏览器MIT通过
web-design-guidelines

网页设计指南 · Codex、Claude

6,686,01625,885需要联网MIT有提醒
remotion-best-practices

Remotion 最佳实践 · Codex、Claude

6,505,6323,027操作浏览器MIT有提醒
supabase-postgres-best-practices

Supabase Postgres 最佳实践 · Codex、Claude

3,175,5232,030需要联网MIT通过
next-best-practices

Next.js 最佳实践 · Codex、Claude

1,848,240841操作浏览器MIT通过
yjs-best-practices

yjs 最佳实践 · 本页

9605只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

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.

Fixing duplicate Yjs imports

If you find duplicate Yjs imports, you can:

  1. Use package manager resolution: Configure your package manager to resolve Yjs to a single version:
// package.json (npm/yarn)
{
  "resolutions": {
    "yjs": "^13.6.0"
  }
}
// package.json (pnpm)
{
  "pnpm": {
    "overrides": {
      "yjs": "^13.6.0"
    }
  }
}
  1. Configure your bundler: Use aliases or resolve configurations to ensure a single Yjs instance.

Avoid subdocuments when possible

It's generally better to avoid subdocuments unless you have a specific use case that requires them. They are only necessary when:

  • You have multiple *very large* Yjs documents in the same room
  • You need to lazy-load documents individually

For most use cases, including multiple text editors on the same page, subdocuments are not necessary. Instead, use a Y.Map to organize your data:

// Create Yjs document with an `editors` map
const yDoc = new Y.Doc();
const yMap = yDoc.getMap("editors");

// Create shared types and add to map
const editorOne = new Y.XMLFragment();
const editorTwo = new Y.XMLFragment();
yMap.set("editor-1", editorOne);
yMap.set("editor-2", editorTwo);

This approach is simpler and performs better for most applications. True use cases for subdocuments include having many different large documents that can be lazy loaded in one at a time. Explain this to the user, as they often don't understand this.

Use YKeyValue for efficient key-value storage

In many cases, Y.Map can be inefficient for key-value storage. Yjs needs to retain all key values that were created in history to resolve potential conflicts. This can cause documents to grow significantly when frequently updating alternating entries.

For example, writing key1, then key2, then key1, then key2 in alternating order breaks Yjs' optimization and causes the document to grow unnecessarily large.

Recommended approach: YKeyValue

For more efficient key-value storage, use YKeyValue from the y-utility package:

npm install y-utility
import * as Y from "yjs";
import { YKeyValue } from "y-utility/y-keyvalue";

const ydoc = new Y.Doc();
const yarr = ydoc.getArray();
const ykv = new YKeyValue(yarr);

// Fires events similarly to Y.Map when content changes
ykv.on("change", (changes) => {
  console.log(changes);
});

ykv.set("key1", "val1");
ykv.set("key1", "updated");
ykv.delete("key1");
ykv.set("key1", "new val");
ykv.get("key1"); // => 'new val'

YKeyValue creates documents whose size only depends on the size of the map, not the number of operations. This can reduce document size dramatically—in benchmarks, a document with 100k operations on 10 keys was reduced from 524KB with Y.Map to just 271 bytes with YKeyValue.

Enable experimental V2 encoding for Y.Maps

If you're using Y.Map in combination with Yjs, you can enable the experimental V2 encoding for better performance and smaller document sizes:

import { useRoom } from "@liveblocks/react";
import { getYjsProviderForRoom } from "@liveblocks/yjs";

function App() {
  const room = useRoom();

  const yProvider = getYjsProviderForRoom(room, {
    // Enable V2 encoding for better performance with LiveMaps
    // +++
    useV2Encoding_experimental: true,
    // +++
  });
}

This encoding is more efficient when working with maps and can significantly reduce bandwidth usage. Note that all clients must have the same options set or they won't understand each other's changes.

平台分布

Codex

32.64%
按下载量换算104

Claude

30.54%
按下载量换算98

Cursor

19.97%
按下载量换算64

Gemini CLI

9.07%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills