consistency-guard

Used to ensure cross-layer consistency and to perform risk-aware corrections across schemas, migrations, backend models, DTOs, validators, API contracts, SDKs, frontend types, forms, caches, tests, documentation, and protected domains. Applicable when changing or reviewing data structures, API contracts, business rules, permissions, persistence, generated clients, raw SQL, transactions, money flows, rollback plans, or any change that may introduce divergences between application layers.

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 "consistency-guard" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-975e18382c14f6794b68bda8be3b6b1a11a0cfe2c78fcc1fc4defc8093e962b4. Verify the upstream source and version against https://skillhub.cn/skills/user_347d40d8/consistency-guard 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

Used to ensure cross-layer consistency and to perform risk-aware corrections across schemas, migrations, backend models, DTOs, validators, API contracts, SDKs, frontend types, forms, caches, tests, documentation, and protected domains. Applicable when changing or reviewing data structures, API contracts, business rules, permissions, persistence, generated clients, raw SQL, transactions, money flows, rollback plans, or any change that may introduce divergences between application layers.

0 Downloads

Introduction source: third_party · user_347d40d8 · 0.0.4 Reference

SkillPi interpretation

Tasks
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.
Inputs and outputs
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: Use the full machine-readable schema in `references/report-format.md` only when structured output is explicitly useful.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
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:

  1. Capability Negotiation: declare what this agent can read, edit, parse, execute, test, inspect, and verify; downgrade unsupported steps.
  2. Intake: read the request, diff, changed files, errors, schemas, or specs.
  3. Project Profile: load project adapter, artifact map, source priority, verification commands, protected domains, generated files, ignore rules, overrides, and non-goals when available.
  4. Artifact Discovery: scan relevant project files and ignore generated/build/vendor output.
  5. Artifact Classification: classify migrations, schemas, entities, DTOs, validators, API specs, SDKs, frontend types, forms, cache contracts, tests, and docs.
  6. Artifact Registry: record artifact paths, roles, confidence, evidence, and adapter capabilities.
  7. Source of Truth Discovery: identify candidate authoritative contracts.
  8. Contract Priority Resolution: apply project-declared priority or stop for a human decision.
  9. Consistency Graph Build: connect artifacts by contract, mapping, generation, consumption, validation, caching, and documentation relationships.
  10. Impact View: derive affected nodes from the changed graph node.
  11. Non-goals: state what will not be changed.
  12. Protected Domain Detection: identify authentication, authorization, payment, wallet, withdrawal, audit, upload access, websocket permission, rate limit, captcha, and other approval-required domains.
  13. Migration Classification: classify changes as safe readonly, simple write, batch write, transactional, financial, distributed, DDL, maintenance, cleanup, background job, or permission/security related.
  14. Drift Detection: compare connected nodes and contract groups for structural, semantic, compatibility, security, and documentation drift.
  15. Risk Scoring: quantify findings and repairs by priority, category, confidence, blast radius, and reversibility.
  16. Repair Plan: include execution, verification, rollback, evidence, confidence, and blocked reasons.
  17. Decision Gate: enter NEED_HUMAN_DECISION, NEED_HUMAN_REVIEW, or NEED_APPROVAL when information, confidence, capability, or protected-domain authorization is insufficient.
  18. Verification Checklist: produce and complete a checklist for the change type, or a manual checklist when commands cannot run.
  19. Exit Criteria: evaluate no known drift, verification status, protected-domain status, confidence threshold, rollback plan, and documented remaining risk.
  20. 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_AMBIGUOUS or CONTRACT_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.

Current listing version

0.0.4

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 覆盖数据库 schema、API 契约、前后端类型、缓存、测试、文档等全栈一致性守护
  • 适用于中大型项目的变更评审与风险防控,实用价值高
Trigger Precision95/100

Highlights

  • 触发场景描述详尽,涵盖数据形状、API 契约、业务规则、权限、SQL、事务、财务流等关键变更类型
  • 边界清晰,能有效引导用户在相关场景下调用
Structure and Standards75/100

Areas to improve

  • 引用文件缺失 Reported severity: Major

    SKILL.md 中引用了 references/ 目录下的多个 .md 文件(如 artifact-discovery.md、consistency-graph.md 等),但 ZIP 包中未包含这些文件

    Recommendation: 请补充所有被引用的 reference 文件,或明确说明这些文件将由平台动态加载

Highlights

  • 文档结构完整,包含核心契约、20 步工作流、状态门控、输出协议等关键章节
  • 有明确的出口条件和状态中断机制,逻辑严谨
Execution Reliability70/100

Areas to improve

  • 缺乏具体执行示例 Reported severity: Minor

    虽然定义了完整的工作流和协议,但未提供具体的工具调用示例、命令模板或自动化脚本

    Recommendation: 建议补充典型场景下的执行示例(如数据库迁移一致性检查、API 契约漂移检测等)

Highlights

  • 强调能力协商、证据优先、回滚计划和人工决策门控,可靠性设计良好
  • 对不可逆操作有严格确认机制,风险防控意识强
Evidence Verifiability (mean of the first four)81/100

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.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

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.