dbt-transformation-patterns
π―SkillPractical patterns for dbt, a tool that turns raw data into clean tables for analysis using SQL. It covers project layout, naming, data checks and documentation.
Installation
npx skills add wshobson/agents --skill dbt-transformation-patternsRun it in a terminal; it asks which AI coding tools to install it for (Claude Code, Codex, Cursor and more).
Uses skills.sh Β· Node.js 22.20+
After installing
Ask for related work and the agent uses it on its own, or call it yourself.
/dbt-transformation-patternsInstall by hand
Copy the whole skill folder from GitHub to the place below. Copying only SKILL.md can leave out files the skill uses.
Open the skill folder β- This project
.claude/skills/dbt-transformation-patterns/ - All projects
~/.claude/skills/dbt-transformation-patterns/
These paths are for Claude Code. For other tools, the command above puts it in the right place.
What this skill does
Overview
dbt (data build tool) lets you write SQL steps that clean and combine raw data into tables ready for reports. This skill shares proven patterns for setting up and growing a dbt project. It organizes work into layers, from raw sources to final analytics tables.
Key Features
- Arrange models into staging, intermediate and marts layers, each with a clear job.
- Follow naming rules like
stg_,int_,dim_andfct_so files are easy to find. - Start quickly with a sample
dbt_project.ymland folder layout. - Add data quality tests, such as checking for empty or duplicate values.
- Use incremental models, which only process new rows, for very large tables.
Who is this for?
This is for analytics engineers and data analysts who build reporting data with dbt. It helps new projects start with a clean structure. Deeper examples are in references/details.md.
Summarized by AI from this skill's SKILL.md. Suggest a better one
SKILL.md
View on GitHub β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.
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
More from this repository10
Helps you build a consistent look for your app with Tailwind CSS v4. It sets up shared colors, sizes, dark mode and reusable components so every screen matches.
A guide to TypeScript's advanced type features, which describe the shape of your data so mistakes are caught before the code runs. It covers reusable types, types that change based on rules, and built-in helper types, with short examples.
Guidance for building reliable server-side apps with Node.js, using Express or Fastify. It covers login, error handling, databases, API design and a list of proven best practices.
Intelligent automation and multi-agent orchestration for Claude Code
Claude Code plugin for AI-powered framework migration workflows, coordinating specialized agents to plan and execute transitions between technology stacks as part of the wshobson/agents marketplace.
A Claude Code plugin for payment system integration covering Stripe, PayPal, and billing platforms with checkout flows, subscription management, and webhook handling in the wshobson/agents ecosystem.
A Claude Code plugin bundling core development tools and agents for everyday tasks like debugging and code generation, part of the wshobson/agents marketplace with 73 focused plugins.
Claude Code plugin for observability and monitoring including logging, metrics, distributed tracing, and alerting, part of the wshobson/agents marketplace with 73 focused plugins.
A Claude Code plugin providing specialized AI agents for deployment strategy planning and execution, covering blue-green deployments, canary releases, rolling updates, and zero-downtime patterns.
Claude Code plugin for JVM language development including Java, Kotlin, and Scala with specialized agents for idiomatic patterns, build tools, and runtime optimization in the wshobson/agents marketplace.