processing-markdown

processing-markdown is a skill for Claude Code, Codex from harehare/mq. It costs 36 tokens per session (1,795 once invoked), scanned A, original, MIT.

A skill for querying and transforming Markdown files with mq, a command-line language similar in style to jq. It provides selectors for headings, text, code, links, images, lists, tables, frontmatter, and other Markdown elements.

In plain words
What is it for?
Use it to select document parts, filter headings or code blocks, read attributes such as URLs and language names, and process Markdown content from the command line.
Why use it?
It avoids writing custom parsing code for common Markdown extraction and transformation tasks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to select document parts, filter headings or code blocks, read attributes such as URLs and language names, and process Markdown content from the command line.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/harehare/mq/processing-markdown
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,060 stars · on GitHub · mqlang.org

Install

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.

Any agent
npx skills add harehare/mq --skill processing-markdown
Clone the repo
git clone --depth 1 https://github.com/harehare/mq

Made for: Claude Code, Codex.

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 processing-markdown

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

agentmods 80×15 button for processing-markdown

Your own site · 80×15
<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>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,795 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00036 $0.01795
Opus 5.5 $0.00014 $0.00718
Sonnet 5.5 $0.00007 $0.00359
Haiku 4.5 $0.00004 $0.00179

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

Security

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'
skills/processing-markdown/SKILL.md · 183 lines

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

Read the full file on GitHub · 183 lines

Files

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.

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 First seen · 183 lines · 36 tokens per session scan A 013908de0492

Subscribe to this mod's changes

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.