DBT Analytics Engineering
Dbt transformation patterns

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best…
--- name: dbt-transformation-patterns description: Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices. --- # dbt Transformation Patterns Production-ready patterns for dbt (data build tool) including model organization, testing strategies, documentation, and incremental processing. ## When to Use This Skill - Building data transformation pipelines with dbt - Organizing models into staging, intermediate, and marts layers - Implementing data quality tests - Creating incremental models for large datasets - Documenting data models and lineage - Setting up dbt project structure
Overview
Production-ready patterns for dbt (data build tool) including model organization, testing strategies, documentation, and incremental processing.
Manual install (npx, ZIP)
Claude Code
npx skills add wshobson/agents --skill dbt-transformation-patterns -g -a claude-codeClaude Code (manual)
mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/wshobson/agents/tar.gz/4236bb91f839 \
| tar -xz -C ~/.claude/skills --strip-components=4 agents-4236bb91f839/plugins/data-engineering/skills/dbt-transformation-patternsWindows (PowerShell)
New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/e97b3daffd6a9520b095/dbt-transformation-patterns.zip" -OutFile "$env:TEMP\dbt-transformation-patterns.zip"; Expand-Archive "$env:TEMP\dbt-transformation-patterns.zip" -DestinationPath "$HOME\.claude\skills" -ForceClaude.ai / desktop
Codex, Cursor, other agents
Connects with Agent Alley MCP · agentalley.io/mcp
Files included
SKILL.md3.2 KBreferences/1 file · 10.2 KB
Read the files here
SKILL.md
Show the full text115 lines
dbt Transformation Patterns
Production-ready patterns for dbt (data build tool) including model organization, testing strategies, documentation, and incremental processing.
When to Use This Skill
- Building data transformation pipelines with dbt
- Organizing models into staging, intermediate, and marts layers
- Implementing data quality tests
- Creating incremental models for large datasets
- Documenting data models and lineage
- Setting up dbt project structure
Core Concepts
1. Model Layers (Medallion Architecture)
sources/ Raw data definitions
↓
staging/ 1:1 with source, light cleaning
↓
intermediate/ Business logic, joins, aggregations
↓
marts/ Final analytics tables
2. Naming Conventions
| Layer | Prefix | Example |
|---|---|---|
| Staging | stg_ |
stg_stripe__payments |
| Intermediate | int_ |
int_payments_pivoted |
| Marts | dim_, fct_ |
dim_customers, fct_orders |
Quick Start
# dbt_project.yml
name: "analytics"
version: "1.0.0"
profile: "analytics"
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
vars:
start_date: "2020-01-01"
models:
analytics:
staging:
+materialized: view
+schema: staging
intermediate:
+materialized: ephemeral
marts:
+materialized: table
+schema: analytics
# Project structure
models/
├── staging/
│ ├── stripe/
│ │ ├── _stripe__sources.yml
│ │ ├── _stripe__models.yml
│ │ ├── stg_stripe__customers.sql
│ │ └── stg_stripe__payments.sql
│ └── shopify/
│ ├── _shopify__sources.yml
│ └── stg_shopify__orders.sql
├── intermediate/
│ └── finance/
│ └── int_payments_pivoted.sql
└── marts/
├── core/
│ ├── _core__models.yml
│ ├── dim_customers.sql
│ └── fct_orders.sql
└── finance/
└── fct_revenue.sql
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Best Practices
Do's
- Use staging layer - Clean data once, use everywhere
- Test aggressively - Not null, unique, relationships
- Document everything - Column descriptions, model descriptions
- Use incremental - For tables > 1M rows
- Version control - dbt project in Git
Don'ts
- Don't skip staging - Raw → mart is tech debt
- Don't hardcode dates - Use
{{ var('start_date') }} - Don't repeat logic - Extract to macros
- Don't test in prod - Use dev target
- Don't ignore freshness - Monitor source data
| 1 | |
| 2 | name dbt-transformation-patterns |
| 3 | description Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices. |
| 4 | |
| 5 | |
| 6 | # dbt Transformation Patterns |
| 7 | |
| 8 | Production-ready patterns for dbt (data build tool) including model organization, testing strategies, documentation, and incremental processing. |
| 9 | |
| 10 | ## When to Use This Skill |
| 11 | |
| 12 | Building data transformation pipelines with dbt |
| 13 | Organizing models into staging, intermediate, and marts layers |
| 14 | Implementing data quality tests |
| 15 | Creating incremental models for large datasets |
| 16 | Documenting data models and lineage |
| 17 | Setting up dbt project structure |
| 18 | |
| 19 | ## Core Concepts |
| 20 | |
| 21 | ### 1. Model Layers (Medallion Architecture) |
| 22 | |
| 23 | |
| 24 | sources/ Raw data definitions |
| 25 | ↓ |
| 26 | staging/ 1:1 with source, light cleaning |
| 27 | ↓ |
| 28 | intermediate/ Business logic, joins, aggregations |
| 29 | ↓ |
| 30 | marts/ Final analytics tables |
| 31 | |
| 32 | |
| 33 | ### 2. Naming Conventions |
| 34 | |
| 35 | | Layer | Prefix | Example | |
| 36 | | ------------ | -------------- | ----------------------------- | |
| 37 | | Staging | `stg_` | `stg_stripe__payments` | |
| 38 | | Intermediate | `int_` | `int_payments_pivoted` | |
| 39 | | Marts | `dim_`, `fct_` | `dim_customers`, `fct_orders` | |
| 40 | |
| 41 | ## Quick Start |
| 42 | |
| 43 | |
| 44 | # dbt_project.yml |
| 45 | name: "analytics" |
| 46 | version: "1.0.0" |
| 47 | profile: "analytics" |
| 48 | |
| 49 | model-paths: ["models"] |
| 50 | analysis-paths: ["analyses"] |
| 51 | test-paths: ["tests"] |
| 52 | seed-paths: ["seeds"] |
| 53 | macro-paths: ["macros"] |
| 54 | |
| 55 | vars: |
| 56 | start_date: "2020-01-01" |
| 57 | |
| 58 | models: |
| 59 | analytics: |
| 60 | staging: |
| 61 | +materialized: view |
| 62 | +schema: staging |
| 63 | intermediate: |
| 64 | +materialized: ephemeral |
| 65 | marts: |
| 66 | +materialized: table |
| 67 | +schema: analytics |
| 68 | |
| 69 | |
| 70 | |
| 71 | # Project structure |
| 72 | models/ |
| 73 | ├── staging/ |
| 74 | │ ├── stripe/ |
| 75 | │ │ ├── _stripe__sources.yml |
| 76 | │ │ ├── _stripe__models.yml |
| 77 | │ │ ├── stg_stripe__customers.sql |
| 78 | │ │ └── stg_stripe__payments.sql |
| 79 | │ └── shopify/ |
| 80 | │ ├── _shopify__sources.yml |
| 81 | │ └── stg_shopify__orders.sql |
| 82 | ├── intermediate/ |
| 83 | │ └── finance/ |
| 84 | │ └── int_payments_pivoted.sql |
| 85 | └── marts/ |
| 86 | ├── core/ |
| 87 | │ ├── _core__models.yml |
| 88 | │ ├── dim_customers.sql |
| 89 | │ └── fct_orders.sql |
| 90 | └── finance/ |
| 91 | └── fct_revenue.sql |
| 92 | |
| 93 | |
| 94 | ## Detailed patterns and worked examples |
| 95 | |
| 96 | Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient. |
| 97 | |
| 98 | ## Best Practices |
| 99 | |
| 100 | ### Do's |
| 101 | |
| 102 | **Use staging layer** - Clean data once, use everywhere |
| 103 | **Test aggressively** - Not null, unique, relationships |
| 104 | **Document everything** - Column descriptions, model descriptions |
| 105 | **Use incremental** - For tables > 1M rows |
| 106 | **Version control** - dbt project in Git |
| 107 | |
| 108 | ### Don'ts |
| 109 | |
| 110 | **Don't skip staging** - Raw → mart is tech debt |
| 111 | **Don't hardcode dates** - Use `{{ var('start_date') }}` |
| 112 | **Don't repeat logic** - Extract to macros |
| 113 | **Don't test in prod** - Use dev target |
| 114 | **Don't ignore freshness** - Monitor source data |
| 115 |
Details
- Updated
- Sep 21, 2026
- License
- MIT
- Stars on the repo
- ★ 39,857
- Checked
- Source
- wshobson/agents ↗
- Creator
- wshobson · 179 listings
Similar skills
See all →
SkillSnowflake to BigQuery Translator
SkillDeepline Revenue Analytics
SkillApache Airflow DAG Builder
SkillApache Spark Optimizer
SkillData Quality Validation
SkillData Quality AuditorMore from wshobson
Skill.NET Backend Developer
SkillWCAG 2.2 Implementation
SkillMaterial Design 3 & Compose
SkillAngularJS to Angular Upgrade
SkillReverse Engineering Defense
SkillApache Airflow DAG Builder