一键导入
tuzi-format-markdown
格式化纯文本或 Markdown 文件,添加 frontmatter、标题、摘要、小标题、加粗、列表和代码块。当用户要求"格式化markdown"、"美化文章"、"添加格式"或改善文章排版时使用。输出到 {filename}-formatted.md。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
格式化纯文本或 Markdown 文件,添加 frontmatter、标题、摘要、小标题、加粗、列表和代码块。当用户要求"格式化markdown"、"美化文章"、"添加格式"或改善文章排版时使用。输出到 {filename}-formatted.md。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | tuzi-format-markdown |
| description | 格式化纯文本或 Markdown 文件,添加 frontmatter、标题、摘要、小标题、加粗、列表和代码块。当用户要求"格式化markdown"、"美化文章"、"添加格式"或改善文章排版时使用。输出到 {filename}-formatted.md。 |
Transforms plain text or markdown files into well-structured markdown with proper frontmatter, formatting, and typography.
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 |
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .tuzi-skills/tuzi-format-markdown/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.tuzi-skills/tuzi-format-markdown/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │ .tuzi-skills/tuzi-format-markdown/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.tuzi-skills/tuzi-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
Claude performs content analysis and formatting (Steps 1-6), then runs the script for typography fixes (Step 7).
Read the user-specified markdown or plain text file.
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:
Identify:
#)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) |
Logic:
title → use it, no H1 in bodytitle, remove H1 from bodyTitle generation flow:
AskUserQuestion tool:Select a title:
1. [Title A] (Recommended)
2. [Title B]
3. [Title C]
Title principles:
Important: Once title is in frontmatter, body should NOT have H1 (avoid duplication)
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:
Save as {original-filename}-formatted.md
Examples:
final.md → final-formatted.mddraft-v1.md → draft-v1-formatted.mdIf user chose "Keep original formatting" (from Step 1.5):
{filename}-formatted.md without modificationsBackup 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.mdAfter 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):
"..." with fullwidth quotes "..." (default: disabled)**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
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.
python, javascript)Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
通过兔子API(nano-banana 模型)、Google、OpenAI、DashScope 和 Replicate 进行 AI 图片生成。支持文生图、参考图片、宽高比、模型选择,以及 OpenAI 兼容网关方言切换。当用户要求生成、创建或绘制图片时使用。
通过兔子API进行AI视频生成。支持 Veo、Sora、Kling、Seedance 等模型,单视频和长视频(多段合成)模式。当用户要求生成视频、创建视频或需要视频生成后端时使用。
优化社交媒体文案,支持小红书、X/Twitter、抖音、微信等平台。根据平台特性调整文风、长度、标签和排版。当用户要求"优化文案"、"润色推文"、"改写小红书文案"、"polish copy"时使用。
为小红书、抖音、X/Twitter、视频号等平台生成短视频内容。分析用户输入,自动适配平台规格,生成视频脚本并调用视频生成后端。当用户要求"生成短视频"、"做一个视频"、"短视频"或为社交平台创建视频内容时使用。
分析代码审查反馈或开发中发现的问题,提取通用规则并更新 CLAUDE.md 和详细规则文档。当用户说"更新规则"、"添加编码规则"、"update claude md"或发现需要记录的编码模式时使用。
通用发布工作流。自动检测版本文件和变更日志。支持 Node.js、Python、Rust、Claude 插件和通用项目。当用户说"发布"、"release"、"新版本"、"bump version"、"push"、"推送"时使用。