# Markdownlint — Lint Markdown for AI Content Quality > Node.js markdown linter with 50+ rules. Ensure consistent formatting in CLAUDE.md, .cursorrules, README files, and AI-generated documentation across your project. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash npm install -g markdownlint-cli2 markdownlint-cli2 "**/*.md" ``` Or use the VS Code extension: search "markdownlint" in Extensions. ## What is Markdownlint? Markdownlint is a Node.js-based linter for Markdown files with 50+ configurable rules. It catches formatting inconsistencies, broken links, and structural issues — ensuring clean, consistent markdown in your CLAUDE.md, .cursorrules, README files, and AI-generated documentation. **Answer-Ready**: Markdownlint is a Node.js markdown linter with 50+ rules for consistent formatting. Lint CLAUDE.md, .cursorrules, README files, and AI-generated docs. Available as CLI, VS Code extension, and GitHub Action. 5k+ GitHub stars. **Best for**: Developers maintaining markdown-based AI tool configurations. **Works with**: VS Code, JetBrains, GitHub Actions, any CI/CD. **Setup time**: Under 1 minute. ## Core Features ### 1. 50+ Built-In Rules | Rule | Description | |------|-------------| | MD001 | Heading levels should increment by one | | MD009 | No trailing spaces | | MD013 | Line length limit | | MD024 | No duplicate headings | | MD032 | Lists should be surrounded by blank lines | | MD033 | No inline HTML | | MD041 | First line should be a top-level heading | ### 2. Configuration ```json // .markdownlint.json { "MD013": { "line_length": 120 }, "MD033": false, "MD041": false, "MD024": { "siblings_only": true } } ``` ### 3. VS Code Integration Install the markdownlint extension: - Real-time linting as you type - Quick fixes for common issues - Works on CLAUDE.md, .cursorrules, README.md ### 4. CI/CD Integration ```yaml # .github/workflows/lint.yml name: Lint Markdown on: [push, pull_request] jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: DavidAnson/markdownlint-cli2-action@v19 with: globs: "**/*.md" ``` ### 5. Fix Automatically ```bash # Auto-fix fixable issues markdownlint-cli2 --fix "**/*.md" ``` ### 6. Ignore Patterns ``` # .markdownlintignore node_modules/ dist/ CHANGELOG.md ``` ## Use with AI Tool Configs ### CLAUDE.md Linting ```bash # Lint your Claude Code config markdownlint-cli2 CLAUDE.md ``` ### .cursorrules Linting ```bash # Treat .cursorrules as markdown markdownlint-cli2 .cursorrules ``` ### AI-Generated Content ```bash # Lint AI-generated docs before committing markdownlint-cli2 --fix docs/**/*.md ``` ## Common Fixes | Issue | Fix | |-------|-----| | Trailing spaces | Auto-fix removes them | | Missing blank lines | Auto-fix adds them | | Inconsistent list markers | Auto-fix standardizes to `-` | | Multiple blank lines | Auto-fix collapses to one | ## FAQ **Q: Does it work with MDX?** A: Partially — it handles standard markdown syntax. JSX blocks may trigger false positives; disable specific rules as needed. **Q: Can I create custom rules?** A: Yes, via the plugin API. Write rules as Node.js modules. **Q: Is there a pre-commit hook?** A: Yes, use with husky or lefthook for pre-commit linting. ## Source & Thanks > Created by [David Anson](https://github.com/DavidAnson). Licensed under MIT. > > [DavidAnson/markdownlint](https://github.com/DavidAnson/markdownlint) — 5k+ stars ## Quick Start ```bash npm install -g markdownlint-cli2 markdownlint-cli2 "**/*.md" ``` One command to check all Markdown files for formatting. ## What is Markdownlint? A Node.js Markdown linter with 50+ rules to ensure consistent formatting. Great for CLAUDE.md, .cursorrules, README, and similar files. **In one sentence**: Node.js Markdown linter with 50+ rules ensuring consistent formatting for CLAUDE.md, .cursorrules, and documentation — 5k+ GitHub stars. **For**: Developers maintaining Markdown AI tool configurations. ## Core Features ### 1. 50+ Rules Heading hierarchy, trailing whitespace, line length, duplicate headings, and more. ### 2. VS Code Integration Real-time checks with quick fixes. ### 3. CI/CD Integration One-click GitHub Actions configuration. ### 4. Auto-Fix Use `--fix` to automatically fix common issues. ## FAQ **Q: Does it support MDX?** A: Partially — JSX may trigger false positives; disable rules as needed. **Q: Is there a pre-commit hook?** A: Yes — use with husky or lefthook. ## Source & Thanks > [DavidAnson/markdownlint](https://github.com/DavidAnson/markdownlint) — 5k+ stars, MIT --- Source: https://tokrepo.com/en/workflows/markdownlint-lint-markdown-ai-content-quality-2f24f820 Author: Script Depot