avinyc:qmd-search
Search project documentation using qmd semantic search. Invoke with /avinyc:qmd-search <query> to find docs, plans, or indexed markdown content in your project.
What this skill does
# QMD Search
Search your project's indexed markdown documentation using qmd's MCP tools. This skill reads your project's qmd configuration to know which collections to search, constructs structured queries, and retrieves relevant documents.
## Step 1: Read Config
Read `.claude/qmd.json` from the project root.
If missing, tell the user:
> qmd is not configured for this project. Run `/avinyc:qmd-configure` to set it up.
Then STOP.
Extract `project` name and `collections` — each has a name, path, and description. Pick the best collection for the query by matching against descriptions. If only one collection exists, use it.
## Step 2: Search via MCP
Use the `mcp__qmd__query` tool with a structured query. This is the primary search method — it's faster than CLI (models stay warm between queries) and supports multi-type queries with intent disambiguation.
### Constructing the Query
Every search should include at least two query types for best recall. The first query gets **2x weight** in fusion scoring, so put your best guess first.
```json
{
"searches": [
{ "type": "lex", "query": "2-5 exact keywords, no filler" },
{ "type": "vec", "query": "full natural language question" }
],
"collections": ["<collection_name>"],
"limit": 10
}
```
### Query Types
| Type | Method | When to use | Writing tips |
|------|--------|-------------|--------------|
| `lex` | BM25 keyword | You know the exact terms in the docs | 2-5 terms. Exact phrases: `"rate limiter"`. Exclude: `-sports`. Code identifiers work. |
| `vec` | Vector semantic | You don't know the vocabulary | Full question. Be specific: "how does the auth system handle session expiry?" |
| `hyde` | Hypothetical doc | Complex topic, you can imagine the answer | Write 50-100 words of what the answer looks like, using vocabulary you expect in the result. |
### When to Use What
| Situation | Query types to include |
|-----------|----------------------|
| Know exact terms | `lex` only |
| Don't know vocabulary | `vec` only |
| Best recall | `lex` + `vec` |
| Complex or broad topic | `lex` + `vec` + `hyde` |
| Ambiguous query (e.g., "performance" could mean web perf, team health, etc.) | Any combination + `intent` |
### Intent Disambiguation
When a query term is ambiguous, add `intent` to steer all pipeline stages (expansion, reranking, snippet extraction):
```json
{
"searches": [
{ "type": "lex", "query": "performance" },
{ "type": "vec", "query": "how to improve page load speed" }
],
"intent": "web page load times and Core Web Vitals",
"collections": ["project_docs"],
"limit": 10
}
```
Intent does not search on its own — it's a steering signal that disambiguates what you mean.
## Step 3: Interpret Results
Results include `docid`, `score`, `file`, `title`, `context`, and `snippet`.
| Score | Meaning |
|-------|---------|
| **0.7+** | Highly relevant — read this document |
| **0.5–0.7** | Worth reading if topic matches |
| **< 0.5 on all** | Try different query types or refine |
## Step 4: Retrieve Documents
To read a full document from the results, use `mcp__qmd__get`:
```json
{ "file": "#docid" }
```
Or by file path:
```json
{ "file": "collection_name/path/to/file.md" }
```
For multiple related documents, use `mcp__qmd__multi_get` to batch retrieve:
```json
{ "pattern": "collection_name/docs/*.md" }
```
This is faster than reading files one at a time.
## Error Handling
If MCP tools fail, diagnose the issue:
| Error | Likely cause | Fix |
|-------|-------------|-----|
| `mcp__qmd__query` not available | MCP server not configured | Run `claude mcp add qmd -- qmd mcp` or add qmd to `.mcp.json`. Run `/avinyc:qmd-configure`. |
| MCP call returns error | Server not running or crashed | Run `qmd mcp` to verify. Check `qmd status`. |
| Collection not found | Config out of sync | Run `/avinyc:qmd-doctor` to diagnose. |
| No results | Index empty or stale | Run `qmd update && qmd embed` to rebuild. |
## CLI Fallback
If MCP tools are unavailable, fall back to the CLI. The `qmd query` command supports structured queries via multiline strings:
```bash
qmd query $'lex: exact keywords here\nvec: natural language question here' -c <collection> --json -n 10
```
This single command subsumes `qmd search` (BM25 only) and `qmd vsearch` (vector only). Always use `--json` for parseable output.
## Fallback to Glob/Grep
After 2 poor query attempts (different query types, refined terms), fall back to Glob/Grep on the collection's directory path from config. qmd can't find everything — sometimes a direct file search is faster.
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.