markdown-formatter
Format and lint Markdown documents with consistent style, proper heading hierarchy, link validation, and code block formatting. Use when working with Markdown files, documentation, README files, or technical writing. Checks for common issues like broken links, inconsistent formatting, and missing alt text. Triggers on "format markdown", "lint markdown", "markdown style", ".md file", "documentation formatting".
When & Why to Use This Skill
The Markdown Formatter skill is a specialized tool designed to automate the linting, styling, and structural validation of Markdown documents. It ensures professional-grade documentation by enforcing consistent heading hierarchies, standardizing code block formatting, and validating internal links. By identifying common errors such as broken links and missing image alt text, it helps developers and technical writers maintain high-quality, accessible, and SEO-optimized content with minimal manual effort.
Use Cases
- Standardizing Project READMEs: Automatically apply consistent styling and structure to GitHub or GitLab README files to ensure a professional and readable project overview.
- Documentation Quality Control: Scan extensive documentation sets to detect and repair broken links, improper heading nesting, and missing accessibility features like image alt text.
- Technical Content Preparation: Format technical blog posts and articles to ensure code blocks are correctly tagged and the overall layout adheres to industry-standard style guides.
- Automated Style Enforcement: Maintain a unified documentation style across team-contributed wikis by standardizing list indentations, link styles, and line lengths.
| name | markdown-formatter |
|---|---|
| description | Format and lint Markdown documents with consistent style, proper heading hierarchy, link validation, and code block formatting. Use when working with Markdown files, documentation, README files, or technical writing. Checks for common issues like broken links, inconsistent formatting, and missing alt text. Triggers on "format markdown", "lint markdown", "markdown style", ".md file", "documentation formatting". |
Markdown Formatter
Purpose
Format and lint Markdown documents to ensure consistent style, proper structure, and best practices.
When to Use
- Formatting Markdown documentation
- Linting README files
- Checking markdown syntax
- Validating links in documentation
- Ensuring consistent style across docs
Core Instructions
- Read File: Load the Markdown file
- Check Syntax: Validate Markdown syntax
- Format: Apply consistent formatting
- Heading hierarchy (h1 -> h2 -> h3, no skips)
- List indentation (2 spaces)
- Code block language tags
- Link format consistency
- Validate: Check for common issues
- Broken internal links
- Missing alt text on images
- Empty links
- Output: Write formatted file or report issues
Formatting Rules
- Headings: ATX style (
#,##,###) - Lists: 2-space indentation for nested items
- Code blocks: Always specify language
- Links: Use reference style for repeated links
- Line length: 80-120 characters (guidance)
Example Pattern
# Main Title
## Section
### Subsection
Regular paragraph text.
- List item 1
- Nested item
- List item 2
```python
def example():
return "formatted"
## Dependencies
- Markdown parser (built-in)
- No external dependencies required
## Version
v1.0.0