AGENTS.md
Analytics pipeline: raw events land in the warehouse, dbt models transform them, Airflow schedules runs.
Commands
- dbt (from
dbt/):dbt build --select <model>+builds a model and everything downstream with tests;dbt test --select <model> - Compile only (no warehouse writes):
dbt compile --select <model> - Lint SQL:
sqlfluff lint dbt/models - Airflow DAG checks:
pytest dags/tests -q
Modeling rules
- Layers:
staging/(1:1 with sources, rename and cast only),intermediate/(joins, business logic),marts/(consumer-facing). - Every model has a YAML entry with description,
uniqueandnot_nulltests on its primary key. - Use
ref()andsource(); never hard-code schema names. - Incremental models need a
unique_keyand must be safe to re-run. - Never select
*in marts; list columns explicitly.
Safety
- Do not run
dbt buildagainst the production target. Use thedevtarget (default inprofiles.yml). - No personal data in marts without the
piitag and the masking macro. - Airflow tasks must be idempotent; backfills use the DAG’s
start_date/end_dateparameters, not ad hoc scripts.