baoyu-format-markdown
Skill0 starsChanged 19 days agoApache-2.0View on GitHub
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.
16 other projects use a version of this, 15 of them edited.
Adopted by
Most recently taken up by
- JimLiu/baoyu-skillsedited, first seen Nov 8, 2026
- AgnesAI-Labs/agnet-skills-cnedited, first seen Nov 1, 2026
- eugeneli326/claude-skillsedited, first seen Oct 13, 2026
- Gopyr/gopyr-skills-hubtheir own version, first seen Oct 11, 2026
- zephyrwang6/myskilledited, first seen Oct 8, 2026
- qihangzhang-272/agent-skill-libraryedited, first seen Oct 2, 2026
Used with
Projects with it also use baoyu-translate and find-skills.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
YuppyChenSkillbaoyu-translate
Translates articles and documents between languages with three modes - quick (direct), normal (analyze then translate), and refined (analyze, translate, review, polish). Supports custom glossaries and terminology consistency via EXTEND.md. Use when user asks to "translate", "翻译", "精翻", "translate article", "translate to Chinese/English", "改成中文", "改成英文", "convert to Chinese", "localize", "本地化", or needs any document translation. Also triggers for "refined translation", "精细翻译", "proofread translation", "快速翻译", "快翻", "这篇文章翻译一下", or when a URL or file is provided with translation intent.
Also in 5 projects that use this
VercelSkillfind-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Also in 3 projects that use this
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 15
- JimLiu/baoyu-skills★ 27k40% same
- anbeime/skill★ 7.9k35% same
- zephyrwang6/myskill★ 33938% same
- YuppyChen/ai-wechat★ 6585% same
- ideacco/baoyu-skills-openclaw★ 1434% same
- SpaceZephyr/allSkills★ 1438% same
- dycnnnb/skills★ 238% same
- qihangzhang-272/agent-skill-library★ 273% same
- AgnesAI-Labs/agnet-skills-cn★ 172% same
- cocyuhao/my-ai-skills-library★ 138% same
5 more not listed
Wrote their own version · 1
- Gopyr/gopyr-skills-hub★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- baoyu-markdown-to-htmlSkill
- content-harnessSkill
- content-strategySkill
- copy-editingSkill
- copywritingSkill
- product-marketingSkill
- socialSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 2 are common, 15 are distinctive, and 4 are very specific to this project.
2
Common
Most of the 15 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Core principle: Only adjust formatting and fix obvious typos.
- Common: line 32
Check EXTEND.md existence (priority order):
- Distinctive: line 82
Read the user-specified file, then detect content type:
- Distinctive: line 118
Read the entire content carefully.
- Very specific: line 171
Check for YAML frontmatter (--- block).
- Distinctive: line 211
Put the strongest hook first and mark it (recommended).
- Distinctive: line 214
Hook in first 5 chars: create information gap or cognitive conflict
- Very specific: line 226
If first line is H1, extract to frontmatter and remove from body.
- Distinctive: line 247
Use concrete details (numbers, outcomes, specific methods) over vague descriptions
- Very specific: line 254
If frontmatter already has summary, skip selection and use it.
- Very specific: line 256
EXTEND.md skip behavior: If auto_select: true is set in EXTEND.md, skip title and summary selection — generate the best candidate directly …
- Distinctive: line 278
Do NOT add sentences, explanations, or commentary
- Distinctive: line 279
Do NOT delete or shorten any content
- Distinctive: line 280
Do NOT rephrase or rewrite the author's words
- Distinctive: line 281
Do NOT add headings that editorialize (e.g., "Amazing Discovery" — use neutral descriptive headings)
- Distinctive: line 282
Do NOT over-format: not every sentence needs bold, not every paragraph needs a heading
- Distinctive: line 288
Add headings where the topic genuinely shifts — prefer vivid, specific headings over generic ones (e.g., "3 天搞定 vs 传统方案" over "方案对比")
- Distinctive: line 289
Use tables for comparisons or structured data buried in prose
- Distinctive: line 290
Use blockquotes for golden quotes, memorable statements, or important warnings
- Distinctive: line 307
Run the formatting script on the output file:
- Common: line 339
Add CJK/English mixed text spacing via autocorrect (default: enabled)
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
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.
| 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)
Check EXTEND.md existence (priority order):
# macOS, Linux, WSL, Git Bash
test -f .baoyu-skills/baoyu-format-markdown/EXTEND.md && echo "project"
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-format-markdown/EXTEND.md" && echo "xdg"
test -f "$HOME/.baoyu-skills/baoyu-format-markdown/EXTEND.md" && echo "user"# PowerShell (Windows)
if (Test-Path .baoyu-skills/baoyu-format-markdown/EXTEND.md) { "project" }
$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { "$HOME/.config" }
if (Test-Path "$xdg/baoyu-skills/baoyu-format-markdown/EXTEND.md") { "xdg" }
if (Test-Path "$HOME/.baoyu-skills/baoyu-format-markdown/EXTEND.md") { "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:
| Setting | Values | Default | Description |
auto_select | true/false | false | Skip both title and summary selection, auto-pick best |
auto_select_title | true/false | false | Skip title selection only |
auto_select_summary | true/false | false | Skip summary selection only |
| Other | — | — | Default 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:
| Indicator | Classification |
Has --- YAML frontmatter | Markdown |
Has #, ##, ### headings | Markdown |
Has **bold**, *italic*, lists, code blocks, blockquotes | Markdown |
| None of above | Plain text |
If Markdown detected, ask user:
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 directlyBased 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.
| Field | Processing |
title | See Title Generation below |
slug | Infer from file path or generate from title |
summary | See Summary Generation below |
coverImage | Check if imgs/cover.png exists in same directory; if so, use relative path |
Title Generation:
Whether or not a title already exists, always 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 3-4 style-differentiated candidates:
| Style | Characteristics | Example |
| Subversive | Deny common practice, create conflict | "All de-AI-flavor prompts are wrong" |
| Solution | Give the answer directly, promise value | "One recipe to make AI write in your voice" |
| Suspense | Reveal half, spark curiosity | "It took me six months to find how to remove AI flavor" |
| Concrete number | Use numbers for credibility | "150 lines of docs taught AI my writing style" |
Present to user:
Pick a title:
1. [Title A] — (recommended)
2. [Title B] — [style note]
3. [Title C] — [style note]
Enter number, or type a custom title:Put the strongest hook first and mark it (recommended).
Title principles:
- Hook in first 5 chars: create information gap or cognitive conflict
- Specific > abstract: "150 lines" beats "a document"
- Negation > affirmation: "you're doing it wrong" beats "the right way"
- Conversational: like chatting with a friend, not a paper title
- Max ~25 chars: longer titles get truncated in feeds
- Accurate, not clickbait: the article must deliver what the title promises
Prohibited patterns:
- "浅谈 XX"、"关于 XX 的思考"、"XX 的探索与实践"
- "震惊!"、"万字长文"、"建议收藏"
- Pure questions without direction: "AI 写作的未来在哪里?"
If first line is H1, extract to frontmatter and remove from body. If frontmatter already has title, include it as context but still generate fresh candidates.
Summary Generation:
Generate 3 candidate summaries with different angles. Present to user:
Pick a summary:
1. [Summary A] — [focus note]
2. [Summary B] — [focus note]
3. [Summary C] — [focus note]
Enter number, or type a custom summary:Summary principles:
- 80-150 characters, precise and information-rich
- Convey core value to the reader, not just the topic
- Vary angles: problem-driven, result-driven, insight-driven
- Hook the reader: make them want to read the full article
- Use concrete details (numbers, outcomes, specific methods) over vague descriptions
Prohibited patterns:
- "本文介绍了..."、"本文探讨了..."
- Pure topic description without value proposition
- Repeating the title in different words
If frontmatter already has summary, skip selection and use it.
EXTEND.md skip behavior: If auto_select: true is set in EXTEND.md, skip title and summary selection — generate the best candidate directly without asking. User can also set auto_select_title: true or auto_select_summary: true independently.
Once title is in frontmatter, body should NOT have 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:
| Element | When to use | Format |
| Headings | Natural topic boundaries, section breaks | ##, ### hierarchy |
| Bold | Key conclusions, important terms, core takeaways | **bold** |
| Unordered lists | Parallel items, feature lists, examples | - item |
| Ordered lists | Sequential steps, ranked items, procedures | 1. item |
| Tables | Comparisons, structured data, option matrices | Markdown table |
| Code | Commands, file paths, technical terms, variable names | `inline` or fenced blocks |
| Blockquotes | Notable quotes, important warnings, cited text | > quote |
| Separators | Major 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 needs bold, not every paragraph needs a heading
Formatting principles — what TO do:
- Preserve the author's voice, tone, and every word
- Bold key conclusions and core takeaways — the sentences a reader would highlight
- Extract parallel items from prose into lists only when the structure is clearly there
- Add headings where the topic genuinely shifts — prefer vivid, specific headings over generic ones (e.g., "3 天搞定 vs 传统方案" over "方案对比")
- Use tables for comparisons or structured data buried in prose
- Use blockquotes for golden quotes, memorable statements, or important warnings
- Fix obvious typos (based on Step 2 findings)
Step 5: Save Formatted File
Save as {original-filename}-formatted.md
Backup existing file:
if [ -f "{filename}-formatted.md" ]; then
mv "{filename}-formatted.md" "{filename}-formatted.backup-$(date +%Y%m%d-%H%M%S).md"
fiStep 6: Execute Typography Script
Run the formatting script on the output file:
${BUN_X} {baseDir}/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 |
Examples:
# Default: spacing + emphasis enabled, quotes disabled
${BUN_X} {baseDir}/scripts/main.ts article.md
# Enable all features including quote replacement
${BUN_X} {baseDir}/scripts/main.ts article.md --quotes
# Only fix emphasis issues, skip spacing
${BUN_X} {baseDir}/scripts/main.ts article.md --no-spacingScript performs (based on options):
- Fix CJK emphasis/bold punctuation issues (default: enabled)
- Add CJK/English mixed text spacing via autocorrect (default: enabled)
- Replace ASCII quotes with fullwidth quotes (default: disabled)
- Format frontmatter YAML (always enabled)
Step 7: Completion Report
Display a report summarizing all changes made:
**Formatting Complete**
**Files:**
- Analysis: {filename}-analysis.md
- Formatted: {filename}-formatted.md
**Content Analysis Summary:**
- Highlights found: X key insights
- Golden quotes: X memorable sentences
- Formatting issues fixed: X items
**Changes Applied:**
- Frontmatter: [added/updated] (title, slug, summary)
- Headings added: X (##: N, ###: N)
- Bold markers added: X
- Lists created: X (from prose → list conversion)
- Tables created: X
- Code markers added: X
- Blockquotes added: X
- Typos fixed: X [list each: "original" → "corrected"]
**Typography Script:**
- CJK spacing: [applied/skipped]
- Emphasis fixes: [applied/skipped]
- Quote replacement: [applied/skipped]Adjust the report to reflect actual changes — omit categories where no changes were made.
Notes
- Preserve original writing style and tone
- Specify correct language for code blocks (e.g.,
python,javascript) - Maintain CJK/English spacing standards
- The analysis file is a working document — it helps maintain consistency between what was identified and what was formatted
Extension Support
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

