Generated banner for Dbt Transformation Patterns
Generated logo for Dbt Transformation Patterns

Dbt Transformation Patterns

Seth HobsonCommunityCreated by Seth Hobson

  • Skill
  • Guidelines
  • Data and AI
  • MIT
  • No issues found

From the author

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.
— the description by Seth Hobson

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

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/wshobson/dbt-transformation-patterns/download
  2. Unzip 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 tables
2. Naming Conventions
LayerPrefixExample
Stagingstg_stg_stripe__payments
Intermediateint_int_payments_pivoted
Martsdim_, 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

Files

LICENSE

MIT License

Copyright (c) 2024 Seth Hobson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. 

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