agentCLAWHUBUnverified

一键转换为机关公文标准格式

Generate official government documents formatted strictly by GB/T 9704-2012 standards, including titles, body, headings, footers, attachments, and contacts. Skill: 一键转换为机关公文标准格式 Owner: zhangxue1985122219 Summary: Generate official government documents formatted strictly by GB/T 9704-2012 standards, including titles, body, headings, footers, attachments, and contacts. Tags: latest:1.0.5 Version history: v1.0.5 | 2026-05-06T08:05:59.928Z | user official-document v1.0.5 - No file changes detected in this version. - Documentation remains unchanged and consistent with previou

OpenClaw

Rank

62

Safety

84

Downloads

2.5k

Updated

Oct 9, 2026

Version

1.0.5

Source

CLAWHUB

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 2.5K downloads reported by the source. Last updated 10/9/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Public facts

Every fact links back to the source it came from.

Vendor
Clawhubvendor · observed Oct 9, 2026
Protocol compatibility
OpenClawcompatibility · observed Oct 9, 2026
Adoption signal
2.5K downloadsadoption · observed Oct 9, 2026
Latest release
1.0.5release · observed May 6, 2026
Handshake status
UNKNOWNsecurity

Install and run

Setup complexity: low.

clawhub skill install s175beywmd89m2zr83wn8rgs7983gq7h:official-document
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-zhangxue1985122219-official-document/snapshot"

Documentation

CLAWHUB

75,294 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

# 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 |
| 页眉距纸边 | 1.5cm |
| 页脚距纸边 | 2.5cm |
| 公文标题 | 方正小标宋简体 22pt,不加粗,居中 |
| 正文 | 仿宋_GB2312 16pt,首行缩进0.85cm |
| 一级标题 | 黑体 16pt,不加粗 |
| 二级标题 | 楷体_GB2312 16pt,不加粗 |
| 行距 | 固定28.5磅 |
| 页码 | 半角宋体(宋体)14pt,格式"— N —",单页右空一字,双页左空一字 |

## 公文结构规范

### 发文字号格式

- 年份必须使用**六角括号** `〔〕`,格式:`机关代字〔年份〕顺序号`
- 示例:`陕XX〔2026〕28号`、`中XX〔2026〕28号`
- **严禁**使用方括号 `【】` 或其他括号代替
- 对齐方式:支持 `left`(左对齐)、`center`(居中)、`right`(右对齐),默认 `center`

### 各部分间距

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

### 标题字体规范

| 要素 | 字体 | 字号 | 加粗 | 说明 |
|------|------|------|------|------|
| 发文字号 | 仿宋_GB2312 | 16pt | 否 | 左对齐/居中/右对齐,年份用六角括号 `〔〕`,如 `陕XX〔2026〕28号`,**不得**用方括号 `【】` |
| 公文标题 | 方正小标宋简体 | 22pt | 否 | 居中 |
| 主送机关 | 仿宋_GB2312 | 16pt | 否 | 顶格 |
| 正文 | 仿宋_GB2312 | 16pt | 否 | 首行缩进0.85cm |
| 一级标题 | 黑体 | 16pt | 否 | 首行缩进0.85cm |
| 二级标题 | 楷体_GB2312 | 16pt | 否 | 首行缩进0.85cm |
| 落款 | 仿宋_GB2312 | 16pt | 否 | 右对齐,右侧空4汉字 |
| 日期 | 仿宋_GB2312 | 16pt | 否 | 右对齐,右侧空4汉字 |
| 联系方式 | 仿宋_GB2312 | 16pt | 否 | 首行缩进0.85cm |
| 页码 | 宋体(半角) | 14pt | 否 | 见页码格式规范 |

### 落款格式规范(GB/T 9704-2012 §7.3.5)

| 项目 | 规定 |
|------|------|
| 发文机关全称 | 右对齐,右侧空4汉字 |
| 成文日期 | 右对齐,右侧空4汉字 |
| 日期写法 | 年月日写全,如 `2026年3月31日` |
| 字体字号 | 仿宋_GB2312,3号(16pt) |

**实现说明**:脚本通过设置段落右对齐 + 右缩进 `Twips(1280)`(约4个汉字宽度)实现落款距右4汉字的效果。

### 联系方式格式规范

**位置**:落款日期下方空1行

**字体字号**:仿宋_GB2312,3号(16pt),首行缩进0.85cm

**配置方式**:支持三种输入模式

1. **字符串模式**(直接使用,自动用中文括号包裹)
   ```python
   "contact": "联系人:张三  电话:029-XXXXXXXX,地址:陕西省西安市XXX"
   ```

2. **结构化字典模式**(自动格式化,字段间用指定分隔符连接)
   ```python
   "contact": {
       "联系人": "张三",
       "电话": "029-XXXXXXXX",
       "地址": "陕西省西安市XXX"
   }
   ```

3. **None**(不显示联系方式)
   ```python
   "contact": None
   ```

**格式选项**(通过 `contactFormat` 配置)

| 选项 | 类型 | 默认值 | 说明 |
|------|------|--------|------|
| `bracket` | bool | `True` | 是否用中文括号 `( )` 包裹整段联系方式 |
| `separator` | str | `"  "` | 结构化模式下的字段间分隔符 |

**配置示例**
```python
CONFIG = {
    # 简单字符串模式
    "contact": "联系人:张三   电话:029-XXXXXX/181XXXXXXXX",

    # 或结构化字典模式
    "contact": {
        "联系人": "赵传洪",
        "电话": "029-XXXXXX/181XXXXXXXX"
    },

    # 格式选项
    "contactFormat": {
        "bracket": True,      # 用中文括号包裹
        "separator": "  "      # 字段间用两个空格分隔
    }
}
```

**输出示例**(字符串模式,bracket=True)
```
(联系人:张三   电话:029-XXXXXX/181XXXXXXXX)
```

**输出示例**(结构化模式,bracket=True)
```
(联系人:张三   电话:029-XXXXXX/181XXXXXXXX)
```

**

README.md

# 机关公文技能(official-document)

> 基于 GB/T 9704-2012 党政机关公文格式标准,程序化生成规范红头文件

---

## 一句话介绍

只需填入发文字号、标题、正文内容,运行一行命令,即可生成符合国家标准的正式公文(通知、请示、报告、函等)。

---

## 核心特性

### ✅ 严格对标 GB/T 9704-2012

| 项目 | 标准值 |
|------|--------|
| 纸张 | A4 |
| 上/下/左/右边距 | 3.7 / 3.5 / 2.8 / 2.6 cm |
| 公文标题 | 方正小标宋简体 22pt,居中 |
| 正文 | 仿宋_GB2312 16pt,首行缩进 2 字符 |
| 一级标题 | 黑体 16pt,首行缩进 |
| 二级标题 | 楷体_GB2312 16pt,首行缩进 |
| 行距 | 固定 28.5 磅 |
| 发文字号年份 | **六角括号** `〔〕`(非方括号) |

### ✅ 中文引号自动还原

AI 生成脚本时容易将中文弯引号(`""` `''`)错写成英文直引号。脚本内置 `normalize_chinese_quotes()` 函数,在文本写入 Word 前自动将 ASCII 直引号交替还原为正确的中文弯引号,无需手动处理。

### ✅ 结构完整

- 发文字号 → 标题(空 2 行)→ 主送机关(空 1 行)→ 正文 → 附件 → 落款(空 3 行)→ 联系方式
- 落款、日期右对齐,联系方式自动套中文括号

### ✅ 零门槛使用

复制脚本 → 修改 CONFIG 和 CONTENTS → 运行,无需了解 Word XML 底层细节。

---

## 快速开始

### 前置依赖

```bash
pip install python-docx==1.2.0
```

### 使用步骤

1. **加载技能**
   ```
   use_skill("official-document")
   ```

2. **复制生成脚本**到工作目录:
   ```
   official-document/scripts/generate_docx.py
   ```

