$npx -y skills add AgriciDaniel/claude-obsidian --skill wiki-queryAnswer questions using the Obsidian wiki vault. Reads hot cache first, then index, then relevant pages. Synthesizes answers with citations. Files good answers back as wiki pages. Supports quick, standard, and deep modes. Triggers on: what do you know about, query:, what is, expla
| 1 | # wiki-query: Query the Wiki |
| 2 | |
| 3 | The wiki has already done the synthesis work. Read strategically, answer precisely, and file good answers back so the knowledge compounds. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## Transport (v1.7+) |
| 8 | |
| 9 | Reads should prefer the same transport the rest of the plugin uses. Consult `.vault-meta/transport.json` (auto-created by `bash scripts/detect-transport.sh`) and use the `preferred` entry: |
| 10 | |
| 11 | - **cli** — `obsidian-cli read "$VAULT" "$NOTE"` and `obsidian-cli search "$VAULT" "<query>"` (Obsidian-native ranking); see [`skills/wiki-cli/SKILL.md`](../wiki-cli/SKILL.md) |
| 12 | - **mcp-obsidian** / **mcpvault** — `mcp__obsidian-vault__read_note`, `search_notes`; see [`skills/wiki/references/mcp-setup.md`](../wiki/references/mcp-setup.md) |
| 13 | - **filesystem** — Claude's `Read` and `Glob`/`Grep` tools (final floor; always works) |
| 14 | |
| 15 | Full decision tree: [`wiki/references/transport-fallback.md`](../../wiki/references/transport-fallback.md). Quick mode (hot.md only) is transport-agnostic — always uses `Read`. |
| 16 | |
| 17 | --- |
| 18 | |
| 19 | ## Retrieval (v1.7+) |
| 20 | |
| 21 | If `wiki-retrieve` is feature-detected — `[ -x scripts/retrieve.py ] && [ -d .vault-meta/chunks ] && [ -f .vault-meta/bm25/index.json ]` — Standard and Deep modes consult it BEFORE the legacy hot→index→drill chain: |
| 22 | |
| 23 | ```bash |
| 24 | python3 scripts/retrieve.py "<the user's question verbatim>" --top 5 |
| 25 | ``` |
| 26 | |
| 27 | Output is JSON with a `candidates` array. Each candidate has `absolute_path` to the source page, a `snippet`, and `bm25_score` + `rerank_score`. Read the cited pages (using the transport selector from §Transport above) and synthesize with chunk-level citation. |
| 28 | |
| 29 | If `retrieve.py` exits 10 (feature not provisioned), or any step in the pipeline errors, fall back to the v1.6 legacy read order described in the Standard/Deep workflows below — no user-visible breakage. |
| 30 | |
| 31 | Quick mode always skips retrieval (hot.md only — keeps the ~1,500 token budget intact). |
| 32 | |
| 33 | Full spec: [`skills/wiki-retrieve/SKILL.md`](../wiki-retrieve/SKILL.md). Setup: `bash bin/setup-retrieve.sh`. The legacy read-order workflows below remain authoritative when wiki-retrieve is not installed. |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | ## Query Modes |
| 38 | |
| 39 | Three depths. Choose based on the question complexity. |
| 40 | |
| 41 | | Mode | Trigger | Reads | Token cost | Best for | |
| 42 | |------|---------|-------|------------|---------| |
| 43 | | **Quick** | `query quick: ...` or simple factual Q | hot.md + index.md only | ~1,500 | "What is X?", date lookups, quick facts | |
| 44 | | **Standard** | default (no flag) | hot.md + index + 3-5 pages | ~3,000 | Most questions | |
| 45 | | **Deep** | `query deep: ...` or "thorough", "comprehensive" | Full wiki + optional web | ~8,000+ | "Compare A vs B across everything", synthesis, gap analysis | |
| 46 | |
| 47 | --- |
| 48 | |
| 49 | ## Quick Mode |
| 50 | |
| 51 | Use when the answer is likely in the hot cache or index summary. |
| 52 | |
| 53 | 1. Read `wiki/hot.md`. If it answers the question, respond immediately. |
| 54 | 2. If not, read `wiki/index.md`. Scan descriptions for the answer. |
| 55 | 3. If found in index summary, respond and do not open any pages. |
| 56 | 4. If not found, say "Not in quick cache. Run as standard query?" |
| 57 | |
| 58 | Do not open individual wiki pages in quick mode. |
| 59 | |
| 60 | --- |
| 61 | |
| 62 | ## Standard Query Workflow |
| 63 | |
| 64 | 1. **Read** `wiki/hot.md` first. It may already have the answer or directly relevant context. |
| 65 | 2. **Read** `wiki/index.md` to find the most relevant pages (scan for titles and descriptions). |
| 66 | 3. **Read** those pages. Follow wikilinks to depth-2 for key entities. No deeper. |
| 67 | 4. **Synthesize** the answer in chat. Cite sources with wikilinks: `(Source: [[Page Name]])`. |
| 68 | 5. **Offer to file** the answer: "This analysis seems worth keeping. Should I save it as `wiki/questions/answer-name.md`?" |
| 69 | 6. If the question reveals a **gap**: say "I don't have enough on X. Want to find a source?" |
| 70 | |
| 71 | --- |
| 72 | |
| 73 | ## Deep Mode |
| 74 | |
| 75 | Use for synthesis questions, comparisons, or "tell me everything about X." |
| 76 | |
| 77 | 1. Read `wiki/hot.md` and `wiki/index.md`. |
| 78 | 2. Identify all relevant sections (concepts, entities, sources, comparisons). |
| 79 | 3. Read every relevant page. No skipping. |
| 80 | 4. If wiki coverage is thin, offer to supplement with web search. |
| 81 | 5. Synthesize a comprehensive answer with full citations. |
| 82 | 6. Always file the result back as a wiki page. Deep answers are too valuable to lose. |
| 83 | |
| 84 | --- |
| 85 | |
| 86 | ## Token Discipline |
| 87 | |
| 88 | Read the minimum needed: |
| 89 | |
| 90 | | Start with | Cost (approx) | When to stop | |
| 91 | |------------|---------------|--------------| |
| 92 | | hot.md | ~500 tokens | If it has the answer | |
| 93 | | index.md | ~1000 tokens | If you can identify 3-5 relevant pages | |
| 94 | | 3-5 wiki pages | ~300 tokens each | Usually sufficient | |
| 95 | | 10+ wiki pages | expensive | Only for synthesis across the entire wiki | |
| 96 | |
| 97 | If hot.md has th |