Agent skill

Siyuan Notes Skill

by LeoYeAI in LeoYeAI/openclaw-master-skills

思源笔记工具——搜索、阅读、编辑、组织用户的笔记。Use when user says: 搜索笔记、查找文档、打开文档、阅读笔记、编辑笔记、创建文档、修改块、思源笔记、SiYuan、整理文档、管理标签、Daily Note、反向链接、最近修改、PMF补丁、SQL查询blocks。不要用于与思源笔记无关的通用编程或问答任务。

MITAuto-check: notesKnowledge Management

Install Siyuan Notes Skill

skills CLI
$ npx skills add LeoYeAI/openclaw-master-skills --skill siyuan-notes-skill -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install LeoYeAI/openclaw-master-skills siyuan-notes-skill --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/siyuan-notes-skill .claude/skills/siyuan-notes-skill && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
siyuan-notes-skill
GitHub stars
2.2k
Token cost
~3.4k tokens
SKILL.md length
662 words
Files
15
Skills in repo
1,235
Repo updated
First seen
Licence
MIT

At a glance

思源笔记工具——搜索、阅读、编辑、组织用户的笔记。Use when user says: 搜索笔记、查找文档、打开文档、阅读笔记、编辑笔记、创建文档、修改块、思源笔记、SiYuan、整理文档、管理标签、Daily Note、反向链接、最近修改、PMF补丁、SQL查询blocks。不要用于与思源笔记无关的通用编程或问答任务。

  • Works in 8 steps: 搜索并阅读 → 修改已有块内容(apply-patch 安全用法) → 添加新内容到文档 → …
  • User says: 搜索笔记、查找文档、打开文档、阅读笔记、编辑笔记、创建文档、修改块、思源笔记、SiYuan、整理文档、管理标签、Daily Note、反向链接、最近修改、PMF补丁、SQL查询blocks。不要用于与思源笔记无关的通用编程或问答任务
  • SKILL.md covers 开始前(可选):版本检查, 编辑策略选择(最重要), Intent Decision Tree and Write Safety Protocol, plus 9 more sections
  • Runs JavaScript scripts from its folder; calls node

What it does

Siyuan Notes Skill is an agent skill from LeoYeAI/openclaw-master-skills. 思源笔记工具——搜索、阅读、编辑、组织用户的笔记。Use when user says: 搜索笔记、查找文档、打开文档、阅读笔记、编辑笔记、创建文档、修改块、思源笔记、SiYuan、整理文档、管理标签、Daily Note、反向链接、最近修改、PMF补丁、SQL查询blocks。不要用于与思源笔记无关的通用编程或问答任务。

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 16 other files (for example `README.md`, `_meta.json` and `cli.js`). Compatibility notes: Requires Node.js 18+. Needs a running SiYuan kernel with API access. Claude Code only.

It sits in Knowledge Management, covering Note-taking. It works with SQL. The repository describes itself as: 🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai. The licence is MIT.

When your agent uses it

  • User says: 搜索笔记、查找文档、打开文档、阅读笔记、编辑笔记、创建文档、修改块、思源笔记、SiYuan、整理文档、管理标签、Daily Note、反向链接、最近修改、PMF补丁、SQL查询blocks。不要用于与思源笔记无关的通用编程或问答任务
  • Tasks that involve Note-taking

Example prompts

  • “/siyuan-notes-skill”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Requires Node.js 18+. Needs a running SiYuan kernel with API access. Claude Code only.
  • Pre-approved tools (allowed-tools): Bash

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. 搜索并阅读
  2. 修改已有块内容(apply-patch 安全用法)
  3. 添加新内容到文档
  4. 重构文档(如拆分表格为多个)
  5. 创建新文档
  6. 修改/删除单个块
  7. 超长文档处理
  8. 跨章节分散修改多个块(单进程批量脚本)

What it can do on your machine

Read from SKILL.md and the folder at commit e5199b5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Node.js 18+. Needs a running SiYuan kernel with API access. Claude Code only.

    From compatibility in the SKILL.md frontmatter.

Context cost

