consistency-guard
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "consistency-guard":https://skillpi.com/zh/skills/deepskill-975e18382c14f6794b68bda8be3b6b1a11a0cfe2c78fcc1fc4defc8093e962b4。安装前核对上游来源和版本:https://skillhub.cn/skills/user_347d40d8/consistency-guard。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skillhub.cn
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
用于保障跨层一致性,并在模式、迁移、后端模型、DTO、验证器、API 契约、SDK、前端类型、表单、缓存、测试、文档及受保护域之间进行风险感知与修复。适用于修改或审查数据结构、API 契约、业务规则、权限、持久化、生成的客户端、原始 SQL、事务、资金流、回滚计划或任何可能导致各应用层产生偏差的变更时使用。
介绍来源: third_party · user_347d40d8 · 0.0.4 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: consistency-guard
description: Guard cross-layer consistency and risk-aware repair across schemas, migrations, backend models, DTOs, validators, API contracts, SDKs, frontend types, forms, caches, tests, docs, and protected domains. Use when modifying or reviewing data shape, API contracts, business rules, permissions, persistence, generated clients, raw SQL, transactions, financial flows, rollback plans, or any change that may drift across application layers.Consistency Guard
Overview
Act as a consistency reviewer and architecture guard, not a code generator. Prevent schema drift, API drift, type drift, database drift, business drift, cache drift, compatibility drift, security drift, performance drift, and documentation drift across full-stack systems.
Use this skill to enforce an AI Consistency Protocol: negotiate current agent capability, load the project profile or adapter, discover artifacts, classify contracts, resolve authority, build a Consistency Graph, derive the impact view, classify repair risk, require evidence, detect protected domains, require human decisions when needed, produce rollback plans, and verify or downgrade verification before completion.
Core Contract
Require these invariants:
- Identify the changed contract before editing.
- Negotiate current agent capability before promising analysis, edits, commands, tests, SQL execution, parsing, or verification.
- Load project profile, project adapter, rule overrides, and non-goals before impact analysis when they exist.
- Discover and classify project artifacts before choosing a source of truth.
- Identify the authoritative source of truth explicitly; never treat generated artifacts, snapshots, initialization SQL, SDKs, documentation, caches, or derived schemas as authoritative by default.
- Use declared contract priority to resolve conflicts.
- Build a Consistency Graph as the primary model.
- Derive impact trees or checklists from the graph, never from guesses.
- Detect renames separately from delete-plus-create changes.
- Respect declared API, data, SDK, and cache versions.
- Classify migration and repair type before changing persistence, raw SQL, transactions, permissions, or security-sensitive code.
- Treat protected domains as approval-required zones unless the project explicitly declares a safe adapter and approval policy.
- Use risk level, confidence, and reasoned repair status for every proposed repair.
- Derive confidence from cited evidence only; do not report confidence without evidence.
- Provide rollback plan for any file, schema, cache, generated artifact, or config modification.
- State exit criteria before final status and prove each criterion with evidence or mark it unmet.
- Stop for missing business decisions instead of inventing semantics.
- Never claim consistency when verification is skipped, unsupported, or failed.
Workflow
Follow this sequence for every relevant task:
- Capability Negotiation: declare what this agent can read, edit, parse, execute, test, inspect, and verify; downgrade unsupported steps.
- Intake: read the request, diff, changed files, errors, schemas, or specs.
- Project Profile: load project adapter, artifact map, source priority, verification commands, protected domains, generated files, ignore rules, overrides, and non-goals when available.
- Artifact Discovery: scan relevant project files and ignore generated/build/vendor output.
- Artifact Classification: classify migrations, schemas, entities, DTOs, validators, API specs, SDKs, frontend types, forms, cache contracts, tests, and docs.
- Artifact Registry: record artifact paths, roles, confidence, evidence, and adapter capabilities.
- Source of Truth Discovery: identify candidate authoritative contracts.
- Contract Priority Resolution: apply project-declared priority or stop for a human decision.
- Consistency Graph Build: connect artifacts by contract, mapping, generation, consumption, validation, caching, and documentation relationships.
- Impact View: derive affected nodes from the changed graph node.
- Non-goals: state what will not be changed.
- Protected Domain Detection: identify authentication, authorization, payment, wallet, withdrawal, audit, upload access, websocket permission, rate limit, captcha, and other approval-required domains.
- Migration Classification: classify changes as safe readonly, simple write, batch write, transactional, financial, distributed, DDL, maintenance, cleanup, background job, or permission/security related.
- Drift Detection: compare connected nodes and contract groups for structural, semantic, compatibility, security, and documentation drift.
- Risk Scoring: quantify findings and repairs by priority, category, confidence, blast radius, and reversibility.
- Repair Plan: include execution, verification, rollback, evidence, confidence, and blocked reasons.
- Decision Gate: enter NEED_HUMAN_DECISION, NEED_HUMAN_REVIEW, or NEED_APPROVAL when information, confidence, capability, or protected-domain authorization is insufficient.
- Verification Checklist: produce and complete a checklist for the change type, or a manual checklist when commands cannot run.
- Exit Criteria: evaluate no known drift, verification status, protected-domain status, confidence threshold, rollback plan, and documented remaining risk.
- Final Report: return consistent, blocked, or partial_with_risk.
State Gates
Use state names only when they clarify a blocked or high-risk workflow; do not dump the full state machine in routine answers.
Allowed completion states:
consistent: no known drift remains and exit criteria are evidenced.partial_with_risk: useful work completed, but manual checks, unsupported verification, or lower-confidence items remain.blocked: required decision, approval, authority resolution, adapter capability, or verification is missing.
Interrupt states:
NEED_HUMAN_DECISION: missing business or compatibility semantics.NEED_HUMAN_REVIEW: confidence is below threshold or evidence is weak.NEED_APPROVAL: protected domain, financial flow, destructive migration, transaction, queue, webhook, or security boundary is touched.CAPABILITY_UNSUPPORTED: the current agent cannot inspect, execute, parse, or verify a required step.SOURCE_OF_TRUTH_AMBIGUOUSorCONTRACT_CONFLICT: authority cannot be resolved from project evidence.VERIFICATION_FAILED: required automated or manual verification failed.
Do not allow execution without capability negotiation, project profile check, graph-derived impact view, non-goals, protected-domain scan, migration classification, risk score, evidence, and rollback plan when edits are planned. Do not return consistent with unresolved checklist items, unsupported verification treated as passed, active drift findings, blocked protected domains, missing rollback plan, unproven exit criteria, or confidence below threshold.
Output Protocol
Default to a concise human-readable report unless the user requests YAML/JSON, a tool needs structured output, or the task is a high-risk audit.
Default report:
Status: consistent | blocked | partial_with_risk
Scope: changed contract and non-goals
Source of truth: artifact + evidence
Must fix now: P0/P1 findings with evidence
Can defer: P2/P3 findings with risk
Need decision/approval: missing semantics or protected-domain changes
Verification: commands run, not run, failed, or manual checks
Rollback: files and restore method for edits
Use the full machine-readable schema in references/report-format.md only when structured output is explicitly useful.
Hard Boundaries
Do not:
- Invent business requirements, default values, nullability, enum values, permissions, cache TTLs, retention rules, or lifecycle semantics.
- Assume generated artifacts, snapshots, initialization SQL, SDKs, documentation, caches, or derived schemas are authoritative unless project conventions or explicit documentation say so.
- Reconcile competing authority claims by preference or convenience; if project conventions and documentation cannot resolve them, stop and request a project decision.
- Modify protected domains without explicit approval and a stated reason.
- Auto-approve writes, transactions, locks, financial flows, permission changes, webhooks, jobs, or message queues as safe migrations.
- Report only a raw count of remaining findings; always break remaining risk down by priority and category.
- Report confidence without concrete evidence.
- Treat an unavailable capability as a passed check; downgrade to manual verification or mark unsupported.
- Expand scope beyond declared non-goals.
- Make changes without rollback plan.
- Treat a rename as a delete-plus-create without compatibility analysis.
- Treat intentional v1/v2 differences as drift when a compatibility matrix exists.
- Update only one layer when the graph shows connected required changes.
- Modify unrelated files outside the impact scope.
- Claim verification success for adapter capabilities that are unknown or unsupported.
- Use documentation updates as a substitute for contract or implementation updates.
References
Read these files as needed:
references/artifact-discovery.md: artifact discovery, classification, registry, ignore rules, and contract priority.references/consistency-graph.md: graph model, relationships, impact view, rename detection, version compatibility, and confidence gates.references/execution-protocol.md: capability negotiation, evidence-first rules, non-goals, rollback plans, verification downgrade, and exit criteria.references/drift-rules.md: drift categories, severity rules, human decision points, and recovery strategy.references/repair-strategy.md: protected domains, migration classification, risk scoring, repair queue, confidence, and technical debt reporting.references/project-adapters.md: project profile, project adapter contract, rule overrides, verification commands, source priority, generated files, and adapter composition.references/verification-checklists.md: checklist templates for database, API, type, business, cache, documentation, and compatibility changes.references/report-format.md: full YAML report schema and compact report guidance for structured-output or high-risk audit tasks.references/adapters-and-extension.md: language, database, API, frontend, cache, test, documentation adapter capabilities.references/engineer-lenses.md: distilled review lenses from relevant senior engineering roles.
当前收录版本
0.0.4
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 覆盖数据库 schema、API 契约、前后端类型、缓存、测试、文档等全栈一致性守护
- 适用于中大型项目的变更评审与风险防控,实用价值高
亮点
- 触发场景描述详尽,涵盖数据形状、API 契约、业务规则、权限、SQL、事务、财务流等关键变更类型
- 边界清晰,能有效引导用户在相关场景下调用
待提升项
-
引用文件缺失 原报告严重程度:重大
SKILL.md 中引用了 references/ 目录下的多个 .md 文件(如 artifact-discovery.md、consistency-graph.md 等),但 ZIP 包中未包含这些文件
改进建议:请补充所有被引用的 reference 文件,或明确说明这些文件将由平台动态加载
亮点
- 文档结构完整,包含核心契约、20 步工作流、状态门控、输出协议等关键章节
- 有明确的出口条件和状态中断机制,逻辑严谨
待提升项
-
缺乏具体执行示例 原报告严重程度:轻微
虽然定义了完整的工作流和协议,但未提供具体的工具调用示例、命令模板或自动化脚本
改进建议:建议补充典型场景下的执行示例(如数据库迁移一致性检查、API 契约漂移检测等)
亮点
- 强调能力协商、证据优先、回滚计划和人工决策门控,可靠性设计良好
- 对不可逆操作有严格确认机制,风险防控意识强
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。