← 返回 Skills 市场
137
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install 8917-docx-official
功能描述
将 Markdown 或其他已有内容转换为符合中国党政机关公文/正式文件格式的 `.docx` 文档;需要时也可输出 PDF。适用于:生成公文、报告、方案、通知、汇报、意见、纪要等正式文档,或用户要求把 Markdown/文本内容排版为公文格式 Word。触发词:公文格式、正式文件、官方格式、转成 docx、公文...
使用说明 (SKILL.md)
8917-docx-official
定位
这是一个 工具型 / Generator skill。
它只负责一件事:
- 把已有内容转换为符合公文/正式格式要求的
.docx文档
它不是内容策划器,不负责采访补全,不负责审批流。
输入与输出
输入
- Markdown 文件
- 或已整理好的文本内容(建议先保存为
.md)
输出
.docx- 如用户明确需要,也可输出
.pdf
核心工作流
Step 1:确认输出格式
如果用户已经明确说了 .docx / .pdf / 两者都要,直接继续。
如果没说清,先确认:
- 只要
.docx - 只要
.pdf - 两者都要
Step 2:整理 Markdown
按以下规则准备输入内容:
- 标题不要手写编号(不要写
## 一、xxx) - 用 Markdown 层级控制公文标题层级
- 正文正常书写
Step 3:必要时读取格式规则
如果需要确认标题层级、公文排版细节或参数,读取:
references/official-format-rules.md
Step 4:执行转换脚本
调用:
scripts/md2docx.py
常见用法:
python scripts/md2docx.py input.md -o output.docx
输出 PDF:
python scripts/md2docx.py input.md -o output.pdf --pdf
同时输出 docx 和 PDF:
python scripts/md2docx.py input.md -o output.docx --pdf
Step 5:返回结果
返回:
- 输出文件路径
- 如转换失败,明确报错原因
Markdown 层级映射
| Markdown | 公文层级 | 自动编号示例 |
|---|---|---|
# |
文档标题 | 居中标题 |
## |
一级标题 | 一、主要任务 |
### |
二级标题 | (一)重点工作 |
#### |
三级标题 | 1.具体事项 |
##### |
四级标题 | (1)实施步骤 |
| 普通段落 | 正文 | - |
关键约束
- 名称固定为
8917-docx-official,这是唯一正式入口。 - 原
docx-official的有效实现应吸收入本 skill。 - 输出路径必须支持
-o参数,不允许硬编码到其他节点目录。 - 如果需要查看格式细节,读 references,不要把大段规范塞进
SKILL.md。
一句话原则
已有内容先整理成 Markdown,再交给 8917-docx-official 转成正式格式 docx。
安全使用建议
This skill appears coherent and implements its stated purpose. Before installing or running it, consider: (1) it will invoke LibreOffice (soffice) to produce PDFs—install LibreOffice if needed; (2) it may require the Python package python-docx in the environment (not auto-installed by the skill); (3) the script may compile a small C LD_PRELOAD shim (using gcc) to allow LibreOffice to run in sandboxed environments — compiling and LD_PRELOADing code is sensitive, so only run this if you trust the skill source or test in an isolated environment; (4) fonts referenced (方正*, 仿宋, 宋体, etc.) may not be available on all systems and could affect output appearance. If you are uncomfortable with local compilation or LD_PRELOAD, run the script in a VM/container or request a version that avoids the shim (or provide a system where AF_UNIX is allowed).
功能分析
Type: OpenClaw Skill
Name: 8917-docx-official
Version: 0.1.1
The script `scripts/md2docx.py` contains a C-source string that is dynamically compiled using `gcc` at runtime and loaded via `LD_PRELOAD`. This technique is used to shim system calls (socket, listen, accept) to bypass environment restrictions on AF_UNIX sockets for LibreOffice. While the code includes documentation justifying this as a workaround for sandboxed environments, the use of runtime compilation and library preloading to intercept system behavior is a high-risk capability that could be repurposed for sandbox escapes, making it suspicious despite the lack of explicit malicious payloads.
能力评估
Purpose & Capability
Name/description (produce official-format .docx/.pdf) match the shipped files: SKILL.md, a formatting reference, and a conversion script. Declared required binaries (python3, gcc, soffice) are reasonable: python3 for the script, soffice for PDF conversion, gcc to compile a small local shim used only if AF_UNIX sockets are unavailable.
Instruction Scope
SKILL.md instructs the agent to prepare Markdown, optionally consult the bundled reference file, and run scripts/md2docx.py. The script's runtime behavior (parsing Markdown, producing .docx, optionally invoking LibreOffice to convert to PDF) stays within the stated scope and does not request unrelated files, credentials, or network endpoints.
Install Mechanism
This is instruction-only (no install spec). The included Python script dynamically writes C source to a temp dir and compiles a shared object with gcc for LD_PRELOAD if needed; compilation uses only local included source (no external downloads). Dynamic compilation is somewhat higher-risk than pure-Python scripts but is justified here to work around sandboxed LibreOffice environments.
Credentials
The skill does not request credentials or config paths. It reads/writes only local temporary files and the user-supplied input/output paths. It sets LD_PRELOAD in subprocess environment when needed (affects only the subprocess used to run soffice). No secrets are collected or transmitted.
Persistence & Privilege
always is false; the skill does not request persistent system-wide changes. It creates temporary files and a cached shim in the temp directory but does not modify other skills or global configuration.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install 8917-docx-official - 安装完成后,直接呼叫该 Skill 的名称或使用
/8917-docx-official触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.1
fix: declare gcc and soffice dependencies in metadata to resolve security scan warning
v0.1.0
First public release of 8917-docx-official, a formal document conversion skill for turning Markdown and existing content into official-format DOCX documents.
元数据
常见问题
8917 DOCX Official 是什么?
将 Markdown 或其他已有内容转换为符合中国党政机关公文/正式文件格式的 `.docx` 文档;需要时也可输出 PDF。适用于:生成公文、报告、方案、通知、汇报、意见、纪要等正式文档,或用户要求把 Markdown/文本内容排版为公文格式 Word。触发词:公文格式、正式文件、官方格式、转成 docx、公文... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 137 次。
如何安装 8917 DOCX Official?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install 8917-docx-official」即可一键安装,无需额外配置。
8917 DOCX Official 是免费的吗?
是的,8917 DOCX Official 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
8917 DOCX Official 支持哪些平台?
8917 DOCX Official 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 8917 DOCX Official?
由 叶澄风(@blicae8917)开发并维护,当前版本 v0.1.1。
推荐 Skills