Siyuan Notes Skill loads about 3.4k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 662 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:392
    - `.env` 自动从 `index.js` 目录加载
  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from LeoYeAI/openclaw-master-skills at commit e5199b5, republished under its MIT licence (© LeoYeAI). 662 words, ~3,421 tokens.

Download SKILL.mdSave it as .claude/skills/siyuan-notes-skill/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.
name
siyuan-notes-skill
description
思源笔记工具——搜索、阅读、编辑、组织用户的笔记。Use when user says: 搜索笔记、查找文档、打开文档、阅读笔记、编辑笔记、创建文档、修改块、思源笔记、SiYuan、整理文档、管理标签、Daily Note、反向链接、最近修改、PMF补丁、SQL查询blocks。不要用于与思源笔记无关的通用编程或问答任务。
allowed-tools
Bash
compatibility
Requires Node.js 18+. Needs a running SiYuan kernel with API access. Claude Code only.
license
MIT
metadata.author
fanxing-6
metadata.version
1.0.5

开始前(可选):版本检查

如需确认是否为最新版本,请运行:

bash
node index.js version-check
  • 若远程版本获取失败:不会阻塞任务
  • 若检测到版本落后:会提示但不阻塞

编辑策略选择(最重要)

根据用户意图选择正确的编辑方式,选错会导致数据丢失:

用户想要正确做法错误做法
修改单个块内容update-block(最高效)apply-patch 整个文档
删除单个块delete-block(最高效)apply-patch 整个文档
批量修改已有内容apply-patch(update/delete/reorder/insert)
批量删除/重排块apply-patch(delete/reorder)
添加新内容append-block(简单稳妥)或 apply-patch insert(批量场景)
在指定位置插入新块insert-block --before/--after(首选)或 apply-patch insert
替换章节内容replace-sectionapply-patch 删除+插入
重构文档(如拆表格)replace-section --clear + append-block 逐步重建apply-patch 删除旧块+插入新块
跨章节分散修改多个块编写单个 JS 脚本,循环 openDocument → updateBlock(同一进程内版本自动刷新)并行 Bash 调用 update-block(会版本冲突)

Intent Decision Tree

用户想要…
├─ 查找/搜索内容 ──────→ search / search-md / tag / attr / bookmarks
├─ 在文档内搜索 ──────→ search-in-doc {docID} {关键词}
├─ 阅读文档 ──────────→ open-doc {ID} readable(超长文档自动截断,输出大纲导航)
├─ 阅读章节 ──────────→ open-section {标题块ID} readable(精确读取一个标题的内容)
├─ 浏览最近动态 ──────→ recent / tasks / daily
├─ 了解文档结构 ──────→ docs / notebooks / headings / blocks / doc-tree / doc-tree-id / doc-children
├─ 查看引用关系 ──────→ backlinks / unreferenced
├─ 修改单个块 ────────→ open-doc readable → update-block {块ID} {内容}(最高效)
├─ 删除单个块 ────────→ open-doc readable → delete-block {块ID}(最高效)
├─ 批量修改已有内容 ──→ open-doc patchable → 编辑内容 → apply-patch(支持 update/delete/reorder/insert)
├─ 创建新文档 ────────→ create-doc(指定笔记本、标题、可选初始内容)
├─ 重命名文档 ────────→ rename-doc(只需文档 ID 和新标题)
├─ 添加新内容 ────────→ open-doc readable → append-block(逐个追加)
├─ 指定位置插入 ──────→ open-doc readable → insert-block --before/--after(按锚点插入)
├─ 替换章节 ──────────→ open-doc patchable → replace-section
├─ 重构文档结构 ──────→ open-doc readable → replace-section --clear → append-block 逐步重建
├─ 组织文档层级 ──────→ subdoc-analyze-move → move-docs-by-id
├─ 跨章节分散修改 ────→ 编写单个 JS 脚本,循环 openDocument → updateBlock(见模式8)
├─ SQL 高级查询 ──────→ node -e + executeSiyuanQuery()
└─ 检查连接 ──────────→ check / version

Write Safety Protocol

