jpskill.com
✍️ ライティング コミュニティ

baoyu-format-markdown

プレーンテキストやMarkdownファイルを、冒頭情報、タイトル、要約、見出し、強調、リスト、コードブロックなどで美しく整え、記事のレイアウトを改善して、読みやすく魅力的なドキュメントを作成するSkill。

📜 元の英語説明(参考)

Formats plain text or markdown files with frontmatter, titles, summaries, headings, bold, lists, and code blocks. Use when user asks to "format markdown", "beautify article", "add formatting", or improve article layout. Outputs to {filename}-formatted.md.

🇯🇵 日本人クリエイター向け解説

一言でいうと

プレーンテキストやMarkdownファイルを、冒頭情報、タイトル、要約、見出し、強調、リスト、コードブロックなどで美しく整え、記事のレイアウトを改善して、読みやすく魅力的なドキュメントを作成するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o baoyu-format-markdown.zip https://jpskill.com/download/19386.zip && unzip -o baoyu-format-markdown.zip && rm baoyu-format-markdown.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19386.zip -OutFile "$d\baoyu-format-markdown.zip"; Expand-Archive "$d\baoyu-format-markdown.zip" -DestinationPath $d -Force; ri "$d\baoyu-format-markdown.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して baoyu-format-markdown.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → baoyu-format-markdown フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
6

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Markdown整形ツール

プレーンテキストまたはMarkdownファイルを、適切なフロントマター、書式設定、およびタイポグラフィを備えた、構造化されたMarkdownに変換します。

スクリプトディレクトリ

スクリプトはscripts/サブディレクトリにあります。${SKILL_DIR}をこのSKILL.mdのディレクトリパスに置き換えてください。

スクリプト 目的
scripts/main.ts CLIオプションを持つメインエントリポイント(CJK強調のためにremark-cjk-friendlyを使用)
scripts/quotes.ts ASCII引用符を全角引用符に置換
scripts/autocorrect.ts オートコレクトを介してCJK/英語のスペースを追加

設定(EXTEND.md)

Bashを使用してEXTEND.mdの存在を確認します(優先順位):

# まずプロジェクトレベルを確認
test -f .baoyu-skills/baoyu-format-markdown/EXTEND.md && echo "project"

# 次にユーザーレベル(クロスプラットフォーム: $HOMEはmacOS/Linux/WSLで動作します)
test -f "$HOME/.baoyu-skills/baoyu-format-markdown/EXTEND.md" && echo "user"

┌──────────────────────────────────────────────────────────┬───────────────────┐ │ パス │ 場所 │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-format-markdown/EXTEND.md │ プロジェクトディレクトリ │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-format-markdown/EXTEND.md │ ユーザーホーム │ └──────────────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 結果 │ アクション │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 見つかった │ 設定を読み込み、解析し、適用する │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 見つからない │ デフォルトを使用する │ └───────────┴───────────────────────────────────────────────────────────────────────────┘

EXTEND.mdがサポートするもの: デフォルトの書式設定オプション | 要約の長さの好み

使用方法

Claudeはコンテンツ分析と書式設定(ステップ1-6)を実行し、その後、タイポグラフィ修正のためにスクリプトを実行します(ステップ7)。

ワークフロー

ステップ1: ソースファイルの読み込み

ユーザーが指定したMarkdownまたはプレーンテキストファイルを読み込みます。

ステップ1.5: コンテンツタイプの検出と確認

コンテンツタイプの検出:

指標 分類
--- YAMLフロントマターがある Markdown
#, ##, ### 見出しがある Markdown
**太字**, *斜体* がある Markdown
- または 1. リストがある Markdown
``` コードブロックがある Markdown
> 引用ブロックがある Markdown
上記のいずれでもない プレーンテキスト

決定フロー:

┌─────────────────┬────────────────────────────────────────────────┐ │ コンテンツタイプ │ アクション │ ├─────────────────┼────────────────────────────────────────────────┤ │ プレーンテキスト │ ステップ2に進む(Markdownに整形) │ ├─────────────────┼────────────────────────────────────────────────┤ │ Markdown │ AskUserQuestionを使用して最適化を確認する │ └─────────────────┴────────────────────────────────────────────────┘

Markdownが検出された場合、ユーザーに質問します:

既存のMarkdown書式が検出されました。どうしますか?

1. 書式を最適化する(推奨)
   - フロントマター、見出し、太字、リストを追加/改善する
   - タイポグラフィスクリプトを実行する(スペース、強調の修正)
   - 出力: {filename}-formatted.md

2. 元の書式を保持する
   - 既存のMarkdown構造を保持する
   - タイポグラフィスクリプトを実行する(スペース、強調の修正)
   - 出力: {filename}-formatted.md

3. タイポグラフィの修正のみ
   - 元のファイルに対してタイポグラフィスクリプトをインプレースで実行する
   - コピーは作成されず、元のファイルを直接変更する

ユーザーの選択に基づいて:

  • 最適化: ステップ2-8に進む(完全なワークフロー)
  • 元の書式を保持: ステップ2-5をスキップし、ファイルをコピー → ステップ6-8(コピーに対してスクリプトを実行)
  • タイポグラフィのみ: ステップ2-6をスキップし、元のファイルに対して直接ステップ7を実行

ステップ2: コンテンツ構造の分析

以下を特定します。

  • 既存のタイトル(H1 #
  • 段落の区切り
  • 太字に適したキーワード
  • リストに変換できる並列コンテンツ
  • コードスニペット
  • 引用

ステップ3: フロントマターの確認/作成

YAMLフロントマター(---ブロック)を確認します。存在しない場合は作成します。

メタフィールドの処理:

フィールド 処理
title ステップ4を参照
slug ファイルパスから推測する(例: posts/2026/01/10/vibe-coding/vibe-coding)またはタイトルから生成する
summary 魅力的な要約を生成する(100-150文字)
coverImage 同じディレクトリにimgs/cover.pngが存在するか確認し、存在する場合は相対パスを使用する(featureImageも受け入れられます)

ステップ4: タイトルの処理

ロジック:

  1. フロントマターにすでにtitleがある場合 → それを使用し、本文にH1は含めない
  2. 最初の行がH1の場合 → フロントマターのtitleとして抽出し、本文からH1を削除する
  3. どちらも存在しない場合 → 候補となるタイトルを生成する

タイトル生成フロー:

  1. コンテンツに基づいて3つの候補タイトルを生成する
  2. AskUserQuestionツールを使用する:
タイトルを選択してください:

1. [タイトルA] (推奨)
2. [タイトルB]
3. [タイトルC]
  1. 数秒以内に選択がない場合、推奨(オプション1)を使用する

タイトルの原則:

  • 簡潔で、最大20文字
  • コアメッセージを捉えている
  • 魅力的で、読者の興味を引く
  • 正確で、クリックベイトを避ける

重要: タイトルがフロントマターにある場合、本文にH1を含めるべきではありません(重複を避けるため)

ステップ5: 書式処理

書式設定ルール:

要素 書式
タイトル #, ##, ### の階層を使用する
キーポイント **太字** を使用する
並列項目 - 順序なしリストまたは 1. 順序付きリストに変換する
コード/コマンド `インライン` または ```ブロック``` を使用する
引用/格言 > 引用ブロックを使用する
区切り線 適切な場所で --- を使用する

書式設定の原則:

  • 元のコンテンツと視点を保持する

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Markdown Formatter

Transforms plain text or markdown files into well-structured markdown with proper frontmatter, formatting, and typography.

Script Directory

Scripts in scripts/ subdirectory. Replace ${SKILL_DIR} with this SKILL.md's directory path.

Script Purpose
scripts/main.ts Main entry point with CLI options (uses remark-cjk-friendly for CJK emphasis)
scripts/quotes.ts Replace ASCII quotes with fullwidth quotes
scripts/autocorrect.ts Add CJK/English spacing via autocorrect

Preferences (EXTEND.md)

Use Bash to check EXTEND.md existence (priority order):

# Check project-level first
test -f .baoyu-skills/baoyu-format-markdown/EXTEND.md && echo "project"

# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-format-markdown/EXTEND.md" && echo "user"

┌──────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-format-markdown/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-format-markdown/EXTEND.md │ User home │ └──────────────────────────────────────────────────────────┴───────────────────┘

┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘

EXTEND.md Supports: Default formatting options | Summary length preferences

Usage

Claude performs content analysis and formatting (Steps 1-6), then runs the script for typography fixes (Step 7).

Workflow

Step 1: Read Source File

Read the user-specified markdown or plain text file.

Step 1.5: Detect Content Type & Confirm

Content Type Detection:

Indicator Classification
Has --- YAML frontmatter Markdown
Has #, ##, ### headings Markdown
Has **bold**, *italic* Markdown
Has - or 1. lists Markdown
Has ``` code blocks Markdown
Has > blockquotes Markdown
None of above Plain text

Decision Flow:

┌─────────────────┬────────────────────────────────────────────────┐ │ Content Type │ Action │ ├─────────────────┼────────────────────────────────────────────────┤ │ Plain text │ Proceed to Step 2 (format to markdown) │ ├─────────────────┼────────────────────────────────────────────────┤ │ Markdown │ Use AskUserQuestion to confirm optimization │ └─────────────────┴────────────────────────────────────────────────┘

If Markdown detected, ask user:

Detected existing markdown formatting. What would you like to do?

1. Optimize formatting (Recommended)
   - Add/improve frontmatter, headings, bold, lists
   - Run typography script (spacing, emphasis fixes)
   - Output: {filename}-formatted.md

2. Keep original formatting
   - Preserve existing markdown structure
   - Run typography script (spacing, emphasis fixes)
   - Output: {filename}-formatted.md

