Dev markdown lint

From Nebulavenus/forge-gpu · View interactive version

Dev markdown lint is an AI agent skill from the GitHub repository Nebulavenus/forge-gpu. Check and fix markdown formatting issues with markdownlint-cli2

How to use this skill

Skill file

Check markdown files for formatting and style issues using markdownlint-cli2.

When to use this skill:

AI auto-invocation:

The model should automatically invoke this skill:

Arguments

If no arguments provided, runs in check-only mode.

What it does

  1. Check mode (default): Reports errors without modifying files
  2. Fix mode (--fix): Automatically fixes issues like:

Note: Not all errors are auto-fixable. Some require manual intervention (like choosing the right language tag for a code block).

Configuration

The project uses .markdownlint-cli2.jsonc for configuration:

Strict rules (must follow):

Lenient rules:

CRITICAL — Configuration is non-negotiable:

If linting fails, fix the markdown — do not weaken the linter. Quality checks

protect learning quality for all users.

Common errors and fixes

MD040: Missing language tag on code block

Error:

README.md:45 MD040/fenced-code-language Fenced code blocks should have a language specified

Problem: Code block missing language identifier:

some code here

Fix: Add appropriate language tag:

some code here

Common tags:

Nested code blocks: When showing a code block inside a code block (like in documentation), use 4 backticks for the outer fence:

Example

code here

MD060: Table columns should have consistent alignment

Error:

README.md:80 MD060/table-column-count Table row column count

Problem: Table rows have different numbers of columns, or alignment is inconsistent.

Fix: Ensure all rows have the same number of columns:

| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |

Running the skill

Check for errors

/dev-markdown-lint

Or manually:

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

Auto-fix issues

/dev-markdown-lint --fix

Or manually:

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

Workflow

Before committing

Always run markdown linting before creating a commit with markdown changes:

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

If errors are found:

  1. Try auto-fix: npx markdownlint-cli2 --fix "**/*.md"
  2. Review remaining errors and fix manually
  3. Re-run to verify: npx markdownlint-cli2 "**/*.md"

In CI

The .github/workflows/markdown-lint.yml workflow runs automatically on:

If CI fails, run the linter locally to see the errors.

Implementation

When this skill is invoked:

  1. Parse arguments:
  1. Run markdownlint-cli2:

```bash

npx markdownlint-cli2 [--fix] "*/.md"

```

  1. Interpret results:
  1. Report to user:
  1. Next steps:

Tips

Example output

All files pass:

markdownlint-cli2 v0.20.0 (markdownlint v0.40.0)
Finding: **/*.md
Linting: 20 file(s)
Summary: 0 error(s)

Errors found:

markdownlint-cli2 v0.20.0 (markdownlint v0.40.0)
Finding: **/*.md
Linting: 20 file(s)
README.md:45 MD040/fenced-code-language Fenced code blocks should have a language specified
lessons/math/01-vectors/README.md:180 MD040/fenced-code-language Fenced code blocks should have a language specified
common/math/DESIGN.md:85 MD040/fenced-code-language Fenced code blocks should have a language specified
Summary: 3 error(s)

Related documentation

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.