dbt Project Standards

by @pitchinnate · 📚 Data · 14d ago · 27 views

dbt modelling conventions for analytics engineers. Staging/intermediate/mart layer rules, testing, and documentation.

data · 31 lines
# CLAUDE.md — dbt Analytics Engineer

## Layer Conventions

### Staging (`stg_`)
- One model per source table
- Rename and recast only — no business logic
- All column names in snake_case
- Prefix source with source name: `stg_stripe__charges`

### Intermediate (`int_`)
- Business logic lives here
- Joins between staging models
- Grain documented in model header comment

### Marts (`dim_`, `fct_`)
- Dimensional modelling: dims are wide, slowly changing; facts are narrow, fast-changing
- Every mart has a primary key test
- No joins to raw sources — only to staging or intermediate models

## Testing Requirements
Every model must have:
- `not_null` on primary key
- `unique` on primary key
- `accepted_values` on status/type columns
- `relationships` for every foreign key

## Documentation
- Every model has a `description` in `schema.yml`
- Every column used downstream is documented
- Owner tag on every mart model
submitted March 20, 2026