Skip to content
Back to skills

Qmd Search

ASecurity

Answer questions by searching a local Markdown repository, notes, or Zettelkasten using the `qmd` (Quick Markdown Search) CLI with grounded file citations. Use when the user wants to look up, search, or synthesize information from local notes, docs, or a knowledge base rather than training data, even without mentioning `qmd`.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 24, 2026
ai-agentsbash

Works with

  • cli

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned December 5, 2026

npx -y skills add tkolleh/skills --skill qmd-search --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Qmd Search?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Qmd Search
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tkolleh-qmd-search/badge)](https://www.skillsdirectory.com/skills/tkolleh-qmd-search)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: qmd-search
description: >-
  Answer questions by searching a local Markdown repository, notes, or
  Zettelkasten using the `qmd` (Quick Markdown Search) CLI with grounded file
  citations. Use when the user wants to look up, search, or synthesize
  information from local notes, docs, or a knowledge base rather than training
  data, even without mentioning `qmd`.
compatibility: "Requires qmd CLI (bunx @tobilu/qmd or npm i -g @tobilu/qmd)."
---

## 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)
```bash
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)
```bash
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
```bash
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
```bash
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:
```bash
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:
```bash
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

| Situation | Action |
|-----------|--------|
| Hybrid query returns 0 results | Re-run with `lex:` structured query to force keyword match |
| `lex:` query also returns nothing | Tell the user: "This topic does not appear in the indexed collection." |
| Snippets are ambiguous or conflicting | Fetch full context with `qmd get`, then reconcile and cite both sources |
| `qmd status` shows unhealthy collections | Report 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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.