Token导航 LogoToken导航TokenDH.com
开发需要联网clawhub未标认证来源可访问clear审计通过

markdown-formatterMarkdown 格式化工具

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

578,323

周安装

23,170

GitHub Stars

10

下载量

187,214
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:markdown-formatter(Markdown 格式化工具)
来源仓库:https://github.com/michael-laffin/markdown-formatter
安装命令:
openclaw skills install markdown-formatter
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install markdown-formatter

简介

使用可配置的样式格式化和美化 Markdown 文档。保留结构、修复格式、确保一致性。

SKILL.md

name
markdown-formatter
description
Format and beautify markdown documents with configurable styles. Preserve structure, fix formatting, ensure consistency.
metadata

Markdown-Formatter - Beautify Your Markdown

Vernox Utility Skill - Make your markdown look professional.

Overview

Markdown-Formatter is a powerful tool for formatting, linting, and beautifying markdown documents. Supports multiple style guides (CommonMark, GitHub Flavored Markdown, custom rules) and handles everything from simple cleanup to complex reformatting.

Features

✅ Formatter Engine

  • Multiple style guides (CommonMark, GitHub, custom)
  • Preserves document structure
  • Handles nested lists, code blocks, tables
  • Configurable line width and indentation
  • Smart heading normalization
  • Link reference optimization

✅ Linting & Cleanup

  • Remove trailing whitespace
  • Normalize line endings (LF vs CRLF)
  • Fix inconsistent list markers
  • Remove empty lines at end
  • Fix multiple consecutive blank lines

✅ Beautification

  • Improve heading hierarchy
  • Optimize list formatting
  • Format code blocks with proper spacing
  • Wrap long lines at configured width
  • Add proper spacing around emphasis

✅ Validation

  • Check markdown syntax validity
  • Report linting errors
  • Suggest improvements
  • Validate links and references

Installation

clawhub install markdown-formatter

Quick Start

Format a Document

const result = await formatMarkdown({
  markdown: '# My Document\
\
\
## Section 1\
Content here...',
  style: 'github',
  options: {
    maxWidth: 80,
    headingStyle: 'atx'
  }
});

console.log(result.formattedMarkdown);

Beautify Multiple Files

const results = await formatBatch({
  markdownFiles: ['./doc1.md', './doc2.md', './README.md'],
  style: 'github',
  options: { wrapWidth: 80 }
});

results.forEach(result => {
  console.log(`${result.file}: ${result.warnings} warnings`);
});

Lint and Fix

const result = await lintMarkdown({
  markdown: '# My Document\
\
\
Bad list\
\
- item 1\
- item 2',
  style: 'github'
});

console.log(`Errors found: ${result.errors}`);
console.log(`Fixed: ${result.fixed}`);

Tool Functions

formatMarkdown

Format markdown content according to style guide.

Parameters:

  • markdown (string, required): Markdown content to format
  • style (string, required): Style guide name ('commonmark', 'github', 'commonmark', 'custom')
  • options (object, optional):

- maxWidth (number): Line wrap width (default: 80) - headingStyle (string): 'atx' | 'setext' | 'underlined' | 'consistent' (default: 'atx') - listStyle (string): 'consistent' | 'dash' | 'asterisk' | 'plus' (default: 'consistent') - codeStyle (string): 'fenced' | 'indented' (default: 'fenced') - emphasisStyle (string): 'underscore' | 'asterisk' (default: 'asterisk') - strongStyle (string): 'asterisk' | 'underline' (default: 'asterisk') - linkStyle (string): 'inline' | 'reference' | 'full' (default: 'inline') - preserveHtml (boolean): Keep HTML as-is (default: false) - fixLists (boolean): Fix inconsistent list markers (default: true) - normalizeSpacing (boolean): Fix spacing around formatting (default: true)

Returns:

  • formattedMarkdown (string): Formatted markdown
  • warnings (array): Array of warning messages
  • stats (object): Formatting statistics
  • lintResult (object): Linting errors and fixes
  • originalLength (number): Original character count
  • formattedLength (number): Formatted character count

formatBatch

Format multiple markdown files at once.

Parameters:

  • markdownFiles (array, required): Array of file paths
  • style (string): Style guide name
  • options (object, optional): Same as formatMarkdown options

Returns:

  • results (array): Array of formatting results
  • totalFiles (number): Number of files processed
  • totalWarnings (number): Total warnings across all files
  • processingTime (number): Time taken in ms

lintMarkdown

Check markdown for issues without formatting.

Parameters:

  • markdown (string, required): Markdown content to lint
  • style (string): Style guide name
  • options (object, optional): Additional linting options

