markdownlint

Ensures style consistency and correctness in Markdown files using markdownlint-cli2. Use whenever creating, updating, editing, or reviewing any Markdown (.md) file. Triggers on any task that creates or modifies .md files, including README.md, CHANGELOG.md, documentation, or any file with a .md extension. Also triggers when the user mentions markdown, linting, markdown formatting, markdown style, or markdownlint. Always run the linter after writing or editing markdown content — do not skip this step.

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 "markdownlint" with this command: npx skills add jcardif/agent-skills/jcardif-agent-skills-markdownlint

Markdownlint

Lint Markdown files for style and consistency using markdownlint via the markdownlint-cli2 CLI.

Running the linter

Lint specific files or directories:

npx markdownlint-cli2 "docs/**/*.md"

Lint and auto-fix fixable issues:

npx markdownlint-cli2 --fix "docs/**/*.md"

Lint multiple paths:

npx markdownlint-cli2 "docs/**/*.md" "README.md" "CHANGELOG.md"

Exclude paths with # (negation):

npx markdownlint-cli2 "**/*.md" "#node_modules"

Exit codes

  • 0: No errors (warnings may exist)
  • 1: Linting errors found
  • 2: Linting failed (e.g., bad config)

Interpreting output

Output format: filepath:line rule/alias description

Example:

docs/guide.md:15 MD022/blanks-around-headings [Expected: 1; Actual: 0; Below]
docs/guide.md:42 MD034/no-bare-urls Bare URL used [Context: "..."]

Configuration

Project config file .markdownlint.json

{
  "default": true,
  "MD013": false,
  "MD033": { "allowed_elements": ["details", "summary", "br"] },
  "MD024": { "siblings_only": true }
}

Rules can be set to:

  • true or "error" — enable as error
  • "warning" — enable as warning
  • false — disable
  • { ... } — enable with parameters

CLI config file .markdownlint-cli2.jsonc

Controls both rules and CLI behavior:

{
  "config": {
    "default": true,
    "MD013": false
  },
  "globs": ["**/*.md"],
  "ignores": ["node_modules/**", "build/**"],
  "fix": false
}

Configuration precedence

  1. .markdownlint-cli2.jsonc / .markdownlint-cli2.yaml (full CLI config)
  2. .markdownlint.jsonc / .markdownlint.json / .markdownlint.yaml (rules only)
  3. Inline HTML comment directives in the file itself

Inline directives

Control rules within a file using HTML comments:

<!-- markdownlint-disable MD013 -->
This long line won't trigger a warning because MD013 is disabled for this section of the file.
<!-- markdownlint-enable MD013 -->

<!-- markdownlint-disable-line MD034 -->
https://bare-url-allowed-on-this-line.com

<!-- markdownlint-disable-next-line MD041 -->
Not a heading on line 1

<!-- markdownlint-configure-file { "MD013": { "line_length": 120 } } -->

State capture/restore:

<!-- markdownlint-capture -->
<!-- markdownlint-disable MD013 -->
Long content here...
<!-- markdownlint-restore -->

Common rules quick reference

RuleAliasWhat it checksFixable
MD001heading-incrementHeading levels increment by oneNo
MD003heading-styleConsistent heading style (atx vs setext)No
MD004ul-styleConsistent unordered list markersYes
MD005list-indentConsistent list indentationYes
MD007ul-indentUnordered list indentation depthYes
MD009no-trailing-spacesNo trailing whitespaceYes
MD010no-hard-tabsNo hard tab charactersYes
MD012no-multiple-blanksNo consecutive blank linesYes
MD013line-lengthLine length limit (default 80)No
MD022blanks-around-headingsBlank lines around headingsYes
MD023heading-start-leftHeadings must start at line beginningYes
MD025single-h1Only one top-level heading per fileNo
MD031blanks-around-fencesBlank lines around fenced code blocksYes
MD032blanks-around-listsBlank lines around listsYes
MD033no-inline-htmlNo inline HTMLNo
MD034no-bare-urlsNo bare URLsNo
MD040fenced-code-languageFenced code blocks need a languageNo
MD041first-line-h1First line should be a top-level headingNo
MD047single-trailing-newlineFiles end with a single newlineYes

For a complete reference of all 47 rules with parameters, see references/rules.md.

Workflow

When creating or editing markdown files:

  1. Write or edit the markdown content
  2. Run the linter: npx markdownlint-cli2 "path/to/file.md"
  3. If errors are found:
    • Try auto-fix first: npx markdownlint-cli2 --fix "path/to/file.md"
    • Manually fix any remaining non-fixable issues
    • Re-run the linter to confirm zero errors
  4. If a rule should be permanently disabled, update .markdownlint.json
  5. For one-off exceptions, use inline directives

Tips

  • Run --fix before manual fixes to save effort — about half the rules are auto-fixable
  • Use rule aliases (e.g., no-trailing-spaces) instead of codes (e.g., MD009) in inline directives for readability
  • The MD013 line-length rule is commonly disabled in projects (this project disables it in .markdownlint.json)
  • Use <!-- markdownlint-disable-next-line --> for single-line exceptions rather than disable/enable blocks
  • Configuration in .markdownlint.json applies to the directory and all subdirectories

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.

Research

scientific-paper

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

Planning with files

Implements Manus-style file-based planning to organize and track progress on complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when aske...

Registry SourceRecently Updated
8.5K22Profile unavailable
Coding

Nutrient Document Processing (Universal Agent Skill)

Universal (non-OpenClaw) Nutrient DWS document-processing skill for Agent Skills-compatible products. Best for Claude Code, Codex CLI, Gemini CLI, Cursor, Wi...

Registry SourceRecently Updated
2740Profile unavailable
Coding

vercel-react-best-practices

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

Repository Source
215.6K23Kvercel