pdd-skills 3.0.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/README.md +1478 -0
- package/bin/pdd.js +354 -0
- package/config/bpmn-rules.yaml +166 -0
- package/config/checkstyle.xml +105 -0
- package/config/eslint.config.js +48 -0
- package/config/pmd.xml +91 -0
- package/config/prd-rules.yaml +113 -0
- package/config/ruff.toml +45 -0
- package/config/sqlfluff.cfg +82 -0
- package/hooks/hook-executor.js +332 -0
- package/index.js +43 -0
- package/lib/api-routes.js +750 -0
- package/lib/api-server.js +408 -0
- package/lib/cache/cache-config.js +209 -0
- package/lib/cache/system-cache.js +852 -0
- package/lib/config-manager.js +373 -0
- package/lib/generate.js +528 -0
- package/lib/grpc/grpc-routes.js +1134 -0
- package/lib/grpc/grpc-server.js +912 -0
- package/lib/grpc/proto-definitions.js +1033 -0
- package/lib/init.js +172 -0
- package/lib/iteration/auto-fixer.js +1025 -0
- package/lib/iteration/auto-reviewer.js +923 -0
- package/lib/iteration/controller.js +577 -0
- package/lib/list.js +130 -0
- package/lib/mcp-server.js +548 -0
- package/lib/openclaw/api-integration.js +535 -0
- package/lib/openclaw/cli-integration.js +567 -0
- package/lib/openclaw/data-sync.js +845 -0
- package/lib/openclaw/openclaw-adapter.js +783 -0
- package/lib/plugin/example-plugins/code-stats/index.js +332 -0
- package/lib/plugin/example-plugins/code-stats/plugin.json +1 -0
- package/lib/plugin/example-plugins/custom-linter/index.js +472 -0
- package/lib/plugin/example-plugins/custom-linter/plugin.json +1 -0
- package/lib/plugin/example-plugins/hello-world/index.js +86 -0
- package/lib/plugin/example-plugins/hello-world/plugin.json +1 -0
- package/lib/plugin/plugin-manager.js +655 -0
- package/lib/plugin/plugin-sdk.js +565 -0
- package/lib/plugin/sandbox.js +627 -0
- package/lib/quality/rules/maintainability.js +418 -0
- package/lib/quality/rules/performance.js +498 -0
- package/lib/quality/rules/readability.js +441 -0
- package/lib/quality/rules/robustness.js +504 -0
- package/lib/quality/rules/security.js +444 -0
- package/lib/quality/scorer.js +576 -0
- package/lib/report.js +669 -0
- package/lib/sdk-base.js +301 -0
- package/lib/sdk-js.js +446 -0
- package/lib/sdk-python/README.md +546 -0
- package/lib/sdk-python/examples/basic_usage.py +450 -0
- package/lib/sdk-python/pdd_sdk/__init__.py +180 -0
- package/lib/sdk-python/pdd_sdk/client.py +1170 -0
- package/lib/sdk-python/pdd_sdk/events.py +423 -0
- package/lib/sdk-python/pdd_sdk/exceptions.py +158 -0
- package/lib/sdk-python/pdd_sdk/models.py +518 -0
- package/lib/sdk-python/pdd_sdk/utils.py +759 -0
- package/lib/token/budget-alert.js +367 -0
- package/lib/token/budget-manager.js +485 -0
- package/lib/update.js +54 -0
- package/lib/utils/logger.js +88 -0
- package/lib/verify.js +741 -0
- package/lib/version.js +52 -0
- package/lib/vm/README.md +102 -0
- package/lib/vm/dashboard/api-routes.js +669 -0
- package/lib/vm/dashboard/server.js +391 -0
- package/lib/vm/dashboard/sse.js +358 -0
- package/lib/vm/dashboard/static/css/dashboard.css +1378 -0
- package/lib/vm/dashboard/static/index.html +118 -0
- package/lib/vm/dashboard/static/js/app.js +949 -0
- package/lib/vm/dashboard/static/js/charts.js +913 -0
- package/lib/vm/dashboard/static/js/kanban-view.js +1053 -0
- package/lib/vm/dashboard/static/js/pipeline-view.js +463 -0
- package/lib/vm/dashboard/static/js/quality-view.js +598 -0
- package/lib/vm/dashboard/static/js/system-view.js +1021 -0
- package/lib/vm/data-provider.js +1191 -0
- package/lib/vm/event-bus.js +402 -0
- package/lib/vm/hooks/extract-hook.js +307 -0
- package/lib/vm/hooks/generate-hook.js +374 -0
- package/lib/vm/hooks/hook-interface.js +458 -0
- package/lib/vm/hooks/report-hook.js +331 -0
- package/lib/vm/hooks/verify-hook.js +454 -0
- package/lib/vm/models.js +1003 -0
- package/lib/vm/reconciler.js +855 -0
- package/lib/vm/scanner.js +988 -0
- package/lib/vm/state-schema.js +955 -0
- package/lib/vm/state-store.js +733 -0
- package/lib/vm/tui/components/card.js +339 -0
- package/lib/vm/tui/components/progress-bar.js +368 -0
- package/lib/vm/tui/components/sparkline.js +327 -0
- package/lib/vm/tui/components/status-light.js +294 -0
- package/lib/vm/tui/components/table.js +370 -0
- package/lib/vm/tui/input.js +335 -0
- package/lib/vm/tui/renderer.js +548 -0
- package/lib/vm/tui/screens/kanban-screen.js +397 -0
- package/lib/vm/tui/screens/overview-screen.js +357 -0
- package/lib/vm/tui/screens/quality-screen.js +336 -0
- package/lib/vm/tui/screens/system-screen.js +379 -0
- package/lib/vm/tui/tui.js +805 -0
- package/package.json +1 -0
- package/scripts/cso-analyzer.js +198 -0
- package/scripts/eval-runner.js +359 -0
- package/scripts/i18n-checker.js +109 -0
- package/scripts/linter/activiti-linter.js +272 -0
- package/scripts/linter/prd-linter.js +162 -0
- package/scripts/linter/report-generator.js +207 -0
- package/scripts/linter/run-linters.js +285 -0
- package/scripts/linter/sql-linter.js +166 -0
- package/scripts/token-analyzer.js +162 -0
- package/scripts/vm-test.js +180 -0
- package/skills/core/official-doc-writer/LICENSE +21 -0
- package/skills/core/official-doc-writer/README.md +232 -0
- package/skills/core/official-doc-writer/SKILL.md +475 -0
- package/skills/core/official-doc-writer/_meta.json +1 -0
- package/skills/core/official-doc-writer/document_generator.py +580 -0
- package/skills/core/official-doc-writer/evals/default-evals.json +1 -0
- package/skills/core/official-doc-writer/examples.md +150 -0
- package/skills/core/official-doc-writer/fonts/FONTS_LIST.md +45 -0
- package/skills/core/official-doc-writer/fonts/README.md +141 -0
- package/skills/core/official-doc-writer/fonts/SIMFANG.TTF +0 -0
- package/skills/core/official-doc-writer/fonts/SIMHEI.TTF +0 -0
- package/skills/core/official-doc-writer/fonts/SIMKAI.TTF +0 -0
- package/skills/core/official-doc-writer/fonts/SIMSUN.TTC +0 -0
- package/skills/core/official-doc-writer/fonts//346/226/271/346/255/243/345/260/217/346/240/207/345/256/213GBK.TTF +0 -0
- package/skills/core/official-doc-writer/references/GBT_9704-2012_/345/205/232/346/224/277/346/234/272/345/205/263/345/205/254/346/226/207/346/240/274/345/274/217.md +422 -0
- package/skills/core/official-doc-writer/scripts/__pycache__/generate_official_doc.cpython-313.pyc +0 -0
- package/skills/core/official-doc-writer/scripts/dialog_manager.py +564 -0
- package/skills/core/official-doc-writer/scripts/generate_official_doc.py +252 -0
- package/skills/core/official-doc-writer/scripts/install_fonts.py +390 -0
- package/skills/core/official-doc-writer/scripts/smart_prompts.py +363 -0
- package/skills/core/pdd-ba/SKILL.md +305 -0
- package/skills/core/pdd-ba/_meta.json +1 -0
- package/skills/core/pdd-ba/evals/default-evals.json +1 -0
- package/skills/core/pdd-code-reviewer/SKILL.md +378 -0
- package/skills/core/pdd-code-reviewer/_meta.json +1 -0
- package/skills/core/pdd-code-reviewer/evals/default-evals.json +1 -0
- package/skills/core/pdd-doc-change/SKILL.md +350 -0
- package/skills/core/pdd-doc-change/_meta.json +1 -0
- package/skills/core/pdd-doc-change/evals/default-evals.json +1 -0
- package/skills/core/pdd-doc-gardener/SKILL.md +248 -0
- package/skills/core/pdd-doc-gardener/_meta.json +1 -0
- package/skills/core/pdd-doc-gardener/evals/default-evals.json +1 -0
- package/skills/core/pdd-entropy-reduction/SKILL.md +360 -0
- package/skills/core/pdd-entropy-reduction/_meta.json +1 -0
- package/skills/core/pdd-entropy-reduction/evals/default-evals.json +1 -0
- package/skills/core/pdd-entropy-reduction/references/entropy-report-template.md +287 -0
- package/skills/core/pdd-entropy-reduction/references/golden-principles.md +573 -0
- package/skills/core/pdd-entropy-reduction/scripts/entropy_scan.py +712 -0
- package/skills/core/pdd-extract-features/SKILL.md +320 -0
- package/skills/core/pdd-extract-features/_meta.json +1 -0
- package/skills/core/pdd-extract-features/evals/default-evals.json +1 -0
- package/skills/core/pdd-generate-spec/SKILL.md +418 -0
- package/skills/core/pdd-generate-spec/_meta.json +1 -0
- package/skills/core/pdd-generate-spec/evals/default-evals.json +1 -0
- package/skills/core/pdd-implement-feature/SKILL.md +332 -0
- package/skills/core/pdd-implement-feature/_meta.json +1 -0
- package/skills/core/pdd-implement-feature/evals/default-evals.json +1 -0
- package/skills/core/pdd-main/SKILL.md +540 -0
- package/skills/core/pdd-main/_meta.json +1 -0
- package/skills/core/pdd-main/evals/default-evals.json +1 -0
- package/skills/core/pdd-main/evals/evals.json +215 -0
- package/skills/core/pdd-verify-feature/SKILL.md +474 -0
- package/skills/core/pdd-verify-feature/_meta.json +1 -0
- package/skills/core/pdd-verify-feature/evals/default-evals.json +1 -0
- package/skills/core/pdd-vm/evals/default-evals.json +1 -0
- package/skills/core/traffic-accident-assessor/LICENSE +29 -0
- package/skills/core/traffic-accident-assessor/SKILL.md +439 -0
- package/skills/core/traffic-accident-assessor/evals/evals.json +1 -0
- package/skills/core/traffic-accident-assessor/references/accident-types.md +369 -0
- package/skills/core/traffic-accident-assessor/references/liability-rules.md +287 -0
- package/skills/core/traffic-accident-assessor/references/traffic-laws.md +226 -0
- package/skills/core/traffic-accident-assessor/references//351/253/230/345/260/224/345/244/253/350/257/264/346/230/216/344/271/246.pdf +32576 -106
- package/skills/core/traffic-accident-assessor/scripts/generate_official_statement.py +588 -0
- package/skills/core/traffic-accident-assessor/scripts/generate_report.py +495 -0
- package/skills/core/traffic-accident-assessor/scripts/generate_statement.py +528 -0
- package/skills/core/traffic-accident-assessor.zip +0 -0
- package/skills/entropy/expert-arch-enforcer/SKILL.md +292 -0
- package/skills/entropy/expert-arch-enforcer/_meta.json +1 -0
- package/skills/entropy/expert-arch-enforcer/evals/default-evals.json +1 -0
- package/skills/entropy/expert-auto-refactor/SKILL.md +327 -0
- package/skills/entropy/expert-auto-refactor/_meta.json +1 -0
- package/skills/entropy/expert-auto-refactor/evals/default-evals.json +1 -0
- package/skills/entropy/expert-code-quality/SKILL.md +468 -0
- package/skills/entropy/expert-code-quality/_meta.json +1 -0
- package/skills/entropy/expert-code-quality/evals/default-evals.json +1 -0
- package/skills/entropy/expert-code-quality/evals/evals.json +109 -0
- package/skills/entropy/expert-code-quality/references/code-smells.md +605 -0
- package/skills/entropy/expert-code-quality/references/design-patterns.md +1111 -0
- package/skills/entropy/expert-code-quality/references/refactoring-catalog.md +1281 -0
- package/skills/entropy/expert-code-quality/references/solid-principles.md +524 -0
- package/skills/entropy/expert-entropy-auditor/SKILL.md +276 -0
- package/skills/entropy/expert-entropy-auditor/_meta.json +1 -0
- package/skills/entropy/expert-entropy-auditor/evals/default-evals.json +1 -0
- package/skills/expert/expert-activiti/SKILL.md +497 -0
- package/skills/expert/expert-activiti/_meta.json +1 -0
- package/skills/expert/expert-mysql/SKILL.md +832 -0
- package/skills/expert/expert-mysql/_meta.json +1 -0
- package/skills/expert/expert-performance/SKILL.md +379 -0
- package/skills/expert/expert-performance/_meta.json +1 -0
- package/skills/expert/expert-performance/evals/default-evals.json +1 -0
- package/skills/expert/expert-ruoyi/SKILL.md +472 -0
- package/skills/expert/expert-ruoyi/_meta.json +1 -0
- package/skills/expert/expert-security/SKILL.md +1341 -0
- package/skills/expert/expert-security/_meta.json +1 -0
- package/skills/expert/expert-security/evals/default-evals.json +1 -0
- package/skills/expert/software-architect/SKILL.md +350 -0
- package/skills/expert/software-architect/_meta.json +1 -0
- package/skills/expert/software-engineer/SKILL.md +437 -0
- package/skills/expert/software-engineer/_meta.json +1 -0
- package/skills/expert/software-engineer/architecture.md +130 -0
- package/skills/expert/software-engineer/patterns.md +151 -0
- package/skills/expert/software-engineer/testing.md +135 -0
- package/skills/expert/system-architect/SKILL.md +628 -0
- package/skills/expert/system-architect/_meta.json +1 -0
- package/skills/expert/system-architect/assets/templates/ARCHITECTURE.md +25 -0
- package/skills/expert/system-architect/assets/templates/README.md +44 -0
- package/skills/expert/system-architect/references/js-ts-standards.md +18 -0
- package/skills/expert/system-architect/references/python-standards.md +19 -0
- package/skills/expert/system-architect/references/scaffolding.md +61 -0
- package/skills/expert/system-architect/references/security-checklist.md +21 -0
- package/skills/openspec/openspec-apply-change/SKILL.md +156 -0
- package/skills/openspec/openspec-apply-change/_meta.json +1 -0
- package/skills/openspec/openspec-archive-change/SKILL.md +114 -0
- package/skills/openspec/openspec-archive-change/_meta.json +1 -0
- package/skills/openspec/openspec-bulk-archive-change/SKILL.md +246 -0
- package/skills/openspec/openspec-bulk-archive-change/_meta.json +1 -0
- package/skills/openspec/openspec-continue-change/SKILL.md +118 -0
- package/skills/openspec/openspec-continue-change/_meta.json +1 -0
- package/skills/openspec/openspec-explore/SKILL.md +288 -0
- package/skills/openspec/openspec-explore/_meta.json +1 -0
- package/skills/openspec/openspec-ff-change/SKILL.md +101 -0
- package/skills/openspec/openspec-ff-change/_meta.json +1 -0
- package/skills/openspec/openspec-new-change/SKILL.md +74 -0
- package/skills/openspec/openspec-new-change/_meta.json +1 -0
- package/skills/openspec/openspec-onboard/SKILL.md +554 -0
- package/skills/openspec/openspec-onboard/_meta.json +1 -0
- package/skills/openspec/openspec-sync-specs/SKILL.md +138 -0
- package/skills/openspec/openspec-sync-specs/_meta.json +1 -0
- package/skills/openspec/openspec-verify-change/SKILL.md +168 -0
- package/skills/openspec/openspec-verify-change/_meta.json +1 -0
- package/skills/pr/pdd-multi-review/SKILL.md +534 -0
- package/skills/pr/pdd-multi-review/_meta.json +1 -0
- package/skills/pr/pdd-pr-batch/SKILL.md +303 -0
- package/skills/pr/pdd-pr-batch/_meta.json +1 -0
- package/skills/pr/pdd-pr-create/SKILL.md +344 -0
- package/skills/pr/pdd-pr-create/_meta.json +1 -0
- package/skills/pr/pdd-pr-merge/SKILL.md +286 -0
- package/skills/pr/pdd-pr-merge/_meta.json +1 -0
- package/skills/pr/pdd-pr-review/SKILL.md +217 -0
- package/skills/pr/pdd-pr-review/_meta.json +1 -0
- package/skills/pr/pdd-task-manager/SKILL.md +636 -0
- package/skills/pr/pdd-task-manager/_meta.json +1 -0
- package/skills/pr/pdd-template-engine/SKILL.md +306 -0
- package/skills/pr/pdd-template-engine/_meta.json +1 -0
- package/templates/behavior-shaping/iron-law-template.md +87 -0
- package/templates/behavior-shaping/rationalization-template.md +62 -0
- package/templates/behavior-shaping/red-flags-template.md +70 -0
- package/templates/bilingual-template.md +139 -0
- package/templates/config/default.yaml +47 -0
- package/templates/project/default/README.md +31 -0
- package/templates/project/frontend/README.md +46 -0
- package/templates/project/java/README.md +48 -0
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
***
|
|
2
|
+
|
|
3
|
+
name: "official-doc-writer"
|
|
4
|
+
description: "Official document writer generating government docs (notifications, reports, requests) per GB/T 9704-2012 standard. Invoke when creating formal documents or government-style output."
|
|
5
|
+
author: "neuqik@hotmail.com"
|
|
6
|
+
license: "MIT"
|
|
7
|
+
--------------
|
|
8
|
+
|
|
9
|
+
# 党政机关公文生成技能 / Official Government Document Generation Skill
|
|
10
|
+
|
|
11
|
+
## 核心概念 / Core Concepts
|
|
12
|
+
|
|
13
|
+
### 🇨🇳 核心概念
|
|
14
|
+
|
|
15
|
+
本技能用于生成符合《党政机关公文处理工作条例》和GB/T 9704-2012《党政机关公文格式》国家标准的公文文档,支持通知、报告、请示、函等10种公文类型,可导出为标准Word文档。
|
|
16
|
+
|
|
17
|
+
**快速使用**: `python scripts/generate_official_doc.py`
|
|
18
|
+
|
|
19
|
+
### 🇺🇸 Core Concepts
|
|
20
|
+
|
|
21
|
+
This skill generates official government documents that comply with the "Regulations on the Processing of Official Documents of Party and Government Organs" and the GB/T 9704-2012 "Format for Official Documents of Party and Government Organs" national standard. It supports 10 document types including notifications, reports, requests, and letters, and can export to standard Word format.
|
|
22
|
+
|
|
23
|
+
**Quick Start**: `python scripts/generate_official_doc.py`
|
|
24
|
+
|
|
25
|
+
## 字体依赖与安装 / Font Dependencies & Installation
|
|
26
|
+
|
|
27
|
+
### 🇨🇳 字体依赖与安装
|
|
28
|
+
|
|
29
|
+
#### 必需字体清单
|
|
30
|
+
|
|
31
|
+
| 字体名称 | 用途 | 文件名 |
|
|
32
|
+
|---------|------|--------|
|
|
33
|
+
| 方正小标宋_GBK | 发文机关标志、标题 | FZXBSJW.TTF |
|
|
34
|
+
| 仿宋_GB2312 | 正文、发文字号 | SIMFANG.TTF |
|
|
35
|
+
| 黑体 | 一级标题、密级 | SIMHEI.TTF |
|
|
36
|
+
| 楷体_GB2312 | 二级标题、签发人姓名 | SIMKAI.TTF |
|
|
37
|
+
| 宋体 | 页码 | SIMSUN.TTF |
|
|
38
|
+
|
|
39
|
+
#### 安装方式
|
|
40
|
+
|
|
41
|
+
**自动安装(推荐)**: `python scripts/install_fonts.py` (Windows需管理员权限)
|
|
42
|
+
|
|
43
|
+
**手动安装**:
|
|
44
|
+
- Windows: 复制字体文件到 `C:\Windows\Fonts`
|
|
45
|
+
- macOS: 复制到 `~/Library/Fonts`
|
|
46
|
+
- Linux: 复制到 `~/.fonts/` 后执行 `fc-cache -fv`
|
|
47
|
+
|
|
48
|
+
**字体来源**: Windows系统自带大部分字体(除方正小标宋外),可从系统字体目录复制;方正小标宋需从[官方网站](http://www.foundertype.com/)获取(需商业授权),或使用开源替代字体(思源宋体/黑体)。
|
|
49
|
+
|
|
50
|
+
**验证安装**: 运行 `python scripts/install_fonts.py --check`
|
|
51
|
+
|
|
52
|
+
> 详细说明见 `fonts/README.md` 和 `scripts/install_fonts.py`
|
|
53
|
+
|
|
54
|
+
### 🇺🇸 Font Dependencies & Installation
|
|
55
|
+
|
|
56
|
+
#### Required Fonts List
|
|
57
|
+
|
|
58
|
+
| Font Name | Usage | Filename |
|
|
59
|
+
|-----------|-------|----------|
|
|
60
|
+
| Founder XiaoBiaoSong_GBK | Issuing authority logo, title | FZXBSJW.TTF |
|
|
61
|
+
| FangSong_GB2312 | Body text, document number | SIMFANG.TTF |
|
|
62
|
+
| SimHei | Level-1 headings, classification level | SIMHEI.TTF |
|
|
63
|
+
| KaiTi_GB2312 | Level-2 headings, signer name | SIMKAI.TTF |
|
|
64
|
+
| SimSun | Page numbers | SIMSUN.TTF |
|
|
65
|
+
|
|
66
|
+
#### Installation Methods
|
|
67
|
+
|
|
68
|
+
**Auto Install (Recommended)**: `python scripts/install_fonts.py` (Requires admin privileges on Windows)
|
|
69
|
+
|
|
70
|
+
**Manual Install**:
|
|
71
|
+
- Windows: Copy font files to `C:\Windows\Fonts`
|
|
72
|
+
- macOS: Copy to `~/Library/Fonts`
|
|
73
|
+
- Linux: Copy to `~/.fonts/` then run `fc-cache -fv`
|
|
74
|
+
|
|
75
|
+
**Font Source**: Most fonts come pre-installed with Windows (except Founder XiaoBiaoSong), which can be copied from the system font directory. Founder XiaoBiaoSong must be obtained from the [official website](http://www.foundertype.com/) (requires commercial license), or use open-source alternatives (Source Han Serif/Sans).
|
|
76
|
+
|
|
77
|
+
**Verify Installation**: Run `python scripts/install_fonts.py --check`
|
|
78
|
+
|
|
79
|
+
> See `fonts/README.md` and `scripts/install_fonts.py` for detailed instructions
|
|
80
|
+
|
|
81
|
+
## 对话交互模式 / Interactive Dialog Mode
|
|
82
|
+
|
|
83
|
+
### 🇨🇳 对话交互模式
|
|
84
|
+
|
|
85
|
+
支持智能对话交互模式,通过逐步引导收集公文要素:
|
|
86
|
+
|
|
87
|
+
#### 核心要素(必须交互)
|
|
88
|
+
- **公文类型**: 选择式(通知/报告/请示/函/通报/纪要/决定/意见/批复/命令)
|
|
89
|
+
- **发文机关**: 开放式输入全称
|
|
90
|
+
- **主送机关**: 接收单位
|
|
91
|
+
- **公文标题**: 引导式生成规范标题
|
|
92
|
+
- **成文日期**: 确认式(默认今天)
|
|
93
|
+
- **正文内容**: 多行输入主要内容要点
|
|
94
|
+
|
|
95
|
+
#### 可选要素(按需触发)
|
|
96
|
+
发文字号 | 密级 | 紧急程度 | 签发人(上行文) | 附件 | 抄送机关 | 印发机关/日期
|
|
97
|
+
|
|
98
|
+
#### 智能提示
|
|
99
|
+
- **开头语推荐**: 通知"为...,现...如下:" | 报告"现将...报告如下:" | 请示"关于...的请示" | 函"关于...的函"
|
|
100
|
+
- **结尾语推荐**: 通知"特此通知。" | 报告"特此报告。" | 请示"妥否,请批示。" | 函"请予研究函复。"
|
|
101
|
+
|
|
102
|
+
#### 对话模式优势
|
|
103
|
+
用户友好(逐步引导) | 智能提示(专业语言建议) | 灵活性强(随时修改) | 质量保证(要素齐全) | 学习价值(了解规范)
|
|
104
|
+
|
|
105
|
+
> 技术实现: `scripts/dialog_manager.py` 和 `scripts/smart_prompts.py`
|
|
106
|
+
|
|
107
|
+
### 🇺🇸 Interactive Dialog Mode
|
|
108
|
+
|
|
109
|
+
Supports intelligent dialog interaction mode, collecting document elements through step-by-step guidance:
|
|
110
|
+
|
|
111
|
+
#### Core Elements (Required Interaction)
|
|
112
|
+
- **Document Type**: Selection-based (Notification / Report / Request / Letter / Circular / Minutes / Decision / Opinion / Reply / Order)
|
|
113
|
+
- **Issuing Authority**: Open input for full name
|
|
114
|
+
- **Recipient**: Receiving organization
|
|
115
|
+
- **Document Title**: Guided generation of standard title
|
|
116
|
+
- **Date of Issue**: Confirmation-based (defaults to today)
|
|
117
|
+
- **Body Content**: Multi-line input for main content points
|
|
118
|
+
|
|
119
|
+
#### Optional Elements (Triggered on Demand)
|
|
120
|
+
Document Number | Classification Level | Urgency Level | Signer (for upward documents) | Attachment | CC Organizations | Issuing Organization/Date
|
|
121
|
+
|
|
122
|
+
#### Smart Prompts
|
|
123
|
+
- **Opening Phrase Recommendations**:
|
|
124
|
+
- Notification: "为……,现……如下:" / "根据……,决定……"
|
|
125
|
+
- Report: "现将……报告如下:" / "关于……情况报告如下:"
|
|
126
|
+
- Request: "关于……的请示" / "现就……请示如下:"
|
|
127
|
+
- Letter: "关于……的函" / "现就……函告如下:"
|
|
128
|
+
- **Closing Phrase Recommendations**:
|
|
129
|
+
- Notification: "特此通知。" / "请认真贯彻执行。"
|
|
130
|
+
- Report: "特此报告。" / "以上报告,请审阅。"
|
|
131
|
+
- Request: "妥否,请批示。" / "以上请示,请予批复。"
|
|
132
|
+
- Letter: "请予研究函复。" / "特此函告。"
|
|
133
|
+
|
|
134
|
+
#### Dialog Mode Advantages
|
|
135
|
+
User-friendly (step-by-step guidance) | Smart prompts (professional language suggestions) | High flexibility (modify anytime) | Quality assurance (complete elements) | Educational value (learn standards)
|
|
136
|
+
|
|
137
|
+
> Technical Implementation: `scripts/dialog_manager.py` and `scripts/smart_prompts.py`
|
|
138
|
+
|
|
139
|
+
## 支持的公文类型 / Supported Document Types
|
|
140
|
+
|
|
141
|
+
### 🇨🇳 支持的公文类型
|
|
142
|
+
|
|
143
|
+
| 类型 | 适用场景 | 结尾语 |
|
|
144
|
+
|-----|---------|-------|
|
|
145
|
+
| 通知 | 发布、传达要求下级机关执行的事项 | 特此通知。 |
|
|
146
|
+
| 通报 | 表彰先进、批评错误、传达重要情况 | 特此通报。 |
|
|
147
|
+
| 报告 | 向上级汇报工作、反映情况 | 特此报告。 |
|
|
148
|
+
| 请示 | 向上级请求指示、批准 | 妥否,请批示。 |
|
|
149
|
+
| 函 | 不相隶属机关之间商洽工作 | 请予研究函复。 |
|
|
150
|
+
| 纪要 | 记载会议主要情况和议定事项 | - |
|
|
151
|
+
| 决定 | 对重要事项作出决策和部署 | - |
|
|
152
|
+
| 意见 | 对重要问题提出见解和处理办法 | - |
|
|
153
|
+
| 批复 | 答复下级机关请示事项 | - |
|
|
154
|
+
| 命令(令) | 公布行政法规、宣布重大措施 | - |
|
|
155
|
+
|
|
156
|
+
### 🇺🇸 Supported Document Types
|
|
157
|
+
|
|
158
|
+
| Type | Use Case | Closing Phrase |
|
|
159
|
+
|------|----------|----------------|
|
|
160
|
+
| Notification (通知) | Publish or convey matters requiring subordinate organs to execute | 特此通知。 |
|
|
161
|
+
| Circular (通报) | Commend advanced examples, criticize errors, convey important situations | 特此通报。 |
|
|
162
|
+
| Report (报告) | Report work or reflect situations to superiors | 特此报告。 |
|
|
163
|
+
| Request (请示) | Request instructions or approval from superiors | 妥否,请批示。 |
|
|
164
|
+
| Letter (函) | Discuss work between non-subordinate organs | 请予研究函复。 |
|
|
165
|
+
| Minutes (纪要) | Record main meeting situations and agreed items | - |
|
|
166
|
+
| Decision (决定) | Make decisions and arrangements on important matters | - |
|
|
167
|
+
Opinion (意见) | Propose views and handling methods for important issues | - |
|
|
168
|
+
| Reply (批复) | Reply to subordinate organ requests | - |
|
|
169
|
+
| Order/Command (命令/令) | Promulgate administrative regulations, announce major measures | - |
|
|
170
|
+
|
|
171
|
+
## 公文格式规范(GB/T 9704-2012) / Document Format Standards (GB/T 9704-2012)
|
|
172
|
+
|
|
173
|
+
### 🇨🇳 公文格式规范(GB/T 9704-2012)
|
|
174
|
+
|
|
175
|
+
#### 版面参数
|
|
176
|
+
- **纸张**: A4型纸 (210mm × 297mm)
|
|
177
|
+
- **页边距**: 天头37mm ± 1mm | 订口28mm ± 1mm
|
|
178
|
+
- **版心尺寸**: 156mm × 225mm
|
|
179
|
+
- **每面行数**: 22行 | **每行字数**: 28字
|
|
180
|
+
|
|
181
|
+
#### 字体字号规范
|
|
182
|
+
|
|
183
|
+
| 要素 | 字体 | 字号 | 颜色 |
|
|
184
|
+
|------|------|------|------|
|
|
185
|
+
| 发文机关标志 | 小标宋体 | - | 红色 |
|
|
186
|
+
| 标题 | 小标宋体 | 2号 | 黑色 |
|
|
187
|
+
| 正文 | 仿宋体 | 3号 | 黑色 |
|
|
188
|
+
| 一级标题 | 黑体 | 3号 | 黑色 |
|
|
189
|
+
| 二级标题 | 楷体 | 3号 | 黑色 |
|
|
190
|
+
| 三级/四级标题 | 仿宋体 | 3号 | 黑色 |
|
|
191
|
+
| 发文字号/密级/紧急程度 | 仿宋体/黑体 | 3号 | 黑色 |
|
|
192
|
+
| 签发人 | 仿宋体(标签)/楷体(姓名) | 3号 | 黑色 |
|
|
193
|
+
| 抄送/印发机关/印发日期 | 仿宋体 | 4号 | 黑色 |
|
|
194
|
+
| 页码 | 宋体 | 4号半角 | 黑色 |
|
|
195
|
+
|
|
196
|
+
#### 公文要素编排规则
|
|
197
|
+
|
|
198
|
+
**版头**(红色分隔线以上):
|
|
199
|
+
- 发文机关标志: 居中排布,上边缘至版心上边缘35mm,红色小标宋体
|
|
200
|
+
- 发文字号: 格式`〔年份〕序号号`,发文机关标志下空二行居中,年份用六角括号
|
|
201
|
+
- 版头分隔线: 发文字号之下4mm处,红色,与版心等宽
|
|
202
|
+
|
|
203
|
+
**主体**(红色分隔线以下至版记之前):
|
|
204
|
+
- 标题: 2号小标宋体,红色分隔线下空二行居中,格式"发文机关+事由+文种"
|
|
205
|
+
- 主送机关: 标题下空一行居左顶格,后标全角冒号
|
|
206
|
+
- 正文: 3号仿宋体,每个自然段左空二字回行顶格
|
|
207
|
+
- 结构层次: 一、(黑体) → (一)(楷体) → 1.(仿宋) → (1)(仿宋)
|
|
208
|
+
- 附件说明: 正文下空一行左空二字,多附件用阿拉伯数字标注
|
|
209
|
+
- 成文日期: 阿拉伯数字年月日标全,居中编排,月日不编虚位
|
|
210
|
+
|
|
211
|
+
**版记**(末页分隔线以下):
|
|
212
|
+
- 分隔线: 首条/末条粗线(0.35mm),中间细线(0.25mm)
|
|
213
|
+
- 抄送机关: 印发机关上一行,4号仿宋体
|
|
214
|
+
- 印发机关和印发日期: 末条分隔线之上,4号仿宋体
|
|
215
|
+
|
|
216
|
+
### 🇺🇸 Document Format Standards (GB/T 9704-2012)
|
|
217
|
+
|
|
218
|
+
#### Page Layout Parameters
|
|
219
|
+
- **Paper**: A4 size (210mm × 297mm)
|
|
220
|
+
- **Margins**: Top margin 37mm ± 1mm | Left (binding) margin 28mm ± 1mm
|
|
221
|
+
- **Text Area**: 156mm × 225mm
|
|
222
|
+
- **Lines per page**: 22 lines | **Characters per line**: 28 characters
|
|
223
|
+
|
|
224
|
+
#### Font and Size Specifications
|
|
225
|
+
|
|
226
|
+
| Element | Font | Size | Color |
|
|
227
|
+
|---------|------|------|-------|
|
|
228
|
+
| Issuing Authority Logo | Founder XiaoBiaoSong | - | Red |
|
|
229
|
+
| Title | Founder XiaoBiaoSong | No. 2 | Black |
|
|
230
|
+
| Body Text | FangSong | No. 3 | Black |
|
|
231
|
+
| Level-1 Heading | SimHei | No. 3 | Black |
|
|
232
|
+
| Level-2 Heading | KaiTi | No. 3 | Black |
|
|
233
|
+
| Level-3/Level-4 Heading | FangSong | No. 3 | Black |
|
|
234
|
+
| Document Number/Classification/Urgency | FangSong/SimHei | No. 3 | Black |
|
|
235
|
+
| Signer | FangSong(label)/KaiTi(name) | No. 3 | Black |
|
|
236
|
+
| CC/Distribution Org/Date | FangSong | No. 4 | Black |
|
|
237
|
+
| Page Number | SimSun | No. 4 half-width | Black |
|
|
238
|
+
|
|
239
|
+
#### Document Element Layout Rules
|
|
240
|
+
|
|
241
|
+
**Header Section** (above red separator line):
|
|
242
|
+
- Issuing Authority Logo: Centered, top edge 35mm from text area top edge, red Founder XiaoBiaoSong font
|
|
243
|
+
- Document Number: Format `〔Year〕Sequence`, centered two lines below the logo, year in hexagonal brackets
|
|
244
|
+
- Header Separator Line: 4mm below document number, red, full width of text area
|
|
245
|
+
|
|
246
|
+
**Body Section** (below red separator line, before end matter):
|
|
247
|
+
- Title: No. 2 Founder XiaoBiaoSong, centered two lines below red separator, format "Issuing Authority + Subject + Document Type"
|
|
248
|
+
- Recipient: One line below title, left-aligned with no indent, followed by full-width colon
|
|
249
|
+
- Body Text: No. 3 FangSong, each paragraph indented by 2 characters, continuation lines flush left
|
|
250
|
+
- Structural hierarchy: 一、(SimHei) → (一)(KaiTi) → 1.(FangSong) → (1)(FangSong)
|
|
251
|
+
- Attachment Note: One line below body text, indented by 2 characters, multiple attachments numbered with Arabic numerals
|
|
252
|
+
- Date of Issue: Full Arabic numeral date (year-month-day), centered, no padding for month/day
|
|
253
|
+
|
|
254
|
+
**End Matter Section** (below last page separator):
|
|
255
|
+
- Separator Lines: First/Last lines thick (0.35mm), middle line thin (0.25mm)
|
|
256
|
+
- CC Organizations: One line above distribution organization, No. 4 FangSong
|
|
257
|
+
- Distribution Organization and Date: Above the last separator line, No. 4 FangSong
|
|
258
|
+
|
|
259
|
+
## 工作流程 / Workflow
|
|
260
|
+
|
|
261
|
+
### 🇨🇳 工作流程
|
|
262
|
+
|
|
263
|
+
#### 步骤1: 需求收集
|
|
264
|
+
提取信息: 公文类型 | 发文机关 | 主送机关 | 发文字号 | 标题 | 正文内容 | 成文日期 | 附件(可选) | 抄送机关(可选)
|
|
265
|
+
|
|
266
|
+
#### 步骤2: 生成文档
|
|
267
|
+
```python
|
|
268
|
+
from scripts.generate_official_doc import create_official_document
|
|
269
|
+
content = {
|
|
270
|
+
'issuer': '发文机关名称',
|
|
271
|
+
'doc_number': '发文字号',
|
|
272
|
+
'title': '公文标题',
|
|
273
|
+
'recipient': '主送机关',
|
|
274
|
+
'body': ['正文段落1', '正文段落2'],
|
|
275
|
+
'signer': '发文机关署名',
|
|
276
|
+
'date': '成文日期',
|
|
277
|
+
'attachment': '附件说明(可选)',
|
|
278
|
+
'copy_to': '抄送机关(可选)'
|
|
279
|
+
}
|
|
280
|
+
doc = create_official_document('公文类型', content)
|
|
281
|
+
doc.save('输出文件路径.docx')
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
#### 步骤3: 格式校验
|
|
285
|
+
检查项: [ ] 标题格式正确 | [ ] 发文字号格式规范 | [ ] 正文层次清晰 | [ ] 语言表达准确 | [ ] 要素齐全完整
|
|
286
|
+
|
|
287
|
+
### 🇺🇸 Workflow
|
|
288
|
+
|
|
289
|
+
#### Step 1: Requirements Collection
|
|
290
|
+
Extract information: Document Type | Issuing Authority | Recipient | Document Number | Title | Body Content | Date of Issue | Attachment (Optional) | CC Organizations (Optional)
|
|
291
|
+
|
|
292
|
+
#### Step 2: Document Generation
|
|
293
|
+
```python
|
|
294
|
+
from scripts.generate_official_doc import create_official_document
|
|
295
|
+
content = {
|
|
296
|
+
'issuer': 'Issuing Authority Name',
|
|
297
|
+
'doc_number': 'Document Number',
|
|
298
|
+
'title': 'Document Title',
|
|
299
|
+
'recipient': 'Recipient Organization',
|
|
300
|
+
'body': ['Body Paragraph 1', 'Body Paragraph 2'],
|
|
301
|
+
'signer': 'Signer Name',
|
|
302
|
+
'date': 'Date of Issue',
|
|
303
|
+
'attachment': 'Attachment Description (optional)',
|
|
304
|
+
'copy_to': 'CC Organizations (optional)'
|
|
305
|
+
}
|
|
306
|
+
doc = create_official_document('Document Type', content)
|
|
307
|
+
doc.save('output_file_path.docx')
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
#### Step 3: Format Validation
|
|
311
|
+
Checklist: [ ] Title format correct | [ ] Document number format compliant | [ ] Body structure clear | [ ] Language expression accurate | [ ] All required elements complete
|
|
312
|
+
|
|
313
|
+
## 公文语言规范 / Document Language Standards
|
|
314
|
+
|
|
315
|
+
### 🇨🇳 公文语言规范
|
|
316
|
+
|
|
317
|
+
#### 常用开头语
|
|
318
|
+
- 通知: `为……,现……如下:` / `根据……,决定……`
|
|
319
|
+
- 报告: `现将……报告如下:` / `关于……情况报告如下:`
|
|
320
|
+
- 请示: `关于……的请示` / `现就……请示如下:`
|
|
321
|
+
- 函: `关于……的函` / `现就……函告如下:`
|
|
322
|
+
|
|
323
|
+
#### 常用结尾语
|
|
324
|
+
- 通知: `特此通知。` / `请认真贯彻执行。`
|
|
325
|
+
- 报告: `特此报告。` / `以上报告,请审阅。`
|
|
326
|
+
- 请示: `妥否,请批示。` / `以上请示,请予批复。`
|
|
327
|
+
- 函: `请予研究函复。` / `特此函告。`
|
|
328
|
+
|
|
329
|
+
#### 数字使用规范
|
|
330
|
+
- 成文日期: 阿拉伯数字(如2026年3月13日)
|
|
331
|
+
- 发文字号序号: 不编虚位(1号而非01号)
|
|
332
|
+
- 统计数据: 阿拉伯数字 | 概数: 汉字(如三五天、七八十人)
|
|
333
|
+
|
|
334
|
+
### 🇺🇸 Document Language Standards
|
|
335
|
+
|
|
336
|
+
#### Common Opening Phrases
|
|
337
|
+
- Notification (通知): `为……,现……如下:` / `根据……,决定……`
|
|
338
|
+
- Report (报告): `现将……报告如下:` / `关于……情况报告如下:`
|
|
339
|
+
- Request (请示): `关于……的请示` / `现就……请示如下:`
|
|
340
|
+
- Letter (函): `关于……的函` / `现就……函告如下:`
|
|
341
|
+
|
|
342
|
+
#### Common Closing Phrases
|
|
343
|
+
- Notification (通知): `特此通知。` / `请认真贯彻执行。`
|
|
344
|
+
- Report (报告): `特此报告。` / `以上报告,请审阅。`
|
|
345
|
+
- Request (请示): `妥否,请批示。` / `以上请示,请予批复。`
|
|
346
|
+
- Letter (函): `请予研究函复。` / `特此函告。`
|
|
347
|
+
|
|
348
|
+
#### Number Usage Guidelines
|
|
349
|
+
- Date of Issue: Arabic numerals (e.g., 2026年3月13日)
|
|
350
|
+
- Document Number Sequence: No zero-padding (1号 instead of 01号)
|
|
351
|
+
- Statistical Data: Arabic numerals | Approximate Numbers: Chinese characters (e.g., 三五天, 七八十人)
|
|
352
|
+
|
|
353
|
+
## 参考文档 / Reference Documents
|
|
354
|
+
|
|
355
|
+
### 🇨🇳 参考文档
|
|
356
|
+
|
|
357
|
+
**国家标准**: [`references/GBT_9704-2012_党政机关公文格式.md`](references/GBT_9704-2012_党政机关公文格式.md) - 包含完整的纸张要求、编排规则、字体字号、印制装订、特定格式及式样图示
|
|
358
|
+
|
|
359
|
+
**其他标准**: 《党政机关公文处理工作条例》(中办发〔2012〕14号) | GB/T 15834《标点符号用法》 | GB/T 15835《出版物上数字用法》
|
|
360
|
+
|
|
361
|
+
### 🇺🇸 Reference Documents
|
|
362
|
+
|
|
363
|
+
**National Standard**: [`references/GBT_9704-2012_党政机关公文格式.md`](references/GBT_9704-2012_党政机关公文格式.md) - Contains complete paper requirements, layout rules, font specifications, printing and binding, special formats, and sample diagrams
|
|
364
|
+
|
|
365
|
+
**Other Standards**: "Regulations on the Processing of Official Documents of Party and Government Organs" (中办发〔2012〕14号) | GB/T 15834 "Punctuation Marks Usage" | GB/T 15835 "General Rules for Writing Numerals in Publications"
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## Iron Law / 铁律
|
|
370
|
+
|
|
371
|
+
### 🇨🇳 铁律
|
|
372
|
+
|
|
373
|
+
1. **国家标准强制**: 生成的公文必须严格符合GB/T 9704-2012标准,不得因美观或方便而偏离标准规定。
|
|
374
|
+
2. **要素完整性**: 必备要素(发文机关、标题、主送机关、正文、成文日期、印章/署名)缺一不可,可选要素在用户明确要求时才添加。
|
|
375
|
+
3. **语言规范性**: 必须使用规范的公文语言(书面语、正式表达),不得使用口语化、网络化表述。
|
|
376
|
+
4. **字体依赖明确**: 必须使用标准规定的字体,缺失时应明确提示用户安装,不得随意替换。
|
|
377
|
+
5. **用户确认必经**: 生成最终文档前必须向用户展示预览并获得确认。
|
|
378
|
+
|
|
379
|
+
**违规示例**: ❌ 自定义非标准页边距 | ❌ 缺少主送机关或成文日期 | ❌ 口语化表达 | ❌ 字体缺失不提示 | ❌ 跳过预览直接输出
|
|
380
|
+
|
|
381
|
+
**合规示例**: ✅ 严格遵循标准参数 | ✅ 输出前检查必备要素清单 | ✅ 使用规范表述 | ✅ 检测字体缺失时主动提示 | ✅ 先预览后生成
|
|
382
|
+
|
|
383
|
+
### 🇺🇸 Iron Law
|
|
384
|
+
|
|
385
|
+
1. **National Standard Mandatory**: Generated documents must strictly comply with GB/T 9704-2012 standard; never deviate from standard requirements for aesthetics or convenience.
|
|
386
|
+
2. **Element Completeness**: Required elements (Issuing Authority, Title, Recipient, Body Text, Date of Issue, Seal/Signature) are non-negotiable; optional elements are added only when explicitly requested by the user.
|
|
387
|
+
3. **Language Standardization**: Must use standardized official document language (written style, formal expression); colloquial or internet-style expressions are prohibited.
|
|
388
|
+
4. **Font Dependency Clarity**: Must use fonts specified by the standard; when fonts are missing, explicitly prompt the user to install them — never silently substitute.
|
|
389
|
+
5. **User Confirmation Required**: Must present a preview and obtain user confirmation before generating the final document.
|
|
390
|
+
|
|
391
|
+
**Violation Examples**: ❌ Custom non-standard margins | ❌ Missing recipient or date of issue | ❌ Colloquial expressions | ❌ No prompt when font missing | ❌ Skip preview and output directly
|
|
392
|
+
|
|
393
|
+
**Compliant Examples**: ✅ Strictly follow standard parameters | ✅ Check required element list before output | ✅ Use formal language | ✅ Proactively alert when font missing | ✅ Preview before generation
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
## Rationalization Table / 理性化对照表
|
|
398
|
+
|
|
399
|
+
### 🇨🇳 理性化对照表
|
|
400
|
+
|
|
401
|
+
| 你可能的想法 | 请问自己 | 应该怎么做 |
|
|
402
|
+
|-------------|---------|-----------|
|
|
403
|
+
| "这个格式太死板了,稍微调一下吧" | 公文格式的严肃性来自标准化和一致性 | 严格遵循GB/T 9704-2012标准的每个参数 |
|
|
404
|
+
| "这几个要素用户没提,应该不需要吧" | 公文的法定效力依赖于要素完整性 | 按照公文类型检查必备要素清单,缺失项必须确认 |
|
|
405
|
+
| "这样写更通俗易懂" | 公文的语言风格体现其正式性 | 使用规范的公文用语库,选择正式准确简洁的表达 |
|
|
406
|
+
| "字体差不多就行,反正能显示" | 字体差异影响公文的正式性和可读性 | 明确检测字体安装情况,缺失时必须提示用户 |
|
|
407
|
+
| "内容应该没问题,直接生成吧" | 公文内容的准确性至关重要 | 强制执行预览确认流程 |
|
|
408
|
+
|
|
409
|
+
**常见陷阱**:
|
|
410
|
+
1. **"创意排版"陷阱**: 为追求视觉效果偏离标准 → 建立格式参数对照表
|
|
411
|
+
2. **"要素遗漏"陷阱**: 因用户未提及省略必备要素 → 建立分类型必备要素检查清单
|
|
412
|
+
3. **"语言口语化"陷阱**: 将口语描述直接写入公文 → 建立"口语→公文语"转换规则
|
|
413
|
+
4. **"静默降级"陷阱**: 字体缺失时静默降级处理 → 所有降级必须明确告知用户
|
|
414
|
+
|
|
415
|
+
### 🇺🇸 Rationalization Table
|
|
416
|
+
|
|
417
|
+
| Your Temptation | Ask Yourself | What To Do Instead |
|
|
418
|
+
|-----------------|-------------|-------------------|
|
|
419
|
+
| "This format is too rigid, let me tweak it a bit" | The seriousness of official document formatting comes from standardization and consistency | Strictly follow every parameter of GB/T 9704-2012 standard |
|
|
420
|
+
| "The user didn't mention these elements, they probably aren't needed" | The legal validity of official documents depends on element completeness | Check the required elements checklist by document type; missing items must be confirmed |
|
|
421
|
+
| "This wording is more accessible" | The language style of an official document reflects its formality | Use a standardized official terminology bank; choose formal, precise, and concise expressions |
|
|
422
|
+
| "These fonts are close enough, as long as they display" | Font differences affect the formality and readability of official documents | Explicitly check font installation status; must alert user when fonts are missing |
|
|
423
|
+
| "The content looks fine, let me just generate it" | The accuracy of official document content is critical | Enforce mandatory preview confirmation workflow |
|
|
424
|
+
|
|
425
|
+
**Common Pitfalls**:
|
|
426
|
+
1. **"Creative Layout" Trap**: Deviating from standards for visual effects → Establish a format parameter reference table
|
|
427
|
+
2. **"Missing Elements" Trap**: Omitting required elements because the user didn't mention them → Create a type-specific required elements checklist
|
|
428
|
+
3. **"Colloquial Language" Trap**: Writing colloquial descriptions directly into documents → Establish "colloquial-to-formal" conversion rules
|
|
429
|
+
4. **"Silent Degradation" Trap**: Silently degrading when fonts are missing → All degradation must be explicitly communicated to the user
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## Red Flags / 红旗警告
|
|
434
|
+
|
|
435
|
+
### 🇨🇳 红旗警告
|
|
436
|
+
|
|
437
|
+
#### Layer 1: 输入检查
|
|
438
|
+
- **INPUT-ODW-001**: 用户提供的公文信息不足以确定公文类型 → 🔴 CRITICAL → 终止并通过对话引导补充
|
|
439
|
+
- **INPUT-ODW-002**: 发文机关名称为空 → 🔴 CRITICAL → 终止并提示这是必备要素
|
|
440
|
+
- **INPUT-ODW-003**: 正文内容为空或过短(<20字) → 🟡 WARN → 提示可能不完整,请用户确认
|
|
441
|
+
|
|
442
|
+
#### Layer 2: 执行检查
|
|
443
|
+
- **EXEC-ODW-001**: 生成的格式参数不符合GB/T 9704-2012标准 → 🔴 CRITICAL → 修正为标准值
|
|
444
|
+
- **EXEC-ODW-002**: 公文语言包含明显的口语化或网络化表达 → 🟡 WARN → 提供规范化改写建议
|
|
445
|
+
- **EXEC-ODW-003**: 缺少必需字体但未提示用户就使用替代字体 → 🔴 CRITICAL → 中止生成,先完成字体安装或明确告知影响
|
|
446
|
+
- **EXEC-ODW-004**: 跳过预览确认环节直接生成最终文档 → 🔴 CRITICAL → 回退到预览步骤等待确认
|
|
447
|
+
|
|
448
|
+
#### Layer 3: 输出检查
|
|
449
|
+
- **OUTPUT-ODW-001**: 生成的Word文档无法正常打开或格式错乱 → 🔴 CRITICAL → 检查字体依赖和脚本日志
|
|
450
|
+
- **OUTPUT-ODW-002**: 文档中的要素与用户确认的预览内容不一致 → 🔴 CRITICAL → 重新确保一致性
|
|
451
|
+
- **OUTPUT-ODW-003**: 文件保存路径超出预期目录范围 → 🟡 WARN → 确认路径并在报告中记录实际位置
|
|
452
|
+
|
|
453
|
+
#### 触发Red Flag时的处理流程
|
|
454
|
+
🔴 CRITICAL → 立即停止,报告问题详情,等待指示 | 🟡 WARN → 记录警告,尝试自动修复,在报告中标注 | 🔵 INFO → 记录信息,正常继续
|
|
455
|
+
|
|
456
|
+
### 🇺🇸 Red Flags
|
|
457
|
+
|
|
458
|
+
#### Layer 1: Input Validation
|
|
459
|
+
- **INPUT-ODW-001**: User-provided document information is insufficient to determine document type → 🔴 CRITICAL → Halt and guide user through dialog to supplement information
|
|
460
|
+
- **INPUT-ODW-002**: Issuing authority name is empty → 🔴 CRITICAL → Halt and inform this is a required element
|
|
461
|
+
- **INPUT-ODW-003**: Body content is empty or too short (<20 characters) → 🟡 WARN → Alert possible incompleteness, ask user to confirm
|
|
462
|
+
|
|
463
|
+
#### Layer 2: Execution Validation
|
|
464
|
+
- **EXEC-ODW-001**: Generated format parameters do not comply with GB/T 9704-2012 standard → 🔴 CRITICAL → Correct to standard values
|
|
465
|
+
- **EXEC-ODW-002**: Document language contains obvious colloquial or internet-style expressions → 🟡 WARN → Provide standardized rewriting suggestions
|
|
466
|
+
- **EXEC-ODW-003**: Missing required fonts but using substitute fonts without alerting the user → 🔴 CRITICAL → Abort generation; complete font installation first or explicitly communicate the impact
|
|
467
|
+
- **EXEC-ODW-004**: Skipping preview confirmation and generating final document directly → 🔴 CRITICAL → Roll back to preview step and wait for confirmation
|
|
468
|
+
|
|
469
|
+
#### Layer 3: Output Validation
|
|
470
|
+
- **OUTPUT-ODW-001**: Generated Word document cannot open normally or has formatting corruption → 🔴 CRITICAL → Check font dependencies and script logs
|
|
471
|
+
- **OUTPUT-ODW-002**: Document elements are inconsistent with user-confirmed preview content → 🔴 CRITICAL → Re-verify consistency before proceeding
|
|
472
|
+
- **OUTPUT-ODW-003**: File save path exceeds expected directory scope → 🟡 WARN → Confirm path and record actual location in report
|
|
473
|
+
|
|
474
|
+
#### Red Flag Trigger Handling Procedure
|
|
475
|
+
🔴 CRITICAL → Stop immediately, report problem details, await instructions | 🟡 WARN → Log warning, attempt auto-fix, annotate in report | 🔵 INFO → Log info, continue normally
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name": "official-doc-writer", "version": "1.0.0", "category": "core", "description": "Official document writer generating government documents per GB/T 9704-2012 standard. Invoke when creating formal government-style output. 支持中文触发:公文生成、党政机关公文、正式文件、政府文档、GB/T标准。生成通知、报告、请示、函等党政机关公文。", "triggers": ["公文生成", "党政机关公文", "正式文件", "政府文档", "GB/T标准", "official document", "government doc", "formal letter", "GB/T 9704", "official writing"]}
|