AI Agent Hub
Back to skills
📁

GB/T 9704 Document Formatting

Office Efficiency Updated 2026.08.30

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

Please follow https://skillhub.cn/install/skillhub.md to install @user_905ff2ca/gongwen-format-gbt9704.

About this skill

Problem: turning a settled draft into an official layout

Many documents already have the final text; what is missing is a reliable A4 layout, text area, heading hierarchy, page numbers, and optional header elements. Editing Word manually can cause fonts, margins, and footers to drift apart, while rebuilding an existing DOCX from extracted text may lose images, comments, tracked changes, hyperlinks, merged cells, and section breaks.

How the skill works

  • Classify the document first: when the request is simply to format a report or summary into Word or official style, it defaults to a continuous document layout without red headers or covers; --cover and --redhead are used only when explicitly requested.
  • Format without rewriting: scripts/generate_gongwen.py generates DOCX and does not normalize punctuation or numbers by default; body punctuation or date digits are adjusted only on explicit request.
  • Apply GB/T 9704 references: A4 page, 156 mm × 225 mm text area, body usually in third-size FangSong, titles usually in second-size XiaoBiaoSong, levels recognized as “一、”, “(一)”, “1.”, and “(1)”, with page numbers in fourth-size half-width Song and one-character lines.
  • Input contracts: supports Markdown, plain text, and JSON; DOCX extraction is limited to --rebuild-docx with simple paragraphs and tables.
  • Quality checks: after generation, it checks script compilation, word/document.xml, footer XML, PAGE fields, odd/even pages, and page rendering to catch missing glyphs, overlap, or misalignment.

Limits and cautions

  • Complex DOCX files should not be rebuilt by this script; make local formatting changes while preserving OOXML structure.
  • It does not automatically handle seals, joint issuance, multiple signers, attachments on separate pages, bottom-locked record notes, or letter/order/minutes styles, so formal issuance needs manual review.
  • If local fonts such as XiaoBiaoSong, FangSong, Kai, Hei, or Song are missing, the DOCX keeps the declared fonts, but preview or PDF output may substitute them.

Use Cases

  • After drafting a report or summary, convert Markdown into an A4 official layout and generate DOCX.
  • When a red header is explicitly requested, add agency, document number, and signer only from provided info.
  • For plain-text materials, detect “一、” “(一)” “1.” “(1)” levels and apply heading/body fonts.
  • After generation, verify page numbers, odd/even pages, PAGE fields, and rendered pages to fix overlap or clipping.

Best For

  • Secretaries drafting Party or government materials who need a GB/T 9704-referenced Word layout.
  • Project specialists turning proposals, reports, and summaries into deliverable DOCX files without rewriting content.
  • Administrative staff generating simple official headers, bodies, and page numbers, then manually reviewing formal elements.
  • Office-automation engineers verifying DOCX fonts, footers, PAGE fields, and rendered pages.