querying-markdown
Installation
SKILL.md
querying-markdown
mq is "jq for Markdown" — it parses a .md file into a node stream and lets
you select, filter, and transform by structure (.h2, .code("rust"),
.link) instead of by line-matching. Reach for it when the task is structural:
"every H2 title", "all bash code blocks", "a table of contents", "strip the
frontmatter". For plain substring search, grep is still the right tool; for
code (not prose) structure, use tree-sitting.
Before you use mq: is this actually a structural task?
mq parses the whole document into a node tree before it answers, and that parse cost is real (see Empirical findings). Most "query a markdown file" tasks don't need it. Decide first, using the target — not the file type: