baoyu-format-markdown

Formats plain text and markdown files with frontmatter, headings, lists, and CJK typography fixes.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/chhpt/skills --skill baoyu-format-markdown-chhpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: baoyu-format-markdown
Source: https://github.com/chhpt/skills/tree/main/skills/baoyu-format-markdown
Command: npx skills add https://github.com/chhpt/skills --skill baoyu-format-markdown-chhpt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires remark-cjk-friendly, remark-frontmatter, remark-gfm, remark-parse, remark-stringify, unified, unist-util-visit, yaml, autocorrect-node, and includes scripts (resource) components.

What problem does it solve? Raw drafts and plain text often lack consistent structure, frontmatter metadata, and proper CJK/English typography, requiring tedious manual cleanup before publishing. ## Core Features & Use Cases - Structured Formatting: Adds YAML frontmatter (title, slug, summary, coverImage), headings, bold, lists, code blocks, and blockquotes to plain text or markdown. - CJK Typography Fixes: Runs a script that fixes CJK emphasis punctuation, adds CJK/English spacing via autocorrect, and optionally converts ASCII quotes to fullwidth quotes. - Safe Output: Writes results to {filename}-formatted.md with automatic timestamped backups of existing files, and supports EXTEND.md preference files at project or user level. - Use Case: You have a rough Chinese-English mixed blog draft; the skill generates a title and summary, structures the content, and normalizes spacing and emphasis for publication. ## Quick Start Format my draft.md file into a well-structured markdown article with frontmatter and proper CJK typography.

Frequently Asked Questions about baoyu-format-markdown

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format a plain text file into structured markdown?

Provide the file path and the skill analyzes the content, generates frontmatter with title, slug, and summary, then adds headings, bold, lists, and code blocks. The result is saved as {filename}-formatted.md.

How to fix CJK and English mixed text spacing in markdown?

The formatting script runs autocorrect via npx autocorrect-node to add proper spacing between CJK and English characters. Spacing is enabled by default and can be disabled with the --no-spacing flag.

Does the markdown formatter overwrite my original file?

No, formatted output is written to a new {filename}-formatted.md file. If that file already exists, it is backed up with a timestamp before being overwritten. Only the typography-only mode modifies the original file.

Can I customize default formatting options for markdown?

Yes, create an EXTEND.md file in .baoyu-skills/baoyu-format-markdown/ at project level or in your home directory. It supports default formatting options and summary length preferences, with project-level taking priority.

What runtime is required to run the formatting script?

The script runs with Bun via npx -y bun and requires npm packages including unified, remark-parse, remark-cjk-friendly, remark-gfm, remark-frontmatter, remark-stringify, and yaml, as declared in scripts/package.json.