3. **修改配置区**(CONFIG)和**正文区**(CONTENTS):

   ```python
   CONFIG = {
       "docNumber": "陕XX〔2026〕28号",         # 六角括号!
       "title": "关于做好全国模范单位奖牌颁发工作的通知",
       "mainRecipients": "各设区市、各高校:",
       "author": "陕西省XXXX",
       "date": "2026年1月15日",
       "attachments": ["全国模范单位奖牌颁发情况统计表"],
       "contact": "联系人:XXX  电话:189XXXXXXXX",
       "outputFile": "公文.docx"
   }

   CONTENTS = [
       ("h1", "一、充分认识奖牌颁发工作的重要意义"),
       ("normal", "全国模范单位奖牌是表彰先进、树立典型的重要载体……"),
       ("h2", "(一)领取方式"),
       ("normal", "获奖单位请于2026年X月X日前联系所在设区市领取奖牌。"),
       # 继续添加正文……
   ]
   ```

4. **运行生成**:
   ```bash
   python generate_docx.py
   ```

---

## CONTENTS 格式说明

| 类型 | 代码 | 说明 |
|------|------|------|
| 一级标题 | `("h1", "一、xxx")` | 黑体,16pt |
| 二级标题 | `("h2", "(一)xxx")` | 楷体,16pt |
| 正文段落 | `("normal", "正文内容")` | 仿宋,16pt,自动首行缩进 |
| 空行 | `("blank", None)` | 手动空一行 |

---

## 发文字号格式规范

**必须使用六角括号** `〔〕`,严禁方括号 `【】`。

```
✅ 正确:陕XX〔2026〕28号
❌ 错误:陕XX【2026】28号
```

---

## 文件结构

```
official-document/
├── README.md
├── SKILL.md                        # 技能说明文档
├── scripts/
│   └── generate_docx.py            # 公文生成脚本
├── references/
│   └── gbt9704-2012.md             # GB/T 9704-2012 标准全文
└── assets/
    └── template_docx.py            # 精简模板参考
```

---

## 适用场景

- 各级党政机关、事业单位正式公文
- 通知、请示、报告、函等红头文件
- 需要严格符合国家公文格式标准的任何文档

_meta.json

{
  "ownerId": "kn77rhrtb8j440t13482py36xd836v6a",
  "slug": "official-document",
  "version": "1.0.5",
  "publishedAt": 1778054759928
}

references/gbt9704-2012.md

# GB/T 9704-2012 党政机关公文格式

> 中华人民共和国国家标准 GB/T 9704-2012
> 2012年6月29日发布,2012年7月1日实施

## 一、适用范围

本标准适用于各级党政机关制发的公文。其他机关和单位的公文可以参照执行。

## 二、公文结构

公文由版头、主体、版记三部分组成:

| 部分 | 位置 | 包含要素 |
|------|------|----------|
| **版头** | 首页红色分隔线以上 |份号、密级、紧急程度、发文机关标志、发文字号、签发人 |
| **主体** | 红线上以下、末条分隔线以上 | 标题、主送机关、正文、附件说明、署名、成文日期、印章、附注、附件 |
| **版记** | 末条分隔线以下 | 抄送机关、印发机关、印发日期、页码 |

## 三、纸张与页面

### 纸张规格
- 尺寸:A4型纸(210mm × 297mm)
- 定量:60~80 g/m²
- 白度:80%~90%

### 页边距(单位:mm)
| 位置 | 标准值 | 允许偏差 |
|------|--------|----------|
| 上边距 | 37mm | ±1mm |
| 下边距 | 35mm | ±1mm |
| 左边距 | 28mm | ±1mm |
| 右边距 | 26mm | ±1mm |

### 页边距(单位:twips)
| 位置 | twips值 | 说明 |
|------|---------|------|
| 上边距 | 2098 | 37mm × 56.7 |
| 下边距 | 1984 | 35mm × 56.7 |
| 左边距 | 1587 | 28mm × 56.7 |
| 右边距 | 1474 | 26mm × 56.7 |

### 版心尺寸
- 宽度:156mm
- 高度:225mm(不含页码)
- 每面:22行 × 28字

## 四、字体与字号

### 各要素字体字号对照表

