← Back to Skills Marketplace
batduke

机关公文排版skill

by batduke · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
452
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install doc-format-gw
Description
公文排版工具 - 根据公文格式规范自动排版Word文档。适用于发送Word文件前进行格式调整。
README (SKILL.md)

公文排版工具

根据公文格式规范自动排版Word文档。

触发条件

用户要求:

  • 排版Word文档
  • 格式化公文
  • 根据公文格式规范排版
  • 发送Word前格式化

功能

  • 自动识别标题层级(一级、二级、三级、四级)
  • 设置正文格式(字体、字号、行距、对齐)
  • 设置页边距
  • 表格格式化
  • 页码设置

使用方法

python3 ~/.npm-global/lib/node_modules/openclaw/skills/doc-format-gw/format_gw.py \x3Cinput.docx> \x3Coutput.docx>

或者在Python中调用:

from format_gw import format_document
format_document('input.docx', 'output.docx')

格式规范

详见同目录下的 references/format-rules.md

依赖

  • python3
  • python-docx
Usage Guidance
This skill appears to do what it says: format .docx files locally using python-docx. Before installing/using it: 1) Install python3 and python-docx in a controlled environment (virtualenv) and test on non-sensitive sample documents. 2) Be aware the script assumes several Chinese fonts; if fonts are missing the output may be incorrect (references mention halting on missing fonts but the script doesn't enforce that). 3) The script contains a bug in the table formatting loop (uses an undefined variable row_index) that can cause a runtime error — you may need to fix that or avoid documents with tables until patched. 4) The SKILL.md example path may not match your installation layout; run the bundled format_gw.py directly. No secrets or network access are requested, so main risks are functional (fonts, formatting) rather than data-exfiltration.
Capability Analysis
Type: OpenClaw Skill Name: doc-format-gw Version: 1.0.0 The skill bundle is a legitimate tool for formatting Word documents according to Chinese government standards. The core logic in `format_gw.py` uses the standard `python-docx` library to adjust fonts, margins, and paragraph styles based on regex-detected heading levels. There are no indicators of malicious behavior, such as network calls, unauthorized file access, or prompt injection.
Capability Assessment
Purpose & Capability
Name/description match the included code: format_gw.py uses python-docx to adjust fonts, margins, headings, tables and save a new .docx. The required runtime (python3) and declared dependency (python-docx in SKILL.md) are consistent with this purpose.
Instruction Scope
Runtime instructions only run the formatter on an input .docx and produce an output .docx (no network calls, no env vars). Notes: SKILL.md shows an example invocation path (~/.npm-global/...), which may be incorrect depending on how the skill is installed; references/format-rules.md mentions stopping when fonts are missing but the code does not implement a font-availability check. The code only reads the provided input file and local reference file, so scope is limited to document processing.
Install Mechanism
No install spec (instruction-only with a bundled Python script). This minimizes install-time risk. The script requires the third-party python-docx package (not enforced by registry metadata), which is a common Python dependency.
Credentials
No environment variables, credentials, or config paths are requested or accessed. The skill does not attempt to read unrelated system files or network endpoints.
Persistence & Privilege
always is false and the skill does not request persistent or elevated privileges. It does not modify other skills or system-wide settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install doc-format-gw
  3. After installation, invoke the skill by name or use /doc-format-gw
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
📋 核心格式 标题: 方正小标宋_GBK,二号字,居中 正文: 方正仿宋_gbk,三号字,两端对齐,首行缩进2字符 页边距: 上37mm,下35mm,左28mm,右26mm 📑 标题层级 一级: 方正黑体 + 一、 二级: 方正楷体 + (一) 三级: 方正仿宋(粗体) + 1. 或 1、 四级: 方正仿宋 + (1) 📊 表格规则 表题: 方正小标宋 表头: 方正黑体14pt居中 表体: 方正仿宋14pt
Metadata
Slug doc-format-gw
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 机关公文排版skill?

公文排版工具 - 根据公文格式规范自动排版Word文档。适用于发送Word文件前进行格式调整。 It is an AI Agent Skill for Claude Code / OpenClaw, with 452 downloads so far.

How do I install 机关公文排版skill?

Run "/install doc-format-gw" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 机关公文排版skill free?

Yes, 机关公文排版skill is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 机关公文排版skill support?

机关公文排版skill is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 机关公文排版skill?

It is built and maintained by batduke (@batduke); the current version is v1.0.0.

💬 Comments