mq: Instructions file for Codex

AGENTS.md

mq AGENTS.md is an instructions file for Codex, OpenCode from harehare/mq. It costs 653 tokens per session, scanned A, original, MIT.

A development guide for mq, a Rust command-line tool for querying and transforming Markdown files. It describes project conventions, Rust practices, and the required commit-message format.

In plain words
What is it for?
Use it during mq development, especially when editing Rust code, adding tests or documentation, handling errors, or preparing commits.
Why use it?
It gives contributors a common reference for writing, testing, documenting, and recording changes.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is harehare/mq's own configuration. It tells Codex and OpenCode how to work on mq itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mq configures →

About the project

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.

harehare/mq · 1,076 stars · on GitHub · mqlang.org

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/harehare/mq/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/harehare/mq

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for mq AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/harehare/mq/agents-md/github.svg)](https://agentmods.dev/instructions/harehare/mq/agents-md)
Your own site
<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.

agentmods 80×15 button for mq AGENTS.md

Your own site · 80×15
<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>
Per session 653 This file is loaded in full into every session.
When invoked 653 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 1mo ago against content hash 15dc07732d8d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 53 lines

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 manipulation
  • mq-run: all CLI logic
  • mq-hir: HIR shared by the LSP, linter and type checker
  • mq-check: type checker, holds builtin type signatures
  • mq-macros: #[mq_macros::mq_fn] native builtin registration
  • mq-test / mq-bench: runners for .mq tests and bench_ functions

Commands

Use just, not bare cargo test.

  • just test-all: fmt check, clippy, mq tests, doctests, all-features and workspace tests
  • just test-mq: .mq tests only. Sufficient when the change is confined to crates/mq-lang
  • just lint: clippy with -D clippy::all
  • just dump-bytecode '<query>' / just vm-profile '<query>': inspect VM output

Conventions

  • Use miette for 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 crate README.md for 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.md Options block
  • docs/books/src/reference/cli.md
  • docs/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 substr when slice exists).
  • A new builtin needs its type signature registered in crates/mq-check/src/builtin.rs.
  • Pure-mq functions in builtin.mq: tests go only in crates/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-statement let/var pipe chain used as an if/else branch value must be wrapped in do ... end. Single-expression branches need no end.

Read the full file on GitHub · 53 lines

Changes

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.

  1. 1mo ago Changed · -49 lines · -190 tokens per session 15dc07732d8d
  2. 2mo ago First seen · 102 lines · 843 tokens per session scan A c25e3d23d254

Subscribe to this mod's changes

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.

Related

mq AGENTS.md compared with instructions from other repositories

mq AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mq AGENTS.mdharehare/mqInstructions file1.1kyesterdayMITA653Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode