data-contract-testing-with-schema-registry
Skill49 starsChanged 6 months agoMITView on GitHub
Guides agents through data-contract testing using schema registries and compatibility checks. Use when validating event contracts, stream schema evolution, consumer compatibility, or release gates for schema-managed systems.
In this repository80 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-data-agent-core.mdcCursor rule
- .cursor/rules/10-spec-first.mdcCursor rule
- .cursor/rules/20-platform-preset-selector.mdcCursor rule
- .cursor/rules/30-quality-gates.mdcCursor rule
- airflow-and-workflow-orchestrationSkill
- apache-beam-unified-batch-and-streamSkill
- apache-hudi-lakehouseSkill
- api-and-saas-ingestion-patternsSkill
- avro-protobuf-json-schema-registrySkill
- bigquery-and-dataform-platform-engineeringSkill
- cdc-and-incremental-loadingSkill
- clickhouse-real-time-analyticsSkill
- data-catalog-and-discoverySkill
- data-lake-and-zone-architectureSkill
- data-mesh-and-domain-oriented-designSkill
- data-migration-and-platform-cutoverSkill
- data-observability-and-sla-managementSkill
- data-platform-ci-cd-and-release-managementSkill
- data-platform-disaster-recovery-and-business-continuitySkill
- data-platform-operating-model-and-service-ownershipSkill
- dataplex-and-bigquery-governanceSkill
- data-quality-and-contract-testingSkill
- data-quality-platforms-and-rule-managementSkill
- data-reconciliation-and-financial-controlsSkill
- data-resiliency-testing-and-failure-injectionSkill
- data-security-compliance-and-regulated-dataSkill
- data-sharing-and-publishing-contractsSkill
- data-specificationSkill
- dbt-and-analytics-engineeringSkill
- debezium-and-kafka-connect-cdcSkill
- delta-lake-and-medallion-architectureSkill
- duckdb-local-analytics-and-devSkill
- enterprise-etl-and-data-integration-modernizationSkill
- esg-and-sustainability-regulatory-reportingSkill
- etl-elt-and-modernization-strategySkill
- feature-store-and-ml-data-pipelinesSkill
- file-and-partner-feed-ingestionSkill
- glue-data-catalog-and-lake-formation-governanceSkill
- great-expectations-deequ-and-cualleeSkill
- incident-triage-and-pipeline-recoverySkill
- java-data-engineering-and-integration-servicesSkill
- kafka-resilience-and-schema-evolutionSkill
- lakefs-and-data-versioningSkill
- lakehouse-table-format-engineeringSkill
- lineage-pii-and-governanceSkill
- lower-environment-data-masking-and-obfuscationSkill
- mainframe-modernization-and-data-offloadSkill
- master-data-and-entity-resolutionSkill
- mcp-data-observability-integrationSkill
- microsoft-purview-and-azure-data-governanceSkill
- notebook-to-production-hardeningSkill
- openmetadata-datahub-and-openlineageSkill
- operational-datastore-selection-relational-and-nosqlSkill
- orchestration-and-backfillsSkill
- pipeline-planning-and-task-breakdownSkill
- privacy-retention-and-right-to-deleteSkill
- python-data-engineering-and-pipeline-packagingSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 14 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill when contracts must be tested through registry-backed compatibility rules, not only by convention.
- Distinctive: line 20
Do not use this when schemas are not managed through a registry or when the system has no shared event contracts.
- Very specific: line 33
use the registry's /compatibility API to check before merging
- Distinctive: line 36
run tests against both the latest registered version and specific consumer versions
- Distinctive: line 38
Test representative producer and consumer scenarios.
- Distinctive: line 40
verify that default values produce correct behavior for removed or added fields
- Distinctive: line 41
test edge cases: null handling, enum additions, nested record changes
- Distinctive: line 47
test that each consumer's current schema can read the proposed producer schema
- Distinctive: line 48
document which consumers need upgrades for breaking changes
- Distinctive: line 60
when breaking changes are necessary, define a migration plan
- Distinctive: line 61
create a new subject or version namespace for the breaking schema
- Distinctive: line 62
run both old and new contracts in parallel during migration
- Distinctive: line 64
document the consumer migration path with explicit deadlines
- Distinctive: line 77
no contract tests in CI — compatibility is checked only at deploy time
- Distinctive: line 81
test output is not stored — no evidence trail for audits
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data Contract Testing With Schema Registry
Overview
Use this skill when contracts must be tested through registry-backed compatibility rules, not only by convention. It helps agents make event contract validation a blocking part of build and release behavior with automated testing, consumer impact analysis, and evidence-driven release gates.
When to Use
- testing event contract changes before production release
- validating schema compatibility as part of CI/CD pipelines
- coordinating producer and consumer schema evolution across teams
- enforcing registry-backed contract quality gates before deployment
- building release evidence that proves schema safety
Do not use this when schemas are not managed through a registry or when the system has no shared event contracts.
Workflow
- Define the contract and compatibility target per subject.
Include:
- which schema registry subjects are in scope
- the compatibility level required:
BACKWARD,FORWARD,FULL, orTRANSITIVEvariants - who owns the contract (producing team, platform team, or shared)
- which consumers depend on each subject and their minimum supported version
- Implement contract tests in CI.
- register the proposed schema against the registry's compatibility endpoint
- use the registry's
/compatibilityAPI to check before merging - fail the build if compatibility is violated
- produce test output showing which rules passed or failed
- run tests against both the latest registered version and specific consumer versions
- Test representative producer and consumer scenarios.
- serialize sample records with the new schema and deserialize with the old
- verify that default values produce correct behavior for removed or added fields
- test edge cases: null handling, enum additions, nested record changes
- for Protobuf: test field number stability and reserved field behavior
- for Avro: test union type evolution and logical type compatibility
- Validate downstream consumer impact before release.
- identify all registered consumers of the subject
- test that each consumer's current schema can read the proposed producer schema
- document which consumers need upgrades for breaking changes
- define the deployment order: consumer upgrade before or after producer change
- communicate schema changes through established team channels
- Tie contract test results to release gates.
- schema compatibility check must pass before deployment proceeds
- produce structured evidence (JSON report) of compatibility test results
- store evidence alongside the release artifact for audit
- block production deploys on compatibility failures — no manual overrides without review
- include contract test results in pull request checks
- Plan for contract migrations and breaking changes.
- when breaking changes are necessary, define a migration plan
- create a new subject or version namespace for the breaking schema
- run both old and new contracts in parallel during migration
- define a deprecation timeline for the old contract
- document the consumer migration path with explicit deadlines
Common Rationalizations
| Rationalization | Reality |
| "We check compatibility manually before releasing." | Manual checks are inconsistent and skip edge cases. Automated registry-backed testing catches issues that humans miss under time pressure. |
| "Adding a field is always safe." | Adding a required field without a default breaks backward compatibility. Adding an optional field is safe only if consumers handle absence correctly. |
| "We only have one consumer so contract testing is overhead." | Consumers multiply over time. Establishing contract testing early prevents breaking changes from accumulating technical debt. |
| "The registry will reject incompatible schemas anyway." | Registry rejection at deploy time is too late. Testing in CI catches issues before code is merged and before release pressure builds. |
Red Flags
- no contract tests in CI — compatibility is checked only at deploy time
- proposed schemas are registered directly without prior compatibility validation
- consumer dependency map does not exist — nobody knows who reads the events
- breaking changes are deployed with "we'll fix consumers later" attitude
- test output is not stored — no evidence trail for audits
- compatibility policy is set to
NONEin production subjects - contract test failures are routinely overridden without review
- migration plans for breaking changes have no timeline or consumer notification
Verification
- Compatibility targets are defined per subject and match consumer expectations
- Contract tests run in CI and block merges on compatibility failures
- Producer and consumer serialization/deserialization are tested with sample records
- Consumer dependency map is documented and up to date
- Contract test evidence is produced, stored, and linked to releases
- Breaking changes have explicit migration plans with timelines
- Deployment order (producer-first vs consumer-first) is defined for each change type
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

