gongwen-skill 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dsh/skills/gongwen-skill/SKILL.md +3 -4
- package/.dsh/skills/gongwen-skill.md +3 -4
- package/CHANGELOG.md +22 -0
- package/README.md +7 -6
- package/SKILL.md +3 -4
- package/cordis.patch.yml +4 -0
- package/dsh/client.js +3 -1
- package/dsh/index.js +4 -2
- package/engine/__init__.py +1 -0
- package/engine/auto_optimizer.py +5 -0
- package/engine/chat_review.py +5 -0
- package/engine/config.py +1 -0
- package/engine/core/__init__.py +1 -0
- package/engine/core/document/__init__.py +1 -0
- package/engine/core/document/_generator_helpers.py +5 -0
- package/engine/core/document/ai_structure_analyzer.py +1 -0
- package/engine/core/document/annotator.py +5 -0
- package/engine/core/document/editor.py +6 -0
- package/engine/core/document/font_utils.py +1 -0
- package/engine/core/document/generator.py +1 -0
- package/engine/core/document/markdown_converter.py +5 -0
- package/engine/core/document/models.py +1 -0
- package/engine/core/document/modifier.py +1 -0
- package/engine/core/document/ooxml_parser.py +5 -0
- package/engine/core/document/ooxml_workflow.py +5 -0
- package/engine/core/document/parser.py +1 -0
- package/engine/core/document/parser_format.py +6 -0
- package/engine/core/document/reviewer_comments.py +5 -0
- package/engine/core/document/structure_analyzer.py +1 -0
- package/engine/core/document/tracked_annotator.py +5 -0
- package/engine/core/document/tracked_changes.py +5 -0
- package/engine/core/document/tracked_common.py +5 -0
- package/engine/core/rules/__init__.py +1 -0
- package/engine/core/rules/checker.py +1 -0
- package/engine/core/rules/engine.py +1 -0
- package/engine/core/rules/fixer.py +1 -0
- package/engine/core/rules/loader.py +1 -0
- package/engine/core/rules/manager.py +1 -0
- package/engine/docx_to_image.py +5 -0
- package/engine/fact_check.py +5 -0
- package/engine/focus_checker.py +5 -0
- package/engine/handoff.py +1 -0
- package/engine/inject.py +1 -1
- package/engine/live_edit.py +5 -0
- package/engine/optimizer.py +1 -1
- package/engine/review_generator.py +5 -0
- package/engine/structure_checker.py +5 -0
- package/engine/style_profile.py +5 -0
- package/engine/table_sign_generator.py +5 -0
- package/engine/table_sign_template.py +6 -0
- package/engine/template_builder.py +1 -0
- package/engine/utils/__init__.py +6 -0
- package/engine/utils/errors.py +5 -0
- package/engine/utils/logger.py +1 -0
- package/engine/utils/parse.py +5 -0
- package/engine/utils/zip_utils.py +5 -0
- package/gongwen/__init__.py +2 -1
- package/gongwen/__main__.py +1 -0
- package/gongwen/_bootstrap.py +6 -0
- package/gongwen/_legacy.py +2 -2
- package/gongwen/cli/__init__.py +1 -0
- package/gongwen/cli/content_cmds.py +6 -0
- package/gongwen/cli/doctor_cmds.py +6 -0
- package/gongwen/cli/font_cmds.py +7 -0
- package/gongwen/cli/helpers.py +7 -0
- package/gongwen/cli/misc_cmds.py +6 -0
- package/gongwen/cli/review_cmds.py +6 -0
- package/gongwen/cli/style_helpers.py +6 -0
- package/gongwen/cli/update_cmds.py +6 -0
- package/package.json +1 -1
- package/prompts/style-prompts.md +5 -4
- package/prompts/usage-prompts.md +7 -1
- package/pyproject.toml +1 -1
- package/rules/official/_common.yaml +4 -0
- package/rules/official/announcement.yaml +4 -0
- package/rules/official/bill.yaml +13 -0
- package/rules/official/bulletin.yaml +13 -0
- package/rules/official/command.yaml +4 -0
- package/rules/official/communique.yaml +21 -0
- package/rules/official/decision.yaml +4 -0
- package/rules/official/instruction.yaml +13 -0
- package/rules/official/letter.yaml +4 -0
- package/rules/official/meeting.yaml +13 -0
- package/rules/official/minutes.yaml +13 -0
- package/rules/official/news.yaml +50 -0
- package/rules/official/notice.yaml +27 -1
- package/rules/official/notice_public.yaml +4 -0
- package/rules/official/opinion.yaml +13 -0
- package/rules/official/regulation.yaml +13 -0
- package/rules/official/reply.yaml +13 -0
- package/rules/official/report.yaml +13 -0
- package/rules/official/request.yaml +4 -0
- package/rules/official/resolution.yaml +13 -0
- package/rules/official/speech.yaml +4 -0
- package/rules/official/summary.yaml +13 -0
- package/rules/official/table_sign.yaml +4 -0
- package/rules/official/technical_proposal.yaml +4 -0
- package/rules/official/work_plan.yaml +13 -0
|
@@ -14,10 +14,9 @@ metadata:
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
<!--
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Licensed under the MIT License. See the LICENSE file for details.
|
|
17
|
+
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
18
|
+
https://github.com/linhut/gongwen-skill
|
|
19
|
+
Licensed under the MIT License. See the LICENSE file for details.
|
|
21
20
|
-->
|
|
22
21
|
|
|
23
22
|
# 公文文档格式化 Skill(GB/T 9704)
|
|
@@ -14,10 +14,9 @@ metadata:
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
<!--
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Licensed under the MIT License. See the LICENSE file for details.
|
|
17
|
+
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
18
|
+
https://github.com/linhut/gongwen-skill
|
|
19
|
+
Licensed under the MIT License. See the LICENSE file for details.
|
|
21
20
|
-->
|
|
22
21
|
|
|
23
22
|
# 公文文档格式化 Skill(GB/T 9704)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
https://github.com/linhut/gongwen-skill
|
|
4
|
+
Licensed under the MIT License. See the LICENSE file for details.
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
## v2.1.0 (2026-08-20)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **格式规则完善**:为 24 种公文类型新增 30+ 条 check/fix 规则,提升规则覆盖率
|
|
11
|
+
- `news.yaml`:从 0 条规则扩展至 5 条(导语段/稿源信息/标题风格/标题字数/听取通报段检查)
|
|
12
|
+
- `notice.yaml`:新增标题格式和通知事项检查
|
|
13
|
+
- `communique.yaml`:新增公报签署和标题格式检查
|
|
14
|
+
- 12 个原只有 2 条规则的类型各新增 1 条检查规则(bill/bulletin/instruction/meeting/minutes/opinion/regulation/reply/report/resolution/summary/work_plan)
|
|
15
|
+
- **版本发布清单**:RELEASE.md 扩展版本号检查点从 4 处代码→9 处(含文档/提示词/DSH 桥接)
|
|
16
|
+
- **pre-commit hook**:`.githooks/pre-commit` 自动检查 4 处代码版本号一致性,阻止版本漂移的提交
|
|
17
|
+
- **动态 PyPI 徽章**:README.md 的 PyPI 徽章改为动态版本号(`https://img.shields.io/pypi/v/gongwen-skill`),自动显示最新版本
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- RELEASE.md 全面更新:修复 12 处残留 1.12.x 引用,更新 npm 发布状态,新增 pre-commit hook 说明
|
|
21
|
+
- 规则文件统一添加 `template_name` 和 `document_type` 字段(news.yaml 补齐)
|
|
22
|
+
|
|
1
23
|
## v2.0.0 (2026-08-20)
|
|
2
24
|
|
|
3
25
|
### Major
|
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
https://github.com/linhut/gongwen-skill
|
|
3
4
|
Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
-->
|
|
5
6
|
|
|
@@ -12,7 +13,7 @@ Licensed under the MIT License. See the LICENSE file for details.
|
|
|
12
13
|
> 中文公文全流程处理工具——基于 **GB/T 9704《党政机关公文格式》** 国家标准,支持 **格式检查与修复、内容优化(Word 原生修订+批注/差异对比版)、模板生成、Markdown 转公文、版头版记页码注入、事实核验、风格增强** 等完整能力。原生支持 **DeepSeek Harness (DSH)** 技能系统,打包为可被 AI Agent 直接调用的 Skill,完全自包含,克隆即用。
|
|
13
14
|
|
|
14
15
|
[](https://github.com/linhut/gongwen-skill/actions)
|
|
15
|
-
[](https://pypi.org/project/gongwen-skill/)
|
|
16
17
|
[](./LICENSE)
|
|
17
18
|

|
|
18
19
|

|
|
@@ -336,7 +337,7 @@ DSH 采用 **Cordis 模块化微内核架构**:技能体系基于本地文件
|
|
|
336
337
|
git clone https://github.com/linhut/gongwen-skill.git
|
|
337
338
|
cd gongwen-skill
|
|
338
339
|
pip install -r requirements.txt # 或 pip install gongwen-skill(已上 PyPI)
|
|
339
|
-
python -m gongwen --version # 检验:gongwen-skill v2.
|
|
340
|
+
python -m gongwen --version # 检验:gongwen-skill v2.1.0
|
|
340
341
|
```
|
|
341
342
|
|
|
342
343
|
### 方式一:作为 DSH Skill 注册(基于本地文件系统)
|
|
@@ -392,7 +393,7 @@ pnpm add -w gongwen-skill
|
|
|
392
393
|
"dependencies": {
|
|
393
394
|
"@deepseek-ai/dsh-base": "...",
|
|
394
395
|
"@deepseek-ai/dsh-web-app": "...",
|
|
395
|
-
"gongwen-skill": "^2.
|
|
396
|
+
"gongwen-skill": "^2.1.0"
|
|
396
397
|
},
|
|
397
398
|
"dsh": {
|
|
398
399
|
"profile": {
|
|
@@ -447,9 +448,9 @@ dsh --profile web
|
|
|
447
448
|
| CLI 独立可执行(`python -m gongwen <命令>`) | ✅ |
|
|
448
449
|
| PyPI 上架(`pip install gongwen-skill`) | ✅ |
|
|
449
450
|
| 零外部运行时依赖(仅 python-docx/pydantic/pyyaml) | ✅ |
|
|
450
|
-
| DSH 配置化排版参数(页边距/行距/字体/默认模板版本) | ✅ v2.
|
|
451
|
+
| DSH 配置化排版参数(页边距/行距/字体/默认模板版本) | ✅ v2.1.0+ |
|
|
451
452
|
|
|
452
|
-
### DSH 插件配置化(v2.
|
|
453
|
+
### DSH 插件配置化(v2.1.0+)
|
|
453
454
|
|
|
454
455
|
DSH 插件支持通过配置文件管理排版参数,Agent 调用时自动注入,纯 CLI 用户不受影响。
|
|
455
456
|
|
|
@@ -573,7 +574,7 @@ pip install -r requirements.txt
|
|
|
573
574
|
用户:帮我优化这份会议通知的第二章节措辞
|
|
574
575
|
|
|
575
576
|
Agent:📋 合规自检报告
|
|
576
|
-
Skill 版本: v2.
|
|
577
|
+
Skill 版本: v2.1.0(多渠道自检已确认最新)
|
|
577
578
|
路径判定: B(内容优化)
|
|
578
579
|
依据: 用户指定了已有文档,且要求"优化措辞"
|
|
579
580
|
命令调用: 1. python -m gongwen optimize-content 会议通知.docx --changes changes.json --apply --paragraphs "5-8"
|
package/SKILL.md
CHANGED
|
@@ -14,10 +14,9 @@ metadata:
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
<!--
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Licensed under the MIT License. See the LICENSE file for details.
|
|
17
|
+
(c) 2026 Jose AI (https://www.linhut.cn)
|
|
18
|
+
https://github.com/linhut/gongwen-skill
|
|
19
|
+
Licensed under the MIT License. See the LICENSE file for details.
|
|
21
20
|
-->
|
|
22
21
|
|
|
23
22
|
# 公文文档格式化 Skill(GB/T 9704)
|
package/cordis.patch.yml
CHANGED
package/dsh/client.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// 公文全流程处理工具 DSH client — 可视化配置面板(gongwen-skill,不做皮肤,仅设置面板)
|
|
2
|
-
// (c) 2026 Jose AI (https://www.linhut.cn)
|
|
2
|
+
// (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
// https://github.com/linhut/gongwen-skill
|
|
4
|
+
// Licensed under the MIT License. See the LICENSE file for details.
|
|
3
5
|
//
|
|
4
6
|
// 在 DSH Web GUI 系统设置 → 插件配置 中渲染公文排版参数编辑界面。
|
|
5
7
|
// 通过 /plugins/gongwen-skill/api/config (GET/POST) 与宿主端通信。
|
package/dsh/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
// 公文全流程处理工具 - DSH plugin bridge (gongwen-skill, v2.
|
|
2
|
-
// (c) 2026 Jose AI (https://www.linhut.cn)
|
|
1
|
+
// 公文全流程处理工具 - DSH plugin bridge (gongwen-skill, v2.1.0+)
|
|
2
|
+
// (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
// https://github.com/linhut/gongwen-skill
|
|
4
|
+
// Licensed under the MIT License. See the LICENSE file for details.
|
|
3
5
|
//
|
|
4
6
|
// 分层架构:
|
|
5
7
|
// - Python CLI:纯工具层,通过 --config-overrides 接收规则覆盖 JSON
|
package/engine/__init__.py
CHANGED
package/engine/auto_optimizer.py
CHANGED
package/engine/chat_review.py
CHANGED
package/engine/config.py
CHANGED
package/engine/core/__init__.py
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
4
|
+
# https://github.com/linhut/gongwen-skill
|
|
5
|
+
# Licensed under the MIT License. See the LICENSE file for details.
|
|
6
|
+
#
|
|
2
7
|
"""
|
|
3
8
|
Generator helper functions: table and page number field creation.
|
|
4
9
|
Extracted from generator.py (tier-2 split).
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
4
|
+
# https://github.com/linhut/gongwen-skill
|
|
5
|
+
# Licensed under the MIT License. See the LICENSE file for details.
|
|
6
|
+
#
|
|
1
7
|
"""
|
|
2
8
|
Content revision engine for official document optimization.
|
|
3
9
|
Produces comparison documents showing original vs revised content
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Font utilities: Handle Chinese font settings correctly for Word documents.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Document generator: converts DocumentModel back into a .docx file.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Pydantic data models for the intermediate document representation.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Document modifier: the single source of truth for all DocumentModel mutations.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Document parser: converts a .docx file into DocumentModel.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
4
|
+
# https://github.com/linhut/gongwen-skill
|
|
5
|
+
# Licensed under the MIT License. See the LICENSE file for details.
|
|
6
|
+
#
|
|
2
7
|
"""
|
|
3
8
|
tracked 修订公共工具(P2-10 修复:消除 tracked_changes / tracked_annotator 重复代码)。
|
|
4
9
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Format checker: validates a DocumentModel against loaded rules.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Rule engine: orchestrates loading, checking, and fixing using the rule system.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Rule-based fixer: interprets YAML fix_rules and delegates to DocumentModifier.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
YAML rule file loader. Reads rule definitions from the rules/ directory.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# This file is part of the Official Document AI Assistant.
|
|
2
2
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
3
|
+
# https://github.com/linhut/gongwen-skill
|
|
3
4
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
4
5
|
"""
|
|
5
6
|
Rule Manager: unified rule loading with priority layering.
|
package/engine/docx_to_image.py
CHANGED
package/engine/fact_check.py
CHANGED
package/engine/focus_checker.py
CHANGED
package/engine/handoff.py
CHANGED
package/engine/inject.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# 公文文档格式化 Skill —— 版头 / 版记 / 页码注入(独立发行版)
|
|
4
4
|
#
|
|
5
5
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
6
|
-
#
|
|
6
|
+
# https://github.com/linhut/gongwen-skill
|
|
7
7
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
8
8
|
#
|
|
9
9
|
# 本模块从原项目 backend/api/routes/optimize.py 中抽取版头/版记/页码
|
package/engine/live_edit.py
CHANGED
package/engine/optimizer.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# 公文文档格式化 Skill —— 内容优化差异对比引擎
|
|
4
4
|
#
|
|
5
5
|
# (c) 2026 Jose AI (https://www.linhut.cn)
|
|
6
|
-
#
|
|
6
|
+
# https://github.com/linhut/gongwen-skill
|
|
7
7
|
# Licensed under the MIT License. See the LICENSE file for details.
|
|
8
8
|
#
|
|
9
9
|
# 功能:将原文段落与优化后段落进行句子级 diff,生成带标注的 .docx 文档。
|
package/engine/style_profile.py
CHANGED
package/engine/utils/__init__.py
CHANGED
package/engine/utils/errors.py
CHANGED
package/engine/utils/logger.py
CHANGED
package/engine/utils/parse.py
CHANGED