Medox new-silver-model
Create a new dbt Silver model with SQL + YAML contract. Use when adding a new Silver layer model from a raw source table.
install
source · Clone the upstream repo
git clone https://github.com/spideystreet/medox
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/spideystreet/medox "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/new-silver-model" ~/.claude/skills/spideystreet-medox-new-silver-model && rm -rf "$T"
manifest:
.claude/skills/new-silver-model/SKILL.mdsource content
Skill: Add a New Silver dbt Model
Steps
-
Identify the raw source table — check
; add it if missing.dbt/models/sources.yml -
Create the SQL model at
:dbt/models/silver/<layer>_<source>__<entity>.sql{{ config(materialized='table') }} SELECT {{ clean_text('col') }} AS col, {{ parse_bdpm_date('date_col') }} AS date_col FROM {{ source('raw', 'table_name') }} WHERE {{ is_valid_cis('cis') }} -
Create the contract at
:dbt/models/silver/<layer>_<source>__<entity>.ymlversion: 2 models: - name: <layer>_<source>__<entity> description: "..." columns: - name: <pk> data_tests: [unique, not_null] -
Add a new macro in
if any transformation is reused across models.dbt/macros/ -
Validate locally:
uv run dotenv -f dbt/.env run -- uv run dbt run --project-dir dbt --profiles-dir dbt --select <model_name> uv run dotenv -f dbt/.env run -- uv run dbt test --project-dir dbt --profiles-dir dbt --select <model_name>