Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

mdformat

$ mdformat Community Low Risk
mdformat · Design & Docs · MIT · macos / linux / windows

mdformat is an opinionated Python Markdown formatter enforcing canonical CommonMark formatting (with GFM, frontmatter, and table extensions via plugins). Its --check flag provides a clean non-mutating CI gate, while normal invocation normalizes files in place or via stdin/stdout (-).

FCRS-1.0 Score
85 /100
Good
Medium Confidence
Zero-Friction Install
brew install mdformat
CLI vs MCP Decision CLI Only

Local Markdown formatting via mdformat operates directly on repository files with no MCP benefit.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 19 / 25

Deterministic headless CLI with --check exit codes, stdin (-) support, and --end-of-line control, though it lacks --json reporting.

  • --check flag gives clean 0/non-zero CI status without writing
  • Supports - stdin-to-stdout formatting
Trust & Safety 23 / 25

100% offline local formatter; --check guarantees read-only verification before in-place writes.

  • --check performs zero filesystem writes
Setup & Portability 14 / 15

Available via Homebrew, pip, and uvx across macOS, Linux, and Windows.

  • Easy install via brew install mdformat or uvx mdformat
Utility & Efficiency 13 / 15

Keeps agent-generated Markdown cleanly normalized in a single deterministic command.

  • Canonical Black-like opinionated formatting for Markdown
Maintenance & Lineage 8 / 10

Well-maintained open-source repository (hukkin/mdformat) under MIT license.

  • Stable releases on PyPI and Homebrew
Docs & Verifiability 8 / 10

Clear Read the Docs manual covering CLI options, .mdformat.toml, and plugin extensions.

  • Official docs at mdformat.readthedocs.io

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates strictly on local Markdown files or stdin.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free, offline, and MIT open-source.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# mdformat Agent Rules
- Run `mdformat --check <paths>` first to verify whether reformatting is actually needed.
- Confirm whether GFM tables/frontmatter plugins (e.g., `mdformat-gfm`) are configured before reformatting docs containing non-CommonMark syntax.

Agent-Ready Command Recipes

Safe Read-Only Queries

Check Markdown formatting without editing files
mdformat --check README.md docs/

Verifies whether files match canonical CommonMark style and exits non-zero if any file needs reformatting.

Controlled Writes & Previews

Normalize Markdown files in a target directory
mdformat --end-of-line lf docs/

Formats Markdown files under docs/ using Unix LF line endings.

Strengths for Agents

  • + Deterministic, Black-style opinionated CommonMark formatting with zero style bikeshedding.
  • + --check flag provides an explicit read-only verification mode.
  • + Supports stdin/stdout (-) and --end-of-line normalization.

Caveats & Pitfalls

  • ! GFM tables, task lists, and YAML frontmatter require extra plugins (mdformat-gfm, mdformat-frontmatter) to avoid escaping.
  • ! No --json output for programmatic diff summaries.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI