dbt-transformation-patterns
Build dbt models with proven patterns
Building reliable dbt transformations can be slow without a clear structure. This skill provides layered model patterns, tests, and incremental strategies you can apply quickly.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "dbt-transformation-patterns". Create a dbt structure for Stripe and Shopify data with staging and marts.
Expected outcome:
- Set up staging models for Stripe customers and payments with stg_ prefix
- Add an intermediate model to aggregate payments by customer using int_ prefix
- Create marts with dim_customers for dimensions and fct_orders for facts
- Add YAML tests for unique and not_null on primary keys
- Configure incremental processing for large payment tables
Using "dbt-transformation-patterns". How do I test my dbt models?
Expected outcome:
- Add not_null and unique tests on all primary key columns
- Use relationships tests to validate foreign key references
- Add accepted_values tests for categorical columns like order_status
- Use dbt_utils.expression_is_true for business rule validation
- Configure freshness checks on source definitions
Using "dbt-transformation-patterns". What are incremental models and when should I use them?
Expected outcome:
- Incremental models process only new or changed data since last run
- Use when tables exceed 1 million rows to reduce runtime
- Configure with unique_key to identify records and incremental_strategy for update logic
- Use is_incremental() macro to filter incoming data
- Supports merge, delete+insert, and insert_overwrite strategies
Security Audit
SafePure documentation skill containing only SQL and YAML examples for dbt patterns. The static analyzer produced false positives: YAML frontmatter markers were flagged as shell backticks, Jinja2 template syntax was flagged as command execution, and normal dbt CLI commands were flagged as reconnaissance. All findings are dismissed. No executable code, network calls, file system access, or external command execution capabilities exist.
Risk Factors
🌐 Network access (5)
⚙️ External commands (34)
Quality Score
What You Can Build
Standardize model layers
Adopt staging, intermediate, and marts patterns with consistent naming and structure.
Improve data quality
Add source and model tests with clear documentation for governance.
Start a dbt project
Set up dbt_project.yml and a clear folder layout for models.
Try These Prompts
Explain a simple staging, intermediate, and marts layout for my dbt project with naming examples.
Draft YAML tests and documentation for a customer dimension and orders fact model.
Suggest an incremental model config for payments with a safe incremental filter.
Show a macro pattern to standardize currency conversion and schema naming in dbt.
Best Practices
- Use a staging layer to clean sources once and reuse downstream across all models
- Add not_null and unique tests for every primary key column in your models
- Document models and columns as you build them with clear descriptions
Avoid
- Skip staging and join raw data directly into marts creates unmaintainable code
- Hardcode dates or values instead of using vars for configuration breaks portability
- Repeat logic across models instead of extracting to reusable macros increases maintenance