Gbt standard docx skill
基于 Word 模板生成、校验和审查符合 GB/T 1.1 体例的中文标准文稿 skill。
npx -y skills add zhangzhangco/gbt-standard-docx-skillAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
使用 GB/T 1.1-2020 模板生成和校验中文标准文稿,优先保留模板样式、编号、页眉页脚和占位控件。
SKILL.md
5.4 KB, ~1.9k tokens by cl100k_base, as published. Nobody here has run it
GB/T 标准文稿 Skill
当任务涉及 GB/T 1.1-2020 标准文稿创建、填充、校验或模板分析时使用本 skill。
工作流
- 把模板视为真源,不从零重建 Word 样式。
- 优先运行
scripts/inspect_template.py,确认当前模板清单。 - 规则知识优先沉淀到
knowledge/gbt_1_1/,避免把规则散落到脚本里。 - 根据模板自动匹配 profile,处理国家标准/行业标准封面差异。
- 用
scripts/validate_gbt.py校验输入结构。 - 用
scripts/render_gbt.py在模板基础上生成.docx。 - 需要目录/交叉引用回写时,运行
scripts/refresh_fields.py。 - 用
scripts/verify_render.py生成 PDF 和页面图片做视觉校验。 - 需要生成后审查时,运行
scripts/review_gbt_docx.py输出结构化审查结果。 - 需要形成送审表时,运行
scripts/report_review_docx.py生成“修改意见表”.docx。 - 涉及规范性引用文件时,运行
scripts/check_normative_refs.py,明确哪些条目必须做在线版本核验。
当前能力边界
第一版支持:
- 封面信息填充
前言、引言、目录页、范围、规范性引用文件、术语和定义的首版填充- 模板内容控件、表单域和常见占位文本替换
- 术语条、附录以及基础图题/表题/注/示例块渲染
- 通过
styled_paragraph显式命中模板专用段落样式,例如标准文件_一级项、标准文件_字母编号列项(一级)、标准文件_正文公式 - 基于显式书签的
REF/PAGEREF交叉引用 - 主条款树和附录条款树的递归渲染
- 基础规则校验
- 目录/交叉引用/页码等现有域的刷新标记与可选 LibreOffice 回写
- 国家标准模板与行业标准模板兼容
- 导出
*.refs.json引用清单,并在渲染时校验交叉引用目标是否存在 - 可通过 profile 覆盖
目次/前言/引言/参考文献标题样式,并在文末追加结束线图片 - 支持对最终
.docx做生成后审查,当前覆盖引言要求性表述、缩略语、列项、悬置段和引用提及关系 - 支持把审查结果转换为“标准征求意见稿修改意见表”
.docx - 已建立
GB/T 1.1知识层,包含原始资料、抽取文本和主题化规则文件 - 已支持规范性引用文件的版本核验提示,能够区分注日期/不注日期引用,并标记需要联网核验的条目
第一版暂不支持:
- 自动目录刷新
- 复杂交叉引用重算
- 复杂图表对象插入
- 更深层级的附录条款编排
补充说明:
- 目录页当前通过插入 Word TOC 域实现。
refresh_fields.py --soffice-roundtrip不会自动展开 TOC 条目,目录条目仍主要依赖 Word 更新域。- 交叉引用可在目标块上显式声明
bookmark,并在文本里使用{{ref:...}} / {{refnum:...}} / {{page:...}}。 - 未显式声明
bookmark时,图、表、术语条、主条款、附录和附录条款会按稳定规则自动生成引用名。 scripts/render_gbt.py会在输出.docx同目录生成*.refs.json,便于检查书签名和域指令。scripts/validate_gbt.py会提前检查标准号/日期格式、重复书签、缺失引用目标和附录连续性,适合在渲染前先卡掉明显错误。scripts/review_gbt_docx.py当前直接读取 OOXML,输出 JSON 形式的审查结果,适合后续再转成正式审查报告。scripts/report_review_docx.py当前使用三列表格输出序号 / 章条编号 / 意见,意见列内含原文 / 建议 / 理由。scripts/build_gbt_knowledge.py可把GB/T 1.1原始文档抽取成全文和高频规则摘录,供后续扩展主题规则。scripts/check_normative_refs.py不直接替换引用版本,而是输出“是否必须联网核验”“如果升级是否可能构成技术差异”的判断提示。
常用命令
python3 scripts/inspect_template.py --template templates/gbt/source/国家标准.dotx --output outputs/gbt-template-manifest.json
python3 scripts/validate_gbt.py --input examples/gbt-minimal.yaml --rules profiles/gbt/rules.yaml
python3 scripts/render_gbt.py --input examples/gbt-minimal.yaml --template templates/gbt/source/国家标准.dotx --output outputs/generated/示例标准.docx
python3 scripts/render_gbt.py --input examples/industry-minimal.yaml --template templates/gbt/source/行业标准.dotx --output outputs/generated/行业示例标准.docx
python3 scripts/refresh_fields.py --input outputs/generated/示例标准.docx --soffice-roundtrip
python3 scripts/verify_render.py --input outputs/generated/示例标准.docx --output-dir outputs/verify/national
python3 scripts/review_gbt_docx.py --input outputs/generated/示例标准.docx --output outputs/review/示例标准.review.json
python3 scripts/report_review_docx.py --input outputs/review/示例标准.review.json --output outputs/review/示例标准-修改意见表.docx
python3 scripts/check_normative_refs.py --input examples/gbt-minimal.yaml --output outputs/review/示例标准.normative-refs.json
python3 scripts/build_gbt_knowledge.py --input "knowledge/gbt_1_1/raw/GBT 1.1.docx" --full-output knowledge/gbt_1_1/extracted/gbt-1.1-full.md --focus-output knowledge/gbt_1_1/extracted/gbt-1.1-focus.md
Gives 0 of the 12 instructions most pdf office docs skills give in ~1.9k tokens
Counted across 635 of the 690 authors here whose files we hold, read 2026-08-06
- extract text using pdfplumberin 92 of 635, across 25 files
- create PDFs using reportlabin 83 of 635, across 16 files
- read FORMS.md to fill out PDF formsin 80 of 635, across 13 files
- OCR scanned PDFs using pytesseractin 77 of 635, across 10 files
- merge or split PDFs using qpdfin 70 of 635, across 3 files
- use Excel formulas instead of hardcoded calculated valuesin 68 of 635, across 12 files
- unpack edit xml and repack existing documentsin 63 of 635, across 8 files
- document sources for hardcoded valuesin 61 of 635, across 9 files
- write minimal python code without unnecessary commentsin 59 of 635, across 7 files
- run the recalculation script after adding or modifying formulasin 58 of 635, across 6 files
- fix all identified formula errors and recalculatein 58 of 635, across 6 files
- format years as text stringsin 57 of 635, across 5 files
Said here and by no other author read
- treat the template as the source of truth
- do not rebuild Word styles from scratch
- consolidate rule knowledge into the knowledge directory
- match the profile based on the template
- render the docx using the template
- refresh fields when cross-references are needed
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.