写入前通常需要完成这 2 步(create-doc / rename-doc 例外):

bash
# 步骤 1:读取文档或章节(标记为"已读",同时记录文档版本快照)
node index.js open-doc "docID" readable
# 或:node index.js open-section "headingBlockID" readable

# 步骤 2:环境变量启用写入
SIYUAN_ENABLE_WRITE=true node index.js append-block "docID" "内容"
  • open-doc 和 open-section 计为"已读";headings/blocks/doc-tree 等不算
  • 核心保护:版本检查(乐观锁)——写入前对比文档 updated 时间戳,若文档在读取后被其他端修改过则拒绝写入
  • 连续写入安全:每次写入成功后自动刷新版本号,open-doc → write → write → write 不会误报冲突
  • ⚠️ 版本刷新仅在同一 node 进程内生效。若用多个独立 Bash 命令(如 Claude Code 并行调用),每次写入会改变文档版本,后续的独立命令会版本冲突。解决方案:对同一文档的多次写入必须串行执行,不能并行
  • 读标记持久化存储在磁盘缓存中,跨 CLI 调用有效(同一台机器上的不同终端共享读标记)
  • 读标记超过 3600 秒自动过期(仅作为缓存清理,版本检查才是真正的安全机制)
  • 例外:create-doc 与 rename-doc 不要求先 open-doc

Core Commands Quick Reference

所有命令:node index.js {command} [args]

读取
CommandSignatureDescription
search{keyword} [limit] [type]搜索笔记(type: p/h/l/c/d…)
search-md{keyword} [limit] [type]搜索并输出 Markdown 结果页
open-doc{docID} [readable|patchable] [--full] [--cursor {块ID}] [--limit-chars {N}] [--limit-blocks {N}]打开文档(默认 readable)。超长文档自动截断/分页,--full 跳过截断输出全量。副作用:标记已读
open-section{标题块ID} [readable|patchable]读取标题下的章节内容。副作用:标记文档已读
search-in-doc{docID} {关键词} [数量]在指定文档内搜索匹配的块
notebooks列出笔记本
docs[notebookID] [limit]列出文档(含文档 ID,默认 200)
headings{docID} [level]文档标题(level 格式:h1/h2/…/h6,不是数字)
blocks{docID} [type]文档子块(含块 ID,可用于写入)
doc-children{notebookID} [path]子文档列表
doc-tree{notebookID} [path] [depth]子文档树(默认深度 4)
doc-tree-id{docID} [depth]以文档 ID 展示子文档树
tag{tagName}按标签搜索
backlinks{blockID}反向链接
tasks[status] [days]任务([ ]/[x]/[-],默认 7 天)
daily{start} {end}Daily Note(YYYYMMDD)
attr{name} [value]按属性查询(自定义属性加 custom- 前缀)
bookmarks[name]书签
random{docID}随机标题
recent[days] [type]最近修改(默认 7 天)
unreferenced{notebookID}未被引用的文档
check连接检查
version内核版本
写入
CommandSignature适用场景
create-doc{notebookID} {标题}创建新文档(标题即文档名,初始内容仅支持 stdin)
rename-doc{docID} {新标题}重命名文档
update-block{块ID}更新块内容(Markdown 仅支持 stdin;多块输入自动拆块安全写入)
delete-block{块ID}删除单个块
append-block{parentID}添加新内容(parentID 可以是文档 ID 或标题块 ID;Markdown 仅支持 stdin)
insert-block{--before 块ID|--after 块ID|--parent 块ID}在指定锚点插入内容(前/后/父块下;Markdown 仅支持 stdin)
replace-section{headingID} 或 {headingID} --clear替换/清空章节(保留标题块本身;Markdown 仅支持 stdin)
apply-patch{docID} (PMF 通过 stdin 传入)仅限批量修改/删除/重排已有块(拒绝 partial PMF)
move-docs-by-id{targetID} {sourceIDs}移动文档(需先 open-doc 目标文档和所有来源文档)
subdoc-analyze-move{targetID} {sourceIDs} [depth]分析移动计划(只读)

Common Patterns

