Token导航 LogoToken导航

Agent Skill · 研究检索

markdown-content-formatter(Markdown 内容格式化工具)

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

markdown-content-formatter 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 38,803。

总安装 1,508周安装 61GitHub Stars 53下载 473核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/dkyazzentwatwa/chatgpt-skills --skill markdown-content-formatter

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

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

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/markdown-content-formatter

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dkyazzentwatwa/chatgpt-skills --skill markdown…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

markdown-content-formatter 怎么安装?

在终端执行 npx skills add https://github.com/dkyazzentwatwa/chatgpt-skills --skill markdown-content-f…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

markdown-content-formatter 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

markdown-content-formatter 需要什么权限?

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

markdown-content-formatter 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

markdown-content-formatter 用的人多吗?

公开数据是累计安装 1,508 次,近一周安装 61 次,下载 473 次,GitHub 53 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

markdown-content-formatter 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
markdown-content-formatter

Markdown 内容格式化工具 · 本页

1,50853需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Markdown Content Formatter

Structure, validate, and format long-form markdown content for documentation, blogs, and static site generators. Auto-generate tables of contents, add frontmatter, validate structure, and convert between markdown flavors.

Workflow

The markdown formatting process follows these steps:

  1. Load - Read markdown file or content
  2. Validate - Check heading hierarchy, broken links, structure issues
  3. Format - Apply formatting rules (spacing, code blocks, etc.)
  4. Generate - Add TOC, frontmatter, cross-references
  5. Export - Save in target markdown flavor

Quick Start

from scripts.markdown_formatter import MarkdownFormatter

# Load and format markdown
formatter = MarkdownFormatter(file_path='document.md')

# Generate table of contents
toc = formatter.generate_toc(max_depth=3)

# Validate structure
validation = formatter.validate_structure()
if not validation['valid']:
    print("Issues found:")
    for error in validation['errors']:
        print(f"  - {error['message']}")

# Add frontmatter
formatter.add_frontmatter({
    'title': 'My Document',
    'author': 'John Doe',
    'date': '2024-01-15'
})

# Export formatted version
formatter.export(
    output_path='formatted.md',
    include_toc=True,
    target_flavor='github'
)

Formatting Operations

1. Table of Contents Generation

Auto-generate TOC from document heading structure:

  • Customizable depth (H2, H3, etc.)
  • GitHub-style anchor links
  • Numbered or bulleted format
  • Smart indentation based on heading levels

2. Frontmatter Management

Add YAML/TOML/JSON frontmatter for static site generators:

  • YAML (---) for Jekyll/Hugo
  • TOML (+++) for Hugo
  • JSON for custom parsers
  • Structured metadata (title, author, date, tags, etc.)

3. Structure Validation

Check document structure for common issues:

  • Heading hierarchy - Detect skipped levels (H2 → H4)
  • Broken links - Find invalid internal (#anchors) and external links
  • Duplicate headings - Identify heading ID conflicts
  • Missing elements - Check for required sections

4. Code Block Formatting

Enhance code blocks with syntax highlighting markers:

  • Add language tags to fenced code blocks
  • Convert indented code to fenced blocks
  • Default language specification
  • Consistent formatting

5. Cross-Reference Linking

Auto-link headings and create cross-references:

  • Generate unique heading IDs
  • Link section mentions (e.g., "see Introduction")
  • Create anchor links for internal navigation
  • Handle duplicate heading names

6. Spacing and Consistency

Apply consistent formatting rules:

  • Line breaks around headings
  • List formatting (bullets, numbers)
  • Code block spacing
  • Paragraph breaks
  • Horizontal rules

7. Flavor Conversion

Convert between markdown flavors:

  • GitHub Flavored Markdown - Task lists, tables, syntax highlighting
  • CommonMark - Standard specification
  • Jekyll - Liquid templates, includes
  • Hugo - Shortcodes, taxonomies

Validation Checks

The validator identifies these common issues:

Issue TypeDescriptionExample
Heading SkipLevel jumps (H2 → H4)Missing H3 between H2 and H4
Broken LinkInvalid internal/external link[link](#missing-section)
Duplicate HeadingSame heading appears multiple timesTwo "Introduction" headings
Missing IDHeading lacks unique identifierAnchor link fails
Invalid StructureIncorrect nesting or formattingList inside heading

API Reference

MarkdownFormatter

Initialization:

formatter = MarkdownFormatter(
    file_path='document.md',  # OR
    content='# Markdown text...'
)

Parameters:

  • file_path (str): Path to markdown file (optional)
  • content (str): Direct markdown content (optional)

One of file_path or content must be provided.

Table of Contents

generate_toc()
toc = formatter.generate_toc(
    max_depth=3,        # Max heading level (1-6)
    start_level=2,      # Start from H2 (skip H1)
    style='github'      # 'github', 'numbered', 'bullets'
)

Returns: TOC markdown string

Styles:

  • github - Bulleted list with anchor links
  • numbered - Numbered outline
  • bullets - Simple bullet list

Example Output (github style):

## Table of Contents

- [Introduction](#introduction)
- [Getting Started](#getting-started)
  - [Installation](#installation)
  - [Configuration](#configuration)
- [Advanced Topics](#advanced-topics)

Frontmatter

add_frontmatter()
content = formatter.add_frontmatter(
    metadata={
        'title': 'Document Title',
        'author': 'John Doe',
        'date': '2024-01-15',
        'tags': ['markdown', 'documentation']
    },
    format='yaml'  # 'yaml', 'toml', or 'json'
)

Returns: Markdown content with frontmatter prepended

Example Output (YAML):

---
title: Document Title
author: John Doe
date: 2024-01-15
tags:
  - markdown
  - documentation
---

Validation

validate_structure()
result = formatter.validate_structure()

Returns: Dictionary with validation results

{
    'valid': bool,
    'errors': [
        {
            'type': 'heading_skip',
            'line': 45,
            'message': 'Heading level jumps from H2 to H4'
        }
    ],
    'warnings': [
        {
            'type': 'duplicate_heading',
            'line': 120,
            'message': 'Heading "Introduction" appears multiple times'
        }
    ]
}

Code Blocks

format_code_blocks()
content = formatter.format_code_blocks(
    add_language_tags=True,
    default_language='text'
)

Returns: Markdown with formatted code blocks

Converts:

    code here

To:

code here

Cross-References

auto_link_headings()
content = formatter.auto_link_headings()

Returns: Markdown with heading IDs and cross-reference links

Generates GitHub-style anchors:

  • # Getting Started → <a id="getting-started"></a>
  • Links "see Getting Started" → [Getting Started](#getting-started)

Spacing

fix_spacing()
content = formatter.fix_spacing()

Returns: Markdown with consistent spacing

Applies rules:

  • 2 blank lines before H1
  • 1 blank line before H2-H6
  • 1 blank line around code blocks
  • 1 blank line around lists

Flavor Conversion

convert_to_flavor()
content = formatter.convert_to_flavor(target='jekyll')

Parameters:

  • target (str): 'github', 'commonmark', 'jekyll', or 'hugo'

Returns: Converted markdown string

Export

export()
formatter.export(
    output_path='formatted.md',
    include_toc=True,
    include_frontmatter=True,
    target_flavor='github'
)

Parameters:

  • output_path (str): Output file path
  • include_toc (bool): Add TOC at beginning
  • include_frontmatter (bool): Preserve/add frontmatter
  • target_flavor (str): Target markdown flavor

CLI Usage

Generate TOC

python scripts/markdown_formatter.py \
    --input document.md \
    --toc \
    --toc-depth 3 \
    --toc-style github \
    --output formatted.md

Add Frontmatter

# From command line
python scripts/markdown_formatter.py \
    --input document.md \
    --frontmatter title="My Doc" author="John Doe" date="2024-01-15" \
    --output formatted.md

# From file
python scripts/markdown_formatter.py \
    --input document.md \
    --frontmatter-file metadata.yaml \
    --output formatted.md

Validate Structure

python scripts/markdown_formatter.py \
    --input document.md \
    --validate \
    --format json

Output:

{
  "valid": false,
  "errors": [
    {
      "type": "heading_skip",
      "line": 45,
      "message": "Heading level jumps from H2 to H4"
    }
  ],
  "warnings": []
}

Full Formatting

python scripts/markdown_formatter.py \
    --input document.md \
    --toc \
    --frontmatter title="My Doc" \
    --auto-link \
    --fix-spacing \
    --flavor github \
    --output formatted.md

Batch Processing

# Format all markdown files in directory
for file in docs/*.md; do
    python scripts/markdown_formatter.py \
        --input "$file" \
        --toc \
        --fix-spacing \
        --output "formatted/$file"
done

CLI Arguments

ArgumentDescriptionDefault
--input, -iInput markdown fileRequired
--output, -oOutput file pathstdout
--tocGenerate table of contentsFalse
--toc-depthMax TOC depth (1-6)3
--toc-styleTOC style (github/numbered/bullets)github
--frontmatterKey=value pairs for frontmatter-
--frontmatter-fileYAML file with frontmatter-
--auto-linkAuto-link headingsFalse
--fix-spacingFix spacing and formattingFalse
--flavorTarget markdown flavorgithub
--validateValidate structure onlyFalse
--formatOutput format for validation (json/text)text

Examples

Example 1: Auto-Generate TOC

formatter = MarkdownFormatter(file_path='guide.md')
toc = formatter.generate_toc(max_depth=3, style='github')

print(toc)
# ## Table of Contents
# - [Introduction](#introduction)
# - [Setup](#setup)
#   - [Installation](#installation)
#   - [Configuration](#configuration)

Example 2: Add Jekyll Frontmatter

formatter = MarkdownFormatter(file_path='post.md')

formatter.add_frontmatter({
    'layout': 'post',
    'title': 'Getting Started with Markdown',
    'date': '2024-01-15',
    'categories': ['tutorial', 'markdown'],
    'tags': ['beginner', 'documentation']
}, format='yaml')

formatter.export('_posts/2024-01-15-getting-started.md')

Example 3: Validate Document Structure

formatter = MarkdownFormatter(file_path='documentation.md')
result = formatter.validate_structure()

if not result['valid']:
    print("Errors found:")
    for error in result['errors']:
        print(f"Line {error['line']}: {error['message']}")

    print("\nWarnings:")
    for warning in result['warnings']:
        print(f"Line {warning['line']}: {warning['message']}")
else:
    print("Document structure is valid!")

Example 4: Fix Common Issues

formatter = MarkdownFormatter(file_path='messy.md')

# Fix spacing issues
formatter.fix_spacing()

# Format code blocks
formatter.format_code_blocks(default_language='python')

# Add heading IDs
formatter.auto_link_headings()

# Export cleaned version
formatter.export('clean.md', target_flavor='github')

Example 5: Convert for Hugo Static Site

formatter = MarkdownFormatter(file_path='article.md')

# Add Hugo frontmatter
formatter.add_frontmatter({
    'title': 'My Article',
    'date': '2024-01-15T10:00:00Z',
    'draft': False,
    'tags': ['hugo', 'static-site'],
    'categories': ['web-development']
}, format='toml')

# Generate TOC
toc = formatter.generate_toc(max_depth=2)

# Convert to Hugo flavor
formatter.convert_to_flavor('hugo')

# Export
formatter.export(
    output_path='content/posts/my-article.md',
    include_toc=True,
    target_flavor='hugo'
)

Example 6: Batch Validation

# Validate all markdown files
for file in docs/**/*.md; do
    echo "Validating $file..."
    python scripts/markdown_formatter.py \
        --input "$file" \
        --validate \
        --format json > "${file}.validation.json"
done

# Find files with errors
jq -r 'select(.valid == false) | input_filename' docs/**/*.validation.json

Dependencies

markdown>=3.5.0
pyyaml>=6.0.0
beautifulsoup4>=4.12.0
pandas>=2.0.0

Install dependencies:

pip install -r scripts/requirements.txt

Limitations

  • Link Validation: External link checking requires network requests (not performed by default)
  • Markdown Parsing: Uses Python-Markdown library; some edge cases may differ from other parsers
  • Flavor Differences: Not all flavor-specific features are converted (e.g., Hugo shortcodes)
  • Heading Anchors: Anchor generation follows GitHub algorithm but may differ from other platforms
  • Code Language Detection: Automatic language detection is limited; manual tags recommended
  • Large Files: Very large files (>10MB) may be slow to process
  • Unicode: Some unicode characters in heading anchors may cause issues
  • Nested Lists: Complex nested list structures may not format perfectly
  • HTML in Markdown: Raw HTML blocks are preserved but not validated
  • Math Equations: LaTeX math equations are not parsed or validated

Markdown Flavor Notes

GitHub Flavored Markdown (GFM)

  • Task lists: - [] Task / - [x] Done
  • Tables with alignment
  • Strikethrough: ~~text~~
  • Automatic link detection

CommonMark

  • Strict specification adherence
  • No extensions (no task lists, no tables)
  • Predictable parsing

Jekyll

  • Liquid templating: {{variable}}
  • Includes: {% include file.html %}
  • Frontmatter required

Hugo

  • Shortcodes: {{< shortcode >}}
  • TOML frontmatter preferred
  • Taxonomies (tags, categories)
  • Nested sections

平台分布

Claude Code

30.53%
按下载量换算144

OpenCode

21.83%
按下载量换算103

Antigravity

17.17%
按下载量换算81

windsurf

12.92%
按下载量换算61

Codex

7.23%
按下载量换算34

Gemini CLI

3.77%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills