linhut/gongwen-skill
公文全流程处理工具——基于 GB/T 9704《党政机关公文格式》 国家标准,面向公文写作、企事业单位材料编制场景,支持 格式检查与修复、内容优化(Word 原生修订+批注/差异对比版)、模板生成、Markdown 转公文、版头版记页码注入、事实核验、风格增强 等完整能力。原生支持 DeepSeek Harness (DSH) 技能系统,打包为可被 AI Agent 直接调用的 Skill,完全自包含,克隆即用。
Project Overview项目介绍
This is a full-process processing tool for Chinese official government documents, built to comply with the national standard GB/T 9704 for official document formatting. It extracts the core formatting engine from the open-source desktop project AI Document Assistant, removes desktop and database dependencies, and is released as a standalone module. It supports all core official document workflows, from template generation, format checking and repair, content polishing, Markdown to docx conversion, to header, footer and page number injection, fact checking, and style enhancement. It natively integrates with the DeepSeek Harness (DSH) skill system and can be automatically discovered and loaded by DSH agents.
The tool targets users who need to write, revise, and format Chinese government official documents, and it adapts to multiple types of AI agent calling environments. For code-execution capable agents including DSH, Claude Code, and WorkBuddy, the tool can be called directly to read and write local files and complete document processing. For pure dialogue LLMs that do not support code execution, the agent can guide users to manually install and run the tool, then interpret the output results to help users complete their tasks.
The tool only depends on three pure Python packages: python-docx, pydantic, and pyyaml, and it requires no database or web framework to run. It is fully open-source under the MIT license, and by default it does not rely on third-party large language models, as all deterministic formatting capabilities are fully self-contained. If you need to enable LLM-assisted content optimization and internet fact checking, you can configure the corresponding environment variables to turn on these features. It also has built-in DNS pollution diagnostics that can automatically retry connections and give suggestions when GitHub access is abnormal in mainland China.
这是一款符合GB/T 9704《党政机关公文格式》国家标准的中文公文全流程处理工具,从开源桌面项目「AI公文智能优化助手」抽取核心格式引擎,剥离桌面端和数据库依赖后独立发行。它支持公文从模板生成、格式检查修复、内容优化、Markdown转公文、版头版记页码注入到事实核验、风格增强的全流程能力,原生集成DeepSeek Harness(DSH)技能系统,可被DSH Agent自动发现加载。
本工具面向需要撰写、校改、排版党政机关公文的用户,同时适配不同类型的AI Agent调用环境。对于支持代码执行的Agent环境(包括DSH、Claude Code、WorkBuddy等),可直接调用工具命令读写本地文件完成公文处理;对于无代码执行能力的纯对话LLM,可引导用户手动安装执行工具,再解读输出结果辅助用户完成操作。
本工具仅依赖python-docx、pydantic、pyyaml三个纯Python包,无需数据库或Web框架,完全开源遵循MIT许可证。默认不依赖第三方大语言模型,所有确定性格式处理能力完全自包含,若需要启用LLM辅助内容优化和互联网事实核验,可配置对应环境变量开启相关功能。工具还内置DNS污染诊断,国内访问GitHub异常时可自动重试并给出处置建议。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:gongwen-skill(linhut/gongwen-skill)
仓库:https://github.com/linhut/gongwen-skill
本站详情页:https://www.yhbd.top/plugins/linhut-gongwen-skill/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 71 · 最近提交 2026-10-01 · 主语言 Python
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- This site's static screen found no obvious risk signal (stars, license, activity, manifest)本站静态筛查没发现明显风险信号(星标、许可证、更新活跃度、清单完整度)
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add -w gongwen-skill
把 linhut/gongwen-skill 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
公文全流程处理专家
中文公文全流程处理专家——基于 GB/T 9704《党政机关公文格式》 国家标准,支持 格式检查与修复、内容优化(Word 原生修订+批注/差异对比版)、模板生成、Markdown 转公文、版头版记页码注入、事实核验、风格增强 等完整能力。原生支持 DeepSeek Harness (DSH) 技能系统,打包为可被 AI Agent 直接调用的 Skill,完全自包含,克隆即用。
本 Skill 源自开源桌面项目 AI 公文智能优化助手,将其核心格式引擎抽取、剥离桌面端/数据库依赖后独立发行,支持公文的模板建立、解析、规则检查、自动修复、内容优化、Markdown 转公文全流程能力。同时原生集成 DeepSeek Harness (DSH) 技能系统,支持 DSH Agent 自动发现与加载。
✨ 能力一览
| 能力 | 命令 | 说明 |
|---|---|---|
| 📋 列类型 | list-types |
列出 25 种支持的公文类型(新增主持词 host_speech;含新闻稿/讲话稿) |
| 🏗️ 模板生成 | template |
按类型生成 GB/T 9704 标准空白模板 |
| 🔍 解析 | parse |
.docx → 结构化 DocumentModel(含文本框/修订摘要) |
| ✅ 格式检查 | check |
按国标检查,分级 P0/P1/P2(只读) |
| 🔧 格式修复 | optimize |
自动修复字体/字号/行距/页边距,输出合规文档;--verify 单命令闭环自动复查、P0 存在时退出码非 0;--json 结构化输出 |
| ✍️ 内容优化 | optimize-content |
内容润色:默认 Word 原生修订+批注(审阅面板逐条接受/拒绝),可选行内差异对比版;--precheck 预检 changes 与原文一致性、--preset quick/full/review 参数收敛 |
| 📝 草稿转公文 | md2docx |
Markdown 文本直接转为格式化 .docx(支持 Front Matter) |
| 🚀 一站式生成 | draft |
Markdown 草稿 → 国标成品 + 自动验证(路径 C 四步合一) |
| 📄 模型生成 | generate |
从 JSON 模型生成 .docx |
| 🔴 版头 | header |
注入发文机关标志 + 发文字号 + 签发人 + 红色反线 |
| 📑 版记 | footer |
注入抄送机关 + 印发机关 + 印发日期 + 分隔线 |
| 🔢 页码 | pagenum |
注入 Word PAGE 域动态页码(宋体 4 号,默认单右双左适配双面打印) |
| 🖊️ 首句加粗 | bold-first |
正文段落首句自动加粗(公文规范) |
| 🧰 一键修复 | fix-common |
路径 D 一键修复常见格式:段落类型修正 + 编号拆分 + 首句加粗 + 加粗范围修复 |
| 📋 桌签生成 | table-signs |
批量生成 A5 横版会议桌签 |
| 🔍 审稿生成 | review |
按五角色审稿机制生成审稿意见 |
| 🧩 完整审校 | full-review |
修订+批注联合命令(句子级差异修订 + 分类批注) |
| 🎨 样式学习 | style-learn / style-list |
上传标准文档学习 Run/段落/页面三级样式(字体/字号/字间距/行距/缩进/页边距),生成命名模板持久化,后续用 optimize -t 模板名 套用 |
| 🔄 版本自检 | check-update |
版本自检(PyPI pip 包权威判定 + GitHub 备用,GitCode/AtomGit 作国内镜像提示;GitHub 不可达时自动做 DNS 污染诊断 + hosts 建议) |
| 🩺 自我诊断 | doctor / repair |
全面诊断 23 项(Python/依赖/版本一致性/字体/DSH 文件/DSH 技能 frontmatter/代码风格/网络 DNS),自动修复常见问题;--offline 跳过网络检查 |
| 🕵️ 文档审计 | audit |
检查删除线/加粗/AI 声明等痕迹 |
| 🤝 会话交接 | handoff |
跨会话上下文传递(--list / --latest / Agent 长任务收尾必写) |
| ⚙️ 规则管理 | rule-export/import/list |
YAML 规则三层定制(官方/单位/用户) |
| 🧭 向导式交互 | wizard |
交互式路径引导(A/B/C/D/E)+ 一键执行;Agent 用 --answers 非交互 / --dry-run 只打印命令 |
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
titanwings/dsh-automation
akira399/dsh-novel-writer
hr98w/dsh-memory
Jungod1121/dsh-anchored-standard
omdsh-dev/dsh-advisor
shuguang1994/project-blueprint