BA

baoyu-format-markdown

Automatically formats markdown and plain text for readability. Adds structure without altering your original content.

Install

mkdir -p .claude/skills/baoyu-format-markdown && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1103" && unzip -o skill.zip -d .claude/skills/baoyu-format-markdown && rm skill.zip

Installs to .claude/skills/baoyu-format-markdown

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
255 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Beginner

Key capabilities

  • Adds frontmatter and structured headers to markdown
  • Normalizes list structures and bold styling
  • Applies CJK spacing standards for readability
  • Replaces ASCII quotes with fullwidth counterparts
  • Generates formatted output to new file destinations

How it works

Runs remark-based scripts to process document styling, spacing, and metadata without modifying the core content.

Inputs & outputs

You give it
Raw markdown or plain text
You get back
A prettified, formatted markdown file

When to use baoyu-format-markdown

  • Format raw documentation
  • Beautify a blog draft
  • Add structured headings to plain text
  • Clean up markdown syntax

About this skill

Markdown Formatter

Transforms plain text or markdown into well-structured, reader-friendly markdown. The goal is to help readers quickly grasp key points, highlights, and structure — without changing any original content.

Core principle: Only adjust formatting and fix obvious typos. Never add, delete, or rewrite content.

User Input Tools

When this skill prompts the user, follow this tool-selection rule (priority order):

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.
  2. Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.
  3. Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.

Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.

Script Directory

Scripts in scripts/ subdirectory. {baseDir} = this SKILL.md's directory path. Resolve ${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bun. Replace {baseDir} and ${BUN_X} with actual values.

ScriptPurpose
scripts/main.tsMain entry point with CLI options (uses remark-cjk-friendly for CJK emphasis)
scripts/quotes.tsReplace ASCII quotes with fullwidth quotes
scripts/autocorrect.tsAdd CJK/English spacing via autocorrect

Preferences (EXTEND.md)

Check EXTEND.md in priority order — the first one found wins:

