official-document

v1.0.0

Generate official government documents formatted strictly by GB/T 9704-2012 standards, including titles, body, headings, footers, attachments, and contacts.

1· 832·5 current·5 all-time
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (generate GB/T 9704-2012-compliant official documents) align with included files: a Python script (generate_docx.py) and a JS template for docx generation. Required capabilities are local file creation and python-docx/docx libraries—appropriate for the stated purpose.
Instruction Scope
Runtime instructions are limited to copying the provided script to the working directory, editing CONFIG/CONTENTS, installing python-docx, and running the script. No steps read unrelated system files, access environment variables, or transmit data externally. Note: small documentation inconsistencies (typos/mismatched filenames in SKILL.md file-structure vs actual files: e.g., generate_docxy.py vs generate_docx.py, assets/template_docx.py vs assets/template_docx.js) could confuse users following the instructions.
Install Mechanism
No install spec; it's effectively instruction-only. The only external dependency is the public python package python-docx (documented). No downloads from arbitrary URLs or archive extraction; code is included in the bundle.
Credentials
The skill requests no environment variables, credentials, or config paths. The included scripts operate on local data only (CONFIG and CONTENTS in the script). Default CONFIG contains example contact info, but that's not a secret or external credential.
Persistence & Privilege
always is false and the skill does not request persistent or elevated platform privileges. It does not modify other skills or system-wide agent settings.
Assessment
This skill appears to do exactly what it says: generate GB/T 9704-2012 formatted .docx files using local scripts. Before running: (1) review and, if needed, edit the CONFIG block in scripts/generate_docx.py to avoid leaving placeholder contact information; (2) install python-docx in a controlled environment (virtualenv) and run the script locally; (3) be aware of minor documentation typos — the script to run is scripts/generate_docx.py (not generate_docxy.py), and the JS template is template_docx.js; (4) if you have strict font requirements, ensure the referenced Chinese fonts are available on your system (otherwise Word will substitute). If you need higher assurance, open the included files and inspect them (they contain no network calls or credential access).

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

latestvk97fmhd8kzeez2cdmk7n6ja4yx83g8e9
832downloads
1stars
1versions
Updated 3w ago
v1.0.0
MIT-0

official-document - 通用机关公文技能

基于 GB/T 9704-2012 党政机关公文格式标准,适用于各级机关单位生成正式公文。

适用场景

  • 生成党政机关公文(通知、请示、报告、函等)
  • 按国家标准排版的正式文档
  • 需要规范格式的红头文件

技术方案

  • 语言: Python 3
  • : python-docx
  • 编码: UTF-8(文件头声明 # -*- coding: utf-8 -*-

核心格式参数(GB/T 9704-2012)

项目标准值
纸张A4
上边距3.7cm
下边距3.5cm
左边距2.8cm
右边距2.6cm
公文标题方正小标宋简体 22pt,不加粗,居中
正文仿宋_GB2312 16pt,首行缩进0.85cm
一级标题黑体 16pt,不加粗
二级标题楷体_GB2312 16pt,不加粗
行距固定28.5磅
页码宋体 12pt,居中或右下

公文结构规范

发文字号格式

  • 年份必须使用六角括号 〔〕,格式:机关代字〔年份〕顺序号
  • 示例:陕XX〔2026〕28号中XX〔2026〕28号
  • 严禁使用方括号 【】 或其他括号代替

各部分间距

位置间距要求
发文字号 → 标题空2行
标题 → 主送机关空1行
主送机关 → 正文直接连接,正常行距
正文段落之间正常行距,无额外段前段后
附件前空1行
落款前空3行
落款 → 日期同一行或相邻行,距右4汉字
日期 → 联系方式空1行

标题字体规范

要素字体字号加粗说明
发文字号仿宋_GB231216pt右对齐,年份用六角括号 〔〕,如 陕XX〔2026〕28号不得用方括号 【】
公文标题方正小标宋简体22pt居中
主送机关仿宋_GB231216pt顶格
正文仿宋_GB231216pt首行缩进0.85cm
一级标题黑体16pt首行缩进0.85cm
二级标题楷体_GB231216pt首行缩进0.85cm
落款仿宋_GB231216pt右对齐
日期仿宋_GB231216pt右对齐

附件格式

  • 单个附件:附件:文件名
  • 多个附件:
    附件:1.文件名1
          2.文件名2
    
    (编号左对齐)

联系方式格式

  • 位置:落款日期下方空1行
  • 格式:(联系人:XXX 电话:XXX,地址:XXX)
  • 首行缩进0.85cm

使用方法

  1. 加载技能:use_skill("official-document")
  2. 复制 scripts/generate_docx.py 到工作目录
  3. 修改 CONFIG 配置和 CONTENTS 正文内容
  4. 运行 python generate_docx.py

Python 编码注意事项

重要:所有字符串使用三引号 """...""" 包裹,避免文本内容中的引号与字符串分隔符冲突。

# 正确示例:正文内容含中文弯引号时,必须用三引号包裹
text = """切实发挥中文弯引号的作用"""

# 错误示例
contact = "联系人:XX.."  # 文本中有逗号可能没问题,但引号会有问题

中文引号必须原样保留

中文排版引号为弯引号字符,区分左右(左引号和右引号不同)。生成脚本时必须原样保留用户输入的引号,不得替换为英文直引号。

注意:Markdown 无法正确显示中文弯引号,因此严禁在 SKILL.md 或代码示例中展示引号字符来"示范正确用法"。

文件结构

official-document/
├── SKILL.md                      # 本文档
├── scripts/
│   └── generate_docxy.py          # Python生成脚本
├── references/
│   └── gbt9704-2012.md           # GB/T 9704-2012 标准全文
└── assets/
    └── template_docx.py           # 精简模板

Comments

Loading comments...