ivanshamaev/de-agent-skills/data-contracts

Claude Code and agent skill by ivanshamaev/de-agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Data Contracts — datacontract.com YAML specification (schema, quality, SLA, ownership, servers, changelog), Data Contract CLI (init/test/lint/diff/breaking/publish/export), SodaCL-style quality checks embedded in contract, breaking change detection (column removal/type change/constraint tightening), CI/CD GitHub Actions PR enforcement, Kafka/S3/database server definitions, contract-driven development (producer-first), semver versioning and deprecation, DataHub and OpenMetadata catalog publishing

Install

npx vskill@latest install ivanshamaev/de-agent-skills/data-contracts

SKILL.md

The same SKILL.md was published earlier as ivanshamaev/de-agent-skills/data-contracts.

Data Contracts

When to Use

Load this skill when the user needs to:

  • Author or review a datacontract.yaml file following the datacontract.com specification
  • Run datacontract CLI commands (init, test, lint, diff, breaking, publish, export, catalog)
  • Embed SodaCL or custom SQL quality checks inside a contract
  • Detect breaking changes between contract versions in PRs
  • Set up GitHub Actions CI/CD to enforce contracts automatically
  • Define server blocks for Kafka topics, S3 buckets, or database tables
  • Follow the contract-driven development pattern (producer writes contract first)
  • Apply semver versioning and deprecation notices to contracts
  • Publish contracts to DataHub or OpenMetadata for catalog governance

Core Concepts

datacontract.yaml
├── info — id, title, version, owner, contact, description, status
├── servers — where the data lives (Kafka, S3, Postgres, Snowflake, …)
├── terms — usage/access conditions, billing, retention
├── models — logical schema: tables → fields (type, constraints, PII, examples)
├── quality — SodaCL checks or custom SQL assertions
├── servicelevels — SLA commitments (freshness, availability, latency, retention)
└── info.links — external docs, data catalog URLs, Slack channels

Installation

bash
pip install datacontract-cli # latest stable
# or with extras for specific data sources
pip install "datacontract-cli[s3]" # AWS S3 / Parquet
pip install "datacontract-cli[kafka]" # Apache Kafka
pip install "datacontract-cli[postgres]" # PostgreSQL / Trino / Vertica
pip install "datacontract-cli[all]" # all extras

Complete Contract YAML Example

yaml
# datacontract.yaml — datacontract.com specification v0.9.3
dataContractSpecification: 0.9.3
# ─── Identity & Ownership ───────────────────────────────────────────────────
id: urn:datacontract:orders:v2
info:
title: Orders Domain — Enriched Orders
version: 2.1.0 # semver for THIS contract document
status: active # draft | active | deprecated | retired
description: |
Enriched order events produced by the Orders microservice after payment
gateway confirmation. One record per order state transition.
owner: team-orders # team slug or email group
contact:
name: Orders Platform Team
url: https://wiki.example.com/orders
email: orders-platform@example.com
links:
data_catalog: https://datahub.example.com/dataset/urn:li:dataset:(urn:li:dataPlatform:kafka,orders.enriched,PROD)
runbook: https://wiki.example.com/orders/runbook
slack: https://example.slack.com/archives/C0ORDERS
# ─── Terms of Use ────────────────────────────────────────────────────────────
terms:
usage: |
Data may be used for operational reporting and analytics. Re-publication
to external systems requires written approval from the Orders team.
limitations: |
PII fields must not be exposed in dashboards without masking. See
https://wiki.example.com/data-classification for the classification guide.
billing: free # free | subscription | metered
noticePeriod: P3M # ISO 8601 duration — 3-month deprecation notice
# ─── Servers (Where the Data Lives) ─────────────────────────────────────────
servers:
production_kafka:
type: kafka
host: kafka.example.com:9092
topic: orders.enriched.v2
format: avro # avro | json | protobuf
delimiter: none # newline | comma | none
description: Primary Kafka topic; compacted, Avro schema in Confluent Registry
environment: production
roles:
- name: read
description: Consumer group access
- name: write
description: Orders service producer access
production_s3:
type: s3
environment: production
location: s3://data-lake-prod/orders/enriched/v2/
format: parquet
delimiter: none
description: Daily Parquet snapshot synced from Kafka at 02:00 UTC
analytics_postgres:
type: postgres
environment: production
host: analytics-db.internal
port: 5432
database: analytics
schema: orders
description: Materialized serving layer for BI tools
# ─── Models (Schema) ─────────────────────────────────────────────────────────
models:
enriched_orders:
description: One row per order state transition with enriched customer data
type: table
fields:
order_id:
type: varchar
description: Globally unique order identifier (UUID v4)
required: true
unique: true
pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
example: "a3b2c1d0-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
pii: false
customer_id:
type: varchar
description: Reference to the customer entity
required: true
references: customers.customer_id # cross-model FK hint
pii: false
customer_email:
type: varchar
description: Customer email address — PII, must be masked in marts
required: true
pii: true
dataClass: sensitive # sensitive | restricted | internal | public
classification: PII_EMAIL
order_status:
type: varchar
description: Current state in the order lifecycle
required: true
enum:
- CREATED
- PAYMENT_PENDING
- CONFIRMED
- SHIPPED
- DELIVERED
- CANCELLED
order_total_usd:
type: decimal
precision: 12
scale: 2
description: Total order value in USD including tax and shipping
required: true
minimum: 0
example: 149.99
pii: false
created_at:
type: timestamp
description: UTC timestamp when the order was first created
required: true
pii: false
updated_at:
type: timestamp
description: UTC timestamp of the most recent state transition
required: true
pii: false
metadata:
type: object
description: Opaque key/value bag for source-system flags
required: false
pii: false
fields:
source_system:
type: varchar
description: Originating microservice name
required: false
feature_flags:
type: array
description: Active feature flags at order creation time
required: false
# ─── Quality Checks (SodaCL) ─────────────────────────────────────────────────
quality:
type: SodaCL # SodaCL | montecarlo | custom
specification:
checks for enriched_orders:
# Completeness
- row_count > 1000:
name: Minimum daily row count
severity: error
- missing_count(order_id) = 0:
name: order_id must never be null
severity: error
- missing_count(customer_id) = 0:
name: customer_id must never be null
severity: error
- missing_percent(customer_email) < 1:
name: Email null rate under 1 %
severity: warning
# Uniqueness
- duplicate_count(order_id) = 0:
name: order_id must be unique
severity: error
# Value validity
- invalid_count(order_status) = 0:
name: order_status must be in allowed enum values
valid values: [CREATED, PAYMENT_PENDING, CONFIRMED, SHIPPED, DELIVERED, CANCELLED]
severity: error
- min(order_total_usd) >= 0:
name: No negative order totals
severity: error
# Freshness
- freshness(updated_at) < 2h:
name: Data must not be more than 2 hours stale
severity: error
# Custom SQL check
- failed rows:
name: No orders with DELIVERED status and zero total
fail query: |
SELECT order_id
FROM enriched_orders
WHERE order_status = 'DELIVERED'
AND order_total_usd = 0
severity: warning
# ─── Service Level Agreements ────────────────────────────────────────────────
servicelevels:
availability:
description: Kafka topic must be available 99.9 % of the time
percentage: 99.9%
retention:
description: Kafka topic retention; S3 data kept for 3 years
period: P7D # Kafka: 7 days ISO 8601 duration
unlimited: false
latency:
description: End-to-end latency from source event to topic
threshold: 30s
sourceTimestampField: enriched_orders.created_at
processedTimestampField: enriched_orders.updated_at
freshness:
description: New data must arrive every hour during business hours
threshold: 1h
timestampField: enriched_orders.updated_at
frequency:
description: Batch S3 snapshot produced once per day
type: batch
cron: "0 2 * * *"
tzinfo: UTC
support:
description: Business-hours support; critical incidents 24/7
time: 9am to 5pm CET, Mon-Fri
responseTime: 4h
# ─── Changelog ───────────────────────────────────────────────────────────────
# Follow semver: MAJOR.MINOR.PATCH
# MAJOR — breaking change (column removed, type narrowed, constraint added)
# MINOR — backward-compatible addition (new optional column, relaxed constraint)
# PATCH — non-schema changes (description update, SLA adjustment, contact info)
changelog:
- version: 2.1.0
date: 2025-11-01
author: orders-platform@example.com
description: |
Added `metadata` object field (optional, non-breaking).
Tightened freshness SLA from 4h to 2h (SLA-only change, MINOR).
- version: 2.0.0
date: 2025-09-15
author: orders-platform@example.com
description: |
BREAKING: Removed `legacy_order_ref` (VARCHAR) — deprecated in v1.5.0.
BREAKING: Changed `order_total` type from FLOAT to DECIMAL(12,2).
Consumers must migrate before 2025-09-15; use v1.x for backward compat.
- version: 1.5.0
date: 2025-06-01
author: orders-platform@example.com
description: |
Deprecated `legacy_order_ref`; will be removed in 2.0.0 (3-month notice).
Added `customer_email` field (optional in this version).

Data Contract CLI Commands

Install & Bootstrap
bash
pip install "datacontract-cli[all]"
# Scaffold a new contract from built-in template
datacontract init datacontract.yaml
# Validate the YAML structure against the JSON Schema
datacontract lint datacontract.yaml
Testing Against a Live Data Source
bash
# Test schema + quality checks (uses servers[*].type to auto-detect driver)
datacontract test datacontract.yaml
# Test only schema (skip quality checks)
datacontract test --only-schema datacontract.yaml
# Test only quality checks
datacontract test --only-quality datacontract.yaml
# Use a non-default server block
datacontract test --server production_s3 datacontract.yaml
# Test examples embedded in the contract (no live source needed)
datacontract test --examples datacontract.yaml
# Output as JSON for downstream tooling
datacontract test --format json datacontract.yaml

Environment variables for credentials (never hard-code in YAML):

bash
# PostgreSQL
export DATACONTRACT_POSTGRES_USERNAME=svc_datacontract
export DATACONTRACT_POSTGRES_PASSWORD=secret
# AWS S3 (standard AWS env vars)
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_DEFAULT_REGION=eu-west-1
# Kafka
export DATACONTRACT_KAFKA_SASL_USERNAME=...
export DATACONTRACT_KAFKA_SASL_PASSWORD=...
Diff and Breaking Change Detection
bash
# Show all differences between two contract files
datacontract diff datacontract-v1.yaml datacontract-v2.yaml
# Exit non-zero if any breaking changes exist (use in CI)
datacontract breaking datacontract-v1.yaml datacontract-v2.yaml

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ivanshamaev/de-agent-skills/data-contracts/badge)](https://verified-skill.com/skills/ivanshamaev/de-agent-skills/data-contracts)

Something wrong with this skill or its page? Tell us.