← Back to Skills Marketplace
longjf25

Gongwen Format

by juanfenglong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
177
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install gongwen-format
Description
Skill for creating Chinese official documents (公文) following standardized formatting requirements. Use when user wants to create official documents such as n...
README (SKILL.md)

\r \r

gongwen_format\r

\r

技能说明 / Skill Description\r

\r This skill creates Chinese official documents (公文) following standardized formatting requirements based on:\r

  • GB/T 9704-2012: 党政机关公文格式国家标准\r
  • Common enterprise standards: Based on 南航股份办公室 培训要求\r \r

公文格式规范 / Document Formatting Standards\r

\r

字体规范 / Font Standards\r

\r | 元素 | 字体 | 字号 | 粗体 | 说明 |\r |------|------|------|------|------|\r | 标题 | 方正小标宋简体 | 二号 | 否 | 多行标题行距38磅 |\r | 正文 | 方正仿宋 | 三号 | 否 | 行距28磅 |\r | 一级标题 | 方正黑体 | 三号 | 否 | 格式:"一、" |\r | 二级标题 | 方正楷体 | 三号 | 否 | 格式:"(一)" |\r | 三级标题 | 方正仿宋 | 三号 | 否 | 格式:"1." (不能用"1、") |\r | 四级标题 | 方正仿宋 | 三号 | 否 | 格式:"(1)" |\r | 附件序号 | 方正仿宋 | 三号 | 否 | 格式:"1." "2." |\r \r

页面设置 / Page Settings\r

\r

  • 纸张: A4 (210mm × 297mm)\r
  • 页边距: 上37mm,下35mm,左28mm,右26mm\r
  • 版心: 156mm × 225mm\r \r

标题行数 / Title Line Count\r

\r

  • 单行标题: 居中,字号二号,加粗\r
  • 多行标题: 居中,字号二号,不加粗,行距38磅\r \r ---\r \r

创建公文 / Creating Official Documents\r

\r

方法1: 使用 docx-js (推荐 / Recommended)\r

\r 参考 references/gongwen_template.js 获取完整模板代码:\r \r

// 创建公文文档\r
const { Document, Packer, Paragraph, TextRun, AlignmentType, LineRuleType } = require('docx');\r
const fs = require('fs');\r
\r
// 公文字体映射\r
const FONTS = {\r
  xiaobiaosong: '方正小标宋简体',  // 标题\r
  fangsong: '方正仿宋',            // 正文\r
  heiti: '方正黑体',              // 一级标题\r
  kaiti: '方正楷体',              // 二级标题\r
};\r
\r
// 公文字号映射 (二号=22pt, 三号=16pt)\r
const SIZES = {\r
  erhao: 44,   // 二号 (22pt = 44 half-points)\r
  sanhao: 32,  // 三号 (16pt = 32 half-points)\r
};\r
\r
const doc = new Document({\r
  sections: [{\r
    properties: {\r
      page: {\r
        size: { width: 11906, height: 16838 },  // A4 in DXA\r
        margin: { top: 1570, bottom: 1484, left: 1134, right: 1106 }\r
        // 对应: 上37mm, 下35mm, 左28mm, 右26mm\r
      }\r
    },\r
    children: [\r
      // 标题\r
      new Paragraph({\r
        alignment: AlignmentType.CENTER,\r
        children: [new TextRun({\r
          text: '关于XXXX的通知',\r
          font: FONTS.xiaobiaosong,\r
          size: SIZES.erhao,\r
        })],\r
        spacing: { line: 38 * 20, lineRule: LineRuleType.AUTO }\r
      }),\r
      // 正文...\r
    ]\r
  }]\r
});\r
\r
Packer.toBuffer(doc).then(buffer => {\r
  fs.writeFileSync('gongwen.docx', buffer);\r
});\r
```\r
\r
### 方法2: 使用 C# OpenXML SDK\r
\r
参考 `references/gongwen_template.cs` 获取完整模板代码。\r
\r
---\r
\r
## 标题层级示例 / Heading Hierarchy Example\r
\r
```\r
                                  [标题:方正小标宋简体 二号 居中]\r
\r
一、一级标题(方正黑体 三号)\r
  (一)二级标题(方正楷体 三号)\r
    1. 三级标题(方正仿宋 三号)\r
      (1)四级标题(方正仿宋 三号)\r
        正文内容(方正仿宋 三号,行距28磅)\r
