Word Master 是一套 AI 驱动的 Word 文档创建与编辑系统,采用“AI 意图层 + 确定性执行层”的双层架构,适用于创建、编辑、审阅或排版 .docx 文件的场景,覆盖“从零写文档”和“改已有文档”两类需求。
主要能力由多个脚本承担:md_to_docx.py 将 Markdown 按格式模板转换为 DOCX;docx_reader.py 读取 DOCX 并输出带段落 ID(p0、p1…)的富文本 Markdown;docx_editor.py 对 DOCX 执行 JSON DSL 操作;docx_diff.py 对比修改前后的 DOCX 并生成差异报告;style_analyzer.py 从模板 DOCX 提取格式指纹;style_transfer.py 把模板样式配置应用到目标 DOCX;template_analyzer.py 提取段落与表格的综合格式配置;table_analyzer.py 提取表格样式指纹。
使用方式分三条工作流。创建模式:先与用户讨论大纲,AI 生成 draft.md,迭代审阅 Markdown 内容,再用 python ${SKILL_DIR}/scripts/md_to_docx.py draft.md output.docx --template json:formal 转换,必要时转入编辑模式微调。编辑模式:先用 python ${SKILL_DIR}/scripts/docx_reader.py document.docx --overview 读取文档,由 AI 生成 JSON DSL 操作(如 replace_text、rewrite_paragraph、set_font、set_paragraph_format),再用 python ${SKILL_DIR}/scripts/docx_editor.py document.docx operations.json 执行,原文件自动备份为 document.docx.bak,最后用 docx_diff.py 校验。样式迁移:用 template_analyzer.py 生成 style_profile.json,由 AI 审阅调整 roles 与 table_roles,再运行 python ${SKILL_DIR}/scripts/style_transfer.py --profile style_profile.json draft.docx output.docx 应用,支持 --review、--skip-head N、--skip-tail N。
格式模板支持 JSON 规则(--template json:name,内置 default、formal、casual)与 DOCX 样式(--template docx:file.docx)。段落角色白名单为 Heading 1–9、Normal、List Bullet、List Number。样式迁移按精确名称与结构匹配,表格用最近邻打分(列数、表头行、行数相似度)匹配。编辑前始终生成 .bak 备份。
限制:具体依赖环境、安装方式、脚本完整参数、DSL 全部操作项及效果未在资料中完整给出,详见 ${SKILL_DIR}/references/edit-ops.md。