Gbt standard docx skill
使用 GB/T 1.1-2020 模板生成和校验中文标准文稿,优先保留模板样式、编号、页眉页脚和占位控件。From its SKILL.md
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.
- 8 stars8 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.
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
What ships with it: 42 files
392.1 KB alongside SKILL.md, 9 of them executable
docs/
- architecture.md1.8 KB
- gbt-1.2-adoption.md1.7 KB
- normative-reference-verification.md2.0 KB
- public-repo.md1.1 KB
- roadmap.md843 B
examples/
- dy-led-auditorium.yaml31.1 KB
- gbt-minimal.yaml3.3 KB
- industry-minimal.yaml3.1 KB
knowledge/
- gbt_1_1/index.yaml905 B
- gbt_1_1/README.md875 B
- gbt_1_1/rules/abbreviations.yaml871 B
- gbt_1_1/rules/citations.yaml1.1 KB
- gbt_1_1/rules/decision_map.yaml619 B
- gbt_1_1/rules/foreword.yaml773 B
- gbt_1_1/rules/introduction.yaml661 B
- gbt_1_1/rules/lists.yaml977 B
- gbt_1_1/rules/normative_refs.yaml1013 B
- gbt_1_1/rules/normative_ref_verification.yaml990 B
- gbt_1_1/rules/scope.yaml812 B
- gbt_1_2/index.yaml268 B
- gbt_1_2/README.md428 B
- gbt_1_2/rules/adoption.yaml670 B
profiles/
- gbt/document_schema.json8.5 KB
- gbt/rules.yaml1.4 KB
- gbt/style_map.yaml1.5 KB
scripts/
- build_gbt_knowledge.pyruns1.7 KB
- check_normative_refs.pyruns4.2 KB
- inspect_template.pyruns6.7 KB
- refresh_fields.pyruns4.2 KB
- render_gbt.pyruns60.5 KB
- report_review_docx.pyruns4.1 KB
- review_gbt_docx.pyruns29.7 KB
- validate_gbt.pyruns28.6 KB
- verify_render.pyruns2.4 KB
templates/
- .gitignore495 B
- README.md5.7 KB
- requirements.txt33 B
2 more files not listed here. See all 42 in the repository.