/dataproduct-builder-dbt:datacontract-editfrom dataproduct-builder-dbt
Edits output-port ODCS contract files, runs contract tests against live data, and classifies failures as breaking or non-breaking with suggested fixes.
Ships in dataproduct-builder-dbt. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Change an output-port models/output_ports/v<N>/*.odcs.yaml file, run the contract test, and tell the user whether the change breaks consumers.
This skill operates only on output-port contracts — the spec this data product commits to. Input-port contracts under models/input_ports/ are cached snapshots of upstream's spec and are not editable here; if you want to refresh one (because upstream changed it), run dataproduct-implement instead.
${PLUGIN_ROOT}below refers to the root of this plugin — the directory that containsskills/. On Claude Code it is set automatically as${CLAUDE_PLUGIN_ROOT}— use that. On any other agent (Codex, Copilot CLI, etc.) it is unset; resolve it as../..relative to thisSKILL.mdfile's directory (i.e. the grandparent ofskills/<this-skill>/).
Before running Step 0, print this plan to the user verbatim:
Running datacontract-edit. I'll:
- Locate the output-port contract file under
models/output_ports/v<N>/that matches your request.- Apply the edit in place and show you a unified diff.
- Run
datacontract testagainst the live server to check the change.- Classify each failure as breaking-schema, breaking-quality, additive, or unrelated.
- Report and suggest concrete fixes (no version bump, no v2 directory, no dbt model changes).
Then proceed.
models/output_ports/**/*.odcs.yaml — never models/input_ports/. If the user names an input-port contract, stop and explain it can't be edited here (refresh via dataproduct-implement instead).models/output_ports/.models block as BEFORE.Edit the ODCS YAML in place using the user's instruction. Keep the change minimal — do not reformat unrelated fields.
Common edits and the right shape:
| User says | What to change |
|---|---|
| "add column X" | Append a field under the relevant model with at least type; set required: false by default unless the user says it's required |
| "remove column X" | Delete the field; this is breaking — flag in Step 4 |
| "rename X to Y" | Rename the field; this is breaking — flag |
| "make X required" | Add required: true; breaking if existing rows can be null |
| "change X type from int to string" | Update type; breaking unless the new type is a strict superset (e.g. int → bigint) |
| "add a unique/not_null/enum check" | Add to the field's quality rules; breaking iff existing data violates the new rule — only Step 2 can tell |
After editing, remember the new models block as AFTER and show the user a unified diff before continuing.
Run the test with the datacontract CLI against the local contract file:
datacontract test models/output_ports/v<N>/<file>.odcs.yaml --server <server> --logs
production). Default to all only if the user explicitly asks.--logs so failure detail is in the output you read; otherwise the CLI only prints a summary.--output ./test-results/junit.xml --output-format junit.TEST_RESULT. Non-zero exit means at least one rule failed; the log section names the failing field/rule.Pre-reqs the CLI needs (verify before running, fail fast with a clear message if missing):
uv run --quiet datacontract --version succeeds from the project root. If it fails, run uv sync and retry. Invoke as uv run datacontract test … for every CLI invocation in this skill.DATACONTRACT_SNOWFLAKE_USERNAME / ..._PASSWORD, or DATACONTRACT_DATABRICKS_TOKEN). Tell the user which env vars are missing — do not try to source them yourself.Do not use the platform's server-side contract-test endpoint from this skill. The local datacontract CLI runs against the edited file and gives line-level failure detail; testing the published version on the server would test the previous contract, which defeats the point of testing the edit.
Group every failure into one of these buckets:
| Bucket | Examples | Severity |
|---|---|---|
| Breaking — schema | column removed, type narrowed, column renamed | High — bump major version, deprecate old port |
| Breaking — quality | new not_null/unique/enum rule violated by existing data | High — clean data first, then re-test |
| Non-breaking — additive | new optional column, widened type, loosened rule | Low — minor version bump |
| Test failure unrelated to the edit | flaky source, infra error, unchanged rule failing | Investigate separately |
For each failure, name the exact field/rule and which bucket it falls into. Don't lump them together.
End with this two-part recap. The Status column uses the shared enum (created, updated, already present, deferred, skipped), and below it a classification table covers any test failures.
Part 1 — outcome table.
| Artifact | Status | Details |
|---|---|---|
| Contract file | updated | models/output_ports/v<N>/<file>.odcs.yaml — show the unified diff inline |
| Contract test | … | pass, fail (<N> failures), or not run (missing creds) — name the server |
| Breaking — schema | … | count of failures in this bucket, or "—" |
| Breaking — quality | … | count of failures in this bucket, or "—" |
| Non-breaking — additive | … | count of changes in this bucket, or "—" |
| Test failures unrelated to the edit | … | count, or "—" |
| Recommended version bump | … | patch / minor / major based on the edit |
For the four "bucket" rows, leave Status = — and put the failure count + a one-line bucket description in Details.
Part 2 — next steps. Per failure, give a concrete fix suggestion:
models/output_ports/v2/), keep v1 alive, add a deprecation note in <id>.odps.yaml.version minor, no consumer impact.Do not auto-bump the contract version, do not create v2/ directories, and do not modify dbt models. Surface the recommendation; let the user decide.
dataproduct-implement after this skill.entropy-data datacontracts get <id> -o yaml redirected to the file).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub entropy-data/dataproduct-builder-dbt --plugin dataproduct-builder-dbt8 skills in this plugin
/datacontract-testRun the Data Contract CLI (`datacontract test`) against ODCS contracts in the project to verify the live data still conforms — schema, quality rules, and freshness. Handles two kinds of contracts with different semantics: output-port contracts under `models/output_ports/**/*.odcs.yaml` (tested against this project's warehouse — "am I still producing what I promised?") and input-port contracts under `models/input_ports/*.odcs.yaml` (tested against the upstream warehouse — "is upstream still producing what I trusted?"). Trigger when the user asks to "test the data contracts", "verify the data product matches its contract", "are we still contract-conformant", "check upstream drift", or "run the contract tests"./dataproduct-bootstrapBootstrap a brand-new dbt data product from scratch — create dbt_project.yml, the Entropy Data model layout (input_ports, staging, intermediate, output_ports/v1), README with uv install instructions, .gitignore, and a profiles.yml.example for the chosen warehouse. After scaffolding, hands off to the entropy-data-sync skill to add the publishing layer (ODPS, ODCS, OpenLineage, GitHub Actions). Trigger when the user asks to start a new data product, scaffold a new dbt project, or "create a data product from scratch."Other plugins' skills for the same job