DBT Analytics Engineering

Dbt transformation patterns

by wshobson · MIT license · ★ 39,857 on GitHub · updated Sep 21

Dbt transformation patterns cover

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 Codenpx skills add wshobson/agents --skill dbt-transformation-patterns -g -a claude-code
Claude 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-patterns
Windows (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" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md3.2 KB
  • references/1 file · 10.2 KB
Read the files here
wshobson/4236bb92 files
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---
2name: dbt-transformation-patterns
3description: 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 
8Production-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```
24sources/ Raw data definitions
25 ↓
26staging/ 1:1 with source, light cleaning
27 ↓
28intermediate/ Business logic, joins, aggregations
29 ↓
30marts/ 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```yaml
44# dbt_project.yml
45name: "analytics"
46version: "1.0.0"
47profile: "analytics"
48 
49model-paths: ["models"]
50analysis-paths: ["analyses"]
51test-paths: ["tests"]
52seed-paths: ["seeds"]
53macro-paths: ["macros"]
54 
55vars:
56 start_date: "2020-01-01"
57 
58models:
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
72models/
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 
96Detailed 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 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 39,857
Checked
Source
wshobson/agents ↗
Creator
wshobson · 179 listings
View creator

Similar skills

See all →
SkillSnowflake to BigQuery Translatorgoogle/skills · by googleTranslates Snowflake dbt SQL models to Standardized BigQuery SQL. Handles SQL compilation, Jinja macro placeholder masking, BigQuery Translation Service migration workflows, AST-based config transformations, explicit type casting, JSON extraction standardization, and deduplication. Use when migrating Snowflake dbt pipelines or models to Google Cloud BigQuery. Don't use for generic BigQuery queries or non-Snowflake SQL migrations.★ 20.9k GitHub starsSkillDeepline Revenue Analyticsgetaero-io/gtm-eng-skills · by getaero-ioUse this skill when answering business analytics, RevOps, GTM metric, pipeline, revenue, funnel, customer, or warehouse questions with Deepline. Triggers on phrases like 'query Snowflake', 'analyze pipeline', 'total ACV', 'break down by quarter', 'use the semantic layer', 'run a semantic query', or any use of snowflake_get_semantic_layer / snowflake_run_semantic_query. Skip prospecting, enrichment, contact finding, outbound, or personalization workflows; use deepline-gtm for those.★ 66 GitHub starsSkillApache Airflow DAG Builderwshobson/agents · by wshobsonBuild production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.★ 39.9k GitHub starsSkillApache Spark Optimizerwshobson/agents · by wshobsonOptimize Apache Spark jobs with partitioning, caching, shuffle optimization, and memory tuning. Use when improving Spark performance, debugging slow jobs, or scaling data processing pipelines.★ 39.9k GitHub starsSkillData Quality Validationwshobson/agents · by wshobsonImplement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts.★ 39.9k GitHub starsSkillData Quality Auditoralirezarezvani/claude-skills · by alirezarezvaniAudit datasets for completeness, consistency, accuracy, and validity. Profile data distributions, detect anomalies and outliers, surface structural issues, and produce an actionable remediation plan. Use when the user asks to check data quality, profile a dataset, hunt outliers or missing values, or validate data before analysis or model training.★ 26.3k GitHub stars

More from wshobson

Skill.NET Backend Developerwshobson/agents · by wshobsonMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.★ 39.9k GitHub starsSkillWCAG 2.2 Implementationwshobson/agents · by wshobsonImplement WCAG 2.2 compliant interfaces with mobile accessibility, inclusive design patterns, and assistive technology support. Use when auditing accessibility, implementing ARIA patterns, building for screen readers, or ensuring inclusive user experiences.★ 39.9k GitHub starsSkillMaterial Design 3 & Composewshobson/agents · by wshobsonMaster Material Design 3 and Jetpack Compose patterns for building native Android apps. Use when designing Android interfaces, implementing Compose UI, or following Google's Material Design guidelines.★ 39.9k GitHub starsSkillAngularJS to Angular Upgradewshobson/agents · by wshobsonMigrate from AngularJS to Angular using hybrid mode, incremental component rewriting, and dependency injection updates. Use when upgrading AngularJS applications, planning framework migrations, or modernizing legacy Angular code.★ 39.9k GitHub starsSkillReverse Engineering Defensewshobson/agents · by wshobsonUnderstand anti-reversing, obfuscation, and protection techniques encountered during software analysis. Use this skill when analyzing malware evasion techniques, when implementing anti-debugging protections for CTF challenges, when reverse engineering packed binaries, or when building security research tools that need to detect virtualized environments.★ 39.9k GitHub starsSkillApache Airflow DAG Builderwshobson/agents · by wshobsonBuild production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workflows, or scheduling batch jobs.★ 39.9k GitHub stars