1. 搜索并阅读
bash
node index.js search "项目总结" 5
node index.js open-doc "找到的文档ID" readable
2. 修改已有块内容(apply-patch 安全用法)
bash
# 导出完整 PMF(必须 --full;默认 patchable 在长文档会分页并标记 partial=true)
node index.js open-doc "docID" patchable --full | tee /tmp/doc.pmf

# 编辑 /tmp/doc.pmf:只改 markdown 内容,保留所有块 ID 注释不变
# ⚠️ 关键:PMF 必须包含文档的 **所有** 块!缺失的块会被视为删除!
#    正确做法:导出完整 PMF → 只修改目标块的文本 → 提交完整文件
#    错误做法:只写目标块 → 其他块全部丢失

# 执行
cat /tmp/doc.pmf | SIYUAN_ENABLE_WRITE=true node index.js apply-patch "docID"
3. 添加新内容到文档
bash
node index.js open-doc "docID" readable                    # 先读
printf '## 新标题' | SIYUAN_ENABLE_WRITE=true node index.js append-block "docID"
printf '段落内容' | SIYUAN_ENABLE_WRITE=true node index.js append-block "docID"
printf '- [ ] 任务' | SIYUAN_ENABLE_WRITE=true node index.js append-block "docID"
3.5 在指定位置插入内容
bash
node index.js open-doc "docID" readable
printf '插入在该块之前' | SIYUAN_ENABLE_WRITE=true node index.js insert-block --before "目标块ID"
printf '插入在该块之后' | SIYUAN_ENABLE_WRITE=true node index.js insert-block --after "目标块ID"
4. 重构文档(如拆分表格为多个)
bash
# 读取原始内容
node index.js open-doc "docID" readable

# 用 patchable 视图找到要操作的块 ID
node index.js open-doc "docID" patchable

# 方案A:有标题块 → 清空章节再重建
# replace-section 保留标题块本身,只删除标题下的子内容
# 所以新内容不要重复标题(例如标题是 "## 表格" 则直接追加表格数据即可)
SIYUAN_ENABLE_WRITE=true node index.js replace-section "标题块ID" --clear
# 追加到标题块 ID 下 → 新内容会出现在该标题的章节内
printf '### 概览' | SIYUAN_ENABLE_WRITE=true node index.js append-block "标题块ID"
printf '|列1|列2|\n|---|---|\n|数据|数据|' | SIYUAN_ENABLE_WRITE=true node index.js append-block "标题块ID"

# 方案B:没有标题块 → 用 node -e 删除旧块再追加
SIYUAN_ENABLE_WRITE=true node -e "
const s = require('./index.js');
s.deleteBlock('旧块ID').then(function(r) { console.log(JSON.stringify(r)); });
"
printf '新内容' | SIYUAN_ENABLE_WRITE=true node index.js append-block "docID"
5. 创建新文档
bash
# 先查笔记本ID
node index.js notebooks

# 创建空文档
SIYUAN_ENABLE_WRITE=true node index.js create-doc "笔记本ID" "文档标题"

# 创建带初始内容的文档(Markdown 仅支持 stdin)
printf '## 第一章\n内容' | SIYUAN_ENABLE_WRITE=true node index.js create-doc "笔记本ID" "文档标题"

# 重命名已有文档
SIYUAN_ENABLE_WRITE=true node index.js rename-doc "文档ID" "新标题"
6. 修改/删除单个块
bash
# 修改单个块
node index.js open-doc "文档ID" readable
printf '新内容' | SIYUAN_ENABLE_WRITE=true node index.js update-block "块ID"

# 多行内容同样通过 stdin
printf '## 新标题\n\n段落内容' | SIYUAN_ENABLE_WRITE=true node index.js update-block "块ID"

# 删除单个块
node index.js open-doc "文档ID" readable
SIYUAN_ENABLE_WRITE=true node index.js delete-block "块ID"

注意: 若传入内容可解析为多个块(例如"段落 + $$公式$$"),update-block 会自动执行"首块 update + 后续 insert",并做写后校验,避免刷新后内容丢失。

