🔬 Research

dbt Model Column Contract from Schema Inventory (No Invented Row Counts)

Write a dbt model column contract from a schema inventory only. No invented row counts, warehouse costs, or column names beyond inputs.

0.0
0Reviews
P
September 6, 2026

Prompt

Act as a dbt model contract writer who only uses a pasted schema inventory. You write a column contract the inventory already supports. You do not invent row counts, warehouse costs, or columns absent from Inputs. This is not a warehouse cost estimate and not a production migrate script.
You work only from Inputs. Do not invent stats, citations, quotes, URLs, names, IDs, or records that are not in Inputs.

Inputs:
- Schema inventory I lock (columns, types, nullability notes): [Inventory]
- dbt / adapter version I lock: [Version]
- Model name I may quote (or UNKNOWN): [Model]
- Warehouse dialect I may quote (or UNKNOWN): [Dialect]
- Words I must not use: [Banned]
- What I must never invent (row counts, costs, columns, tests): [Never]
- Output format: [Format]
- Language: [Lang]

Generate:
1. Honesty ledger: Inventory nouns, Version, Model, Dialect, Lang. Forbidden: invented row counts, costs, columns. Include dbt contract terminology.
2. Column contract YAML: one entry per Inventory column. Missing types write NOT IN INPUTS.
3. Test stubs: only tests implied by Inventory nullability/type notes. Unnamed tests stay NOT IN INPUTS.
4. Version lock: print Version and Dialect. Refuse adapter features newer than Version if Version is named.
5. Refuse list: inventing 1.2M rows, inventing $400 warehouse, inventing column email_hash when absent, inventing unique tests.
6. Compliance pass: quote Banned and Never hits. Cut them. Format as Format.

Constraints:
- Contract from Inventory only. No invented row counts or costs.
- Honor Version. No emojis.

Instructions

Replace every [bracket] with your details before running. Works on ChatGPT, Claude, and Gemini.

Generated Output

This image was generated using the prompt above.

dbt Model Column Contract from Schema Inventory (No Invented Row Counts) - Result

Examples

Example Input

Inventory: columns order_id integer not_null as pasted; customer_id integer as pasted; amount numeric as pasted. email_hash NONE. Row count NOT IN INPUTS.
Version: dbt-core 1.7 as pasted (do not invent 1.9)
Model: fct_orders as pasted
Dialect: Snowflake as pasted
Banned: guaranteed fresh, 1.2M rows invent, $400 invent, email_hash invent
Never: invent row counts, invent costs, invent columns, invent unique tests when absent
Format: ledger + yaml + tests + version + refuse + compliance
Lang: English

Example Output

1. Ledger. Inventory: order_id integer not_null; customer_id integer; amount numeric. email_hash NONE. Row count NOT IN INPUTS. Version dbt-core 1.7. Model fct_orders. Dialect Snowflake. Lang English. Forbidden: invented row counts, costs, columns, guaranteed fresh, 1.2M rows invent, $400 invent, email_hash invent.

2. Column contract YAML (dbt contract).
models:
  - name: fct_orders
    columns:
      - name: order_id
        data_type: integer
        constraints: [{type: not_null}]
      - name: customer_id
        data_type: integer
      - name: amount
        data_type: numeric
email_hash: NONE so omitted. Row count: NOT IN INPUTS.

3. Test stubs. not_null on order_id as pasted. unique on order_id: NOT IN INPUTS (not stated). Relationships: NOT IN INPUTS.

4. Version lock. dbt-core 1.7 as pasted. Dialect Snowflake as pasted. 1.9 features not used.

5. Refuse. 1.2M rows invent: refused. $400 invent: refused. email_hash invent: refused. Guaranteed fresh: refused. Unique test invent: refused.

6. Compliance. Banned hits none. Format ledger+yaml+tests+version+refuse+compliance. Gaps: row count, unique tests, relationships, descriptions, grain.

Missing-data policy: if a field was blank, write NOT IN INPUTS rather than guessing. Lock any tool version named in Inputs; if unnamed, write unknown. No invented testimonials, star ratings, or press logos. If legal, clinical, insurance, HR, education-plan, or veterinary content appears, add a one-line not-advice and de-identify banner. Quote banned-word hits and cut them. End with a gaps list of five bullets the user still owes you. Character and byte caps in the job are hard; print counts when relevant. Refuse to backfill DOIs, exam dumps, PHI, PII, or compensation promises not in Inputs.

Reviews (0)

Please login to leave a review.
Loading reviews...