Files
personal-wiki/skills/wiki-query/SKILL.md
Daniel 6bab904d13 feat: v1.4.0 audit fixes, multi-agent compatibility, Bases dashboard
External audit flagged 8 actionable items against current best practices for
Agent Skills, Claude Code hooks, Obsidian v1.9-v1.12, and JSON Canvas 1.0.
This release addresses all of them and adds multi-agent compatibility files
at zero cost to existing users.

Tier 1, critical fixes:

* wiki/meta/dashboard.base: NEW Obsidian Bases dashboard (native, no plugin
  needed). Replaces Dataview as the primary dashboard. Six views: Recent
  Activity, Seed Pages, Entities Missing Sources, Open Questions,
  Comparisons, Sources.
* wiki/meta/dashboard.md: now embeds dashboard.base. Legacy Dataview queries
  retained as optional fallback for users on Obsidian < 1.9.10.
* README.md and skills/wiki/references/plugins.md: Plugins section
  reorganized to recommend Bases (core, no install) primary, Dataview
  optional/legacy.
* skills/canvas/references/canvas-spec.md: added missing JSON Canvas 1.0
  fields. Group nodes now document background and backgroundStyle (cover,
  ratio, repeat). Edges document fromEnd (default 'none') and toEnd
  (default 'arrow') asymmetric defaults. Hex ID convention noted alongside
  descriptive ID alternative.
* .gitignore: track wiki/meta/dashboard.base explicitly.

Tier 2, important improvements:

* hooks/hooks.json: SessionStart now uses both command type
  ([ -f wiki/hot.md ] && cat ...) and prompt type. Command type is the
  canonical safety check that works in non-vault sessions without erroring.
  Matcher: startup|resume.
* hooks/hooks.json: NEW PostCompact hook re-injects hot cache after context
  compaction (hook-injected context does not survive compaction; CLAUDE.md
  does).
