Skills · Data & AI

Dbt Transformation Patterns

Unverified30/40

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.

Originally by wshobson · MIT

Claude CodePartialHas SKILL.md but declares no allowed-tools — Claude Code will ask for permission each time
CursorPartialPlain prose you can paste in — but no Cursor rules file
CodexPartialPlain prose you can paste in — but no AGENTS.md
Gemini CLIPartialPlain prose you can paste in
CopilotPartialPlain prose you can paste in — but no Copilot instructions file
npx agentalley add dbt-transformation-patterns

This command does not work yet — the CLI is still being built. Until then, use Raw in the reader below to take the file.

Who is stuck, and on what

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 whole source

No sign-in, no blur, nothing truncated
dbt-transformation-patterns/SKILL.md115 lines3.2 KBRawView on GitHub
Frontmatter — 2 properties
namedbt-transformation-patterns
descriptionMaster 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.
1---
2name: dbt-transformation-patterns
3description: 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.
4---A5No allowed-tools declared — no way to tell what this skill may touch
5 
6# dbt Transformation Patterns
7 
8Production-ready patterns for dbt (data build tool) including model organization, testing strategies, documentation, and incremental processing.
9 
10## When to Use This Skill
11 
12- Building data transformation pipelines with dbt
13- Organizing models into staging, intermediate, and marts layers
14- Implementing data quality tests
15- Creating incremental models for large datasets
16- Documenting data models and lineage
17- Setting up dbt project structure
18 
19## Core Concepts
20 
21### 1. Model Layers (Medallion Architecture)
22 
23```
24sources/ Raw data definitions
25
26staging/ 1:1 with source, light cleaning
27
28intermediate/ Business logic, joins, aggregations
29
30marts/ Final analytics tables
31```
32 
33### 2. Naming Conventions
34 
35| Layer | Prefix | Example |
36| ------------ | -------------- | ----------------------------- |
37| Staging | `stg_` | `stg_stripe__payments` |
38| Intermediate | `int_` | `int_payments_pivoted` |
39| Marts | `dim_`, `fct_` | `dim_customers`, `fct_orders` |
40 
41## Quick Start
42 
43```yaml
44# dbt_project.yml
45name: "analytics"
46version: "1.0.0"
47profile: "analytics"
48 
49model-paths: ["models"]
50analysis-paths: ["analyses"]
51test-paths: ["tests"]
52seed-paths: ["seeds"]
53macro-paths: ["macros"]
54 
55vars:
56 start_date: "2020-01-01"
57 
58models:
59 analytics:
60 staging:
61 +materialized: view
62 +schema: staging
63 intermediate:
64 +materialized: ephemeral
65 marts:
66 +materialized: table
67 +schema: analytics
68```
69 
70```
71# Project structure
72models/
73├── staging/
74│ ├── stripe/
75│ │ ├── _stripe__sources.yml
76│ │ ├── _stripe__models.yml
77│ │ ├── stg_stripe__customers.sql
78│ │ └── stg_stripe__payments.sql
79│ └── shopify/
80│ ├── _shopify__sources.yml
81│ └── stg_shopify__orders.sql
82├── intermediate/
83│ └── finance/
84│ └── int_payments_pivoted.sql
85└── marts/
86 ├── core/
87 │ ├── _core__models.yml
88 │ ├── dim_customers.sql
89 │ └── fct_orders.sql
90 └── finance/
91 └── fct_revenue.sql
92```
93 
94## Detailed patterns and worked examples
95 
96Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.
97 
98## Best Practices
99 
100### Do's
101 
102- **Use staging layer** - Clean data once, use everywhere
103- **Test aggressively** - Not null, unique, relationships
104- **Document everything** - Column descriptions, model descriptions
105- **Use incremental** - For tables > 1M rows
106- **Version control** - dbt project in Git
107 
108### Don'ts
109 
110- **Don't skip staging** - Raw → mart is tech debt
111- **Don't hardcode dates** - Use `{{ var('start_date') }}`
112- **Don't repeat logic** - Extract to macros
113- **Don't test in prod** - Use dev target
114- **Don't ignore freshness** - Monitor source data
115 

Reviews

Installed this one?Write the first review and take the Trailblazer badge.

Reviews only open after a real install, so this is empty — and we leave it empty rather than invent one.

Alternatives

Also in Data & AI