policy-consistency
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "policy-consistency" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-63885a8d8cfd9d5766998cb0cb26ecc6d42d19482c24d3bb3e153f8db58df37d. Verify the upstream source and version against https://skillhub.cn/skills/user_c9a5f9eb/policy-consistency-skill before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Policy consistency analysis: given an ontology policy file, it automatically parses and queries related higher- and lower-level policies, and after manual confirmation of relationships performs paragraph-level consistency comparison; alternatively, users can directly specify the higher/lower files to compare. Produces a consistency analysis report in Markdown format. Suitable for scenarios requiring hierarchical policy comparison, policy duplication checks, or clause-difference verification.
Introduction source: third_party · user_c9a5f9eb · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: policy-consistency
description: 政策一致性分析 — 给定本体政策文件,自动解析、查询上下位关联政策、人工确认关联关系后做段落级一致性比对;或手动指定上下位文件直接比对。产出 Markdown 一致性分析报告。当用户要对政策做上下位一致性比对、政策查重、政策条款差异核查,或提到「政策一致性分析 / 政策比对 / 上下位政策」时使用。政策一致性分析 skill
把一份「本体政策」与其上位 / 下位政策做段落级一致性比对,产出一致性分析报告(Markdown)。 本 skill 只调用三个真实后端接口(文件解析 / 关联查询 / 一致性分析),不依赖前端、不需要启动任何服务、零 npm 依赖,直接用 Node 运行脚本。
- 适用:政策上下位一致性比对、政策查重、条款差异核查。
- 前置:Node 18+(使用内置
fetch,无需npm install)。 - 输入:本体 / 上下位文件既可给本地路径,也可给 http(s) 线上地址(接口①的 fileUrl 模式,自动识别)。
- 鉴权(必须):使用者需自备 api-key,到北京彩智科技(深知智能)Maas 平台申请:https://platform.dknowc.cn/#/home。skill 出厂不内置任何 key。
- 数据与隐私:运行时政策全文会发送到第三方服务
open.dknowc.cn做解析与比对;详见NOTICE.md。结论由 AI 给出,仅供参考。
首次使用前:提供 api-key
每个使用者都必须提供自己的 api-key。提供方式任选其一:
| 方式 | 用法 | 适合场景 |
|---|---|---|
| 命令行参数(临时) | 每条命令加 --api-key sk-xxxx |
一次性 / 测试 |
| 环境变量 | PC_API_KEY=sk-xxxx |
当前 shell 会话 |
| 配置文件(持久,推荐) | 把 apiKey 填入 config.json,或复制为 config.local.json 后填写 |
长期使用;config.local.json 不会随 skill 分发 |
优先级:--api-key > PC_API_KEY > config.local.json > config.json。
未提供 key 时,任何分析命令都会直接报错并提示申请地址(help 不需要 key)。
多种调用方式
不论哪种方式,最终都走同一套脚本(scripts/consistency.js),行为一致。<skill> 指本 skill 文件夹。
| # | 方式 | 命令 | 适合 |
|---|---|---|---|
| 1 | 交互向导(最简单) | node <skill>/scripts/consistency.js menu |
不想记子命令的人;缺 key 时会现场引导输入 |
| 2 | 子命令(脚本/熟练) | node <skill>/scripts/consistency.js prepare \| run \| auto \| manual \| health |
自动化、批处理 |
| 3 | Claude Code 内 | 直接 /policy-consistency |
在 Claude 会话里让我代跑 |
| 4 | 类 Unix 双击/终端 | ./start.sh(先 chmod +x) |
macOS/Linux 图形用户 |
| 5 | 全局命令 | npm link(在 skill 目录)后,任意位置 policy-consistency menu(Win/类 Unix 通用) |
想在任意目录直接敲命令 |
注:方式 4/5 均依赖系统已安装 Node 18+ 并在 PATH 中。方式 4(
start.sh)会cd到 skill 目录,故报告生成在 skill 目录下。
两种用法
1) 自动分析(推荐)—— 给定本体文件,自动查关联 + 人工确认 + 比对
三步,中间有人工确认关联关系的检查点(与 Web 端体验一致):
# 第1步:解析本体 + 自动查询上下位关联政策,输出 draft.json 供确认
node <skill>/scripts/consistency.js prepare <本体文件> [--title 标题] [--out draft.json]
# 第2步:(人工)确认 / 编辑 draft.json —— 可增删上下位、改标题
# 第3步:用确认后的草稿执行一致性分析,生成报告
node <skill>/scripts/consistency.js run <draft.json>
「一键、不确认」的快捷版(自动查询后直接比对,跳过检查点):
node <skill>/scripts/consistency.js auto <本体文件> [--title 标题]
2) 手动配置 —— 直接指定本体 + 上下位文件(跳过关联查询)
node <skill>/scripts/consistency.js manual <本体文件> --upper <上位1,上位2> [--lower <下位1,下位2>] [--title 标题]
--upper/--lower用英文逗号分隔多个文件路径。- 标题缺省时按文件名推导(去扩展名 + 去「02-国家级-」类前缀)。
输出
每次执行②分析后,生成(默认在当前工作目录,可用 --out-dir <目录> 改目录):
policy-report-<时间戳>.md—— 一致性分析报告(关联清单 / 概览 / 问题 / 逐条段落比对)。policy-report-<时间戳>.json—— 报告原始结构(schemaVersion: 1),字段定义见docs/REPORT_SCHEMA.md。
报告内容同时打印到终端;加 --quiet 则只打印一行概要 + 文件路径(适合脚本)。
通用选项(任意子命令可附加)
--api-key <key>—— 本次使用的 api-key(也可用PC_API_KEY环境变量 / 配置文件)。--quiet—— 不打印完整报告,仅一行概要 + 路径。--out-dir <目录>—— 报告输出目录(不存在自动创建)。--title <标题>—— 指定本体政策标题(缺省按文件名/URL 末段推导)。version/--version—— 打印版本号。
执行建议(给 Claude)
- 先拿到 api-key:使用者必须自备 api-key(申请:https://platform.dknowc.cn/#/home)。若尚未配置(
config.json为空、无PC_API_KEY),先问用户要 key,再每次命令带上--api-key <key>,或写入config.local.json持久化。绝不假设默认 key——即使是对 skill 作者本人,也必须先索要其 key。 - 先确认本体文件路径存在;若用户只给了政策标题、无文件,提示需要文件(接口①需上传文件解析)。
- 自动模式默认走
prepare→ 确认 →run,以体现人工确认环节:- 跑完
prepare后,把检测到的上位 / 下位关联政策清单展示给用户,用 AskUserQuestion 让用户选择「全部采用 / 去掉部分 / 改手动指定」。用户要去掉某些项时,直接编辑draft.json(删掉对应条目或清空其标题)后再run。 - 用户明确表示「不用确认、直接出结果」时,再用
auto。
- 跑完
- 手动模式:用户已明确知道上下位文件时,用
manual一次出结果。 - 接口②分析最长约 3 分钟(脚本侧 200 秒超时)。若超时,提示用户减少上下位关联政策数量后重试(自动模式回到草稿删条目;手动模式少给几个文件)。
- 报告生成后,向用户口述概览(一致性评分、各档计数、需复核的问题数),并把
.md报告路径告诉用户;用户要细节时再读取.md展示逐条比对。 - 若
prepare查不到任何关联政策(上下位均为 0),提示用户改用manual手动指定。
辅助命令
node <skill>/scripts/consistency.js health # 验证上游接口与 API Key 是否可用
node <skill>/scripts/consistency.js help # 打印用法
数据契约要点(避免误判)
- 接口②每条匹配只有文字结论
matchConclusion:完全匹配 / 包含匹配 / 部分匹配 / 相关。没有数值相似度。报告里的「一致性评分」是由「完全(100)+包含(85)」加权派生的参考分;部分/相关不计入评分。 - 「部分匹配 / 相关」会被派生为「建议复核」的一致性问题(中等/低);完全/包含不计为问题。
- 接口③对直辖市(北京/上海/天津/重庆)会标
level:"省级"—— 报告原样展示 level,不要在客户端归一化。上下位关系看relationType(upper/lower),不看 level。 - 三个接口的端点、请求体、解包逻辑见
scripts/api.js;报告分档/计数见scripts/report.js。
文件结构
policy-consistency-skill/
├── SKILL.md # 本文件(Claude 使用指引)
├── README.md # 人类可读说明(安装/运行)
├── config.json # 默认模板:服务地址/端点/超时;apiKey 出厂留空
├── config.local.json # (可选,自建)本地覆盖,填 apiKey;不随 skill 分发
├── package.json # bin/scripts/engines,供 npm link 全局命令
├── start.sh # 类 Unix 双击启动器 → 进入交互向导
└── scripts/
├── consistency.js # CLI 入口:menu / prepare / run / auto / manual / health
├── interactive.js # 交互向导(menu):readline 引导选模式、填路径、索要 key
├── api.js # 三个上游接口封装(fetch,零依赖)
├── report.js # 接口② → 报告(分档/计数/问题 + Markdown 渲染)
└── config.js # 读取 config.json + config.local.json + PC_API_KEYCurrent listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决政策上下位一致性比对的明确刚需,显著提升合规审查效率
- 支持自动关联查询与人工确认,兼顾自动化与准确性
Highlights
- 触发词精准完整,覆盖「政策一致性分析 / 政策比对 / 上下位政策」等多种变体
- 边界清晰,无歧义或重叠风险
Areas to improve
-
description写错位置 Reported severity: Minor
顶层 frontmatter 中 description 为空,实质描述内容位于 skill_body 内部
Recommendation: 将 description 内容移至顶层 frontmatter,保持规范一致
Highlights
- Phase/步骤清晰,有出口条件,含端到端示例
- frontmatter 完整,单文件结构良好
Areas to improve
-
缺少When to Use显式章节 Reported severity: Minor
文档中未显式设置 When to Use 章节,但 description 已覆盖核心使用场景
Recommendation: 可补充显式 When to Use 章节以增强可读性
Highlights
- 工具来源明确(深知智能 Maas 平台),参数正确
- 覆盖主要异常处理(缺 key、超时、关联为空),配置优先级清晰
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 12 -
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 14, 17, 19, 23, 25
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- platform.dknowc.cn
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.