Official Document Generator (GB/T 9704-2012) for Openclaw

A professional Python-based generator for creating standardized Chinese official documents following the GB/T 9704-2012 layout requirements.

zhangxue1985122219
v1.0.5
May 6, 2026
2
2.6k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install official-document

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install official-document using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Official Document Generator (GB/T 9704-2012)?

The Official Document Generator is a specialized tool designed to produce documents that adhere strictly to the GB/T 9704-2012 standard for party and government organs. By leveraging Openclaw Skills, developers and administrative staff can automate the creation of formal notices, requests, reports, and letters without worrying about complex layout configurations.

This tool handles the technical nuances of Chinese typesetting, including specific margin settings (3.7cm top, 3.5cm bottom), font hierarchies like FangSong_GB2312 and KaiTi_GB2312, and fixed line spacing of 28.5pt. It ensures that every output meets the professional requirements essential for official state and party correspondence.

Official Document Generator (GB/T 9704-2012) Use Cases

  • Generating official government notices, reports, and formal requests.
  • Typesetting documents according to the national GB/T 9704-2012 standard.
  • Automating the creation of formal documents with precise margin and font control.
  • Standardizing document numbers and contact information formatting across departments.

How Official Document Generator (GB/T 9704-2012) Works

  1. The user provides document metadata including the title, document number, and sender information.
  2. The system initializes a python-docx object configured with GB/T 9704-2012 standard margins.
  3. Content is parsed and styles are applied based on hierarchy (e.g., Level 1 headings in HeiTi, Body in FangSong).
  4. A specialized font isolation algorithm handles secondary titles to prevent KaiTi styles from bleeding into subsequent body text.
  5. Standardized footers and page numbers are dynamically generated with odd/even page alignment rules.
  6. The final DOCX file is exported ready for official printing or distribution.

Official Document Generator (GB/T 9704-2012) Setup

To get started with this tool from Openclaw Skills, follow these steps:

# Load the skill into your environment
use_skill("official-document")

# Ensure the required Python library is installed
pip install python-docx

# Copy the generation script to your working directory
cp scripts/generate_docx.py .

Official Document Generator (GB/T 9704-2012) Data Schema & Taxonomy

The skill follows a strict metadata schema to ensure compliance with national standards:

Element Standard Value Font Specification
Paper Size A4 N/A
Document Title Centered FangZhengXiaoBiaoSong (22pt)
Main Body Indent 0.85cm FangSong_GB2312 (16pt)
Document Number Hexagonal Brackets FangSong_GB2312 (16pt)
Line Spacing Fixed 28.5pt N/A
Page Numbers — N — SongTi (14pt)

Official Document Generator (GB/T 9704-2012) Advanced Features

  • Smart font isolation for h2 headers to maintain 100% style integrity between titles and body text.
  • Dynamic footer logic that automatically mirrors page numbers for odd and even pages.
  • Flexible contact information formatting supporting both structured dictionaries and raw strings.
  • Automatic conversion of document number brackets to the mandatory hexagonal format.
  • Multi-attachment support with automated left-aligned numbering and indentation.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*