mq is a command-line tool for querying and transforming Markdown with syntax modeled on jq, a utility commonly used for processing JSON. It helps developers extract sections, reshape documentation, analyze content, and prepare Markdown for language-model workflows. Its catalogue add-ons support using mq through coding-agent instructions and skills.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add harehare/mq --skill processing-markdowngit clone --depth 1 https://github.com/harehare/mqWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/harehare/mq/processing-markdown)<a href="https://agentmods.dev/skills/harehare/mq/processing-markdown"><img src="https://agentmods.dev/badge/skills/harehare/mq/processing-markdown/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/harehare/mq/processing-markdown"><img src="https://agentmods.dev/badge/skills/harehare/mq/processing-markdown.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00036 | $0.01795 |
| Opus 5.5 | $0.00014 | $0.00718 |
| Sonnet 5.5 | $0.00007 | $0.00359 |
| Haiku 4.5 | $0.00004 | $0.00179 |
Grade A, and why
processing-markdown scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -s https://example.com | mq -I html '.p | to_text' How it starts
The opening of the file, as written. The whole thing — 183 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Processing Markdown with mq
Core Selectors
| Selector | Description |
|---|---|
.h |
All headings |
.h1–.h6 |
Specific heading level |
.text |
Text nodes |
.code |
Code blocks |
.code_inline |
Inline code |
.strong |
Bold text |
.emphasis |
Italic text |
.delete |
Strikethrough |
.link |
Links |
.image |
Images |
.list |
List items |
.blockquote |
Block quotes |
.[][] |
Table cells |
.html / .<> |
HTML nodes |
.footnote |
Footnotes |
.math |
Math blocks |
.yaml, .toml |
Frontmatter |
.link_ref |
Link references |
.image_ref |
Image references |
.definition |
Link/image definitions |
Selector Calls (Filtered Matching)
.h(1) # Only h1 headings
.h(2, 3) # h2 and h3 headings
.h(1..3) # h1 through h3 (range)
.code("rust") # Only Rust code blocks
Key Attribute Access
.h.level / .h.depth # Heading level (1–6)
.h.value # Heading text
.code.lang # Code language
.code.value # Code content
.link.url # Link URL
.image.alt # Image alt text
.list.checked # Checkbox state (boolean)
."key" # Dict key access (property selector)
Update Operator
.code.lang |= "rust" # Change code language in-place
.link.url |= "https://new" # Update link URL
Recursive Descent
..ident # Recursively select matching nodes in nested structures
Common Patterns
# Extract
mq '.h' file.md # All headings
mq '.h(2)' file.md # h2 only
mq '.code("rust")' file.md # Rust code blocks
mq '.link.url' file.md # All URLs
mq '.yaml | to_text' post.md # Frontmatter
# Filter
mq 'select(.code)' file.md # Only code blocks
mq 'select(!.code)' file.md # Exclude code blocks
mq 'select(.h.level <= 2)' file.md # h1 and h2 only
mq 'select(contains("TODO"))' file.md # Nodes with "TODO"
# Transform
mq '.h | to_text' file.md # Headings as plain text
mq -U '.code.lang |= "rust"' file.md # Update in place
# Multi-file
mq -A 'pluck(.code.value)' *.md # Collect code values, per file
mq --eval-all -A '.h | to_text' *.md # Combine all files into one query (e.g. cross-file TOC)
mq -S 's"\n---\n"' 'identity' *.md # Merge with separator
# mq accepts multiple file args directly (shell glob expansion) —
# no need to loop over files in bash:
mq '.h | to_text' *.md work/*.md docs/*.md
# Format conversion
mq -F html 'identity' file.md # Markdown → HTML
mq -F json '.h | to_text' file.md # Headings → JSON
mq -I html 'identity' page.html # HTML → Markdown
# Streaming large files
mq --stream 'select(contains("ERROR"))' large.md
# Section operations (needs -A or `nodes` — see EXAMPLES.md)
mq -A 'section::section("Installation")' file.md # Extract section by heading
mq -A 'section::filter_sections(fn(s): section::title(s) != "Deprecated";) | section::collect()' file.md # Delete section by heading
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 183 lines · 36 tokens per session scan A 013908de0492
processing-markdown is a skill published in the GitHub repository harehare/mq (1,060 stars, last pushed today), licensed MIT. It adds 36 tokens to every session and 1,795 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
feishu
Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.
Read, extract, split, merge, rotate, watermark, fill, OCR, or create PDF files with verification of page counts and text extraction.
docx
Create/edit/inspect Word documents using available managed or host capabilities.
pptx
Create/edit/inspect/verify slide decks and PPTX presentations.
xlsx
Create/edit/analyze/verify spreadsheet workbooks including XLSX/CSV/TSV.
spreadsheets
Compatibility alias for the xlsx skill. Prefer loading xlsx.