PriorityPathScope
1.baoyu-skills/baoyu-format-markdown/EXTEND.mdProject
2${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-format-markdown/EXTEND.mdXDG
3$HOME/.baoyu-skills/baoyu-format-markdown/EXTEND.mdUser home

If none found, use defaults — no first-time setup required for this skill.

EXTEND.md supports:

SettingValuesDefaultDescription
auto_selecttrue/falsefalseSkip both title and summary selection, auto-pick best
auto_select_titletrue/falsefalseSkip title selection only
auto_select_summarytrue/falsefalseSkip summary selection only
OtherDefault formatting options, typography preferences

Usage

The workflow has two phases: Analyze (understand the content) then Format (apply formatting). Claude performs content analysis and formatting (Steps 1-5), then runs the script for typography fixes (Step 6).

Workflow

Step 1: Read & Detect Content Type

Read the user-specified file, then detect content type:

IndicatorClassification
Has --- YAML frontmatterMarkdown
Has #, ##, ### headingsMarkdown
Has **bold**, *italic*, lists, code blocks, blockquotesMarkdown
None of abovePlain text

If Markdown detected, use AskUserQuestion to ask:

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

1. Optimize formatting (Recommended)
   - Analyze content, improve headings, bold, lists for readability
   - Run typography script (spacing, emphasis fixes)
   - Output: {filename}-formatted.md

2. Keep original formatting
   - Preserve existing markdown structure
   - Run typography script only
   - 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 (full workflow)
  • Keep original: Skip to Step 5, copy file then run Step 6
  • Typography only: Skip to Step 6, run on original file directly

Step 2: Analyze Content (Reader's Perspective)

Read the entire content carefully. Think from a reader's perspective: what would help them quickly understand and remember the key information?

Produce an analysis covering these dimensions:

2.1 Highlights & Key Insights

  • Core arguments or conclusions the author makes
  • Surprising facts, data points, or counterintuitive claims
  • Memorable quotes or well-phrased sentences (golden quotes)

2.2 Structure Assessment

  • Does the content have a clear logical flow? What is it?
  • Are there natural section boundaries that lack headings?
  • Are there long walls of text that could benefit from visual breaks?

2.3 Reader-Important Information

  • Actionable advice or takeaways
  • Definitions, explanations of key concepts
  • Lists or enumerations buried in prose
  • Comparisons or contrasts that would be clearer as tables

2.4 Formatting Issues

  • Missing or inconsistent heading hierarchy
  • Paragraphs that mix multiple topics
  • Parallel items written as prose instead of lists
  • Code, commands, or technical terms not marked as code
  • Obvious typos or formatting errors

Save analysis to file: {original-filename}-analysis.md

The analysis file serves as the blueprint for Step 3. Use this format:

# Content Analysis: {filename}

## Highlights & Key Insights
- [list findings]

## Structure Assessment
- Current flow: [describe]
- Suggested sections: [list heading candidates with brief rationale]

## Reader-Important Information
- [list actionable items, key concepts, buried lists, potential tables]

## Formatting Issues
- [list specific issues with location references]

## Typos Found
- [list any obvious typos with corrections, or "None found"]

Step 3: Check/Create Frontmatter, Title & Summary

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

FieldProcessing
titleSee Title Generation below
slugInfer from file path or generate from title
summaryOne-sentence concise summary (see Summary Generation below)
descriptionLonger descriptive summary (see Summary Generation below)
coverImageCheck if imgs/cover.png exists in same directory; if so, use relative path

Title Generation

Whether or not a title already exists, run the title optimization flow unless auto_select_title is set.

Preparation — read the full text and extract:

  • Core argument (one sentence: "what is this article about?")
  • Most impactful opinion or conclusion
  • Reader pain point or curiosity trigger
  • Most memorable metaphor or golden quote

Generate candidates using formulas from references/title-formulas.md:

  1. Select the 2-3 best-matching hook formulas based on the article's content, tone, and structure (see "When to pick each formula" in the reference)
  2. Generate 1-2 straightforward titles (descriptive or declarative, no formula — clear and accurate)
  3. If the user specifies a direction (e.g., "make it suspenseful"), prioritize that direction
  4. Total: 4-5 candidates

Present via AskUserQuestion:

Pick a title:

1. [Hook title A] — (recommended) [formula name]
2. [Hook title B] — [formula name]
3. [Hook title C] — [formula name]
4. [Straightforward title D] — straightforward
5. [Straightforward title E] — straightforward

Enter number, or type a custom title:

Put the strongest hook first and mark it (recommended). See references/title-formulas.md for principles and prohibited patterns.

If the first line is an H1, extract it to frontmatter and remove it from the body. If frontmatter already has a title, include it as context but still generate fresh candidates — the existing title may be weak.

Skip behavior: If auto_select: true or auto_select_title: true, skip the user prompt and use the top candidate directly.

Summary Generation

Generate two versions directly (no user selection), both stored in frontmatter:

FieldLengthPurpose
summary1 sentence, ~50-80 charsConcise hook — for feeds, social sharing, SEO meta
description2-3 sentences, ~100-200 charsRicher context — for article previews, newsletter blurbs

Principles:

  • Convey core value to the reader, not just the topic
  • Use concrete details (numbers, outcomes, specific methods) over vague descriptions
  • summary should be punchy and self-contained; description can expand with supporting details
  • If frontmatter already has summary or description, keep the existing one and only generate the missing field

Prohibited patterns:

  • "This article introduces...", "This article explores..."
  • Pure topic description without value proposition
  • Repeating the title in different words

Once the title is in frontmatter, the body should NOT contain an H1 (avoid duplication).

Step 4: Format Content

Apply formatting guided by the Step 2 analysis. The goal is making the content scannable and the key points impossible to miss.

Formatting toolkit:

ElementWhen to useFormat
HeadingsNatural topic boundaries, section breaks##, ### hierarchy
BoldKey conclusions, important terms, core takeaways**bold**
Unordered listsParallel items, feature lists, examples- item
Ordered listsSequential steps, ranked items, procedures1. item
TablesComparisons, structured data, option matricesMarkdown table
CodeCommands, file paths, technical terms, variable names`inline` or fenced blocks
BlockquotesNotable quotes, important warnings, cited text> quote
SeparatorsMajor topic transitions---

Formatting principles — what NOT to do:

  • Do NOT add sentences, explanations, or commentary
  • Do NOT delete or shorten any content
  • Do NOT rephrase or rewrite the author's words
  • Do NOT add headings that editorialize (e.g., "Amazing Discovery" — use neutral descriptive headings)
  • Do NOT over-format: not every sentence nee

Content truncated.

When not to use it

  • For obfuscated or minified code files
  • When existing document structure must remain strictly untouched

Prerequisites

bunnpx

Limitations

  • Cannot improve the quality of original prose
  • Might break deeply nested or non-standard markdown syntax
  • Formatting logic is restricted by defined script capabilities

How it compares

It uses CJK-specific typography rules that standard formatters typically ignore.

Compared to similar skills

baoyu-format-markdown side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
baoyu-format-markdown (this skill)73moReviewBeginner
ml-paper-writing486moReviewAdvanced
docs-review107moNo flagsBeginner
claude-md-improver216moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

baoyu-xhs-images

JimLiu

Generates Xiaohongshu (Little Red Book) infographic series with 10 visual styles and 8 layouts. Breaks content into 1-10 cartoon-style images optimized for XHS engagement. Use when user mentions "小红书图片", "XHS images", "RedNote infographics", "小红书种草", or wants social media infographics for Chinese platforms.

2051

baoyu-article-illustrator

JimLiu

Analyzes article structure, identifies positions requiring visual aids, generates illustrations with Type × Style two-dimension approach. Use when user asks to "illustrate article", "add images", "generate images for article", or "为文章配图".

1848

baoyu-comic

JimLiu

Knowledge comic creator supporting multiple art styles and tones. Creates original educational comics with detailed panel layouts and sequential image generation. Use when user asks to create "知识漫画", "教育漫画", "biography comic", "tutorial comic", or "Logicomix-style comic".

1329

baoyu-infographic

JimLiu

Generates professional infographics with 20 layout types and 17 visual styles. Analyzes content, recommends layout×style combinations, and generates publication-ready infographics. Use when user asks to create "infographic", "信息图", "visual summary", or "可视化".

1230

baoyu-compress-image

JimLiu

Compresses images to WebP (default) or PNG with automatic tool selection. Use when user asks to "compress image", "optimize image", "convert to webp", or reduce image file size.

1129

baoyu-cover-image

JimLiu

Generates article cover images with 5 dimensions (type, palette, rendering, text, mood) combining 9 color palettes and 6 rendering styles. Supports cinematic (2.35:1), widescreen (16:9), and square (1:1) aspects. Use when user asks to "generate cover image", "create article cover", or "make cover".

1020

You might also like

ml-paper-writing

davila7

Write publication-ready ML/AI papers for NeurIPS, ICML, ICLR, ACL, AAAI, COLM. Use when drafting papers from research repos, structuring arguments, verifying citations, or preparing camera-ready submissions. Includes LaTeX templates, reviewer guidelines, and citation verification workflows.

4897

docs-review

metabase

Review documentation changes for compliance with the Metabase writing style guide. Use when reviewing pull requests, files, or diffs containing documentation markdown files.

1085

claude-md-improver

anthropics

Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project memory optimization".

2167

write-docs

tldraw

Writing SDK documentation for tldraw. Use when creating new documentation articles, updating existing docs, or when documentation writing guidance is needed. Applies to docs in apps/docs/content/.

665

update-docs

vercel

This skill should be used when the user asks to "update documentation for my changes", "check docs for this PR", "what docs need updating", "sync docs with code", "scaffold docs for this feature", "document this feature", "review docs completeness", "add docs for this change", "what documentation is affected", "docs impact", or mentions "docs/", "docs/01-app", "docs/02-pages", "MDX", "documentation update", "API reference", ".mdx files". Provides guided workflow for updating Next.js documentation based on code changes.

2543

wiki-architect

microsoft

Analyzes code repositories and generates hierarchical documentation structures with onboarding guides. Use when the user wants to create a wiki, generate documentation, map a codebase structure, or understand a project's architecture at a high level.

1144

Search skills

Search the agent skills registry