DB

dbt-transformation-patterns

A development tool for dbt that enforces analytics engineering best practices through model organization and testing patterns.

Install

mkdir -p .claude/skills/dbt-transformation-patterns && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/452" && unzip -o skill.zip -d .claude/skills/dbt-transformation-patterns && rm skill.zip

Installs to .claude/skills/dbt-transformation-patterns

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
247 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Organize models into staging, intermediate, and marts layers
  • Implement data quality tests for nulls, uniqueness, and relationships
  • Configure incremental model strategies for large datasets
  • Define project structure using dbt_project.yml
  • Document model lineage and column descriptions

How it works

It organizes data pipelines into a medallion architecture, separating raw sources from cleaned staging, business-logic intermediate, and final marts layers.

Inputs & outputs

You give it
Raw data sources and SQL transformation logic
You get back
Structured analytics tables and documentation

When to use dbt-transformation-patterns

  • Implementing medallion architecture in dbt
  • Adding data quality tests to models
  • Structuring new analytics projects
  • Setting up incremental model strategies

About this skill

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

When not to use it

  • When skipping the staging layer for raw data
  • When hardcoding dates instead of using variables
  • When testing in production environments

Prerequisites

Git for version controldbt project configuration

Limitations

  • Requires incremental strategies for tables exceeding 1 million rows
  • Staging layer is mandatory to avoid technical debt

How it compares

It enforces a standardized directory structure and naming convention compared to ad-hoc SQL script management.

Compared to similar skills

dbt-transformation-patterns side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
dbt-transformation-patterns (this skill)62moNo flagsIntermediate
embu-data-audit03moReviewIntermediate
interface-lint17moReviewIntermediate
code-review06moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by wshobson

View all by wshobson

You might also like

Search skills

Search the agent skills registry