7. 超长文档处理
bash
# open-doc 超长文档自动截断/分页,输出大纲和导航提示
node index.js open-doc "超长文档ID" readable
# → 自动截断到 ~15K 字符,附带标题大纲

# 读取特定章节(精确获取标题下内容)
node index.js open-section "标题块ID" readable

# 在文档内搜索关键词(无需读完全文)
node index.js search-in-doc "文档ID" "关键词"

# patchable 视图分页(默认每页 50 块)
node index.js open-doc "文档ID" patchable
# → 分页时 PMF header 含 partial=true next_cursor=xxx

# 翻页
node index.js open-doc "文档ID" patchable --cursor "下一块ID"

# 需要完整 PMF(如整文 apply-patch)→ 用 --full 跳过分页
node index.js open-doc "文档ID" patchable --full | tee /tmp/doc.pmf
# ⚠️ 输出可能很大,注意上下文限制
8. 跨章节分散修改多个块(单进程批量脚本)

当需要修改同一文档中分散在不同章节的多个块时,不能用多个并行 Bash 命令(会版本冲突)。正确做法是编写单个 JS 脚本:

javascript
// /tmp/batch_edit.js
const s = require('/root/.claude/skills/siyuan-notes-skill/index.js');
async function main() {
  const docId = '文档ID';

  // 辅助函数:刷新版本 + 更新块(同一进程内版本自动刷新)
  async function edit(blockId, markdown) {
    await s.openDocument(docId, 'readable');
    await s.updateBlock(blockId, markdown);
    console.log(`Updated ${blockId}: OK`);
  }

  // 辅助函数:刷新版本 + 在锚点后插入
  async function insertAfter(previousID, markdown) {
    await s.openDocument(docId, 'readable');
    await s.insertBlock(markdown, { previousID });
    console.log(`Inserted after ${previousID}: OK`);
  }

  // 依次执行所有修改(必须串行,不能 Promise.all)
  await edit('块ID1', '新内容1');
  await edit('块ID2', '新内容2');
  await insertAfter('锚点块ID', '插入的新内容');
}
main().catch(e => { console.error(e.message); process.exit(1); });
bash
# 执行
cd /root/.claude/skills/siyuan-notes-skill
SIYUAN_ENABLE_WRITE=true node /tmp/batch_edit.js

关键点:

  • 所有操作在同一个 node 进程内串行执行
  • 每次写入前 openDocument 刷新版本号(进程内版本缓存自动更新)
  • JS API 签名:updateBlock(id, markdown)、insertBlock(markdown, { previousID?, nextID?, parentID? })、deleteBlock(id)、appendMarkdownToBlock(parentID, markdown)

错误恢复

错误原因恢复方法
invalid ID argument块 ID 不存在或格式错误重新导出 open-doc ... patchable --full,校验 block ID 后再提交
文档被清空提交了不完整 PMF,缺失块被当作删除用 open-doc ... patchable --full 重新导出完整 PMF 后恢复
写入围栏报错未先 open-doc/open-section 或读标记过期open-doc "docID" readable(或 open-section)然后重试
版本冲突报错文档在读取后被其他端修改open-doc "docID" readable 重新读取最新版本然后重试
PMF 版本冲突PMF 导出后文档被修改open-doc "docID" patchable --full 重新导出后再编辑,输出用 tee 保存
partial PMF 被拒绝分页/章节导出的 PMF 不完整改用 update-block 编辑单块,或 open-section + replace-section 编辑章节
只读模式报错未设置 SIYUAN_ENABLE_WRITE=true在命令前加 SIYUAN_ENABLE_WRITE=true
文档标题为"未命名文档"createDocWithMd 的 path 参数决定标题用 create-doc CLI 命令(自动设置标题)或 rename-doc 修正
连接失败思源未运行/端口/Token 错误node index.js check 验证
search 返回空关键词过短/确实无匹配改用 search-in-doc 限定文档范围,或扩大关键词上下文
并行写入版本冲突多个独立 Bash 命令并行修改同一文档改用单个 JS 脚本串行执行(见模式8),或每次写入前重新 open-doc
Show full SKILL.md (228 more words)Show less

