agentsclimarketplace

Obsidian base query

Skill 21noises/agent-skills/plugins/obsidian/skills/obsidian-base-query

通过 `obsidian` CLI 运行已有的 Obsidian Bases(`.base` 文件)取回结果,并解读、调试 base。当前工作目录本身就是一个 Obsidian vault。当用户要「跑某个 base 看结果」「把某视图的笔记列出来」「这个 base 为什么没出现某篇笔记」「这个 base 在筛什么」这类针对已建好视图的结构化检索或排错需求时走本 skill。触发示例:「跑一下进行中任务这个 base」「按 json 给我阅读清单库的结果」「日记索引为什么少了昨天那篇」。From its SKILL.md

Install
npx -y skills add 21noises/agent-skills --skill obsidian-base-query

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 2 commands, including `obsidian bases` and 1 more.

SKILL.md

3.8 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

你在这里做两件事:运行已有的 .base 取回结果,以及在结果不符预期时解读、调试。你只读,不新建也不修改任何笔记与 .base,这些写入都归 obsidian-base-author

问题能不能用 base 回答、该不该为它新建 base,不由你负责判断。

如果既有 bases 没有能与问题相匹配的,你唯一出口是立即调用 Skill 工具、skill 名 obsidian-base-author,把用户的原始需求原样转交。不要自己回答,不要改用全文搜索或手工读笔记凑答案,也不要只报告「没有这个 base」就收尾。

前置条件

Obsidian 1.12.7 及以上,并已启用 CLI:Settings → General → Command line interface(一次性注册后会生成 obsidian 命令)。若命令报「command not found」,说明 CLI 尚未注册,请如实报告,不要改用其他工具绕开。

命令依赖 Obsidian 应用运行,但不必手动先开;首条命令会自动把它启动起来,可能略有延迟。

关键约定

  1. 一个 .base 文件只放一个视图。
  2. 文件名主体等于视图的 name 字段,看文件名就能认出是什么视图。

工作流

  1. 先列出已有 base。obsidian bases 列出 vault 里全部 .base 文件。这一步强制,用来在已有文件里定位目标,而不是凭空猜文件名。
  2. 定位目标。 在第 1 步的清单里按文件名挑出目标;文件名不足以判断时,用 Read 打开那个 .base 看它筛什么。若整个清单里都没有对得上的 base,那不是名字一时对不上,而是它还不存在,按上文立即调用 Skill 工具转交 obsidian-base-author,本步到此结束,不要在没有 base 的前提下继续往下跑查询,也不要自己另寻答案。
  3. 跑查询取结果。 obsidian base:query path=<完整路径> format=<格式>path 取第 1 步列出的完整路径,要带扩展名,值含空格时加引号;单视图无歧义,view= 可省。格式按消费方选:给人看用 md,给程序用 jsoncsvtsv,只要命中文件清单用 paths,默认 md
  4. 整理回报。 把结果按用户需要的形式呈现。

解读与调试分支

结果不符预期时:

  1. 用 Read 读那个 .base 文件。
  2. 逐条展开 filtersandornot,解析属性的类型前缀以及 this 的语境含义;类型前缀有 note.file.formula.,无前缀时默认按 note。
  3. 对照常见原因排查:属性名或类型不匹配,公式输出类型由底层数据与函数返回值决定;缺空值保护导致该行报错;file.hasTag 连带命中嵌套标签、精确字符串比较不会;file.inFolder 连带命中子文件夹;链接相等与 this 语境;日期相减得毫秒数,误用不存在的 .days 字段会算空,求天数要除以 86400000file.backlinksfile.properties 不随 vault 变化自动刷新。
  4. 需要更深的筛选语法、类型行为或函数语义来判断,或定位后要改筛选,都立即调用 Skill 工具转交 obsidian-base-author,不要凭印象自行改写筛选或猜测语义。

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.