| 公文要素 | 字体 | 字号 | 说明 |
|----------|------|------|------|
| 发文机关标志 | 小标宋体 | 不大于上级机关 | 醒目美观 |
| 公文标题 | 方正小标宋简体 | 2号(22pt) | 加粗,居中 |
| 一级标题 | 黑体 | 3号(16pt) | - |
| 二级标题 | 楷体_GB2312 | 3号(16pt) | - |
| 三级标题 | 仿宋_GB2312 | 3号(16pt) | 可加粗 |
| 正文 | 仿宋_GB2312 | 3号(16pt) | - |
| 主送机关 | 仿宋_GB2312 | 3号(16pt) | - |
| 附件标题 | 仿宋_GB2312 | 3号(16pt) | - |
| 落款署名 | 仿宋_GB2312 | 3号(16pt) | - |
| 签发人 | 楷体_GB2312 | 3号(16pt) | 上行文 |
| 页码 | 半角宋体 | 4号(14pt) | - |
| 抄送机关 | 仿宋_GB2312 | 4号(14pt) | - |
| 印发机关 | 仿宋_GB2312 | 4号(14pt) | - |

### 字号换算(docx half-points)

| 标准说法 | 实际大小 | docx值 |
|----------|----------|--------|
| 2号 | 22pt | 44 |
| 3号 | 16pt | 32 |
| 4号 | 14pt | 28 |
| 5号 | 10.5pt | 21 |

### Windows中文字体名称

| 字体 | 名称 | 注意事项 |
|------|------|----------|
| 方正小标宋 | 方正小标宋简体 | 最常用 |
| 黑体 | 黑体 | - |
| 楷体 | 楷体_GB2312 | 注意下划线 |
| 仿宋 | 仿宋_GB2312 | 注意下划线 |
| 宋体 | 宋体 | - |

## 五、排版规则

### 行距要求
- **固定值28.5磅**(约等于3号字高度的7/8)
- docx设置:`line: 570, lineRule: "exact"`

### 首行缩进
- 正文首行:缩进2个字符
- docx设置:`firstLine: 640`(约2字符)

### 对齐方式
| 要素 | 对齐 |
|------|------|
| 公文标题 | 居中 |
| 正文 | 两端对齐 |
| 发文字号 | 左对齐 |
| 落款 | 右对齐 |
| 日期 | 右对齐 |
| 页码 | 单页右空一字,双页左空一字 |

## 六、各要素编排位置

### 6.1 版头部分

#### 发文字号
```
格式:发文机关代字〔年份〕序号号
示例:国发〔2025〕1号
位置:发文机关标志下方、空4字后
字体:仿宋_GB2312,3号
```

#### 红色分隔线
- 位置:发文字号下方
- 样式:红色实线,宽度0.75mm~1pt
- 注意:程序生成时可省略

### 6.2 主体部分

#### 公文标题
```
格式:[发文机关]关于[事由]的[文种]
示例:国务院关于加强政府网站建设的通知
字体:方正小标宋简体,2号,加粗
对齐:居中
行数:一般不超过22行
字数:一般不超过32字
标点:不使用标点符号结尾
```

#### 主送机关
```
格式:机关名称,末尾加冒号
示例:各省、自治区、直辖市人民政府,国务院各部委、各直属机构:
字体:仿宋_GB2312,3号
对齐:左对齐
```

#### 正文
```
字体:仿宋_GB2312,3号
行距:固定值28.5磅
首行:缩进2个字符
对齐:两端对齐
```

#### 附件说明
```
格式:
附件:
1. [附件名称]
2. [附件名称]

字体:仿宋_GB2312,3号
编号:阿拉伯数字加点
位置:正文之后、落款之前
```

#### 落款
```
格式:
[发文机关全称]
XXXX年XX月XX日

字体:仿宋_GB2312,3号
对齐:右对齐
日期:年月日写全
```

### 6.3 版记部分

#### 抄送机关
```
格式:抄送:机关1,机关2
字体:仿宋_GB2312,4号
位置:印发机关上一行
```

#### 印发机关和日期
```
格式:
XXX办公室   XXXX年XX月XX日印发

字体:仿宋_GB2312,4号
位置:版记最后一行
```

