← 返回 Skills 市场
rokami

DOCX Formatter

作者 Rokami · GitHub ↗ · v1.0.1
cross-platform ⚠ suspicious
952
总下载
1
收藏
11
当前安装
2
版本数
在 OpenClaw 中安装
/install docx-formatter
功能描述
生成符合中国公文格式规范的Word文档,支持标题、正文样式、自动格式排版和中文引号配对。
使用说明 (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 转换功能,添加一键安装脚本
安全使用建议
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.
功能分析
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.
能力评估
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).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install docx-formatter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /docx-formatter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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 转换、公文材料润色与格式优化 - 实现自动字体、标题、段落和页码排版 - 中文标点自动配对,支持多级标题与正文排版 - 提供安装脚本与命令行用法示例
元数据
Slug docx-formatter
版本 1.0.1
许可证
累计安装 12
当前安装数 11
历史版本数 2
常见问题

DOCX Formatter 是什么?

生成符合中国公文格式规范的Word文档,支持标题、正文样式、自动格式排版和中文引号配对。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 952 次。

如何安装 DOCX Formatter?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install docx-formatter」即可一键安装,无需额外配置。

DOCX Formatter 是免费的吗?

是的,DOCX Formatter 完全免费(开源免费),可自由下载、安装和使用。

DOCX Formatter 支持哪些平台?

DOCX Formatter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 DOCX Formatter?

由 Rokami(@rokami)开发并维护,当前版本 v1.0.1。

💬 留言讨论