← Back to Skills Marketplace
952
Downloads
1
Stars
11
Active Installs
2
Versions
Install in OpenClaw
/install docx-formatter
Description
生成符合中国公文格式规范的Word文档,支持标题、正文样式、自动格式排版和中文引号配对。
README (SKILL.md)
docx-formatter
公文格式规范生成器
严格按照中国公文格式规范生成 Word 文档。
自动触发场景
当用户请求以下任务时,自动使用此 skill:
- 生成公文、报告、总结、方案等正式文档
- 润色、修改现有公文材料
- 需要符合公文格式规范的 Word 文档
- 民主生活会、述职报告等党政材料
关键词识别:
- "公文"、"材料"、"报告"、"总结"、"方案"
- "民主生活会"、"对照检查"、"述职"、"发言"
- "润色"、"修改"、"生成文档"
- "Word"、"docx"、"格式规范"
功能
- 生成符合公文格式规范的 .docx 文档
- 自动处理字体、段落、页码等格式
- 支持中文引号自动配对
- 支持多级标题和正文
安装
首次使用前,运行一次安装脚本:
cd ~/.openclaw/workspace/skills/docx-formatter
./install.sh
或者直接使用,脚本会自动检测并安装依赖。
使用方法
推荐用法(从 Markdown 转换):
# 基本用法
./docx-formatter --from-markdown input.md --output output.docx
# 带署名
./docx-formatter --from-markdown input.md --output output.docx --author "长春市农业农村局\
2026年2月2日"
高级用法(JSON 输入):
./docx-formatter --title "文档标题" --author "作者" --content content.json --output output.docx
Markdown 格式规范:
# 文档标题(自动识别为大标题)
## 一、一级标题(黑体 3号)
### (一)二级标题(楷体 3号)
正文段落(仿宋 3号)
**1. ** 带加粗前缀的段落(前缀加粗)
格式规范
字体
- 大标题:方正小标宋简体 2号
- 一级标题:黑体 3号
- 二级标题:楷体_GB2312 3号
- 正文:仿宋_GB2312 3号
- 三级标题:仿宋_GB2312 3号加粗(不另起一行)
段落
- 行间距:固定值 28 磅
- 段前间距:0
- 段后间距:0
- 首行缩进:2 字符(32 磅)
- 对齐方式:两端对齐(标题、署名、日期居中)
- 孤行控制:关闭
页面
- 纸张:A4 (8.27" × 11.69")
- 页边距:上下 1",左右 1.25"
- 页码:页脚居中,纯数字
标点
- 引号:中文引号 " "(U+201C U+201D)
- 书名号:《》
- 括号:()
示例
见 examples/ 目录。
更新日志
- 2026-02-02: 实现 Markdown 转换功能,添加一键安装脚本
Usage Guidance
This package appears to implement what it claims (formatting .docx documents) and doesn't request secrets or network access, but it contains several practical issues you should address before running it:
- Do NOT run install.sh unreviewed. It uses an unknown 'uv' command. Replace with standard commands (for example: python3 -m venv .venv && source .venv/bin/activate && pip install python-docx) or inspect what 'uv' would do on your system.
- quick_api.py will fail as written: it imports 'docx_formatter' but the supplied file is named 'docx-formatter.py' (hyphens make it unimportable). Rename files or fix imports before using the API helper.
- examples/content.json appears to contain unescaped double quotes inside a JSON string (invalid JSON). Fix/validate the example JSON to avoid runtime json.load errors.
- The SKILL.md suggests passing an author with a literal '\n' sequence; the implementation splits on the two-character string '\\n' rather than actual newline characters—test and decide on a consistent convention (or accept real newlines).
- Because the skill documents automatic triggers for politically sensitive document types, be mindful of the content you feed into the tool and your local policies for generating or storing such materials.
Recommended next steps: run the code in an isolated environment (container or throwaway VM), correct the installer and import issues, validate example files, and run the test.sh only after fixing these problems. If you are not comfortable fixing the repository, treat it as untrusted/broken and avoid executing the install script on a production machine.
Capability Analysis
Type: OpenClaw Skill
Name: docx-formatter
Version: 1.0.1
The skill bundle is designed for a legitimate purpose (document formatting) and does not contain explicit malicious code for data exfiltration, backdoors, or unauthorized remote control. However, the `docx-formatter.py` and `quick_api.py` scripts directly use user-provided file paths for `--output`, `--content`, and `--from-markdown` arguments without sanitization. This creates a path traversal vulnerability, allowing an attacker (via prompt injection to the agent) to potentially read or write files to arbitrary locations on the system, which could lead to information disclosure or unauthorized file modification.
Capability Assessment
Purpose & Capability
The name, description, and primary code (docx-formatter.py) are consistent: the script uses python-docx to produce Chinese government-style .docx documents and implements quote conversion, headings, pagination, and formatting. There are no unexpected credentials or network calls, so the requested resources are proportionate to the stated purpose.
Instruction Scope
SKILL.md instructs running install.sh and provides CLI usage consistent with the code, but the documentation also declares automatic trigger keywords for sensitive government/party documents (e.g., "民主生活会","述职"). The runtime instructions do not ask for unrelated system files or credentials. However, SKILL.md examples and usage examples are inconsistent with the code (see details below), which could cause the agent or user to run failing or unexpected commands.
Install Mechanism
There is no registry install spec (instruction-only), but an included install.sh is present. install.sh uses a nonstandard command 'uv' (calls 'uv venv' and 'uv pip install python-docx') which is not a typical system tool and will likely fail or execute an unexpected program if 'uv' exists on the host. The installer is therefore brittle and potentially dangerous to run without review; it should be replaced with a standard venv/pip invocation.
Credentials
The skill declares no required environment variables, no credentials, and no system config paths. The code does not access environment variables or secrets. This is proportionate to the skill's functionality.
Persistence & Privilege
The skill does not request always:true, does not modify other skills, and has no installation behavior that attempts to persist credentials or modify global agent settings. It is user-invocable only (default).
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install docx-formatter - After installation, invoke the skill by name or use
/docx-formatter - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
No user-facing changes in this version.
- Version bump to 1.0.1 with no file changes detected.
- Functionality and documentation remain unchanged.
v1.0.0
docx-formatter v1.0.0
- 首次发布,严格按照中国公文格式规范生成 Word 文档(.docx)
- 支持 Markdown 转换、公文材料润色与格式优化
- 实现自动字体、标题、段落和页码排版
- 中文标点自动配对,支持多级标题与正文排版
- 提供安装脚本与命令行用法示例
Metadata
Frequently Asked Questions
What is DOCX Formatter?
生成符合中国公文格式规范的Word文档,支持标题、正文样式、自动格式排版和中文引号配对。 It is an AI Agent Skill for Claude Code / OpenClaw, with 952 downloads so far.
How do I install DOCX Formatter?
Run "/install docx-formatter" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is DOCX Formatter free?
Yes, DOCX Formatter is completely free (open-source). You can download, install and use it at no cost.
Which platforms does DOCX Formatter support?
DOCX Formatter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created DOCX Formatter?
It is built and maintained by Rokami (@rokami); the current version is v1.0.1.
More Skills