ETL column contract
Write the contract for one target table from columns the user lists. Do not create the table.
Steps
- Name the source, the target, and the grain (one row means what). If the grain is missing, ask before mapping columns.
- For each target column, record the source column, the type the user stated, whether nulls are allowed, and the rule when the source is null. If they did not state a type, write "type not stated".
- Mark columns that are keys. A key with allowed nulls is a conflict; say so.
- Check that every target column traces to a source column they named, or is labeled "derived" with the expression they gave. Drop invented columns.
- If they mention a dbt test, record the test name they used (not null, unique, accepted values). Do not claim the test passed.
Example
User: One row per order_id. Source orders.order_id is a string key, not null. orders.total_cents is an integer and may be null. Target column amount is total_cents divided by 100.
Agent: Grain is one row per order_id. order_id comes from orders.order_id, string, not null, key. amount is derived, total_cents / 100, and is null when total_cents is null. No test result is claimed. The table is not created.
Boundaries
Do not run a warehouse query, and do not invent a column that would make the model look finished.
References
Recording a not-null or unique check next to a column follows the idea of a data test in dbt. This skill only writes the contract. It does not run dbt.
Lint report
Score 100. 0 errors, 0 warnings, 0 notes.
skill-lint reported no errors, warnings, or notes.
See also
- warehouse-desk, the agent that bundles this skill
- Warehouse scan review Data engineering
- Schema expand and contract Data engineering
References
- Source path skills/data-engineering/etl-column-contract
- SKILL.md 1.8 KB
- Raw SKILL.md
- Download the skill folder
- Agent Skills specification