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.
npx skills add https://github.com/JimLiu/baoyu-skills --skill baoyu-format-markdown
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.
When this skill prompts the user, follow this tool-selection rule (priority order):
AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.
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 |
Check EXTEND.md in priority order — the first one found wins:
| Priority | Path | Scope |
|----------|------|-------|
| 1 | .baoyu-skills/baoyu-format-markdown/EXTEND.md | Project |
| 2 | ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-format-markdown/EXTEND.md | XDG |
| 3 | $HOME/.baoyu-skills/baoyu-format-markdown/EXTEND.md | User home |
If none found, use defaults — no first-time setup required for this skill.
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 |
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).
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, 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:
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
2.2 Structure Assessment
2.3 Reader-Important Information
2.4 Formatting Issues
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"]
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 | One-sentence concise summary (see Summary Generation below) |
| description | Longer descriptive summary (see Summary Generation below) |
| coverImage | Check if imgs/cover.png exists in same directory; if so, use relative path |
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:
Generate candidates using formulas from references/title-formulas.md:
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.
Generate two versions directly (no user selection), both stored in frontmatter:
| Field | Length | Purpose |
|-------|--------|---------|
| summary | 1 sentence, ~50-80 chars | Concise hook — for feeds, social sharing, SEO meta |
| description | 2-3 sentences, ~100-200 chars | Richer context — for article previews, newsletter blurbs |
Principles:
summary should be punchy and self-contained; description can expand with supporting detailssummary or description, keep the existing one and only generate the missing fieldProhibited patterns:
Once the title is in frontmatter, the body should NOT contain an H1 (avoid duplication).
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:
Formatting principles — what TO do:
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"
fi
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-spacing
Script performs (based on options):
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.
python, javascript)Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
Low-level plotting library for full customization. Use when you need fine-grained control over every plot element, creating novel plot types, or integrating with specific scientific workflows. Export to PNG/PDF/SVG for publication. For quick statistical plots use seaborn; for interactive plots use plotly; for publication-ready multi-panel figures with journal styling, use scientific-visualization.
Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.
> This skill orchestrates autonomous discovery of brand materials across enterprise platforms (Notion, Confluence, Google Drive, Box, SharePoint, Figma, Gong, Granola, Slack). It should be used when the user asks to "discover brand materials", "find brand documents", "search for brand guidelines", "audit brand content", "what brand materials do we have", "find our style guide", "where are our brand docs", "do we have a style guide", "discover brand voice", "brand content audit", or "find brand assets".
Low-level Python plotting for scientific figures: publication-quality line, scatter, bar, heatmap, contour, 3D; multi-panel layouts; fine control of every element. PNG/PDF/SVG export. Use seaborn for quick stats, plotly for interactive.
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.
Enterprise-grade PowerPoint deck generation system using evidence-based prompting techniques, workflow enforcement, and constraint-based design. Use when creating professional presentations (board decks, reports, analyses) requiring consistent visual quality, accessibility compliance, and integration of complex data from multiple sources. Implements html2pptx workflow with spatial layout optimization, validation gates, and multi-chat architecture for 30+ slide decks.
Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.
Audit a python-pptx export against its source HTML deck, identify layout/content drift (footer overflow, cropped content, missing italic/em, lost styling, off-rhythm spacing), and re-export with strict footer-rail + cursor-flow layout discipline. Use this skill whenever the user has a .pptx that was generated from an HTML slide deck and asks to compare/audit/verify/fix the export — including phrases like "compare ppt with html", "fidelity audit", "fix the pptx", "ppt is cut off", "footer overlap", "italic missing in pptx", "re-export the deck", "pptx-html-fidelity-audit", or any case where a python-pptx → HTML round-trip needs verification or repair. Also trigger when the user shows you a deck.html and a deck.pptx side by side and is debugging visual differences.
Take jimliu/baoyu-format-markdown from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npx.
Without those the skill loads but fails at the first command.