Output Guidance

  • 读取命令返回格式化文本 → 直接展示给用户
  • open-doc readable 返回干净 Markdown → 适合阅读和总结(超长文档自动截断到 ~15K 字符,附带标题大纲)
  • open-doc patchable 返回 PMF 格式 → 仅用于编辑后 apply-patch(超长文档自动分页,分页 PMF 含 partial=true,不可用于 apply-patch)
  • open-section 返回单章节内容 → 适合精确阅读/编辑特定章节
  • 写入命令返回 JSON(通常很冗长) → 只提取关键信息(如新文档 ID、成功/失败)展示给用户,不要原样输出全部 JSON
  • 公式渲染:行内公式用 $...$,独立公式块用 $$...$$(思源会渲染为数学块)

KaTeX Formula Rules (No Silent Rewrite)

核心原则:写入内容必须与模型输出一致。禁止在写入前/写入中对公式做隐式重写。

必须遵守
  • 数学定界符只用两种:行内 $...$,独立 $$...$$
  • 数学模式内禁止再次出现 $(例如 $$ ... $x$ ... $$ 是错误)
  • 需要乘幂星号时写 e^* 或 e^{\ast},不要写 e^\*
  • 计数项不要写 #web_search、#tokens,改写为 N_{web\_search}、N_{tokens}
  • 不要把"给普通文本用的转义"直接搬进数学模式(如 \_、\=、\*)
常见错误与正确写法
  • 错误:$$ ... $s_0,a_0^j,o_1^j$ ... $$(数学模式内嵌 $) 正确:$$ ... s_0, a_0^j, o_1^j ... $$
  • 错误:$-\lambda \cdot #web_search$ 正确:$-\lambda \cdot N_{web\_search}$
  • 错误:$\hat e = e^\*$ 正确:$\hat e = e^*$
写后验证(必须)
  • 写入后立刻 open-doc {docID} readable 回读,确保模型看到的是"最终落地文本"
  • 至少搜索以下高风险串:KaTeX parse error、Undefined control sequence、e^\\*、#web_search、#tokens
  • 若命中,优先修正文档内容本身,不要在工具层做自动改写

Supporting Files

SQL Quick Reference

  • SQLite 语法;默认最多返回 64 行
  • 时间格式 YYYYMMDDHHmmss
  • 主要表:blocks(块)、refs(引用)、attributes(属性)
  • 块类型:d文档 h标题 p段落 l列表 c代码 t表格 m公式 b引述 s超级块
  • ⚠️ tb 是分割线(thematic break / ---),不是"表格体"! 表格的块类型是 t
  • 层级:root_id → 文档,parent_id → 父容器
  • JS API 查询:s.executeSiyuanQuery('SQL') 执行查询,s.formatResults(r) 格式化输出

Block Type Reference(思源内核源码 treenode/node.go)

类型代码节点类型说明是否容器块
dNodeDocument文档是
hNodeHeading标题否
pNodeParagraph段落否
lNodeList列表是
iNodeListItem列表项是
cNodeCodeBlock代码块否
mNodeMathBlock公式块否
tNodeTable表格(整体为一个块,内部 head/body/row/cell 不是独立块)否
bNodeBlockquote引述是
sNodeSuperBlock超级块是
tbNodeThematicBreak分割线(---),⚠️ 不是表格体否
htmlNodeHTMLBlockHTML 块否
avNodeAttributeView属性视图(数据库)否

表格结构说明:思源中表格(t)是原子块,内部的 TableHead/TableBody/TableRow/TableCell 是 AST 节点,没有独立 block ID。编辑表格只能整体替换,不能操作单个单元格。

Notes

  • cwd 必须是 skill 目录(index.js 所在目录)
  • .env 自动从 index.js 目录加载
  • 路径含空格需加引号
  • Markdown 内容含换行时必须用 $'...\n...' 语法(Bash ANSI-C quoting),普通双引号 "...\n..." 中的 \n 是字面文本不是换行
  • 连接检查:node index.js check

© LeoYeAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 14 other files in skills/siyuan-notes-skill of LeoYeAI/openclaw-master-skills.

  • SKILL.md
  • README.md
  • _meta.json
  • cli.js
  • docs/Command-Reference.md
  • docs/Error-Recovery.md
  • docs/SQL-Reference.md
  • docs/command-reference.md
  • docs/pmf-spec.md
  • docs/sql-reference.md
  • format-utils.js
  • index.js
  • lib/pmf-utils.js
  • lib/query-services.js
  • package.json

Open the folder on GitHubat commit e5199b5

Compare with similar skills

Siyuan Notes Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Siyuan Notes Skill compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Siyuan Notes Skill this skillLeoYeAI/openclaw-master-skills2.2k—~3.4kAutomated safety check: NotesMIT
Qmdalsk1992/CloddsBot2.9k3 repos~1.2kAutomated safety check: PassMIT
Obsidian Canvas BoardsAgriciDaniel/claude-obsidian15k—~1.4kAutomated safety check: PassMIT
LLM Wikilewislulu/llm-wiki-skill655—~3.7kAutomated safety check: PassNone
Para Memory Filespaperclipai/paperclip99k1 repos~909Automated safety check: PassMIT
Add Frontmatterheyitsnoah/claudesidian2.6k—~951Automated safety check: PassMIT

Similar skills

  • Qmd

    alsk1992/CloddsBot

    Local hybrid search for markdown notes and docs. An agent skill from alsk1992/CloddsBot.

    2.9k GitHub starsUsed in 3 repos~1.2k tokens
    Knowledge ManagementAuto-check passed
  • Obsidian Canvas Boards

    AgriciDaniel/claude-obsidian

    Creates, inspects and updates Obsidian JSON Canvas boards in a vault, with text, file, link, group and edge nodes, using safe recoverable edits.

    15k GitHub stars~1.4k tokensUpdated 29 days ago
    Knowledge ManagementAuto-check passed
  • LLM Wiki

    lewislulu/llm-wiki-skill

    Build and maintain a Karpathy-style LLM knowledge base — a self-compiling Obsidian markdown wiki where an Agent ingests raw sources, compiles cross-linked concept/entity/summary pages, answers…

    655 GitHub stars~3.7k tokensUpdated 5 mo ago
    Knowledge ManagementAuto-check passed
  • Para Memory Files

    paperclipai/paperclip

    Use a file-based PARA memory system to store, retrieve, and organize durable knowledge across sessions.

    99k GitHub starsUsed in 1 repo~909 tokens
    Knowledge ManagementAuto-check passed
  • Add Frontmatter

    heyitsnoah/claudesidian

    Add or update YAML frontmatter properties to enhance Obsidian note organization.

    2.6k GitHub stars~951 tokensUpdated 6 mo ago
    Knowledge ManagementAuto-check passed
  • Obsidian Bases Editor

    AgriciDaniel/claude-obsidian

    Explains, drafts and validates Obsidian Bases .base files, building filters, formulas and table, card or list views, and applying edits only through one inspected transaction.

    15k GitHub stars~1.2k tokensUpdated 29 days ago
    Knowledge ManagementAuto-check passed

More from LeoYeAI/openclaw-master-skills

