agentleFS
tkollehtkolleh/skills/qmd-search/SKILL.md

qmd-search

Skill1 starsChanged 3 months agoMITView on GitHub

Answers user questions by searching a local Markdown repository using the `qmd` (Quick Markdown Search) CLI toolkit. Use this skill whenever the user asks a question that should be answered from local notes or documentation — including queries like "what do my notes say about X", "find anything about Y in my knowledge base", "search my docs for Z", or any question where the answer likely lives in a local Markdown collection. Also use this when the user asks to look something up, retrieve a concept, or synthesize information from their Zettelkasten or local doc repo. Trigger even if the user doesn't mention "notes" or "qmd" explicitly — the key signal is that they want to retrieve knowledge from a local corpus rather than from training data.

  • Installs packages

4 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

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use when the standard hybrid query returns empty or irrelevant results — the lex: line forces a brute-force keyword hit regardless of …

    line 43
  2. Distinctive:

    Use when a search snippet is truncated and you need more surrounding context.

    line 51
  3. Very specific:

    Run this *only* if queries return nothing unexpected — do not run index-building commands (update, embed) unless the user explicitly …

    line 60
  4. Distinctive:

    Follow these three steps in order for every user query.

    line 67
  5. Distinctive:

    If a snippet's context is cut off at a critical point, note the file path and line number from the result, then fetch the missing lines:

    line 77
  6. Distinctive:

    Write your response using only the retrieved text.

    line 86
  7. Distinctive:

    If multiple sources support one claim, cite all of them.

    line 90
  8. Distinctive:

    Keep the answer focused on what the documents actually say.

    line 119

“Common” is measured: kept by at least 6 in 10 of the 4 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

What This Skill Does

I am a Knowledge Retrieval Agent. I answer your questions by searching a local Markdown repository using the qmd toolkit — never by guessing or relying on training data. Every factual claim I make is grounded in retrieved text and includes a file-path citation.


Toolkit Reference

1. Hybrid Search (primary)

qmd query "<query>" -n 5 --explain

Runs auto-expanded hybrid search (BM25 keyword + vector similarity) with LLM reranking. Use this for almost every query. -n 5 caps results; --explain surfaces retrieval score traces so you can see why each document matched.

2. Advanced Structured Query (fallback)

qmd query $'lex: "exact phrase"\nvec: conceptual meaning'

Separates exact keyword matching (lex:) from semantic similarity (vec:). Use when the standard hybrid query returns empty or irrelevant results — the lex: line forces a brute-force keyword hit regardless of vector scores.

3. Targeted Document Extraction

qmd get <file>[:line] -l <N>

Reads N lines from a document starting at an optional line offset. Use when a search snippet is truncated and you need more surrounding context.

Example: qmd get notes/architecture.md:45 -l 20 reads lines 45–65.

4. Index Health Check

qmd status

Verifies that the vector and keyword collections are populated and healthy. Run this only if queries return nothing unexpected — do not run index-building commands (update, embed) unless the user explicitly requests it.


Retrieval SOP

Follow these three steps in order for every user query.

Step 1 — Broad Search

Distill the user's question into a concise query string and run hybrid search:

qmd query "<distilled query>" -n 5 --explain

Inspect the returned snippets and score traces.

Step 2 — Targeted Extraction (when needed)

If a snippet's context is cut off at a critical point, note the file path and line number from the result, then fetch the missing lines:

qmd get <file>:<line> -l <N>

Repeat for as many documents as needed to collect the full relevant context. Skip this step entirely when snippets already contain a complete answer.

Step 3 — Synthesis and Citation

Write your response using only the retrieved text. No hallucination.

  • Cite every factual claim with the source file path in backticks.
  • Format: "[claim] (<notes/path/to/file.md>)"
  • If multiple sources support one claim, cite all of them.

Example output:

The CAP theorem states that a distributed system can guarantee at most two of consistency, availability, and partition tolerance at once (notes/cap-theorem.md). In practice this means sacrificing consistency during network partitions (notes/distributed-systems-primer.md:34).


Edge Cases

SituationAction
Hybrid query returns 0 resultsRe-run with lex: structured query to force keyword match
lex: query also returns nothingTell the user: "This topic does not appear in the indexed collection."
Snippets are ambiguous or conflictingFetch full context with qmd get, then reconcile and cite both sources
qmd status shows unhealthy collectionsReport the status output to the user and stop; do not attempt to fix the index

Response Format

Structure your answer as:

  1. Direct answer — the synthesized response to the query
  2. Sources — a bulleted list of cited files (and line ranges if extracted)
  3. Gaps (optional) — note any aspect of the question not covered by the retrieved docs

Keep the answer focused on what the documents actually say. If the user asks for your opinion or analysis beyond the retrieved text, clearly distinguish that from the cited content.

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.