### 6.4 页码
```
格式:- 1 -(居中)
字体:半角宋体,4号
位置:版心下

skill-card.md

## Description:

Generates Chinese official government documents in DOCX format using GB/T 9704-2012 layout, typography, spacing, page numbering, attachments, sign-off, and contact conventions.

This skill is ready for commercial/non-commercial use.

## Publisher:

[zhangxue1985122219](https://clawhub.ai/user/zhangxue1985122219)

### License/Terms of Use:

MIT-0

## Use Case:

External users and agents use this skill to prepare standardized Chinese official documents such as notices, requests, reports, and letters. The skill is most useful when a user needs a structured DOCX document with GB/T 9704-2012 formatting from supplied document metadata and body content.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Generated DOCX files may include personal contact details or other sensitive document content.

Mitigation: Review all contact details and document content before producing or sharing the DOCX.

Risk: The skill depends on python-docx for local document generation.

Mitigation: Use a virtual environment and hash-verified dependency installation when stricter supply-chain control is required.

## Reference(s):

- [GB/T 9704-2012 党政机关公文格式](references/gbt9704-2012.md)
- [ClawHub skill page](https://clawhub.ai/zhangxue1985122219/skills/official-document)

## Skill Output:

**Output Type(s):** [Guidance, Configuration, Code, Shell commands, Files]

**Output Format:** [Markdown guidance with Python configuration examples and shell commands; generated output is a DOCX file.]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Requires python-docx and local review of generated document content before sharing.]

## Skill Version(s):

1.0.5 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
Github ReposUpdated 2h agoRank 70

AionUi

Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!

MCPOPENCLAW
Github ReposUpdated 6mo agoRank 70

activepieces

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

OPENCLAW
Github ReposUpdated 6mo agoRank 70

cherry-studio

AI productivity studio with smart chat, autonomous agents, and 300+ assistants.

MCPOPENCLAW
Github ReposUpdated 7mo agoRank 70

CopilotKit

The Frontend for Agents & Generative UI. React + Angular

OPENCLAW

Machine-readable data

The same record, as JSON, for agents and crawlers.

{
  "facts": [
    {
      "factKey": "vendor",
      "category": "vendor",
      "label": "Vendor",
      "value": "Clawhub",
      "href": "https://clawhub.ai/zhangxue1985122219/skills/official-document",
      "sourceUrl": "https://clawhub.ai/zhangxue1985122219/skills/official-document",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-09T14:02:25.477Z",
      "isPublic": true
    },
    {
      "factKey": "protocols",
      "category": "compatibility",
      "label": "Protocol compatibility",
      "value": "OpenClaw",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-zhangxue1985122219-official-document/contract",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-zhangxue1985122219-official-document/contract",
      "sourceType": "contract",
      "confidence": "medium",
      "observedAt": "2026-10-09T14:02:25.477Z",
      "isPublic": true
    },
    {
      "factKey": "traction",
      "category": "adoption",
      "label": "Adoption signal",
      "value": "2.5K downloads",
      "href": "https://clawhub.ai/zhangxue1985122219/official-document",
      "sourceUrl": "https://clawhub.ai/zhangxue1985122219/official-document",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-10-09T14:02:25.477Z",
      "isPublic": true
    },
    {
      "factKey": "latest_release",
      "category": "release",
      "label": "Latest release",
      "value": "1.0.5",
      "href": "https://clawhub.ai/zhangxue1985122219/official-document",
      "sourceUrl": "https://clawhub.ai/zhangxue1985122219/official-document",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-05-06T08:05:59.928Z",
      "isPublic": true
    },
    {
      "factKey": "handshake_status",
      "category": "security",
      "label": "Handshake status",
      "value": "UNKNOWN",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-zhangxue1985122219-official-document/trust",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-zhangxue1985122219-official-document/trust",
      "sourceType": "trust",
      "confidence": "medium",
      "observedAt": null,
      "isPublic": true
    }
  ],
  "events": [
    {
      "eventType": "release",
      "title": "Release 1.0.5",
      "description": "official-document v1.0.5 - No file changes detected in this version. - Documentation remains unchanged and consistent with previous standards. - No new features, bug fixes, or technical modifications introduced.",
      "href": "https://clawhub.ai/zhangxue1985122219/official-document",
      "sourceUrl": "https://clawhub.ai/zhangxue1985122219/official-document",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-05-06T08:05:59.928Z",
      "isPublic": true
    }
  ]
}

Record generated Oct 9, 2026.

Sponsored

Ads related to 一键转换为机关公文标准格式 and adjacent AI workflows.