Install
openclaw skills install @wing-art/format-official-docxopenclaw skills install @wing-art/format-official-docx生成规范的 .docx 文件;不要只给建议而不实际生成。
format-only(仅重排):保留段落文字与顺序,只调整版式与样式。generate(生成):创建公文外壳并撰写简洁正文。references/document-types.md;否则不必加载。references/format-rules.md。本地细则优先于通用 GB/T 9704 知识。scripts/generate_official_docx.py 生成。scripts/check_official_docx.py 做格式校验。outputs/。前置依赖:python-docx;若缺失请用 pip install -r requirements.txt 安装。
XXXX 等占位符。生成请示:
python scripts/generate_official_docx.py --input body.txt --output out.docx --doc-type request --red-header "某单位文件" --outgoing-no "某字〔XXXX〕XX号" --signer "XXX" --title "某单位\n关于XXXX的请示" --recipient "某上级机关:" --issuer "某单位" --date "XXXX年XX月XX日" --add-closing
生成函:
python scripts/generate_official_docx.py --input body.txt --output out.docx --doc-type letter --letterhead "某单位" --outgoing-no "某字〔XXXX〕XX号" --title "关于XXXX的函" --recipient "某单位:" --issuer "某单位" --date "XXXX年XX月XX日" --no-page-number
仅重排:
python scripts/generate_official_docx.py --input source.docx --output formatted.docx --doc-type generic --format-only --promote-first-paragraph-title
格式校验:
python scripts/check_official_docx.py out.docx --doc-type request
python scripts/check_fonts.py
--doc-type:文种,generic / request / report / letter / notice--format-only:仅重排模式--red-header:请示/上行文的红色“发文机关名称+文件”红头--letterhead:函的红色机关头--letter-special-margins:仅在明确要求时使用本地函首页页边距(上 5.1 / 下 2.1)--outgoing-no、--signer、--title、--recipient、--issuer、--date、--contact--attachment、--copy-to、--print-org、--print-date、--disclosure-note--secret-level:左上角三号黑体密级行,如 秘密★1年--add-closing:仅在缺失时补充标准请示/报告结尾--date today:自动填入当前日期(也接受 XXXX年XX月XX日)--bold-headings:一级(黑体)标题加粗;默认关闭,遵循三号黑体不加粗规范检查标题/红头字体、页边距、行距、首行缩进、标题发文机关行、发文字号/签发人、右对齐的署名与日期、联系人/披露说明、页码、版记。若本机未安装方正小标宋简体或仿宋_GB2312,Word 会替换字体。