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

markdownlint-cli2

$ markdownlint-cli2 Community Low Risk
David Anson · Design & Docs · MIT · macos / linux / windows

markdownlint-cli2 (markdownlint-cli2) is the modern, configuration-driven CLI for markdownlint, validating Markdown structure, heading hierarchy, fenced code blocks, and whitespace across globs. It supports --fix for safe formatting fixes and customizable JSON/SARIF output formatters.

FCRS-1.0 Score
87 /100
Good
Medium Confidence
Zero-Friction Install
brew install markdownlint-cli2
CLI vs MCP Decision CLI Only

markdownlint-cli2 lints and auto-fixes local Markdown repositories in milliseconds with zero network access.

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 21 / 25

Deterministic exit codes, --fix, --config, and JSON/SARIF output formatter plugins configured via .markdownlint-cli2.jsonc.

  • Non-interactive glob linting with clean line/rule diagnostics
  • Supports --fix for safe automated formatting cleanup
Trust & Safety 23 / 25

Read-only by default (--fix is explicit opt-in) and 100% offline.

  • No network or credentials
  • In-place edits only happen when --fix is passed
Setup & Portability 14 / 15

Available via npm, npx, and Homebrew across macOS, Linux, and Windows.

  • npm install -g markdownlint-cli2, npx markdownlint-cli2, brew install markdownlint-cli2
Utility & Efficiency 13 / 15

Fast, standard Markdown lint gate that aligns directly with the VS Code markdownlint extension.

  • Shared rule engine and config compatibility with editor extensions
Maintenance & Lineage 8 / 10

Maintained by markdownlint author David Anson (DavidAnson/markdownlint-cli2) under MIT.

  • Active releases from upstream markdownlint maintainer
Docs & Verifiability 8 / 10

Detailed README covering configuration precedence, globs, formatters, and --fix.

  • GitHub README documentation

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No credentials required; pure offline Node.js linter.

Side Effects
Read-Only Local Write
Cost & Quotas

Free open-source software (MIT).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# markdownlint-cli2 Agent Rules
- Quote glob arguments (e.g. `"docs/**/*.md"`) so `markdownlint-cli2` handles globbing consistently across shells.
- Run read-only lint before `--fix`, and inspect `git diff` after `--fix`.
- Respect existing `.markdownlint-cli2.jsonc` / `.markdownlint.json` repository configs instead of overriding rules.

Agent-Ready Command Recipes

Safe Read-Only Queries

Lint all Markdown files in docs directory
markdownlint-cli2 "docs/**/*.md"

Validates Markdown formatting and structural rules across docs/ without modifying files.

Controlled Writes & Previews

Auto-fix fixable Markdown lint violations
markdownlint-cli2 --fix "docs/**/*.md"

Applies safe deterministic fixes (trailing whitespace, list indentation, blank lines) in place.

Strengths for Agents

  • + Fast, deterministic Markdown structural linting with --fix auto-remediation.
  • + Matches the popular VS Code markdownlint extension ruleset and config files.
  • + Zero-install usage via npx markdownlint-cli2 or Homebrew.

Caveats & Pitfalls

  • ! JSON or SARIF output requires configuring an output formatter (such as markdownlint-cli2-formatter-json) rather than a built-in --json CLI flag.
  • ! Unquoted globs can be expanded inconsistently by different shells.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI