Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

dbt-data-transformation

БесплатноБез исполняемых скриптовНе проверен

Complete guide for dbt data transformation including models, tests, documentation, incremental builds, macros, packages, and production workflows

manutejот manutej★ 64 звезды на GitHub21 установка в других каталогах

Об этом скилле

dbt Data Transformation

A comprehensive skill for mastering dbt (data build tool) for analytics engineering. This skill covers model development, testing strategies, documentation practices, incremental builds, Jinja templating, macro development, package management, and production deployment workflows.

When to Use This Skill

Use this skill when:

  • Building data transformation pipelines for analytics and business intelligence
  • Creating a data warehouse with modular, testable SQL transformations
  • Implementing ELT (Extract, Load, Transform) workflows
  • Developing dimensional models (facts, dimensions) for analytics
  • Managing complex SQL dependencies and data lineage
  • Creating reusable data transformation logic across projects
  • Testing data quality and implementing data contracts
  • Documenting data models and business logic
  • Building incremental models for large datasets
  • Orchestrating dbt with tools like Airflow, Dagster, or dbt Cloud
  • Migrating legacy ETL processes to modern ELT architecture
  • Implementing DataOps practices for analytics teams

Core Concepts

What is dbt?

dbt (data build tool) enables analytics engineers to transform data in their warehouse more effectively. It's a development framework that brings software engineering best practices to data transformation:

  • Version Control: SQL transformations as code in Git
  • Testing: Built-in data quality testing framework
  • Documentation: Auto-generated, searchable data dictionary
  • Modularity: Reusable SQL through refs and macros
  • Lineage: Automatic dependency resolution and visualization
  • Deployment: CI/CD for data transformations

The dbt Workflow

1. Develop: Write SQL SELECT statements as models
2. Test: Define data quality tests
3. Document: Add descriptions and metadata
4. Build: dbt run compiles and executes models
5. Test: dbt test validates data quality
6. Deploy: CI/CD pipelines deploy to production

Key dbt Entities

  1. Models: SQL SELECT statements that define data transformations
  2. Sources: Raw data tables in your warehouse
  3. Seeds: CSV files loaded into your warehouse
  4. Tests: Data quality assertions
  5. Macros: Reusable Jinja-SQL functions
  6. Snapshots: Type 2 slowly changing dimension captures
  7. Exposures: Downstream uses of dbt models (dashboards, ML models)
  8. Metrics: Business metric definitions

Model Development

Basic Model Structure

A dbt model is a SELECT statement saved as a .sql file:

-- models/staging/stg_orders.sql

with source as (
    select * from {{ source('jaffle_shop', 'orders') }}
),

renamed as (
    select
        id as order_id,
        user_id as customer_id,
        order_date,
        status,
        _etl_loaded_at
    from source
)

select * from renamed

Key Points:

  • Models are SELECT statements only (no DDL)
  • Use CTEs (Common Table Expressions) for readability
  • Reference sources with {{ source() }}
  • dbt handles CREATE/INSERT logic based on materialization

The ref() Function

Reference other models using {{ ref() }}:

-- models/marts/fct_orders.sql

with orders as (
    select * from {{ ref('stg_orders') }}
),

customers as (
    select * from {{ ref('stg_customers') }}
),

joined as (
    select
        orders.order_id,
        orders.order_date,
        customers.customer_name,
        orders.status
    from orders
    left join customers
        on orders.customer_id = customers.customer_id
)

select * from joined

Benefits of ref():

  • Builds dependency graph automatically
  • Resolves to correct schema/database
  • Enables testing in dev without affecting prod
  • Powers lineage visualization

The source() Function

Define and reference raw data sources:

# models/staging/sources.yml

version: 2

sources:
  - name: jaffle_shop
    description: Raw data from the Jaffle Shop application
    database: raw
    schema: jaffle_shop
    tables:
      - name: orders
        description: One record per order
        columns:
          - name: id
            description: Primary key for orders
            tests:
              - unique
              - not_null
          - name: user_id
            description: Foreign key to customers
          - name: order_date
            description: Date order was placed
          - name: status
            description: Order status (completed, pending, cancelled)
-- Reference the source
select * from {{ source('jaffle_shop', 'orders') }}

Source Features:

  • Document raw data tables
  • Test source data quality
  • Track freshness with freshness config
  • Separate source definitions from transformations

Model Organization

Recommended project structure:

models/
├── staging/           # One-to-one with source tables
│   ├── jaffle_shop/
│   │   ├── _jaffle_shop__sources.yml
│   │   ├── _jaffle_shop__models.yml
│   │   ├── stg_jaffle_shop__orders.sql
│   │   └── stg_jaffle_shop__customers.sql
│
Полный SKILL.md на GitHub

Установить dbt-data-transformation в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

EXAMPLES.mdREADME.md

FAQ

Что делает скилл dbt-data-transformation?

Complete guide for dbt data transformation including models, tests, documentation, incremental builds, macros, packages, and production workflows

Как установить скилл dbt-data-transformation?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dbt-data-transformation запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить dbt-data-transformation с