ADinsights Contract Guard
Overview
Classify contract-impact risk for a proposed change and return an advisory contract decision packet with required docs, tests, reviewers, and next actions. This skill owns contract classification; scope gatekeeper only emits contract risk signals.
Context Load Order
- Open
AGENTS.md. - Open
docs/project/api-contract-changelog.md. - Open
docs/project/integration-data-contract-matrix.md. - Open
docs/runbooks/release-checklist.md. - Open
references/contract-rules.yaml. - Open
references/contract-surfaces.mdwhen classification is ambiguous.
Inputs and Evidence Priority
Use evidence in this order:
--changed-files-from-gitoutput if enabled and non-empty.- Explicit paths from
--changed-file. - Path hints from router/scope packets.
- Prompt-extracted path hints.
- Prompt semantic hints (keywords only).
Decision Outcomes
Return exactly one contract status:
PASS_NO_CONTRACT_CHANGEWARN_POSSIBLE_CONTRACT_CHANGEESCALATE_CONTRACT_CHANGE_REQUIRES_DOCSESCALATE_BREAKING_CHANGE
Strictness Model
- Default/local mode is advisory (
exit 0). --ci-strictremains backward-compatible and maps to strict levelbreaking_only.--ci-strict-level breaking_onlyreturns non-zero forESCALATE_BREAKING_CHANGE.--ci-strict-level breaking_or_missing_docsreturns non-zero for bothESCALATE_BREAKING_CHANGEandESCALATE_CONTRACT_CHANGE_REQUIRES_DOCS.
Output Contract
Return a contract decision packet with:
schema_version(1.0.0)contract_statusbreaking_change_detectedcontract_surfaces_touchedrequired_docs_updatesrequired_reviewersrequired_testsrationaleevidenceentries (type,value,strength,source)next_actions
CLI Interface
Use scripts/evaluate_contract.py:
--prompt "<text>" --format json|markdown--changed-file "<path>"(repeatable)--changed-files-from-git--router-packet "<path-to-json>"--scope-packet "<path-to-json>"--ci-strict--ci-strict-level breaking_only|breaking_or_missing_docs
Guardrails
- Contract guard is advisory unless CI strict mode is explicitly enabled.
- Never suppress required contract docs updates for touched contract surfaces.
- Keep PII/secrets guidance aligned with
AGENTS.md.
Maintenance
- Keep
references/contract-rules.yamlaligned with API/data contract docs. - Run
scripts/validate_contract_rules.pyafter rules edits. - Run
scripts/run_contract_golden_tests.pybefore syncing. - Sync with
scripts/sync_to_codex_home.sh.