feat: add consume skill (write-side pair to /wiki) #8
54
skills/wiki/SKILL.md
Normal file
54
skills/wiki/SKILL.md
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
name: wiki
|
||||
description: Answer from the user's personal Obsidian notes — their "vault", "wiki", or "notes" — read-only. Fires when a question plausibly concerns the user's own recorded knowledge (projects, setup, config, decisions, preferences, or how-to notes they wrote) rather than general world facts, or on "check my notes/vault/wiki", "what do my notes say about…", "do I have anything on…". Returns a synthesized answer with the source note paths, or states plainly that the vault has nothing relevant.
|
||||
---
|
||||
|
||||
# wiki
|
||||
|
||||
Answer a question from the user's personal Obsidian vault, read-only.
|
||||
The vault is a knowledge base the user maintains, and this skill only ever reads it.
|
||||
It searches the vault and nothing else — not the web, not general knowledge — and the caller decides whether to combine the result with other sources.
|
||||
The caller may be the user directly, a subagent, or another skill such as `/consume`, and the process below is the same for all three.
|
||||
|
||||
## 1. Resolve the vault and its read boundary
|
||||
|
||||
The vault lives at `$(xdg-user-dir DOCUMENTS)/notes`.
|
||||
If that path does not resolve or does not exist, report that the vault is unreachable and stop.
|
||||
|
||||
Read `<vault>/.claude/settings.json` and collect every `permissions.deny` entry of the form `Read(<glob>)`.
|
||||
The glob inside each is a path relative to the vault root, so normalize it — drop the leading `./` and trailing `/**` — to get the off-limits path, turning `Read(./05 journal/**)` into `05 journal/`.
|
||||
Those paths are off-limits: never read or search under one, and never let its contents reach an answer.
|
||||
The harness does not apply these rules when you run from outside the vault, so enforcing them is this skill's job.
|
||||
|
||||
Done when you have the vault path and the set of off-limits paths (currently `05 journal/`).
|
||||
|
||||
## 2. Gather candidate notes
|
||||
|
||||
Expand the question into several search terms — synonyms, related concepts, and named entities — so a note worded differently than the question is still found.
|
||||
Search with ripgrep over the Markdown files directly, not obsidian-cli, so retrieval works whether or not Obsidian is running: `rg -l -i` each term over `*.md` under the vault, excluding each off-limits path with ripgrep's own `-g '!<path>'` syntax.
|
||||
|
||||
Then widen for recall through the vault's topic hubs.
|
||||
Each note in `02 tags/` names a topic, and every note on that topic links to it with a `[[topic]]` wikilink, so for any hub matching the question, add its members — the notes containing `[[<hub-name>]]` — to the candidates.
|
||||
|
||||
Done when you have a candidate set of note paths.
|
||||
|
||||
## 3. Read to saturation, following links
|
||||
|
||||
Read every candidate note.
|
||||
Within each, follow every `[[wikilink]]` that bears on the question to its note and read that one too, then repeat on those notes' links.
|
||||
Continue until a full pass surfaces no note you have not already read — saturation.
|
||||
There is no cap on how many notes you read, and a broad question legitimately pulls in many.
|
||||
Never follow a link into a denied glob, and read only Markdown — attachments and other binaries are not sources.
|
||||
|
||||
Done when every note bearing on the question has been read and a further pass finds nothing new.
|
||||
|
||||
## 4. Answer with provenance, or report nothing
|
||||
|
||||
If the notes answer the question, synthesize the answer, then list the notes whose content you drew on by path, each with its key excerpt, and cite that path for every claim taken from the vault.
|
||||
A note that only led you to others, such as an empty topic hub, is a discovery aid rather than a source, so leave it out of the list.
|
||||
Mark anything sourced from `00 INBOX/` as unvetted, since that folder is raw capture the user has not yet curated.
|
||||
|
||||
If nothing relevant was found, say plainly that the vault has nothing on the question.
|
||||
Do not pad the answer with vault-flavored prose that no note supports, and do not create a note to fill the gap.
|
||||
|
||||
Done when the answer cites its source notes, or explicitly reports that the vault has nothing relevant.
|
||||
Reference in New Issue
Block a user