From d14ea495ff80963054a9cb2dcbdb7c04093e032c Mon Sep 17 00:00:00 2001 From: Shun Kakinoki Date: Mon, 16 Feb 2026 12:56:14 +0900 Subject: [PATCH] feat: add qmd skill for markdown knowledge base search --- SKILLS.txt | 1 + skills/qmd/SKILL.md | 151 +++++++++++++++++++++++++++++ skills/qmd/references/mcp-setup.md | 112 +++++++++++++++++++++ 3 files changed, 264 insertions(+) create mode 100644 skills/qmd/SKILL.md create mode 100644 skills/qmd/references/mcp-setup.md diff --git a/SKILLS.txt b/SKILLS.txt index df6b1e6..460f77f 100644 --- a/SKILLS.txt +++ b/SKILLS.txt @@ -2,6 +2,7 @@ anthropics/claude-plugins-official better-auth/skills remotion-dev/skills subsy/ralph-tui +tobi/qmd trailofbits/skills vercel/ai vercel/turborepo diff --git a/skills/qmd/SKILL.md b/skills/qmd/SKILL.md new file mode 100644 index 0000000..6ad55fb --- /dev/null +++ b/skills/qmd/SKILL.md @@ -0,0 +1,151 @@ +--- +name: qmd +description: Search personal markdown knowledge bases, notes, meeting transcripts, and documentation using QMD - a local hybrid search engine. Combines BM25 keyword search, vector semantic search, and LLM re-ranking. Use when users ask to search notes, find documents, look up information in their knowledge base, retrieve meeting notes, or search documentation. Triggers on "search markdown files", "search my notes", "find in docs", "look up", "what did I write about", "meeting notes about". +license: MIT +compatibility: Requires qmd CLI or MCP server. Install via `bun install -g https://github.com/tobi/qmd`. +metadata: + author: tobi + version: "1.1.1" +allowed-tools: Bash(qmd:*), mcp__qmd__* +--- + +# QMD - Quick Markdown Search + +QMD is a local, on-device search engine for markdown content. It indexes your notes, meeting transcripts, documentation, and knowledge bases for fast retrieval. + +## QMD Status + +!`qmd status 2>/dev/null || echo "Not installed. Run: bun install -g https://github.com/tobi/qmd"` + +## When to Use This Skill + +- User asks to search their notes, documents, or knowledge base +- User needs to find information in their markdown files +- User wants to retrieve specific documents or search across collections +- User asks "what did I write about X" or "find my notes on Y" +- User needs semantic search (conceptual similarity) not just keyword matching +- User mentions meeting notes, transcripts, or documentation lookup + +## Search Commands + +Choose the right search mode for the task: + +| Command | Use When | Speed | +|---------|----------|-------| +| `qmd search` | Exact keyword matches needed | Fast | +| `qmd vsearch` | Keywords aren't working, need conceptual matches | Medium | +| `qmd query` | Best results needed, speed not critical | Slower | + +```bash +# Fast keyword search (BM25) +qmd search "your query" + +# Semantic vector search (finds conceptually similar content) +qmd vsearch "your query" + +# Hybrid search with re-ranking (best quality) +qmd query "your query" +``` + +## Common Options + +```bash +-n # Number of results (default: 5) +-c, --collection # Restrict to specific collection +--all # Return all matches +--min-score # Minimum score threshold (0.0-1.0) +--full # Show full document content +--json # JSON output for processing +--files # List files with scores +--line-numbers # Add line numbers to output +``` + +## Document Retrieval + +```bash +# Get document by path +qmd get "collection/path/to/doc.md" + +# Get document by docid (shown in search results as #abc123) +qmd get "#abc123" + +# Get with line numbers for code review +qmd get "docs/api.md" --line-numbers + +# Get multiple documents by glob pattern +qmd multi-get "docs/*.md" + +# Get multiple documents by list +qmd multi-get "doc1.md, doc2.md, #abc123" +``` + +## Index Management + +```bash +# Check index status and available collections +qmd status + +# List all collections +qmd collection list + +# List files in a collection +qmd ls + +# Update index (re-scan files for changes) +qmd update +``` + +## Score Interpretation + +| Score | Meaning | Action | +|-------|---------|--------| +| 0.8 - 1.0 | Highly relevant | Show to user | +| 0.5 - 0.8 | Moderately relevant | Include if few results | +| 0.2 - 0.5 | Somewhat relevant | Only if user wants more | +| 0.0 - 0.2 | Low relevance | Usually skip | + +## Recommended Workflow + +1. **Check what's available**: `qmd status` +2. **Start with keyword search**: `qmd search "topic" -n 10` +3. **Try semantic if needed**: `qmd vsearch "describe the concept"` +4. **Use hybrid for best results**: `qmd query "question" --min-score 0.4` +5. **Retrieve full documents**: `qmd get "#docid" --full` + +## Example: Finding Meeting Notes + +```bash +# Search for meetings about a topic +qmd search "quarterly review" -c meetings -n 5 + +# Get semantic matches +qmd vsearch "performance discussion" -c meetings + +# Retrieve the full meeting notes +qmd get "#abc123" --full +``` + +## Example: Research Across All Notes + +```bash +# Hybrid search for best results +qmd query "authentication implementation" --min-score 0.3 --json + +# Get all relevant files for deeper analysis +qmd query "auth flow" --all --files --min-score 0.4 +``` + +## MCP Server Integration + +This plugin configures the qmd MCP server automatically. When available, prefer MCP tools over Bash for tighter integration: + +| MCP Tool | Equivalent CLI | Purpose | +|----------|---------------|---------| +| `qmd_search` | `qmd search` | Fast BM25 keyword search | +| `qmd_vector_search` | `qmd vsearch` | Semantic vector search | +| `qmd_deep_search` | `qmd query` | Deep search with expansion and reranking | +| `qmd_get` | `qmd get` | Retrieve document by path or docid | +| `qmd_multi_get` | `qmd multi-get` | Retrieve multiple documents | +| `qmd_status` | `qmd status` | Index health and collection info | + +For manual MCP setup without the plugin, see [references/mcp-setup.md](references/mcp-setup.md). diff --git a/skills/qmd/references/mcp-setup.md b/skills/qmd/references/mcp-setup.md new file mode 100644 index 0000000..2a6a626 --- /dev/null +++ b/skills/qmd/references/mcp-setup.md @@ -0,0 +1,112 @@ +# QMD MCP Server Setup + +Manual MCP configuration for use without the qmd plugin. + +> **Note**: If using the qmd plugin, MCP configuration is included automatically. This is only needed for manual setup. + +## Claude Code + +Add to `~/.claude/settings.json`: + +```json +{ + "mcpServers": { + "qmd": { + "command": "qmd", + "args": ["mcp"] + } + } +} +``` + +## Claude Desktop + +Add to `~/Library/Application Support/Claude/claude_desktop_config.json`: + +```json +{ + "mcpServers": { + "qmd": { + "command": "qmd", + "args": ["mcp"] + } + } +} +``` + +## Available MCP Tools + +Once configured, these tools become available: + +### qmd_search +Fast BM25 keyword search. + +**Parameters:** +- `query` (required): Search query string +- `collection` (optional): Restrict to specific collection +- `limit` (optional): Number of results (default: 5) +- `minScore` (optional): Minimum relevance score + +### qmd_vector_search +Semantic vector search for conceptual similarity. + +**Parameters:** +- `query` (required): Search query string +- `collection` (optional): Restrict to specific collection +- `limit` (optional): Number of results (default: 5) +- `minScore` (optional): Minimum relevance score + +### qmd_deep_search +Hybrid search combining BM25, vector search, and LLM re-ranking. + +**Parameters:** +- `query` (required): Search query string +- `collection` (optional): Restrict to specific collection +- `limit` (optional): Number of results (default: 5) +- `minScore` (optional): Minimum relevance score + +### qmd_get +Retrieve a document by path or docid. + +**Parameters:** +- `path` (required): Document path or docid (e.g., `#abc123`) +- `full` (optional): Return full content (default: true) +- `lineNumbers` (optional): Include line numbers + +### qmd_multi_get +Retrieve multiple documents. + +**Parameters:** +- `pattern` (required): Glob pattern or comma-separated list +- `maxBytes` (optional): Skip files larger than this (default: 10KB) + +### qmd_status +Get index health and collection information. + +**Parameters:** None + +## Troubleshooting + +### MCP server not starting +- Ensure qmd is in your PATH: `which qmd` +- Try running `qmd mcp` manually to see errors +- Check that Bun is installed: `bun --version` + +### No results returned +- Verify collections exist: `qmd collection list` +- Check index status: `qmd status` +- Ensure embeddings are generated: `qmd embed` + +### Slow searches +- For faster results, use `qmd_search` instead of `qmd_deep_search` +- The first search may be slow while models load (~3GB) +- Subsequent searches are much faster + +## Choosing Between CLI and MCP + +| Scenario | Recommendation | +|----------|---------------| +| MCP configured | Use `qmd_*` tools directly | +| No MCP | Use Bash with `qmd` commands | +| Complex pipelines | Bash may be more flexible | +| Simple lookups | MCP tools are cleaner |