3. Typography fixes only
   - Run typography script on original file in-place
   - No copy created, modifies original file directly

Based on user choice:

  • Optimize: Continue to Step 2-8 (full workflow)
  • Keep original: Skip Steps 2-5, copy file → Step 6-8 (run script on copy)
  • Typography only: Skip Steps 2-6, run Step 7 on original file directly

Step 2: Analyze Content Structure

Identify:

  • Existing title (H1 #)
  • Paragraph separations
  • Keywords suitable for bold
  • Parallel content convertible to lists
  • Code snippets
  • Quotations

Step 3: Check/Create Frontmatter

Check for YAML frontmatter (--- block). Create if missing.

Meta field handling:

Field Processing
title See Step 4
slug Infer from file path (e.g., posts/2026/01/10/vibe-coding/vibe-coding) or generate from title
summary Generate engaging summary (100-150 characters)
coverImage Check if imgs/cover.png exists in same directory; if so, use relative path (also accepted: featureImage)

Step 4: Title Handling

Logic:

  1. If frontmatter already has title → use it, no H1 in body
  2. If first line is H1 → extract to frontmatter title, remove H1 from body
  3. If neither exists → generate candidate titles

Title generation flow:

  1. Generate 3 candidate titles based on content
  2. Use AskUserQuestion tool:
Select a title:

1. [Title A] (Recommended)
2. [Title B]
3. [Title C]
  1. If no selection within a few seconds, use recommended (option 1)

Title principles:

  • Concise, max 20 characters
  • Captures core message
  • Engaging, sparks reading interest
  • Accurate, avoids clickbait

Important: Once title is in frontmatter, body should NOT have H1 (avoid duplication)

Step 5: Format Processing

Formatting rules:

Element Format
Titles Use #, ##, ### hierarchy
Key points Use **bold**
Parallel items Convert to - unordered or 1. ordered lists
Code/commands Use `inline` or ```block```
Quotes/sayings Use > blockquote
Separators Use --- where appropriate

Formatting principles:

  • Preserve original content and viewpoints
  • Add formatting only, do not modify text
  • Formatting serves readability
  • Avoid over-formatting

Step 6: Save Formatted File

Save as {original-filename}-formatted.md

Examples:

  • final.mdfinal-formatted.md
  • draft-v1.mddraft-v1-formatted.md

If user chose "Keep original formatting" (from Step 1.5):

  • Copy original file to {filename}-formatted.md without modifications
  • Proceed to Step 7 for typography fixes only

Backup existing file:

If {filename}-formatted.md already exists, backup before overwriting:

# Check if formatted file exists
if [ -f "{filename}-formatted.md" ]; then
  # Backup with timestamp
  mv "{filename}-formatted.md" "{filename}-formatted.backup-$(date +%Y%m%d-%H%M%S).md"
fi

Example:

  • final-formatted.md exists → backup to final-formatted.backup-20260128-143052.md

Step 7: Execute Text Formatting Script

After saving, must run the formatting script:

npx -y bun ${SKILL_DIR}/scripts/main.ts {output-file-path} [options]

Script Options:

Option Short Description Default
--quotes -q Replace ASCII quotes with fullwidth quotes "..." false
--no-quotes Do not replace quotes
--spacing -s Add CJK/English spacing via autocorrect true
--no-spacing Do not add CJK/English spacing
--emphasis -e Fix CJK emphasis punctuation issues true
--no-emphasis Do not fix CJK emphasis issues
--help -h Show help message

Examples:

# Default: spacing + emphasis enabled, quotes disabled
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md

# Enable all features including quote replacement
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --quotes

# Only fix emphasis issues, skip spacing
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --no-spacing

# Disable all processing except frontmatter formatting
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --no-spacing --no-emphasis

Script performs (based on options):

  1. Fix CJK emphasis/bold punctuation issues (default: enabled)
  2. Add CJK/English mixed text spacing via autocorrect (default: enabled)
  3. Replace ASCII quotes "..." with fullwidth quotes "..." (default: disabled)
  4. Format frontmatter YAML (always enabled)

Step 8: Display Results

**Formatting complete**

File: posts/2026/01/09/example/final-formatted.md

Changes:
- Added title: [title content]
- Added X bold markers
- Added X lists
- Added X code blocks

Formatting Example

Before:

This is plain text. First point is efficiency improvement. Second point is cost reduction. Third point is experience optimization. Use npm install to install dependencies.

After:

---
title: Three Core Advantages
slug: three-core-advantages
summary: Discover the three key benefits that drive success in modern projects.
---

This is plain text.

**Main advantages:**
- Efficiency improvement
- Cost reduction
- Experience optimization

Use `npm install` to install dependencies.

Notes

  • Preserve original writing style and tone
  • Specify correct language for code blocks (e.g., python, javascript)
  • Maintain CJK/English spacing standards
  • Do not add content not present in original

Extension Support

Custom configurations via EXTEND.md. See Preferences section for paths and supported options.

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。