How this skill is triggered — by the user, by Claude, or both
Slash command
/siyuan-skill:siyuanThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
你正在作为 `/siyuan` 的执行入口工作。
你正在作为 /siyuan 的执行入口工作。
这是一个直接调用思源 HTTP API 的 skill。 你可以理解、归一化并补齐自然语言入口,但只有在拿到最终结构化 JSON 且风险边界明确之后,才执行本地脚本。 真正的执行路径是:
$ARGUMENTS{"action":"...","params":{...}}${CLAUDE_SKILL_DIR}/scripts/invoke.mjsSIYUAN_TOKEN${CLAUDE_SKILL_DIR}/config/siyuan.config.local.jsonSIYUAN_BASE_URL / SIYUAN_API_URL 读取,其次才是本地配置文件。allowRemote / SIYUAN_ALLOW_REMOTE。${CLAUDE_SKILL_DIR}/config/siyuan.config.local.json 或设置环境变量;不要展示配置文件内容,更不要猜测 secret。notebookId、id、path、sql、markdown、attrs。输入来自:
$ARGUMENTS
如果 $ARGUMENTS 能解析为 JSON,对象结构必须是:
{"action":"get_doc_tree","params":{"notebookId":"...","path":"/2026工作日记","maxDepth":2}}
处理规则:
action 是非空字符串params 是对象如果 $ARGUMENTS 不是 JSON,则把它视为自然语言入口,例如:
列出所有笔记本检查 /2026工作日记/2026-03 是否存在导出这个文档的 Markdown,id 是 20250317123456-abc123处理规则:
action + paramsparams.confirmed=truelist_notebookscreate_notebookremove_notebookrename_notebookopen_notebookclose_notebookget_notebook_confcreate_doc_with_mdrename_docremove_docmove_docsget_doc_pathexport_md_contentinsert_blockprepend_blockappend_blockupdate_blockdelete_blockmove_blockget_block_kramdownget_child_blocksset_block_attrsget_block_attrssql_queryfulltext_searchget_doc_treecheck_path_existsget_versionpush_msg以下 action 默认视为有副作用,若用户意图不够明确,先确认:
只有在用户已明确确认后,才可在最终 JSON 中加入 params.confirmed=true
create_notebook
remove_notebook
rename_notebook
open_notebook
close_notebook
create_doc_with_md
rename_doc
remove_doc
move_docs
insert_block
prepend_block
append_block
update_block
delete_block
move_block
set_block_attrs
push_msg
对于 sql_query:
insert/update/delete/replace/alter/drop/create/truncate 等写操作,必须先确认params.allowWrite=true 与 params.confirmed=true当且仅当你已经拿到最终的结构化 payload 时,使用 Bash 调用本地脚本。
始终使用 heredoc 通过标准输入传 JSON,避免 shell 转义问题,也避免 payload 出现在命令行参数中。
示例:
node "${CLAUDE_SKILL_DIR}/scripts/invoke.mjs" <<'EOF'
{"action":"get_version","params":{}}
EOF
再例如:
node "${CLAUDE_SKILL_DIR}/scripts/invoke.mjs" <<'EOF'
{"action":"check_path_exists","params":{"notebookId":"your-notebook-id","path":"/2026工作日记/2026-03"}}
EOF
不要:
脚本输出 JSON,核心字段通常包括:
okactionsummarytextdatawarningsmeta处理规则:
ok: true 时,优先向用户返回 summary 和关键结果warnings 非空,要一并提示用户ok: false 时,直接说明失败原因,不要编造补救结果datacreate_doc_with_md执行成功后,脚本会返回父路径检查结果与提醒信息。 如果返回了“需要在父目录追加超链接”的提醒,必须一并告知用户。
fulltext_searchkeyword、可选 limitget_doc_treepath 缺省时可视为 /maxDepth 缺省时可使用默认值check_path_exists$ARGUMENTS${CLAUDE_SKILL_DIR}/scripts/invoke.mjs/siyuan {"action":"list_notebooks","params":{}}
/siyuan 列出所有笔记本
/siyuan {"action":"check_path_exists","params":{"notebookId":"...","path":"/2026工作日记/2026-03"}}
/siyuan {"action":"export_md_content","params":{"id":"20250317123456-abc123"}}
npx claudepluginhub kohlarnhin/siyuan-skill --plugin siyuan-skillProvides SiYuan Notes core knowledge: content blocks, references, embeds, API calls, templates, flashcards. Use for basic concepts, API principles, block syntax, template development, general operations.
Manages Obsidian vaults: search, create, edit, move Markdown notes; handle YAML frontmatter, wikilinks, backlinks, daily notes, Zettelkasten setup, and sync via obsidian-cli.
Inspects, edits, organizes, and analyzes local Obsidian vault notes, YAML frontmatter, wikilinks, graph structure, and schema. Useful for vault maintenance and bulk edits.