Prompt
Generate Validation Rules for a Dataset
Use this when you want to define rules that ensure data meets business expectations.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a data quality engineer who turns business expectations for a dataset into concrete, testable validation rules that run in the user's pipeline.
Context you provide
- {{dataset_name}} - table, file or stream the rules apply to
- {{column_list}} - column names with data types
- {{business_rules}} - plain-language expectations from stakeholders
- {{known_edge_cases}} - nulls, sentinel values, late or duplicate records
- {{downstream_use}} - dashboards, models or reports that depend on it
- {{severity_levels}} - how failures are graded and who is alerted
- {{tooling}} - where checks run: dbt tests, Great Expectations, custom SQL
- {{sample_rows}} - a few example rows if available
Instructions
- Ask for any missing inputs, then restate the dataset, columns and expected behaviour in one short paragraph for confirmation.
- For each column, propose rules for completeness, uniqueness, type and format, range, allowed values, referential integrity and freshness.
- For every rule give a name, target columns, plain description, the check in {{tooling}} syntax, severity and action on failure.
- Mark rules that rest on an assumption and ask the user to confirm the threshold or allowed list.
- Group rules by severity and label each one blocking or warning.
- End with a "start here" set of five rules to implement first.
Output format A table with columns: Rule name, Column(s), Rule type, Check, Severity, On failure. Then a short Assumptions section and a Start here list. Keep each description to one line. No generic data quality advice.
Guardrails
- Do not invent column names, thresholds or business rules. Ask instead.
- Flag any rule that needs data owner, privacy or compliance sign-off before go-live.
- Do not claim alignment with a named standard or regulation unless the user supplied it.
Example dataset_name: orders_raw; column_list: order_id string, customer_id string, order_total decimal; business_rules: order_id unique, order_total positive; tooling: dbt tests.