modelscope.cn

gov-document

根据GB/T 9704-2012《? 支持生成docx和pdf格式文件。当用户需要创建? 正式通知、决定、?

Installation

$ npx skills add https://modelscope.cn

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from modelscope.cn · top by installs.

npx skills add https://modelscope.cn

Browse all from modelscope.cn

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 6,064 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

党政机关公文格式生成器

根据 GB/T 9704-2012 国家标准,生成符合规范的党政机关公文(docx/pdf)。

何时使用

场景 说明
用户要求创建公文 通知、决定、公告、通报、请示、批复、函、纪要等
用户要求生成红头文件 带发文机关标志的正式公文
用户要求生成符合国标的正式文件 引用 GB/T 9704 标准
用户要求将内容格式化为公文 将已有内容转为标准公文格式

工作流程

  1. 收集信息:确认公文类型、发文机关、标题、正文内容、主送机关、成文日期等要素
  2. 选择格式:通用格式 / 信函格式 / 命令(令)格式 / 纪要格式
  3. 生成文档:运行脚本生成符合标准的 docx 文件
  4. 可选转换:将 docx 转换为 pdf

公文格式核心参数

页面设置

  • 纸张: A4 (210mm × 297mm)
  • 天头(上白边): 37mm ± 1mm
  • 订口(左白边): 28mm ± 1mm
  • 版心尺寸: 156mm × 225mm
  • 行数: 每面22行
  • 每行字数: 28字

字体规范

要素 字体 字号 说明
发文机关标志 小标宋体 由标志区域决定 红色,居中
标题 小标宋体 二号 红色分隔线下空二行,居中
正文 仿宋体 三号 首行缩进2字
主送机关 仿宋体 三号 顶格,回行仍顶格
发文字号 仿宋体 三号 居中/居左,六角括号括年份
签发人 仿宋体+楷体 三号 "签发人"三字仿宋,姓名楷体
附件说明 仿宋体 三号 正文下空一行,左空二字
成文日期 阿拉伯数字,右空四字
附注 仿宋体 三号 成文日期下一行,左空二字加圆括号
抄送机关 仿宋体 四号 左右各空一字
印发机关和日期 仿宋体 四号 印发机关左空一字,日期右空一字
页码 宋体 四号半角 阿拉伯数字,左右各放一字线
密级和保密期限 黑体 三号 顶格,版心左上角
紧急程度 黑体 三号 顶格,版心左上角
份号 三号 6位阿拉伯数字,顶格左上角

结构层次序数

  • 第一层:一、二、三、(黑体)
  • 第二层:(一)(二)(三)(楷体)
  • 第三层:1. 2. 3.(仿宋)
  • 第四层:(1)(2)(3)(仿宋)

分隔线规则

  • 版头分隔线: 发文字号之下4mm处,红色,与版心等宽
  • 版记分隔线: 首条和末条用粗线(0.35mm),中间用细线(0.25mm)

公文格式要素划分

┌─────────────────────────────┐
│         版头区域              │
│  份号 / 密级 / 紧急程度       │
│  发文机关标志(红色小标宋)      │
│  发文字号 / 签发人            │
│  ────── 红色分隔线 ──────     │
├─────────────────────────────┤
│         主体区域              │
│  标题(二号小标宋)             │
│  主送机关                     │
│  正文(三号仿宋)              │
│  附件说明                     │
│  发文机关署名 / 成文日期 / 印章│
│  附注                        │
├─────────────────────────────┤
│         版记区域              │
│  ────── 粗分隔线 ──────       │
│  抄送机关                     │
│  印发机关和印发日期            │
│  ────── 粗分隔线 ──────       │
└─────────────────────────────┘

生成方法

方式一:使用Python脚本生成docx

python <skill-dir>/scripts/generate_gov_docx.py --input <json-input-file> --output <output-path.docx>

JSON输入文件格式见 references/input-format.md

方式二:直接使用python-docx编写

遵循以下核心规则:

from docx import Document
from docx.shared import Pt, Mm, Cm, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml.ns import qn

doc = Document()

# 页面设置 A4
section = doc.sections[0]
section.page_width = Mm(210)
section.page_height = Mm(297)
section.top_margin = Mm(37)      # 天头
section.bottom_margin = Mm(35)   # 下白边(通过版心计算)
section.left_margin = Mm(28)     # 订口
section.right_margin = Mm(26)    # 右白边(通过版心计算)

# 正文段落 - 三号仿宋,首行缩进2字
para = doc.add_paragraph()
para.paragraph_format.first_line_indent = Pt(16 * 2)  # 三号字16pt,缩进2字
para.paragraph_format.line_spacing = Pt(28)  # 行距约28磅
run = para.add_run('正文内容')
run.font.name = '仿宋'
run.font.size = Pt(16)  # 三号字 = 16pt
run._element.rPr.rFonts.set(qn('w:eastAsia'), '仿宋')

重要规则

  1. 公文首页必须显示正文
  2. 文字颜色: 除发文机关标志、红色分隔线外,均为黑色
  3. 成文日期: 用阿拉伯数字标全年月日,右空四字
  4. 印章: 红色,端正居中下压发文机关署名和成文日期
  5. 页码: 单页码居右空一字,双页码居左空一字,版记页不编页码
  6. 附件: 另面编排,版记之前,与正文一起装订
  7. 联合行文: 主办机关名称在前

详细参考

  • 完整格式规范: references/format-spec.md
  • JSON输入格式: references/input-format.md