agentleFS
GabrielHenriqueCAGabrielHenriqueCA/cortex-ai/.claude/skills/data-contracts/SKILL.md

data-contracts

Skill1 starsChanged 7 months agoMITView on GitHub

This skill defines, reviews, and validates data contracts at pipeline layer boundaries using industry-standard tools and patterns. A data contract is a formal agreement between a data producer and its consumers that specifies: Without contracts, consumers discover schema changes in production. With contracts, changes are negotiated and versioned.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. lancegui/causal-powers★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When reviewing a data contract or pipeline boundary, verify:

    line 149

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data Contracts Skill

This skill defines, reviews, and validates data contracts at pipeline layer boundaries using industry-standard tools and patterns.

What Is a Data Contract

A data contract is a formal agreement between a data producer and its consumers that specifies:

  • Schema — field names, types, nullability, and constraints
  • Semantics — what each field means, its unit, and valid values
  • SLA — freshness, availability, and completeness guarantees
  • Ownership — who produces it and who to contact when it breaks

Without contracts, consumers discover schema changes in production. With contracts, changes are negotiated and versioned.

Tools

ToolPurposeWhen to Use
datacontract-cliContract definition + validationPrimary contract format
dbt contracts + constraintsSQL model-level contractsdbt projects
Great ExpectationsData quality assertionsBatch validation in pipelines
Soda CoreSQL-native quality checksWarehouse-native validation

datacontract.com Format

# datacontract.yaml
dataContractSpecification: 0.9.3

id: urn:datacontract:orders:order-events:v1
info:
  title: Order Events
  version: 1.0.0
  status: active
  owner: data-platform-team
  contact:
    name: Data Platform
    url: https://github.com/org/team

servers:
  production:
    type: databricks
    catalog: prod
    schema: orders
    table: order_events

terms:
  usage: >
    Downstream consumers may read this table for analytics and ML features.
    Do not write to this table directly.
  limitations: >
    Data is available with T+1 latency. Same-day data is not guaranteed.
  billing: free
  noticePeriod: P3M   # 3 months notice for breaking changes

models:
  order_events:
    description: One row per order state transition
    type: table
    fields:
      order_id:
        type: string
        required: true
        unique: false
        description: UUID of the order. Surrogate key.
        pii: false
      event_type:
        type: string
        required: true
        enum:
          - created
          - paid
          - shipped
          - delivered
          - cancelled
        description: The lifecycle event that triggered this row.
      occurred_at:
        type: timestamp
        required: true
        description: When the event happened in the source system. UTC.
      customer_id:
        type: string
        required: true
        pii: true
        classification: restricted
        description: References customers.customer_id.
      amount_usd:
        type: decimal
        required: false
        precision: 10
        scale: 2
        description: >
          Order value in USD at time of event. Null for non-financial events
          (e.g., shipped, delivered).

quality:
  type: SodaCL
  specification:
    checks for order_events:
      - row_count > 1000
      - missing_count(order_id) = 0
      - duplicate_count(order_id, occurred_at) = 0
      - invalid_count(event_type) = 0:
          valid values: [created, paid, shipped, delivered, cancelled]
      - freshness(occurred_at) < 25h

dbt Contract Example

# models/orders/schema.yml
models:
  - name: order_events
    description: One row per order state transition
    config:
      contract:
        enforced: true  # dbt will validate types on run

    constraints:
      - type: not_null
        columns: [order_id, event_type, occurred_at, customer_id]
      - type: unique
        columns: [order_id, event_type]

    columns:
      - name: order_id
        data_type: string
        constraints:
          - type: not_null
      - name: event_type
        data_type: string
        constraints:
          - type: not_null
          - type: accepted_values
            values: [created, paid, shipped, delivered, cancelled]
      - name: occurred_at
        data_type: timestamp
        constraints:
          - type: not_null
      - name: amount_usd
        data_type: decimal(10, 2)

Contract Review Checklist

When reviewing a data contract or pipeline boundary, verify:

Schema completeness:

  • All fields have types, nullability, and descriptions
  • PII fields are flagged and classified
  • Enum fields list all valid values
  • Numeric fields specify precision and unit (USD? cents? percentage?)

Semantic correctness:

  • Field descriptions explain what the value means, not just what it is
  • Timestamps specify timezone (UTC assumed? local?)
  • Foreign keys document their reference table

SLA definition:

  • Freshness SLA is defined (how stale is acceptable?)
  • Availability SLA is defined (what % uptime?)
  • Completeness: are partial loads acceptable?

Operational:

  • Owner is identified with a contact channel
  • Notice period for breaking changes is stated
  • Version is incremented on breaking changes (semver)

Breaking vs Non-Breaking Changes

ChangeBreakingAction Required
Add nullable columnNoNotify consumers, bump minor version
Remove columnYesDeprecation period, major version bump
Rename columnYesAlias + deprecation or major version
Change type (widening)SometimesCheck consumer impact
Change type (narrowing)YesMajor version bump
Add enum valueNo (usually)Check consumer exhaustive handling
Remove enum valueYesMajor version bump
Change freshness SLAYesRenegotiate with consumers

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.