Overview & Scope
This skill governs setting up, managing document collections, executing incremental updates, and querying local markdown documents using the QMD (Query Markup Documents) search engine. QMD combines lexical BM25 search, semantic vector search, and LLM re-ranking completely on-device without cloud dependencies.1. Multi-Project Collection Registration
Always register unique, project-scoped collection names to prevent collisions in~/.cache/qmd/index.sqlite:
2. Targeted Querying (Avoiding Cross-Project Clutter)
Target queries using-c <collection> when working within a specific project:
3. Incremental Indexing (Add, Modify, Delete Only)
QMD uses SHA-256 content hashes and mtime comparisons. It does NOT re-index or re-embed unchanged files:4. Hourly Cron Sync Setup
To keep on-device indices continuously updated across projects, configure a cron task runningqmd update and qmd embed:
Sync Script (~/.local/bin/qmd-sync-hourly.sh)
Register Crontab Job
5. Model Context Protocol (MCP) Integration
Configure~/.gemini/config/mcp_config.json or project mcp.json using the executable path resolved during setup (e.g. qmd on PATH or $HOME/.npm-global/bin/qmd):
6. Turnkey AI Master Prompt
For immediate turnkey integration into new projects with AI agents, copy the prompt below:- IF ALREADY INSTALLED:
- Record the version (
qmd --version). - Ensure symbolic link exists for Antigravity agent:
- Skip to PHASE 3.
- Record the version (
PHASE 2: CLEAN INSTALLATION (IF NOT INSTALLED)
- IF NOT INSTALLED:
- Verify Node.js version is v22+ (
node -v). - Prepare root-conflict-free user directory:
- Download local quantized GGUF models:
- Create symbolic link for agent:
- Verify Node.js version is v22+ (
PHASE 3: COLLECTION SETTING
- Identify documentation and rule folders (
docs/,.agents/,notes/). - Register collections:
- Add human context summary:
- Generate embeddings:
PHASE 4: MCP PROTOCOL REGISTRATION
Add theqmd server to ~/.gemini/config/mcp_config.json using the executable path resolved during setup (e.g. qmd or $HOME/.npm-global/bin/qmd):
PHASE 5: VERIFICATION QUERY
- Test BM25 keyword query:
- Test semantic vector query: