agentleFS
Google CloudKnown publisherGoogleCloudPlatform/knowledge-compiler/skills/vault-query/SKILL.md

vault-query

Skill18 starsChanged 12 days agoApache-2.0View on GitHub

Searches, traverses, and synthesizes answers from the local OKF v0.2 knowledge vault and optional shared pattern repositories, writing durable cross-cutting analyses to wiki/synthesis/. Use when the user invokes /vault-query or /query, asks what the vault says about a topic, or wants to synthesize across compiled wiki notes. Don't use for ingesting new raw files into the vault (use ingest) or correcting stale claims across notes (use vault-correct).

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 5 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these 4 mandatory steps:

    line 50
  2. Very specific:

    Run the pure-stdlib Okapi BM25 ranking engine (title 3.0x, aliases 2.5x, tags 2.0x, headings 1.5x, body 1.0x, zero .sqlite/index files …

    line 56
  3. Very specific:

    Before creating a new synthesis or concept note, run the pre-ingest duplicate check (create_safety: exists | probable | unknown):

    line 65
  4. Very specific:

    Read the anchor note(s) using view_file.

    line 75
  5. Very specific:

    Follow outgoing [[wikilinks]] to related concepts, entities, and sources.

    line 76
  6. Distinctive:

    Check reciprocal links to ensure comprehensive bidirectional context.

    line 77
  7. Distinctive:

    CLI Visual Invariant: When rendering architectures or process flows, output clean ASCII/Unicode text box diagrams directly in the terminal …

    line 83
  8. Distinctive:

    If the query produces non-trivial cross-cutting analysis, customer comparisons, or novel architectural synthesis:

    line 86
  9. Very specific:

    Create a permanent synthesis note at: ${OBSIDIAN_VAULT_PATH:-~/ObsidianVault}/wiki/synthesis/<Topic_Name>.md

    line 87
  10. Very specific:

    Add the new synthesis note into ${OBSIDIAN_VAULT_PATH:-~/ObsidianVault}/index.md under ## 📑 Synthesis & Research Analyses.

    line 107
  11. Distinctive:

    Reciprocal Integrity: If writing a new synthesis note that references note A and note B, add reciprocal backlinks to note A and note B.

    line 116

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

🔍 Vault Query & Compounding Synthesis Skill (/vault-query)

This skill enables agents across any working directory to systematically explore, traverse, and synthesize accumulated intelligence from the central Knowledge Compiler Obsidian Vault ($OBSIDIAN_VAULT_PATH, defaults to ~/ObsidianVault) and compound novel insights back into the persistent wiki following the Open Knowledge Format (OKF v0.2).


🚀 Triggers & Commands

  • /vault-query <topic_or_question> or /query <topic_or_question>
  • Natural language requests:
    • "What does our vault say about AcmeCorp's ERP modernization?"
    • "Search vault for FedRAMP high voice synthesis architectures"
    • "Consult vault for Google ADK vs LangGraph tradeoffs"
    • "Synthesize our accumulated patterns on agent governance and identity"

⚡ Execution Workflow

┌─────────────────────────────────────────────────────────────────────────────┐
│                       VAULT QUERY EXECUTION PIPELINE                        │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  [Step 1: Anchor Discovery]                                                 │
│  Read ObsidianVault/index.md or grep_search in wiki/ to find entry nodes    │
│                                │                                            │
│                                ▼                                            │
│  [Step 2: Associative Graph Traversal]                                      │
│  Follow [[wikilinks]] across wiki/entities/, wiki/concepts/, wiki/sources/  │
│                                │                                            │
│                                ▼                                            │
│  [Step 3: Grounded Answer Synthesis]                                        │
│  Generate cited response with wikilinks & terminal ASCII diagrams          │
│                                │                                            │
│                                ▼                                            │
│  [Step 4: Compounding Knowledge Writeback]                                  │
│  If analysis is non-trivial, compile durable note to wiki/synthesis/<Topic> │
│  Update index.md and log.md                                                 │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Follow these 4 mandatory steps:

1. Anchor Discovery & Federated Retrieval

  1. Consult ${OBSIDIAN_VAULT_PATH:-~/ObsidianVault}/purpose.md to align the query context with active projects, architectural pillars, and open investigative theses.
  2. Open the master catalog at ${OBSIDIAN_VAULT_PATH:-~/ObsidianVault}/index.md and, if present, ${OKF_PATTERNS_PATH:-~/shared-okf-patterns}/index.md.
  3. Stateless Multi-Field Okapi BM25 Retrieval (vault_query.py): Run the pure-stdlib Okapi BM25 ranking engine (title 3.0x, aliases 2.5x, tags 2.0x, headings 1.5x, body 1.0x, zero .sqlite/index files written to the vault) to locate top-ranked anchor notes:
    python3 <plugin_dir>/scripts/vault_query.py "<query>" --vault "${OBSIDIAN_VAULT_PATH:-$HOME/ObsidianVault}" --json
    • To include the shared sanitized pattern repository ($OKF_PATTERNS_PATH) with automatic outbound DLP query scrubbing, pass --federated:
      python3 <plugin_dir>/scripts/vault_query.py "<query>" --vault "${OBSIDIAN_VAULT_PATH:-$HOME/ObsidianVault}" --federated --json
    • By default, raw/ is excluded (wiki/ only). When explicitly searching uncompiled raw intake (--include-raw), raw matches are down-weighted (0.7x) and wrapped in <untrusted-snippet source="raw/...">...</untrusted-snippet>.
    • Before creating a new synthesis or concept note, run the pre-ingest duplicate check (create_safety: exists | probable | unknown):
      python3 <plugin_dir>/scripts/vault_query.py "<candidate_title_or_topic>" --vault "${OBSIDIAN_VAULT_PATH:-$HOME/ObsidianVault}" --check-duplicate --json
  4. Locate primary entry points across:
    • wiki/entities/: Organization profiles, platforms, tools, people.
    • wiki/concepts/: Architecture blueprints, security patterns, algorithms, frameworks.
    • wiki/sources/: Distilled meeting notes, whitepapers, lecture decks.

2. Associative Graph Traversal (Progressive Disclosure)

  1. Read the anchor note(s) using view_file.
  2. Follow outgoing [[wikilinks]] to related concepts, entities, and sources.
  3. Check reciprocal links to ensure comprehensive bidirectional context.
  4. Extract key facts, metrics, decision rationales, and customer constraints.

3. Grounded Answer Synthesis

  1. Structure the response with clear headings, bullet points, and comparison tables.
  2. Clickable Links: Link all referenced entities and concepts using [[Target|Alias]] or [Target](file:///path/to/ObsidianVault/wiki/...).
  3. CLI Visual Invariant: When rendering architectures or process flows, output clean ASCII/Unicode text box diagrams directly in the terminal chat.

4. Compounding Synthesis Writeback (Karpathy Compiler Invariant)

If the query produces non-trivial cross-cutting analysis, customer comparisons, or novel architectural synthesis:

  1. Create a permanent synthesis note at: ${OBSIDIAN_VAULT_PATH:-~/ObsidianVault}/wiki/synthesis/<Topic_Name>.md
  2. Include standard OKF v0.2 frontmatter:
    ---
    title: "Synthesis Title"
    type: synthesis
    created: YYYY-MM-DD
    updated: YYYY-MM-DD
    tags:
      - domain/topic
    status: stable
    sources:
      - id: source-slug
        resource: "wiki/sources/..."
    generated: { by: knowledge-compiler/gemini-pro, at: YYYY-MM-DDTHH:MM:SSZ }
    aliases: []
    ---
    Omit verified: on agent-authored notes until explicit human review (vault-lint --approve-human <note>).
  3. Add the new synthesis note into ${OBSIDIAN_VAULT_PATH:-~/ObsidianVault}/index.md under ## 📑 Synthesis & Research Analyses.
  4. Append an entry to ${OBSIDIAN_VAULT_PATH:-~/ObsidianVault}/log.md: ## [YYYY-MM-DD] query | <Topic Name>

🛡️ Critical Invariants

  • Table Invariant: Inside markdown tables, never escape pipe characters in wikilinks (always use [[Target|Alias]], never [[Target\|Alias]]).
  • Reciprocal Integrity: If writing a new synthesis note that references note A and note B, add reciprocal backlinks to note A and note B.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.