gongwen-writer

v1.4.0

政府公文格式文档生成器。支持所有常见文档格式输入(.md .txt .docx .pdf .html .rtf),输出符合国家标准的.docx公文格式。使用场景:产业调研报告、政策分析报告、工作报告等需要严格按照政府公文格式排版的文档。

0· 151·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for wisink/gongwen-writer.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "gongwen-writer" (wisink/gongwen-writer) from ClawHub.
Skill page: https://clawhub.ai/wisink/gongwen-writer
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install gongwen-writer

ClawHub CLI

Package manager switcher

npx clawhub@latest install gongwen-writer
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (government doc .docx formatting) matches the included SKILL.md and the conversion script. The code paths and reference docs describe expected Word/OOXML manipulations (python-docx, XML patching for even/odd footers) that are appropriate for the stated goal. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
Runtime instructions only tell the agent to run the provided convert.py on local input files (md, txt, docx, pdf, html, rtf) and produce a .docx. The SKILL.md asks the agent to refer to SKILL_DIR for the script — no instructions direct reading of unrelated host files, environment variables, or transmitting data to external endpoints.
Install Mechanism
There is no install spec (instruction-only skill with one included script). The script relies on common Python libraries (docx, pdfminer.six, BeautifulSoup, striprtf) but does not pull arbitrary remote code during install. This is a low-risk installation surface; the package dependencies should be installed from normal package indexes by the operator if needed.
Credentials
The skill declares no required environment variables, credentials, or config paths. The behavior described (local file parsing and Word XML manipulation) does not require additional secrets, so requested privileges are proportionate.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request persistent system presence or to modify other skills. The script writes only the output .docx and (by description) patches internal docx XML — these are expected for the functionality and do not imply elevated platform privileges.
Assessment
This skill appears to do what it says: convert local documents into a government-style .docx using python-docx and some XML patching. Before installing/using: (1) review and install required Python packages (python-docx, pdfminer.six, beautifulsoup4, striprtf or equivalents) in a controlled environment; (2) inspect the remainder of scripts/convert.py (the provided file was partially truncated in the review) to confirm there are no network calls, subprocess.exec/os.system calls, or attempts to read unrelated filesystem locations; (3) run conversions on non-sensitive test documents first to verify formatting and that content isn't unintentionally modified (the script performs aggressive punctuation/format cleanup and will remove bold/links and certain characters); (4) keep originals backed up; and (5) run in an isolated environment (virtualenv or container) if you have security concerns. If you want, I can scan the remainder of convert.py (the truncated portion) for unexpected behavior or network access.

Like a lobster shell, security has layers — review code before you run it.

latestvk976bg5yqk1j2ea1m8jmkhq9vh83c1j9
151downloads
0stars
2versions
Updated 1mo ago
v1.4.0
MIT-0

公文写作技能

将多种格式文档转换为符合政府公文格式的.docx文档。

使用场景

  • 产业调研报告
  • 政策分析报告
  • 工作汇报
  • 培训材料

支持的输入格式

格式扩展名说明
Markdown.md原生支持,#为大标题,##为一级标题,###为二级标题
纯文本.txt按行解析,通过文本模式自动判断标题层级
Word文档.docx通过段落样式和字号判断标题层级
PDF文档.pdf使用pdfminer.six提取文本,按段落分割
网页.html .htm使用BeautifulSoup解析,h1→标题,h2→一级标题,h3→二级标题
富文本.rtf使用striprtf提取文本后按段落分割

使用方法

# Markdown → .docx
python3 SKILL_DIR/scripts/convert.py <input.md> <output.docx>

# 纯文本 → .docx
python3 SKILL_DIR/scripts/convert.py <input.txt> <output.docx>

# .docx → .docx(重新格式化)
python3 SKILL_DIR/scripts/convert.py <input.docx> <output.docx>

# PDF → .docx
python3 SKILL_DIR/scripts/convert.py <input.pdf> <output.docx>

# HTML → .docx
python3 SKILL_DIR/scripts/convert.py <input.html> <output.docx>

# RTF → .docx
python3 SKILL_DIR/scripts/convert.py <input.rtf> <output.docx>

SKILL_DIR 为本技能目录的绝对路径。

格式规范

详见 references/format-rules.md

Markdown转换前预处理

Markdown文件需满足:

  1. 使用 ## 作为一级标题(对应一、二、三、)
  2. 使用 ### 作为二级标题(自动转换为(一)(二))
  3. 无加粗标记(脚本会自动去除)
  4. 无markdown链接标记(脚本会自动去除)
  5. 首行以 # 开头的为报告大标题(居中显示)
  6. 任何段落或标题的开头都不能出现"-"字符(脚本会自动去除,但请尽量避免)

脚本功能

  • 自动去除加粗标记 **...**__...__
  • 自动去除markdown链接 [text](url)
  • 自动将二级标题序号转换为中文数字((一)(二)...)
  • 每个一级标题下的二级标题独立编号
  • 段落自动首行缩进、两端对齐
  • 英文数字自动使用Times New Roman字体
  • 页码自动生成(奇数页右下、偶数页左下,格式 -数字-)
  • 落款自动右对齐排版

Comments

Loading comments...