Format and beautify markdown documents with configurable styles. Preserve structure, fix formatting, ensure consistency.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install markdown-formatter或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install markdown-formatter⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/markdown-formatter/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: markdown-formatter description: Format and beautify markdown documents with configurable styles. Preserve structure, fix formatting, ensure consistency. metadata: { "openclaw": { "version": "1.0.0", "author": "Vernox", "license": "MIT", "tags": ["markdown", "formatter", "beautifier", "text", "formatting", "documentation"], "category": "tools" } } ---
Vernox Utility Skill - Make your markdown look professional.
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.
clawhub install markdown-formatter
const result = await formatMarkdown({
markdown: '# My Document\n\n\n## Section 1\nContent here...',
style: 'github',
options: {
maxWidth: 80,
headingStyle: 'atx'
}
});
console.log(result.formattedMarkdown);
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`);
});
const result = await lintMarkdown({
markdown: '# My Document\n\n\nBad list\n\n- item 1\n- item 2',
style: 'github'
});
console.log(`Errors found: ${result.errors}`);
console.log(`Fixed: ${result.fixed}`);
formatMarkdownFormat markdown content according to style guide.
Parameters:
markdown (string, required): Markdown content to formatstyle (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 markdownwarnings (array): Array of warning messagesstats (object): Formatting statisticslintResult (object): Linting errors and fixesoriginalLength (number): Original character countformattedLength (number): Formatted character countformatBatchFormat multiple markdown files at once.
Parameters:
markdownFiles (array, required): Array of file pathsstyle (string): Style guide nameoptions (object, optional): Same as formatMarkdown optionsReturns:
results (array): Array of formatting resultstotalFiles (number): Number of files processedtotalWarnings (number): Total warnings across all filesprocessingTime (number): Time taken in mslintMarkdownCheck markdown for issues without formatting.
Parameters:
markdown (string, required): Markdown content to lintstyle (string): Style guide nameoptions (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 objectswarnings (array): Array of warning objectsstats (object): Linting statisticssuggestions (array): Suggested fixes\\`~~text~~config.json:{
"defaultStyle": "github",
"maxWidth": 80,
"headingStyle": "atx",
"listStyle": "consistent",
"codeStyle": "fenced",
"emphasisStyle": "asterisk",
"linkStyle": "inline",
"customRules": [],
"linting": {
"checkLinks": true,
"checkHeadingLevels": true,
"checkListConsistency": true
}
}
const result = await formatMarkdown({
markdown: '# My Title\n\n\nThis is content.',
style: 'github'
});
console.log(result.formattedMarkdown);
const result = await formatMarkdown({
markdown: '# Header 1\n## Header 2\n\nParagraph...',
style: 'github',
options: {
fixLists: true,
normalizeSpacing: true,
wrapWidth: 80
}
});
console.log(result.formattedMarkdown);
const result = await lintMarkdown({
markdown: '# Title\n\n- Item 1\n- Item 2\n\n## 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'
});
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}`);
...
安装 Markdown Formatter 后,可以对 AI 说这些话来触发它
Help me get started with Markdown Formatter
Explains what Markdown Formatter does, walks through the setup, and runs a quick demo based on your current project
Use Markdown Formatter to format and beautify markdown documents with configurable styles
Invokes Markdown Formatter with the right parameters and returns the result directly in the conversation
What can I do with Markdown Formatter in my developer & devops workflow?
Lists the top use cases for Markdown Formatter, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/markdown-formatter/ 目录(个人级,所有项目可用),或 .claude/skills/markdown-formatter/(项目级)。重启 AI 客户端后,用 /markdown-formatter 主动调用,或让 AI 根据上下文自动发现并使用。
Markdown Formatter 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Markdown Formatter 可免费安装使用。请查阅仓库了解许可证信息。
Format and beautify markdown documents with configurable styles. Preserve structure, fix formatting, ensure consistency.
Markdown Formatter 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Markdown Formatter
Identifies repetitive steps in your workflow and sets up Markdown Formatter to handle them automatically