Skip to content
youdede

Api Contract Compatibility Guard

DevelopmentHookv1.0.0

Compares OpenAPI JSON or indentation-stable YAML signatures and blocks removed routes, operations, response codes, and newly mandatory parameters without executing generators.

Runs on

Scope
$npx @youdede/toolkit add api-contract-compatibility-guard --target claude-code

What it does

Block high-confidence removals from bounded OpenAPI contract edits.

When it fires

  • implementation
  • pre-commit

How it behaves

Block high-confidence removals from bounded OpenAPI contract edits.

It does not call an API or regenerate clients.

It does not infer undocumented consumer behavior.

It does not approve a breaking-version release.

Configuration

targets/claude-code/api-contract-compatibility-guard.mjsnode · read-only

Version
1.0.0
Requires
node
Licence
RiskThis automatic gate blocks high-confidence removals from bounded OpenAPI contract edits; a false denial can interrupt legitimate work, but it does not execute the blocked action.
Medium
ModeHow it works: fixed rules, model instructions, or both.
Deterministic only
Behaviour
Enforces, blocks on violation
On failure
Denies and blocks
LatencyThe entrypoint handles one intercepted event to block high-confidence removals from bounded OpenAPI contract edits without deferred work.
Immediate
Data retentionWhether data remains after use and who manages its storage.
Not retained

Often used with

All in Development