← 返回 Skills 市场
longjf25

Gongwen Format

作者 juanfenglong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
177
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gongwen-format
功能描述
Skill for creating Chinese official documents (公文) following standardized formatting requirements. Use when user wants to create official documents such as n...
使用说明 (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
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gongwen-format
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gongwen-format 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug gongwen-format
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Gongwen Format 是什么?

Skill for creating Chinese official documents (公文) following standardized formatting requirements. Use when user wants to create official documents such as n... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 177 次。

如何安装 Gongwen Format?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gongwen-format」即可一键安装,无需额外配置。

Gongwen Format 是免费的吗?

是的,Gongwen Format 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Gongwen Format 支持哪些平台?

Gongwen Format 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gongwen Format?

由 juanfenglong(@longjf25)开发并维护,当前版本 v1.0.0。

💬 留言讨论