Index of every page on this site: llms.txt
All skills
wshobson avatar

/dbt-transformation-patterns

@4220308
by Seth Hobsonwshobson/agents43k stars
4,518
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/wshobson/agents/dbt-transformation-patterns

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈69 tokens for metadata: the name and description. ≈744 when used: this file. ≈2.6k more on demand in 1 file.

Description uses 3.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈277 characters, or 3.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill contains standard documentation, schemas, and configurations for data build tool (dbt) projects. It demonstrates best practices for organizing models, macros, testing, and implementation, and presents no security risks.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer8mo

    1/1 file flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 4220308. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 6 months ago
  • Documentation
  • dbt
  • data-transformation
  • analytics-engineering
  • sql
  • incremental-models
  • data-testing
  • model-organization

README badge

README badge for wshobson/agents/dbt-transformation-patterns

Teaches dbt project structure, model layering (staging, intermediate, marts), naming conventions, testing strategies, and incremental processing patterns for analytics engineering. Covers the medallion architecture approach and best practices for organizing data transformations in production dbt projects.

Generated from the current SKILL.md.

Does this skill cover dbt Cloud or only dbt Core?
The skill focuses on dbt Core patterns and project structure. It does not address dbt Cloud-specific features like scheduling, CI/CD, or the metadata API.
What data warehouses does this support?
The patterns are warehouse-agnostic and apply to any dbt-supported platform (Postgres, Snowflake, BigQuery, Redshift, etc.). Specific dialect syntax is not covered.
Does this include macro examples or just model organization?
The skill emphasizes model layering, testing, and documentation. Macro development is mentioned as a best practice but not detailed — refer to the `references/details.md` file for deeper examples.
How should I handle incremental models for slowly changing dimensions?
The skill covers incremental strategies for large datasets but does not provide SCD (slowly changing dimension) patterns. That level of detail is in the referenced details.md file.

Generated from the current SKILL.md. These answers refresh after source changes.