* hooks/hooks.json: PostToolUse auto-commit now guarded by [ -d .git ].
* hooks/README.md: NEW documentation including known plugin-hooks STDOUT bug
  (anthropics/claude-code#10875) and workarounds.
* skills/wiki/references/mcp-setup.md: added Option D (Obsidian CLI) for
  v1.12+. Added warning callout above NODE_TLS_REJECT_UNAUTHORIZED line
  explaining process-wide TLS bypass and recommending Option D as the
  secure alternative.
* skills/wiki-ingest/SKILL.md: documented [!contradiction] custom callout
  CSS dependency on vault-colors.css snippet.
* skills/wiki/references/css-snippets.md: full documentation of all four
  custom callouts (contradiction, gap, key-insight, stale) with built-in
  fallback equivalents.

Tier 3, multi-agent compatibility (low complexity, high reach):

* AGENTS.md: Codex CLI / OpenCode bootstrap.
* GEMINI.md: Gemini CLI / Antigravity bootstrap.
* .cursor/rules/claude-obsidian.mdc: Cursor always-on rules.
* .windsurf/rules/claude-obsidian.md: Windsurf Cascade rules.
* .github/copilot-instructions.md: GitHub Copilot conventions.
* bin/setup-multi-agent.sh: idempotent symlink installer for Codex,
  OpenCode, Gemini, Cursor, Windsurf. Wires up the skills/ directory in
  each agent's expected location.

Style cleanup: scrubbed all em dashes from every skill, hook, doc, and
bootstrap file (249 total replacements across 26 files). Skills now use
periods, commas, and colons throughout for cleaner natural prose.

Version: 1.3.0 to 1.4.0 (aligns plugin.json with GitHub release tag format).

Already resolved in v1.1 (no action needed):
* defuddle, obsidian-bases, obsidian-markdown skills shipped
* URL ingestion, vision ingestion, delta tracking docs
* Multi-depth wiki-query (Quick / Standard / Deep)
* PostToolUse auto-commit hook
* allowed-tools field removed from all SKILL.md files
* All templates already use plural tag/alias forms
* Custom callouts CSS already in vault-colors.css

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 17:52:03 +03:00

164 lines
4.9 KiB
Markdown

---
name: wiki-query
description: "Answer 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, explain, summarize, find in wiki, search the wiki, based on the wiki, wiki query quick, wiki query deep."
---
# wiki-query: Query the Wiki
The wiki has already done the synthesis work. Read strategically, answer precisely, and file good answers back so the knowledge compounds.
---
## Query Modes
Three depths. Choose based on the question complexity.
| Mode | Trigger | Reads | Token cost | Best for |
|------|---------|-------|------------|---------|
| **Quick** | `query quick: ...` or simple factual Q | hot.md + index.md only | ~1,500 | "What is X?", date lookups, quick facts |
| **Standard** | default (no flag) | hot.md + index + 3-5 pages | ~3,000 | Most questions |
| **Deep** | `query deep: ...` or "thorough", "comprehensive" | Full wiki + optional web | ~8,000+ | "Compare A vs B across everything", synthesis, gap analysis |
---
## Quick Mode
Use when the answer is likely in the hot cache or index summary.
1. Read `wiki/hot.md`. If it answers the question, respond immediately.
2. If not, read `wiki/index.md`. Scan descriptions for the answer.
3. If found in index summary, respond and do not open any pages.
4. If not found, say "Not in quick cache. Run as standard query?"
Do not open individual wiki pages in quick mode.
---
## Standard Query Workflow
1. **Read** `wiki/hot.md` first. It may already have the answer or directly relevant context.
2. **Read** `wiki/index.md` to find the most relevant pages (scan for titles and descriptions).
3. **Read** those pages. Follow wikilinks to depth-2 for key entities. No deeper.
4. **Synthesize** the answer in chat. Cite sources with wikilinks: `(Source: [[Page Name]])`.
5. **Offer to file** the answer: "This analysis seems worth keeping. Should I save it as `wiki/questions/answer-name.md`?"
6. If the question reveals a **gap**: say "I don't have enough on X. Want to find a source?"
---
## Deep Mode
Use for synthesis questions, comparisons, or "tell me everything about X."
1. Read `wiki/hot.md` and `wiki/index.md`.
2. Identify all relevant sections (concepts, entities, sources, comparisons).
3. Read every relevant page. No skipping.
4. If wiki coverage is thin, offer to supplement with web search.
5. Synthesize a comprehensive answer with full citations.
6. Always file the result back as a wiki page. Deep answers are too valuable to lose.
---
## Token Discipline
Read the minimum needed:
| Start with | Cost (approx) | When to stop |
|------------|---------------|--------------|
| hot.md | ~500 tokens | If it has the answer |
| index.md | ~1000 tokens | If you can identify 3-5 relevant pages |
| 3-5 wiki pages | ~300 tokens each | Usually sufficient |
| 10+ wiki pages | expensive | Only for synthesis across the entire wiki |
If hot.md has the answer, respond without reading further.
---
## Index Format Reference
The master index (`wiki/index.md`) looks like:
```markdown
## Domains
- [[Domain Name]]: description (N sources)
## Entities
- [[Entity Name]]: role (first: [[Source]])
## Concepts
- [[Concept Name]]: definition (status: developing)
## Sources
- [[Source Title]]: author, date, type
## Questions
- [[Question Title]]: answer summary
```
Scan the section headers first to determine which sections to read.
---
## Domain Sub-Index Format
Each domain folder has a `_index.md` for focused lookups:
```markdown
---
type: meta
title: "Entities Index"
updated: YYYY-MM-DD
---
# Entities
## People
- [[Person Name]]: role, org
## Organizations
- [[Org Name]]: what they do
## Products
- [[Product Name]]: category
```
Use sub-indexes when the question is scoped to one domain. Avoid reading the full master index for narrow queries.
---
## Filing Answers Back
Good answers compound into the wiki. Don't let insights disappear into chat history.
When filing an answer:
```yaml
---
type: question
title: "Short descriptive title"
question: "The exact query as asked."
answer_quality: solid
created: YYYY-MM-DD
updated: YYYY-MM-DD
tags: [question, <domain>]
related:
- "[[Page referenced in answer]]"
sources:
- "[[wiki/sources/relevant-source.md]]"
status: developing
---
```
Then write the answer as the page body. Include citations. Link every mentioned concept or entity.
After filing, add an entry to `wiki/index.md` under Questions and append to `wiki/log.md`.
---
## Gap Handling
If the question cannot be answered from the wiki:
1. Say clearly: "I don't have enough in the wiki to answer this well."
2. Identify the specific gap: "I have nothing on [subtopic]."
3. Suggest: "Want to find a source on this? I can help you search or process one."
4. Do not fabricate. Do not answer from training data if the question is about the specific domain in this wiki.