Dbt Transformation Patterns
Seth HobsonCommunityCreated by Seth Hobson
- Skill
- Guidelines
- Data and AI
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to analytics engineering using dbt. It outlines a medallion architecture for organizing data models into staging, intermediate, and marts layers, while offering specific patterns for source definitions, incremental processing, and naming conventions. The content emphasizes maintainability through consistent project structures, aggressive testing, and comprehensive documentation.
What it does
- Defines a layered model architecture for data transformations
- Provides templates for staging, intermediate, and mart model creation
- Establishes naming conventions for database objects
- Demonstrates how to implement data quality tests and source freshness checks
- Shows how to configure incremental materialization for large datasets
- Offers guidance on project structure and configuration
When to use it
- When starting a new dbt project
- When refactoring existing data transformation pipelines
- When implementing data quality and testing standards
- When organizing complex SQL logic into modular layers
- When setting up incremental loading strategies
Advantages
- Promotes consistent project organization
- Reduces technical debt through modular model layers
- Encourages proactive data quality monitoring
- Simplifies lineage tracking and documentation
Usage examples
- “How should I organize my dbt models?”
- The skill provides a directory structure and medallion architecture (staging, intermediate, marts) to organize models logically.
- “Show me how to create an incremental model in dbt.”
- The skill provides a SQL template using the is_incremental() macro to filter data based on the last loaded timestamp.
- “What are the best practices for naming dbt models?”
- The skill lists specific prefixes such as stg_ for staging, int_ for intermediate, and dim_ or fct_ for marts.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/wshobson/dbt-transformation-patterns/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip dbt-transformation-patterns.zip -d .agents/skills
Documentation by Seth Hobson
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 tables2. 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.sqlDetailed 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
Files
- ATTRIBUTION.mdAdded by AutoGineer1013 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md3.2 KiB
- references/details.md10.2 KiB
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Seth Hobson
- Publisher
- Seth Hobson (Community)
- Source
- wshobson/agents · plugins/data-engineering/skills/dbt-transformation-patterns · commit 4bde316
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Seth Hobson.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download dbt-transformation-patterns.zip