\r
附件:\r
1. 附件一名称\r
2. 附件二名称\r
```\r
\r
---\r
\r
## 常见公文类型 / Common Document Types\r
\r
| 类型 | 英文 | 用途 |\r
|------|------|------|\r
| 通知 | Notice | 发布规章、布置工作 |\r
| 报告 | Report | 向上级汇报工作 |\r
| 决定 | Decision | 对重要事项作出决策 |\r
| 批复 | Reply | 答复下级请示 |\r
| 函 | Letter | 机关之间商洽工作 |\r
| 纪要 | Minutes | 记载会议情况 |\r
\r
---\r
\r
## 快速参考 / Quick Reference\r
\r
### 字体安装提示\r
\r
公文格式要求使用特定中文字体(方正系列)。如系统未安装:\r
- Windows: 可从方正官网下载或使用替代字体\r
- 替代方案: 华文系列字体可作为临时替代\r
\r
### 常见错误\r
\r
1. **标题加粗** - 公文标题不应加粗\r
2. **三级标题用"1、"** - 应使用"1."格式\r
3. **行距过密** - 正文行距应设置为28磅\r
4. **页边距错误** - 应严格按照规范设置\r
\r
---\r
\r
## 参考资料 / References\r
\r
- `references/gongwen_template.js` - docx-js 公文模板\r
- `references/gongwen_template.cs` - C# OpenXML 公文模板\r
- `references/gb9704_2012.md` - GB/T 9704-2012 简要说明\r
Usage Guidance
This skill appears coherent and self-contained. Before running the example code: 1) review references/gongwen_template.js (it writes a local gongwen_output.docx) and run it in a trusted environment; 2) install the 'docx' npm package yourself (npm install docx) if you intend to execute the script; 3) the skill references a C# template in SKILL.md that is not included—ignore or request the missing file if you need it; 4) ensure the specific Chinese fonts are installed locally if exact visual fidelity is required. There are no network calls or credential requests in the package.
Capability Analysis
Type: OpenClaw Skill Name: gongwen-format Version: 1.0.0 The skill is designed to assist in formatting Chinese official documents (公文) according to the GB/T 9704-2012 standard. The provided code in 'references/gongwen_template.js' uses the legitimate 'docx' library to generate Word documents locally, and the instructions in 'SKILL.md' are strictly aligned with document processing tasks without any signs of malicious intent, data exfiltration, or prompt injection.
Capability Assessment
Purpose & Capability
Name/description match the included assets: a GB/T 9704 reference and a docx JS template. The required capabilities (document formatting, writing a .docx) align with the resources provided.
Instruction Scope
SKILL.md instructs usage of docx (node) and references a C# template, but no C# file is included. The JS template writes a local .docx file; instructions do not request secrets, read unrelated system files, or send data externally. Minor inconsistency: SKILL.md shows an example JS snippet whose margin DXA values differ from those in references/gongwen_template.js.
Install Mechanism
No install spec included (instruction-only). The JS template depends on the public 'docx' npm package, but the skill does not auto-download or execute remote code. No downloads from unknown URLs or archive extraction.
Credentials
No environment variables, credentials, or sensitive config paths are requested. The only runtime dependency is a user-installed npm package and optionally system fonts for correct rendering.
Persistence & Privilege
always is false and the skill does not request persistent system privileges or modify other skills or system configurations. It writes only an output document to the working directory when the provided template code is executed by the user.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gongwen-format
  3. After installation, invoke the skill by name or use /gongwen-format
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
gongwen-format 1.0.0 initial release - Generates Chinese official documents (公文) following standardized formatting. - Supports GB/T 9704-2012 national standards and common enterprise requirements. - Provides clear font, size, margin, and hierarchy specifications for all elements. - Includes document structure and common公文类型 (notice, report, decision, etc.). - Sample code templates provided for docx-js (JavaScript) and C# OpenXML.
Metadata
Slug gongwen-format
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Gongwen Format?

Skill for creating Chinese official documents (公文) following standardized formatting requirements. Use when user wants to create official documents such as n... It is an AI Agent Skill for Claude Code / OpenClaw, with 177 downloads so far.

How do I install Gongwen Format?

Run "/install gongwen-format" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Gongwen Format free?

Yes, Gongwen Format is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Gongwen Format support?

Gongwen Format is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Gongwen Format?

It is built and maintained by juanfenglong (@longjf25); the current version is v1.0.0.

💬 Comments