agentleFS
datacontractdatacontract/datacontract-skills/skills/datacontract-cli/SKILL.md

datacontract-cli

Skill4 starsChanged 49 days agoMITView on GitHub

Core. Install, upgrade, and configure the Data Contract CLI (`datacontract`), the open-source tool every other data contract skill builds on, and look up its documentation. Use when the user wants to install the CLI, pick the right extras for a data source, set up credentials for a server, check the CLI version, or when another skill's Step 0 says to verify the CLI.

  • Reads credentials
  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 1 is distinctive, and 6 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.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the command is missing or older than the version on PyPI, install or upgrade it.

    line 19
  2. Very specific:

    Ask before installing anything.

    line 33
  3. Very specific:

    Never print the content of .env or a config file with secrets.

    line 61
  4. Very specific:

    Make sure .env is listed in .gitignore before the user writes secrets to it.

    line 62
  5. Very specific:

    Files, not chat: Write contracts to *.odcs.yaml files in the user's repository (ask for the path if there is no obvious convention), and …

    line 96
  6. Very specific:

    Lint after every edit: Run datacontract lint <file> after each change and fix every error before moving on.

    line 97
  7. Very specific:

    No personal data in output: When test results or failed samples (--include-failed-samples) contain values that look personal (names, …

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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 Contract CLI

Persona: anyone working with data contracts Output: a working datacontract installation with credentials for the data sources the user needs

The Data Contract CLI is an open-source command-line tool for data contracts in the Open Data Contract Standard (ODCS). It lints contracts, tests data against them on 20+ data sources, imports contracts from existing schemas, exports them to 25+ formats, compares versions, and opens the visual Data Contract Editor.

Step 1: Check the installation

datacontract --version

If the command is missing or older than the version on PyPI, install or upgrade it. Prefer uv:

uv tool install --python python3.11 --upgrade 'datacontract-cli[all]'

Alternatives:

  • pip install 'datacontract-cli[all]' in a virtual environment (Python 3.10 or newer)
  • uvx --from 'datacontract-cli[all]' datacontract <command> for a one-off run without installing
  • Docker: docker run --rm -v "${PWD}:/home/datacontract" datacontract/cli <command>

[all] pulls in every data source driver. When the user only needs one source, a smaller extra is faster to install: [snowflake], [bigquery], [databricks], [postgres], [s3], [kafka], [sqlserver], [trino], [api] (needed for datacontract edit and datacontract api), and more, see Installation.

Ask before installing anything. Never install with sudo.

Step 2: Credentials

Connection details (host, database, schema, location) live in the servers block of the data contract. Credentials never go into the contract. They are environment variables named DATACONTRACT_<SOURCE>_<OPTION>, for example:

DATACONTRACT_POSTGRES_USERNAME
DATACONTRACT_POSTGRES_PASSWORD
DATACONTRACT_SNOWFLAKE_USERNAME
DATACONTRACT_SNOWFLAKE_PASSWORD
DATACONTRACT_SNOWFLAKE_WAREHOUSE
DATACONTRACT_SNOWFLAKE_ROLE
DATACONTRACT_DATABRICKS_TOKEN
DATACONTRACT_BIGQUERY_ACCOUNT_INFO_JSON_PATH
DATACONTRACT_S3_ACCESS_KEY_ID
DATACONTRACT_S3_SECRET_ACCESS_KEY

The exact variables for each source are on its page under Test your Data. Where they can come from, in order of precedence:

  1. already set environment variables,
  2. a .env file in the working directory or the nearest parent,
  3. a YAML config file (--config-file, or ./datacontract-config.yaml, or ~/.datacontract/config.yaml), see Configuration.

Rules for the agent:

  • Never ask the user to paste a password, token, or key into the chat. Tell them which variables to set and where (a .env file, their shell, a secret store), and let them set the values themselves.
  • Never print the content of .env or a config file with secrets. To check that a variable is set, test for presence only: test -n "$DATACONTRACT_POSTGRES_PASSWORD" && echo set.
  • Make sure .env is listed in .gitignore before the user writes secrets to it.
  • In contracts, server fields may reference variables as ${VAR} or ${VAR:-default}, for example to switch the schema per environment.

Step 3: Look up what you are not sure about

The CLI evolves quickly. Before using an option you have not seen in --help, check it:

datacontract <command> --help
datacontract export <format> --help
datacontract import <format> --help

The full documentation is at cli.datacontract.com, also as llms.txt (an index) and llms-full.txt (every page in one file). Fetch the specific page you need instead of guessing option names or YAML attributes.

Command overview

CommandWhat it doesSkill with details
initCreate a new contract from a templatecreate-data-contract
import <format>Create a contract from SQL DDL, dbt, Avro, JSON Schema, Excel, or a live source (Snowflake, Databricks, BigQuery, Postgres, ...)create-data-contract
lintValidate the contract against the ODCS JSON Schema and the CLI's rulescreate-data-contract
editOpen the contract in the Data Contract Editor (web UI)datacontract-editor
testRun schema, quality, and service level checks against a servertest-data-contract
citest for pipelines: several contracts, annotations, job summary, exit-code controlcontract-ci
changelog / breakingCompare two contract versions, classify breaking changesbreaking-change-check
export <format>Generate SQL DDL, dbt, Avro, JSON Schema, Pydantic, HTML, ...export-data-contract
dbt sync / dbt testGenerate dbt model properties and tests from contractsexport-data-contract
catalogBuild a static HTML catalog of many contractsexport-data-contract
publishPublish a contract to Entropy Data
apiRun the CLI as a REST API server

Conventions for all data contract skills

  • Files, not chat. Write contracts to *.odcs.yaml files in the user's repository (ask for the path if there is no obvious convention), and show diffs instead of whole files.
  • Lint after every edit. Run datacontract lint <file> after each change and fix every error before moving on. Use --all-errors to see everything at once.
  • Ask before connecting to data. test, import from a live source, and ci read from the user's data platform. Say which server and which credentials will be used, and get a go-ahead the first time in a session. Prefer --dry-run or --metadata-only when the user only wants to see what would run.
  • Ask before anything outward-facing: publish, --publish <url>, pushing to a remote, opening a pull request.
  • No personal data in output. When test results or failed samples (--include-failed-samples) contain values that look personal (names, emails, phone numbers, IDs), mask them in what you show.

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.