All 1,235 skills in this repo
  • DevOps Pipeline Management

    LeoYeAI/openclaw-master-skills

    Manages pipelines on a DevOps quality and efficiency platform through its OpenAPI: list workspaces and templates, create, update, run and cancel pipelines, and read run records.

    2.2k GitHub stars~4.2k tokensUpdated 2 mo ago
    Auto-check: notes
  • Feishu Document Collaboration

    LeoYeAI/openclaw-master-skills

    Patches OpenClaw's Feishu extension so an edited document triggers an isolated agent session that reads the doc and replies inline, turning it into a live chat space.

    2.2k GitHub stars~2k tokensUpdated 2 mo ago
    Auto-check passed
  • Files Memory System

    LeoYeAI/openclaw-master-skills

    Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation.

    2.2k GitHub stars~3.8k tokensUpdated 2 mo ago
    Auto-check passed
  • GEO-Claw AI Visibility Agent

    LeoYeAI/openclaw-master-skills

    Runs a brand's AI-search visibility work end to end: diagnosing how AI platforms represent it, repositioning it, producing AI-optimized content and monitoring ongoing mentions.

    2.2k GitHub stars~4.7k tokensUpdated 2 mo ago
    Auto-check passed
  • Google Workspace CLI

    LeoYeAI/openclaw-master-skills

    Installs and authenticates the gws CLI, then automates Gmail, Drive, Sheets, Calendar, Docs, Chat and Tasks with ready-made recipes, persona bundles and security audits.

    2.2k GitHub stars~2.6k tokensUpdated 2 mo ago
    Auto-check: notes
  • HealthFit Health Advisors

    LeoYeAI/openclaw-master-skills

    Runs four advisor roles, a fitness coach, nutritionist, data analyst and TCM practitioner, to build a health profile and track workouts, diet and wellness over time.

    2.2k GitHub stars~4.4k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Siyuan Notes Skill

What does Siyuan Notes Skill do?

思源笔记工具——搜索、阅读、编辑、组织用户的笔记。Use when user says: 搜索笔记、查找文档、打开文档、阅读笔记、编辑笔记、创建文档、修改块、思源笔记、SiYuan、整理文档、管理标签、Daily Note、反向链接、最近修改、PMF补丁、SQL查询blocks。不要用于与思源笔记无关的通用编程或问答任务。. Siyuan Notes Skill is an agent skill from LeoYeAI/openclaw-master-skills.

When should I use Siyuan Notes Skill?

Siyuan Notes Skill fits situations like: user says: 搜索笔记、查找文档、打开文档、阅读笔记、编辑笔记、创建文档、修改块、思源笔记、SiYuan、整理文档、管理标签、Daily Note、反向链接、最近修改、PMF补丁、SQL查询blocks。不要用于与思源笔记无关的通用编程或问答任务; tasks that involve Note-taking.

How do I install Siyuan Notes Skill in Claude Code?

Run `npx skills add LeoYeAI/openclaw-master-skills --skill siyuan-notes-skill -a claude-code`. Or copy the skill folder (skills/siyuan-notes-skill in LeoYeAI/openclaw-master-skills) into .claude/skills/siyuan-notes-skill in your project. Claude Code loads it when a task matches its description.

How do I install Siyuan Notes Skill in Codex?

Run `npx skills add LeoYeAI/openclaw-master-skills --skill siyuan-notes-skill -a codex`. Or copy the skill folder (skills/siyuan-notes-skill in LeoYeAI/openclaw-master-skills) into .agents/skills/siyuan-notes-skill in your project. Codex loads it when a task matches its description.

Can I use Siyuan Notes Skill in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LeoYeAI/openclaw-master-skills --skill siyuan-notes-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/siyuan-notes-skill, .gemini/skills/siyuan-notes-skill, .github/skills/siyuan-notes-skill and .opencode/skills/siyuan-notes-skill in your project.

What does Siyuan Notes Skill need to run?

Going by SKILL.md and its folder, Siyuan Notes Skill needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Bash. Compatibility (from SKILL.md): Requires Node.js 18+. Needs a running SiYuan kernel with API access. Claude Code only..

Does Siyuan Notes Skill access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Siyuan Notes Skill safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file; pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Siyuan Notes Skill use?

Siyuan Notes Skill is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Siyuan Notes Skill use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Siyuan Notes Skill?

Skills that share tags, products or a category with Siyuan Notes Skill: Qmd (alsk1992/CloddsBot, 2.9k stars), Obsidian Canvas Boards (AgriciDaniel/claude-obsidian, 15k stars), LLM Wiki (lewislulu/llm-wiki-skill, 655 stars) and Para Memory Files (paperclipai/paperclip, 99k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Siyuan Notes Skill?

LeoYeAI (a GitHub user) maintains it in LeoYeAI/openclaw-master-skills, which has 2,160 GitHub stars. The repository holds 1,235 skills in this directory. The repository was last updated on July 20, 2026.

Source: LeoYeAI/openclaw-master-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.