文档

Doc Beautifier

试用

Beautify Word documents (.docx) using a professional general template. Trigger when the user asks to: beautify/美化/排版/格式化 a Word document, apply a template/style to a .docx file, make a document look professional/clean/formatted, or clean up a document's formatting. Works by reading the source .docx,

它能做什么

Beautify Word documents (.docx) using a professional general template. Trigger when the user asks to: beautify/美化/排版/格式化 a Word document, apply a template/style to a .docx file, make a document look professional/clean/formatted, or clean up a document's formatting. Works by reading the source .docx, detecting document structure (title, headings, body), and applying consistent fonts, sizes, spacing, indentation, and page layout. Supports multiple template styles.

技能文档

doc-beautifier

Beautify .docx files with a professional general template. Preserves all original text content while applying consistent formatting.

Quick Start

python3 scripts/beautify.py  
# Optional template:
python3 scripts/beautify.py input.docx output.docx --template elegant

Features

  • Structure Detection: Heuristically identifies titles, headings (3 levels), and body paragraphs based on text patterns, length, and existing formatting
  • 3 Built-in Templates:
    • standard — Default professional template (A4, 微软雅黑 headings, 宋体 body, 1.5 line spacing)
    • compact — Tighter spacing, smaller margins, 1.25 line spacing (for dense documents)
    • elegant — Larger margins, refined colors, spacious layout (for formal reports)
  • Page Layout: Sets A4 page size, proper margins, centered page numbers in footer
  • Content Preservation: ALL original text is preserved; no content is added, removed, or reordered

Template Specification

Settingstandardcompactelegant
Page margins2.54/3.18 cm2.0/2.5 cm3.0/3.5 cm
Title size22pt18pt26pt
H1 size16pt14pt16pt
H2 size14pt12pt14pt
H3 size12pt11pt12pt
Body size12pt(小四)11pt(五号)12pt(小四)
Line spacing1.51.251.5
Body font宋体宋体宋体
Heading font微软雅黑微软雅黑微软雅黑

Workflow

  1. Locate the user's input .docx file
  2. Run beautify.py with desired template
  3. Validate the output by unpacking or checking with python-docx
  4. Deliver the beautified document path to the user

Structure Detection Heuristics

The script identifies paragraph roles using:

  • First non-empty paragraph → Document title
  • Already styled as Heading 1-3 → Preserve heading level
  • Bold + large font + short text (< 50 chars) without ending punctuation → Heading
  • Starts with Chinese number (一、二、) or decimal (1.1, 2.3) → Heading
  • Bold paragraphs under 60 chars → Heading
  • Everything else → Body text

Customization

Edit the TEMPLATES dictionary in scripts/beautify.py to:

  • Change colors, fonts, sizes
  • Add new template variants
  • Adjust line spacing or indentation
  • Modify page margins

Requirements

  • python-docx (install: pip install python-docx)
  • Python 3.8+

相关技能

Generate Word documents from Word templates and JSON data. Supports basic placeholder replacement ({field} format) and placeholder extraction for data validation. Best for batch-generating contracts, invitations, certificates, and mail-merge style docs.

1 次安装1 星标

Repair and automate Word DOCX formatting, styles, find-and-replace, numbering, tables, and conversion workflows while preserving document structure. Use when...

doc to video, word to video, markdown to video, document to video — parse the document, outline, storyboard, voiceover, build, validate. Use when the user gives a Doc / Word / Markdown file and wants an explainer, report broadcast, or training video.

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', Use when 需要Development领域自动化处理、数据分析和流程编排时使用。不适用于无明确需求的模糊场景。

5 次安装

将受支持的文档转为 Markdown,方便智能代理读取,并在源文件旁保存单个文件或转换包。

28 次安装7 星标

Transform Markdown or outlines into polished Word/PDF documents with professional templates

6 次安装1 星标