v1.0.1: 制度文件冲突检测与合规审查 - 初版骨架

基于匠厂 skill-template 主仓 v1.0.108 派生的业务技能。

核心业务:
- 起草人在 OA 上传新制度送审稿时,自动比对校内现行制度库(约 300+ 份)
- 条款级冲突检测 + 程序合规性体检 + 疑似重复发文检测
- 在 Word 侧栏生成批注清单,一键跳转冲突原文

输出形态:
- 制度送审稿表状态更新(可送审 → 审查中 → 已通过 / 冲突中 / 驳回)
- 冲突条款清单 + HTML 审查报告 + 可选 PDF 导出

预期提效:制度出台后因"与 XX 文件冲突"而被要求暂停/修订的事件减少至零起。

业务行生命周期:可送审 → 审查中 → 已通过 / 冲突中 / 驳回 / 已跳过

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-09-14 12:19:05 +08:00
commit cd71f49709
38 changed files with 1626 additions and 0 deletions

18
assets/README.md Normal file
View File

@@ -0,0 +1,18 @@
# assets
> 本技能 `assets/` 目录的元数据与 Action manifest,**派生自匠厂 skill-template 主仓**。
>
> **使用方式:** 主仓 `skill-template-main/skill-template/assets/` 已沉淀 Action manifest 规范(schemaVersion / placements / executionProfile / bind.tables / interaction / hostEffects 等);本目录**仅放本技能特有的 Action 清单与示例**,公共规范**请回主仓查阅**。
## 本目录文件清单
- `README.md`:本文件
- `actions.json`:本技能 Action 清单(v1.0.1 已就位)
- `html/example-report.html`:审查报告 HTML 模板(v1.0.1 已就位)
- `examples/`:CLI 成功输出形状示例、Action 形状参考(占位,由开发者按主仓 `assets/examples/` 复制)
- `schemas/skill-actions.schema.json`:Action JSON Schema(占位,由开发者从主仓复制)
- `naming/`:命名规范引用(占位)
## 业务技能注意
若主路径在数据管理,准备 / 载入 / 导入类 Action 应挂 `toolbar` + `bind.tables`(用户看得见),**不要**只挂 `skill-detail` 却在教程里写成「技能详情点按钮」。

122
assets/actions.json Normal file
View File

@@ -0,0 +1,122 @@
{
"schemaVersion": 1,
"skill": "detect-policy-conflict-gs",
"actions": [
{
"id": "health",
"label": "运行检查",
"description": "检查技能运行环境、OA API 连通性、制度库索引完整性,不启动长任务。",
"placements": ["skill-detail", "agent"],
"executionProfile": "sync",
"entrypoint": {
"type": "cli",
"command": "health",
"args": []
}
},
{
"id": "version",
"label": "查看版本",
"description": "返回技能版本和机器标识。",
"placements": ["skill-detail"],
"executionProfile": "sync",
"entrypoint": {
"type": "cli",
"command": "version",
"args": []
}
},
{
"id": "config-path",
"label": "查看配置位置",
"description": "返回技能配置文件位置。",
"placements": ["skill-detail"],
"executionProfile": "sync",
"entrypoint": {
"type": "cli",
"command": "config-path",
"args": []
}
},
{
"id": "audit-policy-draft",
"label": "审查送审稿",
"description": "对一份新制度送审稿执行条款向量化 + 制度库比对 + 程序合规体检 + 重复发文检测,10~30 秒内返回结果。",
"placements": ["row", "agent", "skill-detail"],
"executionProfile": "sync",
"bind": {
"tables": ["制度送审稿"],
"selectionMode": "required",
"labelColumn": "送审稿标题"
},
"entrypoint": {
"type": "cli",
"command": "audit-policy-draft",
"args": ["--draft-id", "{row.送审稿ID}"]
}
},
{
"id": "recheck-conflict-clause",
"label": "重新比对冲突条款",
"description": "对某一条已经标记冲突的条款重新比对,常用于制度库更新后的复核。",
"placements": ["row", "agent"],
"executionProfile": "sync",
"bind": {
"tables": ["冲突条款清单"],
"selectionMode": "required",
"labelColumn": "新条款摘要"
},
"entrypoint": {
"type": "cli",
"command": "recheck-conflict-clause",
"args": ["--clause-id", "{row.冲突条款ID}"]
}
},
{
"id": "export-review-report",
"label": "导出审查报告",
"description": "将指定送审稿的审查结果导出为 PDF 报告,落到本技能 output/ 目录。",
"placements": ["row", "agent"],
"executionProfile": "sync",
"bind": {
"tables": ["制度送审稿"],
"selectionMode": "required",
"labelColumn": "送审稿标题"
},
"entrypoint": {
"type": "cli",
"command": "export-review-report",
"args": ["--draft-id", "{row.送审稿ID}", "--format", "pdf"]
}
},
{
"id": "mark-policy-status",
"label": "标记送审稿状态",
"description": "手动将送审稿标记为已通过 / 驳回(通常用于人工终审后回写状态)。",
"placements": ["row"],
"executionProfile": "sync",
"bind": {
"tables": ["制度送审稿"],
"selectionMode": "required",
"labelColumn": "送审稿标题"
},
"entrypoint": {
"type": "cli",
"command": "mark-policy-status",
"args": ["--draft-id", "{row.送审稿ID}", "--target-status", "{form.target_status}"]
}
},
{
"id": "rescan-pending-drafts",
"label": "定时扫描存量送审稿",
"description": "扫描所有"审查中 / 冲突中"状态的送审稿,因制度库新增 / 变更而重新比对。占位 Action,cron 启用后由定时调度。",
"placements": ["cron", "agent"],
"executionProfile": "async",
"entrypoint": {
"type": "cli",
"command": "rescan-pending-drafts",
"args": []
}
}
]
}

18
assets/examples/README.md Normal file
View File

@@ -0,0 +1,18 @@
# assets/examples
本目录用于存放本技能 Action 形状参考示例(如 `render-html.action.example.json` / `lookup.action.example.json` 等)。
> **使用方式:** 模板参考请查阅主仓 `skill-template-main/skill-template/assets/examples/`,复制所需示例后按本技能业务调整(修改 `skill` slug / `id` / `label` / `description` / `bind.tables` / `entrypoint.command` / `entrypoint.args`)。
>
> 主仓已沉淀的常用示例:
> - `render-html.action.example.json`:HTML 整页报告
> - `lookup.action.example.json`:跨表 Lookup 下拉
> - `visible-when-action.example.json`:条件显隐参数
> - `path-root-file-action.example.json`:本地路径 Action
> - `selection-label-column.action.example.json`:选择摘要标签列
> - `selection-mode-optional.action.example.json`:可选勾选驱动
> - `replaces-*.action.example.json`:接管新增 / 编辑 / 删除
## 本技能暂未提供示例
按需从主仓复制并调整 slug / Action id。

View File

@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<title>{{TITLE}}</title>
<style>
/* 数据管理 iframe 预览布局基线:流体铺满、禁横向滚动 */
html, body {
margin: 0;
padding: 16px;
font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
color: #1f2329;
background: #fafbfc;
line-height: 1.6;
}
.report { max-width: 100%; }
.header {
padding: 16px 20px;
background: #fff;
border: 1px solid #e5e6eb;
border-radius: 8px;
margin-bottom: 16px;
}
.header h1 { margin: 0 0 8px; font-size: 20px; }
.header .meta { color: #646a73; font-size: 13px; }
.summary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 12px;
margin-bottom: 16px;
}
.stat {
padding: 12px 16px;
background: #fff;
border: 1px solid #e5e6eb;
border-radius: 8px;
}
.stat .label { color: #8c959f; font-size: 12px; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 4px; }
.stat.danger .value { color: #c53030; }
.stat.warning .value { color: #d97706; }
.stat.success .value { color: #059669; }
table {
width: 100%;
border-collapse: collapse;
background: #fff;
border: 1px solid #e5e6eb;
border-radius: 8px;
overflow: hidden;
table-layout: fixed;
word-break: break-word;
}
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0f1f3; font-size: 14px; }
th { background: #f5f6f7; color: #4e5969; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.pill {
display: inline-block;
padding: 2px 8px;
border-radius: 10px;
font-size: 12px;
font-weight: 500;
}
.pill.red { background: #fef2f2; color: #c53030; }
.pill.yellow { background: #fffbeb; color: #d97706; }
.pill.green { background: #ecfdf5; color: #059669; }
.footer { margin-top: 16px; color: #8c959f; font-size: 12px; text-align: right; }
</style>
</head>
<body>
<div class="report">
<div class="header">
<h1>{{TITLE}}</h1>
<div class="meta">送审稿编号:{{DRAFT_ID}} · 送审人:{{DRAFTER}} · 送审时间:{{SUBMITTED_AT}}</div>
<div class="meta">审查完成时间:{{GENERATED_AT}}</div>
</div>
<div class="summary">
<div class="stat"><div class="label">条款总数</div><div class="value">{{CLAUSE_TOTAL}}</div></div>
<div class="stat danger"><div class="label">🔴 冲突项</div><div class="value">{{CONFLICT_COUNT}}</div></div>
<div class="stat warning"><div class="label">🟡 程序缺项</div><div class="value">{{COMPLIANCE_GAP_COUNT}}</div></div>
<div class="stat success"><div class="label">🟢 合规通过</div><div class="value">{{PASS_COUNT}}</div></div>
</div>
<table>
<thead>
<tr>
<th style="width: 8%">编号</th>
<th style="width: 12%">冲突类型</th>
<th style="width: 25%">新条款原文</th>
<th style="width: 12%">旧制度文号</th>
<th style="width: 25%">旧条款原文</th>
<th style="width: 18%">建议处理</th>
</tr>
</thead>
<tbody>
{{BODY}}
</tbody>
</table>
<div class="footer">本报告由「制度文件冲突检测与合规审查」技能自动生成 · 仅供合规参考,不替代法律终审</div>
</div>
</body>
</html>

5
assets/naming/README.md Normal file
View File

@@ -0,0 +1,5 @@
# assets/naming
本目录用于存放本技能命名规范的引用。
> **使用方式:** 主仓 `skill-template-main/skill-template/development/NAMING.md` 已沉淀完整规范;本目录为占位,无需额外文件。

5
assets/schemas/README.md Normal file
View File

@@ -0,0 +1,5 @@
# assets/schemas
本目录存放本技能引用的 JSON Schema。
> **使用方式:** 模板请从主仓 `skill-template-main/skill-template/assets/schemas/skill-actions.schema.json` 复制到本目录;新技能严格按该 Schema 校验 `assets/actions.json`。