- checkLinks (boolean): Validate links (default: true) - checkHeadingLevels (boolean): Check heading hierarchy (default: true) - checkListConsistency (boolean): Check list marker consistency (default: true) - checkEmphasisBalance (boolean): Check emphasis pairing (default: false)

Returns:

  • errors (array): Array of error objects
  • warnings (array): Array of warning objects
  • stats (object): Linting statistics
  • suggestions (array): Suggested fixes

Style Guides

CommonMark (default)

  • Standard CommonMark specification
  • ATX headings (ATX-style)
  • Reference-style links [text]
  • Underscore emphasis
  • Asterisk emphasis

GitHub Flavored Markdown

  • Fenced code blocks with \\\`
  • Tables with pipes
  • Task lists [ ] with x
  • Strikethrough ~~text~~
  • Autolinks with <https://url>

Consistent (default)

  • Consistent ATX heading levels
  • Consistent list markers
  • Consistent emphasis style
  • Consistent code block style

Custom

  • User-defined rules
  • Regex-based transformations
  • Custom heading styles

Use Cases

Documentation Cleanup

  • Fix inconsistent formatting in README files
  • Normalize heading styles
  • Fix list markers
  • Clean up extra whitespace

Content Creation

  • Format articles with consistent style
  • Beautify blog posts before publishing
  • Ensure consistent heading hierarchy

Technical Writing

  • Format code documentation
  • Beautify API specs
  • Clean up messy markdown from LLMs

README Generation

  • Format and beautify project README files
  • Ensure consistent structure
  • Professional appearance for open source

Markdown Conversion

  • Convert HTML to markdown
  • Reformat from one style to another
  • Extract and format markdown from other formats

Configuration

Edit config.json:

{
  "defaultStyle": "github",
  "maxWidth": 80,
  "headingStyle": "atx",
  "listStyle": "consistent",
  "codeStyle": "fenced",
  "emphasisStyle": "asterisk",
  "linkStyle": "inline",
  "customRules": [],
  "linting": {
    "checkLinks": true,
    "checkHeadingLevels": true,
    "checkListConsistency": true
  }
}

Examples

Simple Formatting

const result = await formatMarkdown({
  markdown: '# My Title\
\
\
This is content.',
  style: 'github'
});

console.log(result.formattedMarkdown);

Complex Beautification

const result = await formatMarkdown({
  markdown: '# Header 1\
## Header 2\
\
Paragraph...',
  style: 'github',
  options: {
    fixLists: true,
    normalizeSpacing: true,
    wrapWidth: 80
  }
});

console.log(result.formattedMarkdown);

Linting and Fixing

const result = await lintMarkdown({
  markdown: '# Title\
\
- Item 1\
- Item 2\
\
## Section 2',
  style: 'github'
});

console.log(`Errors: ${result.errors.length}`);
result.errors.forEach(err => {
  console.log(`  - ${err.message} at line ${err.line}`);
});

// Fix automatically
const fixed = await formatMarkdown({
  markdown: result.fixed,
  style: 'github'
});

Batch Processing

const results = await formatBatch({
  markdownFiles: ['./doc1.md', './doc2.md', './README.md'],
  style: 'github'
});

console.log(`Processed ${results.totalFiles} files`);
console.log(`Total warnings: ${results.totalWarnings}`);

Performance

Speed

  • Small documents (<1000 words): <50ms
  • Medium documents (1000-5000 words): 50-200ms
  • Large documents (5000+ words): 200-500ms

Accuracy

  • Structure preservation: 100%
  • Style guide compliance: 95%+
  • Whitespace normalization: 100%

Error Handling

Invalid Input

  • Clear error message
  • Suggest checking file path
  • Validate markdown content before formatting

Markdown Parsing Errors

  • Report parsing issues clearly
  • Suggest manual fixes
  • Graceful degradation on errors

File I/O Errors

  • Clear error with file path
  • Check file existence
  • Suggest permissions fix
  • Batch processing continues on errors

Troubleshooting

Format Not Applied

  • Check if style is correct
  • Verify options are respected
  • Check for conflicting rules
  • Test with simple example

Linting Shows Too Many Errors

  • Some errors are style choices, not real issues
  • Consider disabling specific checks
  • Use custom rules for specific needs

Tips

Best Results

  • Use consistent style guide
  • Enable fixLists, normalizeSpacing options
  • Set maxWidth appropriate for your output medium
  • Test on small samples first

Performance Optimization

  • Process large files in batches
  • Disable unused linting checks
  • Use simpler rules for common patterns

License

MIT


Format markdown. Keep your docs beautiful. 🔮

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

87.85%
按下载量换算164,467

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills