dbt-transformation-patterns

Implements dbt model layers, tests, documentation, and incremental strategies for analytics engineering.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill dbt-transformation-patterns-sanketadlak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dbt-transformation-patterns
Source: https://github.com/SanketAdlak/PDMProjectDesign/tree/main/.agents/skills/dbt-transformation-patterns
Command: npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill dbt-transformation-patterns-sanketadlak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building reliable data transformation pipelines requires consistent model organization, testing, and documentation, which teams often implement inconsistently or skip entirely. ## Core Features & Use Cases - Layered Model Architecture: Organize dbt models into staging, intermediate, and marts layers following medallion architecture with standard naming conventions like stg_, int_, dim_, and fct_. - Testing and Documentation: Apply schema tests including unique, not_null, relationships, accepted_values, and freshness checks directly in YAML model definitions. - Incremental Strategies: Configure incremental models with delete+insert, merge, or insert_overwrite strategies for large datasets. - Use Case: When building a customer analytics warehouse, use these patterns to create staging models from Stripe and Shopify sources, aggregate payments in intermediate models, and produce a dim_customers mart with lifetime value tiers and tested surrogate keys. ## Quick Start Ask the AI to create a dbt staging model and a tested customer dimension table from your raw source tables following the layered patterns.

Frequently Asked Questions about dbt-transformation-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I organize dbt models into layers?

Organize dbt models into staging, intermediate, and marts layers. Staging models map 1:1 to sources with light cleaning, intermediate models hold business logic and joins, and marts contain final dimension and fact tables for analytics.

How to create incremental models in dbt?

Set materialized='incremental' with a unique_key in the model config, then use the is_incremental() macro to filter new rows, for example where _fivetran_synced exceeds the max loaded timestamp. Choose delete+insert, merge, or insert_overwrite as the strategy.

What naming conventions should dbt models use?

Use stg_ for staging models like stg_stripe__payments, int_ for intermediate models like int_payments_pivoted, and dim_ or fct_ for marts like dim_customers and fct_orders. Double underscores separate the source system from the entity name.

Which incremental strategy should I use in dbt?

Use delete+insert as the default for most warehouses, merge when handling late-arriving data with specific update columns, and insert_overwrite for partition-based tables on date fields. The choice depends on warehouse support and data arrival patterns.

How do I test dbt models and sources?

Define tests in YAML files alongside models using built-in tests like unique, not_null, relationships, and accepted_values, plus dbt_utils tests like expression_is_true and recency. Run them with dbt test or combine runs and tests with dbt build.

When should I not use incremental models in dbt?

Avoid incremental models for small tables under roughly one million rows where full refreshes are cheap, and for logic requiring full historical recomputation. Incremental models add complexity and can drift if late-arriving data falls outside the lookback window.