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.
Borrowing it
Nothing to install: this file belongs to harehare/mq. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/harehare/mq/main/AGENTS.mdgit 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/instructions/harehare/mq/agents-md)<a href="https://agentmods.dev/instructions/harehare/mq/agents-md"><img src="https://agentmods.dev/badge/instructions/harehare/mq/agents-md/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/instructions/harehare/mq/agents-md"><img src="https://agentmods.dev/badge/instructions/harehare/mq/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00653 | $0.00653 |
| Opus 5.5 | $0.00261 | $0.00261 |
| Sonnet 5.5 | $0.00131 | $0.00131 |
| Haiku 4.5 | $0.00065 | $0.00065 |
Grade A, and why
mq AGENTS.md scanned grade A with 0 findings 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
1 near-identical copy found in the catalogue:
- mq CLAUDE.md — 100% identical, 54 lines differ
How it starts
The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.
mq Development Guide
mq is a jq-like command-line tool for Markdown processing, written in Rust.
Where things live
mq-markdown: all Markdown parsing and manipulationmq-run: all CLI logicmq-hir: HIR shared by the LSP, linter and type checkermq-check: type checker, holds builtin type signaturesmq-macros:#[mq_macros::mq_fn]native builtin registrationmq-test/mq-bench: runners for.mqtests andbench_functions
Commands
Use just, not bare cargo test.
just test-all: fmt check, clippy, mq tests, doctests, all-features and workspace testsjust test-mq:.mqtests only. Sufficient when the change is confined tocrates/mq-langjust lint: clippy with-D clippy::alljust dump-bytecode '<query>'/just vm-profile '<query>': inspect VM output
Conventions
- Use
miettefor user-facing errors. Avoid panics. - Public items get doc comments. Keep comments and clap help text terse, only on non-obvious parts.
- Do not write migration or "what changed from the old parser/markdown-rs" notes in docs or comments. Put that in the commit message.
- Delete code that a change makes unused or always-false, even if the diff grows.
- Avoid em dashes in comments and docs.
- Update
docs/and the crateREADME.mdfor user-visible changes.
Generated docs
Do not hand-edit these, and do not run just docs during normal development. It is run only at release time. It regenerates them from the released mq binary, and CI checks they match it, so a new flag or builtin will not appear until after release.
README.mdOptions blockdocs/books/src/reference/cli.mddocs/books/src/builtins.html
mq docs shells out to the installed mq-docs, not to the local build.
Builtins
- Do not add a builtin that duplicates or thinly wraps an existing one or an operator (e.g. a
substrwhensliceexists). - A new builtin needs its type signature registered in
crates/mq-check/src/builtin.rs. - Pure-mq functions in
builtin.mq: tests go only incrates/mq-lang/builtin_tests.mq. - Native Rust builtins: test only the logic you added, not the behavior of the underlying crate (e.g.
regex). - In
builtin.mq, a multi-statementlet/varpipe chain used as anif/elsebranch value must be wrapped indo ... end. Single-expression branches need noend.
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 Changed · -49 lines · -190 tokens per session 15dc07732d8d
- 2mo ago First seen · 102 lines · 843 tokens per session scan A c25e3d23d254
mq AGENTS.md is an instructions file published in the GitHub repository harehare/mq (1,076 stars, last pushed yesterday), licensed MIT. It adds 653 tokens to every session, about $0.0026 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
mq AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| mq AGENTS.mdharehare/mq | Instructions file | 1.1k | yesterday | MIT | A | 653 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |