[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MG3GYGYWAR0VWQGCY3B06M":3,"skill-same:01M6MG3GYGYWAR0VWQGCY3B06M":54},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":28,"frontMatter":29,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M6MG3GYGYWAR0VWQGCY3B06M","datacontract-test",null,"hashgraph-online\u002Fawesome-codex-plugins","hashgraph-online","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160371962?v=4","01M6CNB6NRJVNNGN14TR01Q6D3","HOL (Hashgraph Online)","01M6JT1HSKKG9V68KQAQGBA7XP",1575,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fentropy-data\u002Fdataproduct-builder-dbt\u002Fskills\u002Fdatacontract-test\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[23,24],"test","datacontract test","2026-11-10 10:12:30",false,"---\nname: datacontract-test\ndescription: Run 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\u002Foutput_ports\u002F**\u002F*.odcs.yaml` (tested against this project's warehouse — \"am I still producing what I promised?\") and input-port contracts under `models\u002Finput_ports\u002F*.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\".\n---\n\n# Test ODCS data contracts against the live server\n\nRun the **Data Contract CLI** (`datacontract test`) against contracts in the project to check whether the data currently produced by a warehouse still matches the schema and quality rules declared in the contract.\n\nTwo kinds of contracts live in this project and they test against different warehouses:\n\n- **Output-port contracts** at `models\u002Foutput_ports\u002Fv\u003CN>\u002F*.odcs.yaml` — what this data product commits to produce. They test against **this project's** warehouse. A failure means we are no longer producing what we promised.\n- **Input-port contracts** at `models\u002Finput_ports\u002F*.odcs.yaml` — cached snapshots of what we trust upstream to produce. They test against the **upstream provider's** warehouse, using a server block from upstream's ODCS. A failure means upstream drifted from the contract we trusted; the consequence is that *our* output may break too. Treat input-port failures as an upstream incident, not a local bug.\n\n## When to use this vs. other skills\n\n- **You changed a contract and want to know if the edit breaks consumers** → use `datacontract-edit` (it edits, tests, *and* classifies the failure as breaking-or-not).\n- **You want to verify existing contracts against current data, no edits** → this skill.\n- **A CI run failed the contract test step** → this skill, to reproduce locally with `--logs`.\n\n## How to run this skill\n\n> `${PLUGIN_ROOT}` below refers to the root of this plugin — the directory that contains `skills\u002F`. 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 `..\u002F..` relative to **this `SKILL.md` file's directory** (i.e. the grandparent of `skills\u002F\u003Cthis-skill>\u002F`).\n\n### Plan announcement (before Step 0)\n\nBefore running Step 0, print this plan to the user verbatim:\n\n> Running **datacontract-test**. I'll:\n> 1. Pre-checks: confirm the `datacontract` CLI is on PATH and the server credentials are available.\n> 2. Pick which contract(s) to test — defaults to all `models\u002Foutput_ports\u002F**\u002F*.odcs.yaml` and `models\u002Finput_ports\u002F*.odcs.yaml`.\n> 3. Pick the server (defaults to `production` if the contract has one).\n> 4. Run `datacontract test` per contract and capture the result.\n> 5. Report pass\u002Ffail with per-rule detail; flag missing credentials separately from real failures.\n\nThen proceed.\n\n### Step 0 — Pre-checks\n\n- Confirm `uv run --quiet datacontract --version` succeeds from the project root. If it fails, run `uv sync` (the bootstrap template seeds `datacontract-cli[all]` as a dev dep in `pyproject.toml`) and retry. If `uv sync` still doesn't make it available, stop and tell the user to verify `datacontract-cli[all]` is listed in `pyproject.toml`'s `[dependency-groups].dev`. **Do not propose `uv tool install` here** — per-project venv is the convention.\n- Confirm at least one `*.odcs.yaml` exists under `models\u002Foutput_ports\u002F**\u002F` or `models\u002Finput_ports\u002F`. If not, stop and tell the user there's nothing to test.\n- For each contract that will run, inspect its `servers` block and list the env vars the chosen server type needs (e.g. `DATACONTRACT_SNOWFLAKE_USERNAME` \u002F `..._PASSWORD`, `DATACONTRACT_DATABRICKS_TOKEN`, `DATACONTRACT_BIGQUERY_ACCOUNT_INFO_JSON`). If any are unset, surface the list to the user and ask whether to continue (the CLI will fail-fast on that server) or stop. Do not try to source credentials yourself.\n\n### Step 1 — Select contracts\n\n- If the user named a specific contract file or data product id, resolve it to one file. Search both `models\u002Foutput_ports\u002F**\u002F*.odcs.yaml` and `models\u002Finput_ports\u002F*.odcs.yaml`.\n- If the user said \"output contracts\" \u002F \"input contracts\" \u002F \"upstream drift\", scope to one of those globs.\n- If they didn't, default to **all** ODCS files under both globs. List them, grouped by **Output ports** and **Input ports** so the user sees the two roles, then ask before running.\n- Remember the resolved list as `CONTRACTS`. For each entry, also remember its role (`output` or `input`) — Step 4 surfaces failures differently.\n\n### Step 2 — Select the server\n\nFor each contract in `CONTRACTS`:\n\n- If the contract has exactly one server, use it.\n- If it has multiple, default to `production`. If `production` isn't defined, ask the user which one.\n- Only pass `--server all` if the user explicitly asks to test every server.\n\n### Step 3 — Run the test\n\nFor each contract:\n\n```\nuv run datacontract test \u003Cpath-to-contract>.odcs.yaml --server \u003Cserver> --logs\n```\n\nWhere `\u003Cpath-to-contract>` is the file resolved in Step 1 — typically `models\u002Foutput_ports\u002Fv\u003CN>\u002F\u003Cfile>.odcs.yaml` for output contracts, or `models\u002Finput_ports\u002F\u003Cfile>.odcs.yaml` for input contracts. The CLI does not care which directory; the role only matters for how Step 4 reports the result.\n\n- `--logs` ensures per-rule failure detail is in stdout — without it the CLI only prints a summary.\n- If the user asks for a persisted report (e.g. to attach to a PR), add `--output .\u002Ftest-results\u002F\u003Ccontract>.xml --output-format junit`.\n- If the user asks to publish results back to Entropy Data (matches the generated CI workflow), add `--publish $API\u002Ftest-results` where `$API` is the Entropy Data host. Don't publish by default — it writes server-side state.\n- Capture stdout and exit code per contract. Non-zero exit means at least one rule failed.\n\nRun sequentially, not in parallel — the warehouse is the bottleneck and parallel runs muddy the log output.\n\n### Step 4 — Report\n\nEnd with this two-part recap. Use the shared `Status` enum (`created`, `updated`, `already present`, `deferred`, `skipped`); for this skill the relevant statuses are `passed`, `failed`, and `skipped` (missing creds).\n\n**Part 1 — outcome table.** One row per contract tested. Group the rows: output-port contracts first, then input-port contracts under a sub-header (so the reader sees the two roles at a glance).\n\n| Contract | Role | Server | Result | Failures | Details |\n|---|---|---|---|---|---|\n| `\u003Ccontract-file>` | `output` \u002F `input` | `\u003Cserver>` | `passed` \u002F `failed` \u002F `skipped` | count or `—` | one line per failing rule (field + rule), or \"missing env var: …\" if skipped |\n\n**Part 2 — next steps.** Bullet list, include only what applies. Treat output vs. input failures differently:\n\n- **Output-port failures**: surface the field and the violated check (e.g. `orders.order_id: not_null violated for 17 rows`). The fix is in this project — either the dbt model is wrong, the contract is wrong, or the data is wrong. If the user wants a follow-up SQL to find the offending rows, suggest the shape but don't run it. If failures look like they came from a contract edit (rules tightening), point at `datacontract-edit` to classify breaking-vs-additive.\n- **Input-port failures**: this is upstream drift. Name the provider data product and output port (from the contract id and file name). The fix is *not* in this project — the user should contact the upstream owner, and in the meantime expect downstream output-port failures. Suggest re-running `dataproduct-implement` once upstream republishes a corrected contract, so the cached snapshot under `models\u002Finput_ports\u002F` refreshes.\n- For each `skipped` row, the exact env vars the user needs to set, and where to get them (usually the warehouse admin or `entropy-data connection get`).\n- If failures look like a data quality issue (rules unchanged, data drifted), suggest investigating the upstream of the failing model — this skill does not auto-fix data.\n\nIf everything passed, write a single line: `All \u003CN> contracts pass against \u003Cserver>.`\n\n## Authentication examples by server type\n\nThe Data Contract CLI reads credentials from environment variables, not from the contract file. Only the connection topology (host, database, schema, etc.) belongs in the `servers` block. The examples below cover the most common warehouses. Other types (Oracle, MySQL, Trino, DuckDB, Kafka, ...) follow the same pattern; see the [Data Contract CLI README](https:\u002F\u002Fgithub.com\u002Fdatacontract\u002Fdatacontract-cli) for the full list.\n\n### Snowflake\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: snowflake\n    account: abcdefg-xn12345\n    database: ORDER_DB\n    schema: ORDERS_PII_V2\n```\n\nAny env var prefixed `DATACONTRACT_SNOWFLAKE_` is forwarded to the Snowflake connector with the prefix stripped and the rest lowercased, so you can pass any Snowflake\u002FSoda parameter this way. Three auth modes:\n\n**Password auth**\n```bash\nexport DATACONTRACT_SNOWFLAKE_USERNAME=...\nexport DATACONTRACT_SNOWFLAKE_PASSWORD=...\nexport DATACONTRACT_SNOWFLAKE_WAREHOUSE=COMPUTE_WH\nexport DATACONTRACT_SNOWFLAKE_ROLE=DATA_CONTRACT_TEST\n```\n\n**Private key (JWT) auth** — used for service accounts and CI:\n```bash\nexport DATACONTRACT_SNOWFLAKE_USERNAME=SVC_DATACONTRACT\nexport DATACONTRACT_SNOWFLAKE_AUTHENTICATOR=SNOWFLAKE_JWT\nexport DATACONTRACT_SNOWFLAKE_PRIVATE_KEY_PATH=\u002Fsecrets\u002Fsnowflake_rsa.p8\n# Only if the key is encrypted:\nexport DATACONTRACT_SNOWFLAKE_PRIVATE_KEY_PASSPHRASE=...\nexport DATACONTRACT_SNOWFLAKE_WAREHOUSE=COMPUTE_WH\nexport DATACONTRACT_SNOWFLAKE_ROLE=DATA_CONTRACT_TEST\n```\n\n**External browser SSO** — interactive, for local runs against an IdP-backed account:\n```bash\nexport DATACONTRACT_SNOWFLAKE_USERNAME=jane.doe@example.com\nexport DATACONTRACT_SNOWFLAKE_AUTHENTICATOR=externalbrowser\nexport DATACONTRACT_SNOWFLAKE_WAREHOUSE=COMPUTE_WH\nexport DATACONTRACT_SNOWFLAKE_ROLE=DATA_CONTRACT_TEST\n```\n\nNot usable in CI — it opens a browser window.\n\n### Databricks\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: databricks\n    host: adb-1234567890.7.azuredatabricks.net   # optional, can also come from env\n    catalog: acme_catalog_prod\n    schema: orders_latest\n```\n\nThe `datacontract` CLI does not share auth state with the `databricks` CLI — a token must be supplied explicitly via `DATACONTRACT_DATABRICKS_TOKEN`. When surfacing missing credentials to the user, recommend the OAuth-first path; fall back to PAT only when OAuth isn't available.\n\n**Recommended — short-lived OAuth from the already-authenticated `databricks` CLI:**\n\n```bash\nexport DATACONTRACT_DATABRICKS_TOKEN=$(databricks auth token | jq -r .access_token)\nexport DATACONTRACT_DATABRICKS_HTTP_PATH=\u002Fsql\u002F1.0\u002Fwarehouses\u002F\u003Cwarehouse-id>\n```\n\nToken is valid ~1h, the literal value never lands in shell history, and a leaked token expires before most attackers notice — much smaller blast radius than a long-lived PAT.\n\n**Fallback — Personal Access Token** (use when `databricks auth token` isn't available: PAT-only profile, OAuth refresh issue, headless shell):\n\n```bash\nexport DATACONTRACT_DATABRICKS_TOKEN=dapi...\nexport DATACONTRACT_DATABRICKS_HTTP_PATH=\u002Fsql\u002F1.0\u002Fwarehouses\u002F\u003Cwarehouse-id>\n```\n\nA PAT is long-lived until rotated. Scope it narrowly (read access to the data product's schema is enough) and avoid putting the `export` in `.bashrc`\u002F`.zshrc` — it persists in shell history.\n\n**CI** — use a service-principal-issued token (M2M OAuth, or an SP-owned PAT), not a personal one, with `SELECT` scoped to the data product's schema. Set as a repository secret named `DATACONTRACT_DATABRICKS_TOKEN`.\n\nOptional env vars:\n\n```bash\nexport DATACONTRACT_DATABRICKS_SERVER_HOSTNAME=adb-...     # only needed if `host` is not in the server block\n```\n\n### Postgres\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: postgres\n    host: db.example.internal\n    port: 5432\n    database: analytics\n    schema: public\n```\n\nEnv vars:\n```bash\nexport DATACONTRACT_POSTGRES_USERNAME=datacontract_ro\nexport DATACONTRACT_POSTGRES_PASSWORD=...\n```\n\nBoth are required. Use a read-only role.\n\n### Amazon Athena\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: athena\n    catalog: awsdatacatalog           # optional, default is awsdatacatalog\n    schema: orders_db\n    regionName: eu-central-1\n    stagingDir: s3:\u002F\u002Facme-athena-results\u002Fdatacontract\u002F\n```\n\nEnv vars:\n```bash\nexport DATACONTRACT_S3_ACCESS_KEY_ID=AKIA...          # required\nexport DATACONTRACT_S3_SECRET_ACCESS_KEY=...          # required\nexport DATACONTRACT_S3_REGION=eu-central-1            # optional, overrides regionName\nexport DATACONTRACT_S3_SESSION_TOKEN=...              # optional, for STS temporary creds\n```\n\nThe IAM principal needs `athena:*` on the workgroup, `glue:Get*` on the catalog, and read\u002Fwrite on the `stagingDir` bucket prefix.\n\n### BigQuery\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: bigquery\n    project: acme-data-prod\n    dataset: orders\n```\n\nTwo auth modes:\n\n**Service account key file**\n```bash\nexport DATACONTRACT_BIGQUERY_ACCOUNT_INFO_JSON_PATH=\u002Fsecrets\u002Fbq-sa.json\n```\n\n**Application Default Credentials (ADC)** — no env vars needed. Used automatically when `DATACONTRACT_BIGQUERY_ACCOUNT_INFO_JSON_PATH` is unset. Works with `gcloud auth application-default login` for local runs and with Workload Identity Federation in CI.\n\nOptional impersonation:\n```bash\nexport DATACONTRACT_BIGQUERY_IMPERSONATION_ACCOUNT=datacontract@acme-data-prod.iam.gserviceaccount.com\n```\n\nThe principal needs `bigquery.dataViewer` on the dataset and `bigquery.jobUser` on the project.\n\n### Microsoft Fabric (SQL Server protocol)\n\nFabric Warehouse and Lakehouse SQL endpoints speak the SQL Server wire protocol, so use `type: sqlserver`.\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: sqlserver\n    host: abc123def.datawarehouse.fabric.microsoft.com\n    port: 1433\n    database: orders_wh\n    schema: dbo\n    driver: ODBC Driver 18 for SQL Server\n```\n\nFabric only accepts Entra ID (Azure AD) auth, not SQL logins. Pick one of:\n\n**Service principal** — for CI:\n```bash\nexport DATACONTRACT_SQLSERVER_AUTHENTICATION=ActiveDirectoryServicePrincipal\nexport DATACONTRACT_SQLSERVER_CLIENT_ID=\u003Capp-registration-client-id>\nexport DATACONTRACT_SQLSERVER_CLIENT_SECRET=\u003Cclient-secret>\n```\n\n**User password** — Entra ID username + password (no MFA):\n```bash\nexport DATACONTRACT_SQLSERVER_AUTHENTICATION=ActiveDirectoryPassword\nexport DATACONTRACT_SQLSERVER_USERNAME=jane.doe@acme.com\nexport DATACONTRACT_SQLSERVER_PASSWORD=...\n```\n\n**Interactive** — opens a browser, for local dev only:\n```bash\nexport DATACONTRACT_SQLSERVER_AUTHENTICATION=ActiveDirectoryInteractive\nexport DATACONTRACT_SQLSERVER_USERNAME=jane.doe@acme.com\n```\n\nThe same env vars work for a regular on-prem SQL Server; switch `DATACONTRACT_SQLSERVER_AUTHENTICATION=sql` and supply `DATACONTRACT_SQLSERVER_USERNAME` \u002F `DATACONTRACT_SQLSERVER_PASSWORD`.\n\nInstall ODBC Driver 18 locally (`brew install msodbcsql18` on macOS, `apt-get install msodbcsql18` on Debian\u002FUbuntu) before running.\n\n## Constraints\n\n- **Read-only against the warehouse.** This skill runs `datacontract test` which executes `SELECT` queries; it never writes. Do not invoke `datacontract publish`, `datacontract export`, or `entropy-data datacontracts put` from this skill.\n- **No edits to contracts or models.** If a test fails, surface it — do not auto-patch the contract to make it pass. That defeats the purpose.\n- **No credential sourcing.** If env vars are missing, tell the user; don't read them from `.env`, `~\u002F.aws`, or anywhere else on the user's behalf.\n- **Idempotent**: re-running the skill produces the same report against the same data. Failures from rules that depend on time (freshness, row-count windows) are expected to drift — note that in the failure detail when relevant.\n","# Test ODCS data contracts against the live server\n\nRun the **Data Contract CLI** (`datacontract test`) against contracts in the project to check whether the data currently produced by a warehouse still matches the schema and quality rules declared in the contract.\n\nTwo kinds of contracts live in this project and they test against different warehouses:\n\n- **Output-port contracts** at `models\u002Foutput_ports\u002Fv\u003CN>\u002F*.odcs.yaml` — what this data product commits to produce. They test against **this project's** warehouse. A failure means we are no longer producing what we promised.\n- **Input-port contracts** at `models\u002Finput_ports\u002F*.odcs.yaml` — cached snapshots of what we trust upstream to produce. They test against the **upstream provider's** warehouse, using a server block from upstream's ODCS. A failure means upstream drifted from the contract we trusted; the consequence is that *our* output may break too. Treat input-port failures as an upstream incident, not a local bug.\n\n## When to use this vs. other skills\n\n- **You changed a contract and want to know if the edit breaks consumers** → use `datacontract-edit` (it edits, tests, *and* classifies the failure as breaking-or-not).\n- **You want to verify existing contracts against current data, no edits** → this skill.\n- **A CI run failed the contract test step** → this skill, to reproduce locally with `--logs`.\n\n## How to run this skill\n\n> `${PLUGIN_ROOT}` below refers to the root of this plugin — the directory that contains `skills\u002F`. 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 `..\u002F..` relative to **this `SKILL.md` file's directory** (i.e. the grandparent of `skills\u002F\u003Cthis-skill>\u002F`).\n\n### Plan announcement (before Step 0)\n\nBefore running Step 0, print this plan to the user verbatim:\n\n> Running **datacontract-test**. I'll:\n> 1. Pre-checks: confirm the `datacontract` CLI is on PATH and the server credentials are available.\n> 2. Pick which contract(s) to test — defaults to all `models\u002Foutput_ports\u002F**\u002F*.odcs.yaml` and `models\u002Finput_ports\u002F*.odcs.yaml`.\n> 3. Pick the server (defaults to `production` if the contract has one).\n> 4. Run `datacontract test` per contract and capture the result.\n> 5. Report pass\u002Ffail with per-rule detail; flag missing credentials separately from real failures.\n\nThen proceed.\n\n### Step 0 — Pre-checks\n\n- Confirm `uv run --quiet datacontract --version` succeeds from the project root. If it fails, run `uv sync` (the bootstrap template seeds `datacontract-cli[all]` as a dev dep in `pyproject.toml`) and retry. If `uv sync` still doesn't make it available, stop and tell the user to verify `datacontract-cli[all]` is listed in `pyproject.toml`'s `[dependency-groups].dev`. **Do not propose `uv tool install` here** — per-project venv is the convention.\n- Confirm at least one `*.odcs.yaml` exists under `models\u002Foutput_ports\u002F**\u002F` or `models\u002Finput_ports\u002F`. If not, stop and tell the user there's nothing to test.\n- For each contract that will run, inspect its `servers` block and list the env vars the chosen server type needs (e.g. `DATACONTRACT_SNOWFLAKE_USERNAME` \u002F `..._PASSWORD`, `DATACONTRACT_DATABRICKS_TOKEN`, `DATACONTRACT_BIGQUERY_ACCOUNT_INFO_JSON`). If any are unset, surface the list to the user and ask whether to continue (the CLI will fail-fast on that server) or stop. Do not try to source credentials yourself.\n\n### Step 1 — Select contracts\n\n- If the user named a specific contract file or data product id, resolve it to one file. Search both `models\u002Foutput_ports\u002F**\u002F*.odcs.yaml` and `models\u002Finput_ports\u002F*.odcs.yaml`.\n- If the user said \"output contracts\" \u002F \"input contracts\" \u002F \"upstream drift\", scope to one of those globs.\n- If they didn't, default to **all** ODCS files under both globs. List them, grouped by **Output ports** and **Input ports** so the user sees the two roles, then ask before running.\n- Remember the resolved list as `CONTRACTS`. For each entry, also remember its role (`output` or `input`) — Step 4 surfaces failures differently.\n\n### Step 2 — Select the server\n\nFor each contract in `CONTRACTS`:\n\n- If the contract has exactly one server, use it.\n- If it has multiple, default to `production`. If `production` isn't defined, ask the user which one.\n- Only pass `--server all` if the user explicitly asks to test every server.\n\n### Step 3 — Run the test\n\nFor each contract:\n\n```\nuv run datacontract test \u003Cpath-to-contract>.odcs.yaml --server \u003Cserver> --logs\n```\n\nWhere `\u003Cpath-to-contract>` is the file resolved in Step 1 — typically `models\u002Foutput_ports\u002Fv\u003CN>\u002F\u003Cfile>.odcs.yaml` for output contracts, or `models\u002Finput_ports\u002F\u003Cfile>.odcs.yaml` for input contracts. The CLI does not care which directory; the role only matters for how Step 4 reports the result.\n\n- `--logs` ensures per-rule failure detail is in stdout — without it the CLI only prints a summary.\n- If the user asks for a persisted report (e.g. to attach to a PR), add `--output .\u002Ftest-results\u002F\u003Ccontract>.xml --output-format junit`.\n- If the user asks to publish results back to Entropy Data (matches the generated CI workflow), add `--publish $API\u002Ftest-results` where `$API` is the Entropy Data host. Don't publish by default — it writes server-side state.\n- Capture stdout and exit code per contract. Non-zero exit means at least one rule failed.\n\nRun sequentially, not in parallel — the warehouse is the bottleneck and parallel runs muddy the log output.\n\n### Step 4 — Report\n\nEnd with this two-part recap. Use the shared `Status` enum (`created`, `updated`, `already present`, `deferred`, `skipped`); for this skill the relevant statuses are `passed`, `failed`, and `skipped` (missing creds).\n\n**Part 1 — outcome table.** One row per contract tested. Group the rows: output-port contracts first, then input-port contracts under a sub-header (so the reader sees the two roles at a glance).\n\n| Contract | Role | Server | Result | Failures | Details |\n|---|---|---|---|---|---|\n| `\u003Ccontract-file>` | `output` \u002F `input` | `\u003Cserver>` | `passed` \u002F `failed` \u002F `skipped` | count or `—` | one line per failing rule (field + rule), or \"missing env var: …\" if skipped |\n\n**Part 2 — next steps.** Bullet list, include only what applies. Treat output vs. input failures differently:\n\n- **Output-port failures**: surface the field and the violated check (e.g. `orders.order_id: not_null violated for 17 rows`). The fix is in this project — either the dbt model is wrong, the contract is wrong, or the data is wrong. If the user wants a follow-up SQL to find the offending rows, suggest the shape but don't run it. If failures look like they came from a contract edit (rules tightening), point at `datacontract-edit` to classify breaking-vs-additive.\n- **Input-port failures**: this is upstream drift. Name the provider data product and output port (from the contract id and file name). The fix is *not* in this project — the user should contact the upstream owner, and in the meantime expect downstream output-port failures. Suggest re-running `dataproduct-implement` once upstream republishes a corrected contract, so the cached snapshot under `models\u002Finput_ports\u002F` refreshes.\n- For each `skipped` row, the exact env vars the user needs to set, and where to get them (usually the warehouse admin or `entropy-data connection get`).\n- If failures look like a data quality issue (rules unchanged, data drifted), suggest investigating the upstream of the failing model — this skill does not auto-fix data.\n\nIf everything passed, write a single line: `All \u003CN> contracts pass against \u003Cserver>.`\n\n## Authentication examples by server type\n\nThe Data Contract CLI reads credentials from environment variables, not from the contract file. Only the connection topology (host, database, schema, etc.) belongs in the `servers` block. The examples below cover the most common warehouses. Other types (Oracle, MySQL, Trino, DuckDB, Kafka, ...) follow the same pattern; see the [Data Contract CLI README](https:\u002F\u002Fgithub.com\u002Fdatacontract\u002Fdatacontract-cli) for the full list.\n\n### Snowflake\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: snowflake\n    account: abcdefg-xn12345\n    database: ORDER_DB\n    schema: ORDERS_PII_V2\n```\n\nAny env var prefixed `DATACONTRACT_SNOWFLAKE_` is forwarded to the Snowflake connector with the prefix stripped and the rest lowercased, so you can pass any Snowflake\u002FSoda parameter this way. Three auth modes:\n\n**Password auth**\n```bash\nexport DATACONTRACT_SNOWFLAKE_USERNAME=...\nexport DATACONTRACT_SNOWFLAKE_PASSWORD=...\nexport DATACONTRACT_SNOWFLAKE_WAREHOUSE=COMPUTE_WH\nexport DATACONTRACT_SNOWFLAKE_ROLE=DATA_CONTRACT_TEST\n```\n\n**Private key (JWT) auth** — used for service accounts and CI:\n```bash\nexport DATACONTRACT_SNOWFLAKE_USERNAME=SVC_DATACONTRACT\nexport DATACONTRACT_SNOWFLAKE_AUTHENTICATOR=SNOWFLAKE_JWT\nexport DATACONTRACT_SNOWFLAKE_PRIVATE_KEY_PATH=\u002Fsecrets\u002Fsnowflake_rsa.p8\n# Only if the key is encrypted:\nexport DATACONTRACT_SNOWFLAKE_PRIVATE_KEY_PASSPHRASE=...\nexport DATACONTRACT_SNOWFLAKE_WAREHOUSE=COMPUTE_WH\nexport DATACONTRACT_SNOWFLAKE_ROLE=DATA_CONTRACT_TEST\n```\n\n**External browser SSO** — interactive, for local runs against an IdP-backed account:\n```bash\nexport DATACONTRACT_SNOWFLAKE_USERNAME=jane.doe@example.com\nexport DATACONTRACT_SNOWFLAKE_AUTHENTICATOR=externalbrowser\nexport DATACONTRACT_SNOWFLAKE_WAREHOUSE=COMPUTE_WH\nexport DATACONTRACT_SNOWFLAKE_ROLE=DATA_CONTRACT_TEST\n```\n\nNot usable in CI — it opens a browser window.\n\n### Databricks\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: databricks\n    host: adb-1234567890.7.azuredatabricks.net   # optional, can also come from env\n    catalog: acme_catalog_prod\n    schema: orders_latest\n```\n\nThe `datacontract` CLI does not share auth state with the `databricks` CLI — a token must be supplied explicitly via `DATACONTRACT_DATABRICKS_TOKEN`. When surfacing missing credentials to the user, recommend the OAuth-first path; fall back to PAT only when OAuth isn't available.\n\n**Recommended — short-lived OAuth from the already-authenticated `databricks` CLI:**\n\n```bash\nexport DATACONTRACT_DATABRICKS_TOKEN=$(databricks auth token | jq -r .access_token)\nexport DATACONTRACT_DATABRICKS_HTTP_PATH=\u002Fsql\u002F1.0\u002Fwarehouses\u002F\u003Cwarehouse-id>\n```\n\nToken is valid ~1h, the literal value never lands in shell history, and a leaked token expires before most attackers notice — much smaller blast radius than a long-lived PAT.\n\n**Fallback — Personal Access Token** (use when `databricks auth token` isn't available: PAT-only profile, OAuth refresh issue, headless shell):\n\n```bash\nexport DATACONTRACT_DATABRICKS_TOKEN=dapi...\nexport DATACONTRACT_DATABRICKS_HTTP_PATH=\u002Fsql\u002F1.0\u002Fwarehouses\u002F\u003Cwarehouse-id>\n```\n\nA PAT is long-lived until rotated. Scope it narrowly (read access to the data product's schema is enough) and avoid putting the `export` in `.bashrc`\u002F`.zshrc` — it persists in shell history.\n\n**CI** — use a service-principal-issued token (M2M OAuth, or an SP-owned PAT), not a personal one, with `SELECT` scoped to the data product's schema. Set as a repository secret named `DATACONTRACT_DATABRICKS_TOKEN`.\n\nOptional env vars:\n\n```bash\nexport DATACONTRACT_DATABRICKS_SERVER_HOSTNAME=adb-...     # only needed if `host` is not in the server block\n```\n\n### Postgres\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: postgres\n    host: db.example.internal\n    port: 5432\n    database: analytics\n    schema: public\n```\n\nEnv vars:\n```bash\nexport DATACONTRACT_POSTGRES_USERNAME=datacontract_ro\nexport DATACONTRACT_POSTGRES_PASSWORD=...\n```\n\nBoth are required. Use a read-only role.\n\n### Amazon Athena\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: athena\n    catalog: awsdatacatalog           # optional, default is awsdatacatalog\n    schema: orders_db\n    regionName: eu-central-1\n    stagingDir: s3:\u002F\u002Facme-athena-results\u002Fdatacontract\u002F\n```\n\nEnv vars:\n```bash\nexport DATACONTRACT_S3_ACCESS_KEY_ID=AKIA...          # required\nexport DATACONTRACT_S3_SECRET_ACCESS_KEY=...          # required\nexport DATACONTRACT_S3_REGION=eu-central-1            # optional, overrides regionName\nexport DATACONTRACT_S3_SESSION_TOKEN=...              # optional, for STS temporary creds\n```\n\nThe IAM principal needs `athena:*` on the workgroup, `glue:Get*` on the catalog, and read\u002Fwrite on the `stagingDir` bucket prefix.\n\n### BigQuery\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: bigquery\n    project: acme-data-prod\n    dataset: orders\n```\n\nTwo auth modes:\n\n**Service account key file**\n```bash\nexport DATACONTRACT_BIGQUERY_ACCOUNT_INFO_JSON_PATH=\u002Fsecrets\u002Fbq-sa.json\n```\n\n**Application Default Credentials (ADC)** — no env vars needed. Used automatically when `DATACONTRACT_BIGQUERY_ACCOUNT_INFO_JSON_PATH` is unset. Works with `gcloud auth application-default login` for local runs and with Workload Identity Federation in CI.\n\nOptional impersonation:\n```bash\nexport DATACONTRACT_BIGQUERY_IMPERSONATION_ACCOUNT=datacontract@acme-data-prod.iam.gserviceaccount.com\n```\n\nThe principal needs `bigquery.dataViewer` on the dataset and `bigquery.jobUser` on the project.\n\n### Microsoft Fabric (SQL Server protocol)\n\nFabric Warehouse and Lakehouse SQL endpoints speak the SQL Server wire protocol, so use `type: sqlserver`.\n\nODCS server block:\n\n```yaml\nservers:\n  production:\n    type: sqlserver\n    host: abc123def.datawarehouse.fabric.microsoft.com\n    port: 1433\n    database: orders_wh\n    schema: dbo\n    driver: ODBC Driver 18 for SQL Server\n```\n\nFabric only accepts Entra ID (Azure AD) auth, not SQL logins. Pick one of:\n\n**Service principal** — for CI:\n```bash\nexport DATACONTRACT_SQLSERVER_AUTHENTICATION=ActiveDirectoryServicePrincipal\nexport DATACONTRACT_SQLSERVER_CLIENT_ID=\u003Capp-registration-client-id>\nexport DATACONTRACT_SQLSERVER_CLIENT_SECRET=\u003Cclient-secret>\n```\n\n**User password** — Entra ID username + password (no MFA):\n```bash\nexport DATACONTRACT_SQLSERVER_AUTHENTICATION=ActiveDirectoryPassword\nexport DATACONTRACT_SQLSERVER_USERNAME=jane.doe@acme.com\nexport DATACONTRACT_SQLSERVER_PASSWORD=...\n```\n\n**Interactive** — opens a browser, for local dev only:\n```bash\nexport DATACONTRACT_SQLSERVER_AUTHENTICATION=ActiveDirectoryInteractive\nexport DATACONTRACT_SQLSERVER_USERNAME=jane.doe@acme.com\n```\n\nThe same env vars work for a regular on-prem SQL Server; switch `DATACONTRACT_SQLSERVER_AUTHENTICATION=sql` and supply `DATACONTRACT_SQLSERVER_USERNAME` \u002F `DATACONTRACT_SQLSERVER_PASSWORD`.\n\nInstall ODBC Driver 18 locally (`brew install msodbcsql18` on macOS, `apt-get install msodbcsql18` on Debian\u002FUbuntu) before running.\n\n## Constraints\n\n- **Read-only against the warehouse.** This skill runs `datacontract test` which executes `SELECT` queries; it never writes. Do not invoke `datacontract publish`, `datacontract export`, or `entropy-data datacontracts put` from this skill.\n- **No edits to contracts or models.** If a test fails, surface it — do not auto-patch the contract to make it pass. That defeats the purpose.\n- **No credential sourcing.** If env vars are missing, tell the user; don't read them from `.env`, `~\u002F.aws`, or anywhere else on the user's behalf.\n- **Idempotent**: re-running the skill produces the same report against the same data. Failures from rules that depend on time (freshness, row-count windows) are expected to drift — note that in the failure detail when relevant.\n",{},"main","2b63f856ce19c2a797929cacabd9e0fc936812fa","plugins\u002Fentropy-data\u002Fdataproduct-builder-dbt\u002Fskills\u002Fdatacontract-test",491,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins","https:\u002F\u002Fhol.org\u002Fplugins\u002Fbest-codex-plugins","https:\u002F\u002Fgithub.com\u002Fhashgraph-online","https:\u002F\u002Fhol.org","Open-source standards and developer tools for interoperable AI agents: discovery, identity, communication, payments, privacy and security.","2026-11-14 14:06:13",{"source":7,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add hashgraph-online\u002Fawesome-codex-plugins --skill datacontract-test",{"tool":46,"command":47},"bunx","bunx skills add hashgraph-online\u002Fawesome-codex-plugins --skill datacontract-test",{"tool":49,"command":50},"pnpm","pnpm dlx skills add hashgraph-online\u002Fawesome-codex-plugins --skill datacontract-test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fentropy-data\u002Fdataproduct-builder-dbt\u002Fskills\u002Fdatacontract-test\u002FSKILL.md",true,[],[55,65,73,81,89,97],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":60,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":64},"01M7DV332YQMGD8WTRJ9DZQXTB","worktable-review-with-annotations","Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.","MIT","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":69,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":64},"01M7DV2YGHCZVBEB1AHYB6CGHE","worktable-find-and-synthesize-context","Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":77,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":64},"01M7DV2TQN1H11ME2SAF9MXN7V","worktable-create-or-update-docs","Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":64},"01M7DV2NE452NEA8TXATKSNAJH","worktable-create-or-manage-records","Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":64},"01M7DV2HENRBR2KSCVM064WH0Y","worktable-create-or-manage-interactive-html","Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":59,"licenseFileUrl":101,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":64},"01M7DV2CADR5R7RQFFYPNAGR9Y","worktable-collaborate-threads","Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FSKILL.md",[],[]]