Follow
for format conventions, links, and language.
Write the artifact in the user's language. Apply correct grammar and any required diacritics or script-specific characters. If the user's language is unclear, ask before generating output.
When the user's language differs from the wiki language, translate the retrieval query into the wiki language before searching. Determine the wiki language from
(
or
), then from wiki frontmatter/index if guardrails are absent. Keep exact product names and code identifiers unchanged.
The recommended retrieval engine is
QMD (local hybrid search: BM25 + vector + LLM reranking). Setup is one-time per repo — see
in this skills repo.
Never run
,
, or
automatically — those are owner-run setup commands. The skill only
queries an already-built index.
-
Plan the search — turn the user's question into a structured query document. Always provide an
line so reranking and snippet extraction stay anchored to the actual goal:
intent: <one-sentence framing of what the user actually wants>
lex: <exact terms / phrases / -negations>
vec: <natural-language paraphrase of the question>
hyde: <one short paragraph that looks like the ideal answer>
Drop a sub-query if it does not add signal (a glossary lookup needs only
; a "how does X work" is mostly
/
).
-
Retrieve via QMD
- MCP: call with the structured array (or the multi-line string) and the field. Restrict by when the question is scoped to a single collection vs cross-repo.
- CLI:
qmd query "$(cat <<EOF intent: ... lex: ... vec: ... hyde: ... EOF )" --json --files -n 8 --min-score 0.3
- Read the top 3-5 hits with / (or / on the CLI). Fetch the full body when the snippet is borderline; honor the field returned by QMD — it carries collection-level guidance the owner curated.
-
Fallback path (no QMD)
- Read and use the "By topic" table to locate likely pages.
- Use / with the keywords distilled in step 1.
- Read the identified pages in full.
-
Synthesize the answer:
- Direct answer to the question.
- Cite the wiki pages used with links: (use the path returned by QMD, not the docid).
- If sources contradict each other, present the different viewpoints and flag the conflict.
- If the information does not exist in the wiki, say so explicitly and suggest sources that could be ingested.
-
Assess whether the answer has lasting value
- If the answer synthesizes multiple pages in a new and useful way → offer to save it as a page in (cross-cutting summary) or as a new section in an existing page.
- If it is a simple one-off answer → no need to save.
-
Log (only if the query resulted in a wiki update):
## [YYYY-MM-DD] query | <question summary>
- Retrieval: qmd | grep-fallback
- Pages consulted: ...
- Result saved: yes/no (which page, if yes)