mdq

Query and filter Markdown documents using jq-like selector syntax.

1|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/akhy/agent-skills --skill mdq-akhy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mdq
Source: https://github.com/akhy/agent-skills/tree/main/mdq
Command: npx skills add https://github.com/akhy/agent-skills --skill mdq-akhy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mdq.

What problem does it solve? Extracting specific elements like headings, tasks, links, or tables from large Markdown files usually requires manual scanning or writing custom parsing scripts. This Skill lets you query Markdown documents with a jq-like selector syntax to pull exactly the content you need. ## Core Features & Use Cases - Selector-Based Queries: Extract headings, list items, tasks, links, images, tables, code blocks, blockquotes, paragraphs, and front matter using Markdown-mirroring syntax. - Chained Filters and JSON Output: Pipe selectors together to narrow results and emit structured JSON for programmatic processing. - Use Case: Given a long README, run a selector like '# Installation | - ' to list only the installation steps, or use '- [ ]' on a TODO file to find all uncompleted tasks. ## Quick Start Ask the agent to use mdq to list all uncompleted tasks in your TODO.md file.

Frequently Asked Questions about mdq

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract headings from a Markdown file?▼

Use mdq with a heading selector such as 'mdq "## " README.md' to list all h2 headings, or '# *' to match headings at any level. Text matching is case-insensitive by default and supports regex patterns.

How to find uncompleted tasks in a Markdown checklist?▼

Run 'mdq "- [ ]" file.md' to match all unchecked task items. Use '- [x]' for completed tasks or '- [?]' to match tasks regardless of completion state.

Can mdq output results as JSON for scripting?▼

Yes, pass the --output json flag to get structured JSON instead of Markdown. You can pipe the result into jq, for example 'mdq --output json "[]()" README.md | jq ".[] | .url"' to list link URLs.

Does mdq support filtering content under a specific section?▼

Yes, chain selectors with the pipe operator, such as 'mdq "# Installation | - " file.md', which returns only list items appearing under the Installation heading. Each selector filters the output of the previous one.

How do I install mdq on macOS or Linux?▼

Install via Homebrew with 'brew install mdq', or download a prebuilt binary from the GitHub releases page for macOS ARM64 or Linux x86_64. A Docker image is also available for running without local installation.