
dbt Transformation Patterns
FreeStreamline your dbt data transformation workflows.
Free · Opens the source repo
What dbt Transformation Patterns does
The dbt Transformation Patterns skill provides a structured approach to building data transformation pipelines using dbt (data build tool). It offers production-ready patterns that help in organizing models, implementing testing strategies, documenting processes, and optimizing for incremental processing. This skill is essential for analytics engineers looking to adopt best practices in their data projects.
The core concepts outlined in this skill revolve around the Medallion Architecture, which segments data into layers: raw sources, staging, intermediate, and marts. Each layer serves a specific purpose, ensuring that data is cleaned and organized efficiently. For example, the staging layer allows for light cleaning of data before it is transformed into more complex business logic in the intermediate layer. This systematic approach not only enhances data quality but also improves collaboration among team members.
In addition to model organization, the skill emphasizes the importance of documentation and testing. Users are encouraged to document their data models and lineage thoroughly, which aids in maintaining clarity and understanding of the data flow. Testing strategies are also highlighted, ensuring that data integrity is preserved through rigorous checks. Furthermore, the skill provides guidelines for creating incremental models, which are particularly beneficial when dealing with large datasets, allowing for efficient updates without the need for complete reprocessing.
Overall, this skill is designed for data professionals who are actively working with dbt to build and maintain robust data transformation workflows. By following the outlined patterns and best practices, users can enhance their analytics engineering capabilities and ensure that their data projects are scalable and maintainable.
When to use it
Use this skill when developing data transformation pipelines with dbt, especially for organizing models and implementing testing strategies.
When not to use it
This skill may not be suitable for users who are not using dbt for their data transformations or for those who require custom solutions outside of the provided patterns.
What you can build with it
Building a New Data Pipeline
When starting a new data transformation project, use this skill to set up a structured dbt project with defined model layers and best practices.
Improving Data Quality
Implement rigorous testing strategies and documentation practices to enhance the quality and reliability of your data transformations.
Creating Incremental Models
Utilize the guidelines for building incremental models to efficiently manage large datasets without reprocessing all data.
How to install dbt Transformation Patterns
View source1. Install with the skills CLI
npx skills add wshobson/agents/dbt-transformation-patterns --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by wshobsondbt 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
Frequently asked questions about dbt Transformation Patterns
Similar skills
Single-Cell RNA-seq QC
Automate quality control for single-cell RNA-seq data.
Instrument Data to Allotrope Converter
Standardize lab data for seamless integration.
SQL Server Table Reconciliation
Efficiently compare SQL Server tables across instances.
Data Cleaning and Variable Screening
Streamline credit risk data preprocessing for modeling.
Arize Dataset
Manage and query Arize datasets efficiently.
Spreadsheet Management
Efficiently create, edit, and analyze spreadsheet files.
