refactoring-dbt-models
Installation
SKILL.md
dbt Refactoring
Find ALL downstream dependencies before changing. Refactor in small steps. Verify output after each change.
Workflow
1. Analyze Current Model
cat models/<path>/<model_name>.sql
Identify refactoring opportunities:
- CTEs longer than 50 lines → extract to intermediate model
- Logic repeated across models → extract to macro
- Multiple joins in sequence → split into steps
- Complex WHERE clauses → extract to staging filter
2. Find All Downstream Dependencies
Related skills