mq

Query markdown files efficiently with mq CLI. Use when exploring documentation structure, extracting specific sections, or reducing token usage when reading .md files.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "mq" with this command: npx skills add muqsitnawaz/mq/muqsitnawaz-mq-mq

mq Skill: Efficient Document Querying

mq doesn't compute answers - it externalizes document structure into your context so you can reason to answers yourself.

Documents → mq query → Structure enters your context → You reason → Results

The Pattern

1. See structure    →  mq <path> .tree            → Map enters your context
2. Find relevant    →  mq <path> ".search('x')"   → Locations enter your context
3. Extract content  →  mq <path> ".section('Y') | .text"  → Content enters your context
                       mq <path> ".record(N)"     → (JSONL: full record at line N)
4. Reason           →  You compute the answer from what's now in your context

Your context accumulates structure. You do the final reasoning.

Quick Reference

# Structure (your working index)
mq file.md .tree                    # Document structure
mq file.md ".tree('preview')"       # Structure + content previews
mq dir/ .tree                       # Directory overview
mq dir/ ".tree('full')"             # All files with sections + previews

# Search
mq file.md ".search('term')"        # Find sections containing term
mq dir/ ".search('term')"           # Search across all files
mq log.jsonl ".search('error')"     # JSONL: line-level search with record context

# Extract
mq file.md ".section('Name') | .text"   # Get section content
mq file.md ".code('python')"            # Get code blocks by language
mq file.md .links                       # Get all links
mq file.md .metadata                    # Get YAML frontmatter
mq log.jsonl '.record(7)'               # JSONL: pretty-print record at line 7

Efficient Workflow

Starting: Get the Map

# For a single file
mq README.md .tree

# For a directory (start here for multi-file exploration)
mq docs/ ".tree('full')"

Output shows you the territory:

docs/ (7 files, 42 sections)
├── API.md (234 lines, 12 sections)
│   ├── # API Reference
│   │        "Complete reference for all REST endpoints..."
│   ├── ## Authentication
│   │        "All requests require Bearer token..."

Now you know: API.md has auth info, 234 lines, section called "Authentication".

Finding: Narrow Down

If you need something specific but don't know where:

mq docs/ ".search('OAuth')"

Output points you to exact locations:

Found 3 matches for "OAuth":

docs/auth.md:
  ## Authentication (lines 34-89)
     "...OAuth 2.0 authentication flow..."
  ## OAuth Flow (lines 45-67)

Now you know: auth.md, section "OAuth Flow", lines 45-67.

Extracting: Get Only What You Need

Don't read the whole file. Extract the section:

mq docs/auth.md ".section('OAuth Flow') | .text"

This returns just that section's content.

Anti-Patterns

Bad: Reading entire files

cat docs/auth.md  # Wastes tokens on irrelevant content

Good: Query then extract

mq docs/auth.md .tree                           # See structure
mq docs/auth.md ".section('OAuth Flow') | .text"  # Get only what's needed

Bad: Re-querying structure you already have

mq docs/ .tree    # First time - good
mq docs/ .tree    # Again - wasteful, you already have this in context

Good: Use what's in your context

mq docs/ .tree    # Once - now you know the structure
# Use the structure you learned to make targeted queries
mq docs/auth.md ".section('OAuth') | .text"

Context as Working Memory

Every mq output enters your context. Your context becomes a working index that grows as you explore:

Query 1: mq docs/ .tree
→ You now see: file list, line counts, section counts
→ You can reason: "auth.md looks relevant to my question"

Query 2: mq docs/auth.md .tree
→ You now see: auth.md's full section hierarchy
→ You can reason: "OAuth Flow section has what I need"

Query 3: mq docs/auth.md ".section('OAuth Flow') | .text"
→ You now have: the actual content
→ You can reason: compute the final answer

mq externalizes structure. You do the thinking. Don't re-query what you already see.

Examples by Task

"Find something in a JSONL session file"

mq session.jsonl ".search('deploy')"  # Line-level matches with record type
# → [line 5] user/user
#     content: Can you deploy the new version?
#     ts: 2026-02-01T20:25:29Z
# → [line 8] assistant/tool_use: Bash
#     ts: 2026-02-01T20:25:34Z

mq session.jsonl '.record(8)'         # Full pretty-printed JSON of that record

"Find how authentication works"

mq docs/ ".search('auth')"           # Find relevant files/sections
mq docs/auth.md ".section('Overview') | .text"  # Read the overview

"Get all Python examples"

mq docs/ ".tree('full')"             # Find files with examples
mq docs/examples.md ".code('python')"  # Extract all Python code

"Understand the API structure"

mq docs/api.md .tree                 # See all endpoints/sections
mq docs/api.md ".section('Endpoints') | .tree"  # Drill into endpoints
mq docs/api.md ".section('POST /users') | .text"  # Get specific endpoint

"Find configuration options"

mq . ".search('config')"             # Search entire project
mq config.md ".section('Options') | .text"  # Extract options

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

processing-markdown

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated