My Docx Formatter
生成符合中国公文格式规范的 Word 文档,支持标题分级、字体样式、段落格式、页码与中文标点自动处理。
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 21 · 1 current installs · 1 all-time installs
MIT-0
Security Scan
OpenClaw
Suspicious
medium confidencePurpose & Capability
The Python code (docx-formatter.py) implements .docx generation and formatting consistent with the description. However there are mismatches: quick_api.py imports from 'docx_formatter' while the file is named 'docx-formatter.py' (dash vs underscore) which will cause import errors; examples/content.json contains unescaped quote characters that make the example JSON invalid; _meta.json ownerId/version differ from the registry metadata (owner/version mismatch). These inconsistencies suggest sloppy packaging or copy/paste errors rather than coherent release management.
Instruction Scope
SKILL.md instructions are limited to installing dependencies and running the included CLI/API to convert Markdown/JSON to .docx. It does not instruct reading unrelated system files or sending data to external endpoints. Note: SKILL.md marks many keywords for automatic invocation (including political/party document keywords); this affects when the agent may auto-run the skill but is conceptually within purpose (document generation).
Install Mechanism
There is no formal install spec, but an install.sh is provided. The script attempts to create and use a virtualenv and pip-install python-docx — which is reasonable — but it uses an unknown 'uv' command ('uv venv' and 'uv pip install python-docx'). 'uv' is not a standard tool; this looks like a typo or an alias and will likely fail on most systems. The install script does not download arbitrary remote archives (pip will contact PyPI), but you should not run the script unreviewed until the 'uv' lines are fixed.
Credentials
The skill declares no required environment variables or secrets and the code does not reference credentials or remote endpoints. That is proportionate to the stated functionality.
Persistence & Privilege
The skill does not request 'always: true' and has no install-time behavior that modifies other skills or system-wide configuration. It only creates/uses a local virtualenv per its install script (if fixed). Autonomous invocation is enabled by default but not combined with any broad privileges here.
What to consider before installing
Do not run install.sh or the scripts blindly. Specific recommendations:
- Inspect and fix install.sh: replace the unknown 'uv' commands with correct commands (e.g., python3 -m venv .venv and .venv/bin/python -m pip install python-docx). The current script will likely fail or do nothing.
- Fix runtime issues: quick_api.py imports 'docx_formatter' but the file is named docx-formatter.py; rename or add a proper package/module (or change the import). Examples/content.json appears to contain invalid JSON (unescaped internal quotes) — don't use it as-is.
- The tool does not request credentials or network endpoints beyond PyPI for pip; that is good. Still prefer to create/inspect the virtualenv manually and run pip in an isolated environment.
- Note the metadata mismatches (ownerId/version) — this may indicate copy/paste or packaging mistakes; confirm the publisher identity if provenance matters.
- Because SKILL.md marks many keywords for automatic invocation, review agent settings if you want to restrict when the skill can run (especially for politically sensitive document types).
If you want to use this skill safely: correct the install script, test the CLI in an isolated environment, and optionally run a static/lint pass on the Python files to resolve import/formatting errors.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
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 "长春市农业农村局\n2026年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 转换功能,添加一键安装脚本
Files
7 totalSelect a file
Select a file to preview.
Comments
Loading comments…
