AI Agent Hub
Back to skills
Government Official Document Standard Formatter icon

Government Official Document Standard Formatter

Office Efficiency Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please refer to https://skillhub.cn/install/skillhub.md to install @user_2ecc1bb2/gongwenformat-pro.

About this skill

The Problem to Solve

When dealing with government official documents, the major hurdle is often not the content itself, but the process of transforming a draft into a formal document compliant with the GB/T 9704-2012 national standard. Manually adjusting fonts, sizes, margins, line spacing, and various header elements (like the red header and document number) is tedious and error-prone. This can lead to invalid submissions, especially during urgent issuance.

How the Skill Works

The gongwenformat-pro skill automates this process using a Python script (gongwen_format.py). Its core function is to parse input text and apply a predefined official document format template.

Key Steps and Capabilities:
1. Intelligent Input Parsing: Accepts multiple input formats. It can automatically identify ## headings and **bold text** in Markdown, segment plain text by blank lines, and extract pure text content from Word documents (.docx).
2. Standardized Output Generation: It populates the content into the correct format framework according to national standards. For example:
- The title is automatically set to Erhao Xiaobiao Song font and centered.
- The body text uses Sanhao Fangsong font, with each paragraph's first line indented by two characters.
- Page settings are configured for A4 paper, with margins, line spacing, etc., strictly adhering to the standard.
3. Advanced Element Customization: Through a rich set of command-line parameters (--parameter), you can insert complete document header and footer information. For instance:
- --redhead "XX Provincial People's Government" to generate the red header.
- --doc-number "X Gov Issuance [2026] No. 12" to add the document number.
- --secret-level "Confidential*20 Years" to annotate the security level.
- It also supports the signatory, main recipient, copied recipients, printing authority, and other details, catering to needs ranging from ordinary notices to upward-reporting documents.

Applicable Scope and Considerations

  • Format Authority: This tool strictly follows the GB/T 9704-2012 standard, but some organizations may have more specific internal formatting guidelines. Manual review is still necessary after generation.
  • Dependence on Input Quality: The accuracy of the output format partly relies on the structural clarity of the input text. A well-structured .md file, for example, will yield more reliable parsing results than a .docx with mixed formatting.
  • External Dependencies: Generating .pdf format requires LibreOffice to be installed on the system; otherwise, this functionality will be unavailable.
  • Flexibility Limits: For non-standard or highly specialized document layouts, the preset templates of this skill may not directly cover them, requiring parameter adjustments or post-processing.

Use Cases

  • Convert a ready Markdown-formatted research report into an official Word document adhering to the party/government document standard for distribution.
  • Receive a disorganized TXT text file and format it into a complete official document including red header and document number, strictly following the GB/T 9704-2012 standard.
  • Need to add standard footer information (issuing authority, date, copied recipients) to an internal notice for distribution and export it as a non-editable PDF.
  • Draft an upward-reporting document (a request for instructions) that requires automatic addition of specific formatting elements like the signatory and main recipient during typesetting.

Best For

  • Secretaries or administrative staff in party/government offices who need to quickly format drafted reports and notices into officially compliant documents.
  • Administrative or HR specialists in enterprises who regularly draft and issue formal notices and meeting minutes that must adhere to specific formatting guidelines.
  • University teachers or researchers who need to format academic papers or syllabi into official documents with specific layout requirements based on official templates.
  • Project coordinators or technical leads responsible for consolidating team weekly reports and summaries into a uniformly formatted document during project management.