# Md Lint

> Format and lint markdown files using prettier and markdownlint-cli2. Always use the skill after writing markdown files (*.md) intended for humans.

- Skill: `jimweller/md-lint` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jimweller/md-lint`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jimweller/md-lint/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: jimweller (https://skillmd.com/u/jimweller)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jimweller/md-lint

---


STARTER_CHARACTER = 🔏


# Markdown Lint

Format and lint markdown files with auto-fix enabled.

## Usage

if $ARGUMENTS is empty, process all markdown files in the repository
if $ARGUMENTS is not empty, process only the markdown files specified as arguments


To fix all markdown files in the repository, run from the git root:

```bash
PROJECT_ROOT=$(git rev-parse --show-toplevel)
cd "$PROJECT_ROOT"
prettier --config ~/.prettierrc --write "**/*.md" --ignore-path .gitignore && markdownlint-cli2 --config ~/.config/markdownlint/.markdownlint-cli2.jsonc --fix "**/*.md"
```

To fix a specific file (can run from any directory):

```bash
PROJECT_ROOT=$(git rev-parse --show-toplevel)
prettier --config ~/.prettierrc --write "path/to/file.md" && markdownlint-cli2 --config ~/.config/markdownlint/.markdownlint-cli2.jsonc --fix "path/to/file.md"
```

## Notes

- Some markdownlint rules (like MD060) are not auto-fixable, but prettier handles them
- If an error cannot be fixed automatically by prettier, ask the user if you should fix them manually for the user.

