format-migrator-pro

Word formatting migration tool: given a user-supplied template (standard) and a new document, it applies the template's formatting to the new file, outputs a self-contained .docx expected to be >95% consistent across computers, and provides a processing report and structural QA report.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "format-migrator-pro" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-a73cbcc03c9f54f599bde917171ba6c19470aa0e2f83460dd71849c7ed1d3874. Verify the upstream source and version against https://skillhub.cn/skills/org-3hf3zduu/word-format-migrator-pro before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Word formatting migration tool: given a user-supplied template (standard) and a new document, it applies the template's formatting to the new file, outputs a self-contained .docx expected to be >95% consistent across computers, and provides a processing report and structural QA report.

0 Downloads

Introduction source: third_party · org-3hf3zduu · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: format-migrator-pro
description: Word排版迁移师——标准无关的通用 Word 排版迁移器。用户传入自己的模板(标准)+ 一份新文件,Skill 让新文件学模板的排版,输出自包含、跨电脑 95%+ 一致的 .docx,附处理报告和结构 QA 报告。

Word排版迁移师

Word排版迁移师是一个标准无关的通用 Word 排版迁移器。它自己不持有任何标准——标准由用户每次传入的模板决定。内置 make_demo_template.py 可生成演示模板,仅供回归测试,不是标准。

核心理念

  • 输入:用户模板(=他的标准)+ 一份新文件(待排版)。
  • 动作:让新文件去学用户传入的模板。
  • Skill 是"学习者/搬运工",不是"标准本身"。换个用户、换个模板,学的就是另一套。

为什么能做到跨电脑一致

Word 排版 = 指令 × 解析 × 渲染三层。常规做法只复制指令层(styles.xml),换电脑因字体缺失、主题字体引用、行距算法而漂移——表现为"换电脑字体和高度都变了"。

Word排版迁移师把模板的有效排版冻结成绝对值(具体字体名、绝对字号、固定行距、RGB 颜色、锁定编号),输出自包含、环境无关的 docx:

  • 提取模板"有效视觉格式"(样式继承链 + 直接格式合成的最终视觉,不挑模板)
  • 字体绝对化:主题引用 → 具体字体名,显式设 eastAsia
  • 段距/行距/列宽/颜色/编号 全部写成绝对值

使用场景

  • 投标书、方案书、建议书按客户或公司模板重排
  • 多人协作后格式统一
  • 跨电脑交付需要格式不漂
  • .doc 旧文档重排

必须确认的输入

  1. 参考模板 Word(标准来源):.docx 优先,.doc 也行
  2. 待排版 Word(内容来源):.docx 优先
  3. 输出路径:生成新 .docx,不覆盖原始文件
  4. 可选:--header-text 指定页眉文字;--embed-fonts 嵌入字体(默认关)

工作流

  1. .doc 输入自动走多后端降级转 .docx(Word COM > WPS COM > soffice > 人工指引)
  2. 解析源文档:段落、表格、章节文本
  3. 识别标题层级(1/1.1/1.1.1/1.1.1.1 编号 → Heading 1-4)
  4. 提取模板有效视觉格式(样式继承链 + 直接格式合成,不挑模板)
  5. 字体绝对化:主题引用 → 具体名,显式 eastAsia,颜色 RGB,字号 sz
  6. 冻结成绝对值:正文段距读模板、标题视觉回填、表格学模板、编号/图片固定
  7. 输出自包含 docx + 处理报告 + QA 报告
  8. 渲染检查(打包在 Skill 内)

能力边界

  • 跨电脑一致性:95%+,不承诺 100%(打印机 metrics、Word/WPS 引擎差异残留)
  • 不改写正文内容,只迁移排版
  • 复杂合并单元格、超宽表格仍需人工复核
  • 字体嵌入默认关(实测代价 5-7MB/小文档);中文 Windows 用安全字体名(宋体/黑体/仿宋/楷体/微软雅黑)即可跨电脑一致

.doc 转换依赖

.doc → .docx 按顺序尝试本机已有的软件,无需额外安装:

  1. Microsoft Word COM(商务客户,保格式最准)
  2. WPS COM(中国 WPS 用户)
  3. LibreOffice/soffice(跨平台兜底)
  4. 全无时给出"另存为 .docx"的人工指引,不直接报错

命令示例

# 基本排版
python scripts/migrate_format.py --template my_template.docx --input messy.docx --out formatted.docx --report formatted.report.json

# 指定页眉
python scripts/migrate_format.py --template my_template.docx --input messy.docx --out formatted.docx --header-text "项目方案设计书"

# 嵌入字体(跨平台场景,文件会变大)
python scripts/migrate_format.py --template my_template.docx --input messy.docx --out formatted.docx --embed-fonts

# 结构 QA
python scripts/qa_docx.py --docx formatted.docx --json-out formatted.qa.json

验收清单

  • 输出 .docx 可正常打开
  • 正文段距、标题字号/颜色来自模板(不再白板/不再硬编码)
  • 页面尺寸、页边距、页眉页脚接近模板
  • dump styles.xml 无 asciiTheme,eastAsia 有具体值
  • 表格文字完整、边框来自模板
  • 渲染页面无文字重叠、页眉页脚断裂、表格溢出
  • 换电脑打开字体/高度一致(95%+)

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value88/100

Highlights

  • 解决用户自定义模板排版迁移的高频刚需场景
  • 支持 .doc/.docx 输入,具备多后端降级转换能力
  • 输出自包含、跨电脑 95%+ 一致的文档,实用性强
Trigger Precision92/100

Highlights

  • 触发词精准完整,覆盖模板、输入文件、输出路径等核心要素
  • 支持多种参数变体(页眉、字体嵌入等),边界清晰
Structure and Standards95/100

Areas to improve

  • 缺少 When to Use 显式章节 Reported severity: Minor

    文档内容已涵盖使用场景,但未使用标准章节名 When to Use

    Recommendation: 建议增加 When to Use 显式章节以提升规范性

Highlights

  • 结构完整,包含核心理念、工作流、能力边界、命令示例、验收清单
  • 步骤清晰,有端到端命令示例,frontmatter 完整
Execution Reliability85/100

Highlights

  • 工具来源明确(Python 脚本),参数说明清晰
  • 覆盖 .doc 转 .docx 的多后端降级策略,异常处理合理
  • 输出新文件不覆盖原始文件,具备安全机制
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.