AgentStack
SKILL verified MIT Self-run

Obsidian Base Query

skill-21noises-agent-skills-obsidian-base-query · by 21noises

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

No reviews yet
0 installs
2 views
0.0% view→install

Install

$ agentstack add skill-21noises-agent-skills-obsidian-base-query

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Obsidian Base Query? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

你在这里做两件事:运行已有的 .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,不要凭印象自行改写筛选或猜测语义。

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.