From altimateai-data-engineering-skills
Converts legacy SQL (stored procedures, views, raw SQL) into modular dbt models with layered staging, intermediate, and mart structure. Validates each layer incrementally.
How this skill is triggered — by the user, by Claude, or both
Slash command
/altimateai-data-engineering-skills:migrating-sql-to-dbtThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Don't convert everything at once. Build and validate layer by layer.**
Don't convert everything at once. Build and validate layer by layer.
cat <legacy_sql_file>
Identify all tables referenced in the query.
# Search for existing models/sources that reference the table
grep -r "<table_name>" models/ --include="*.sql" --include="*.yml"
find models/ -name "*.sql" | xargs grep -l "<table_name>"
For each table referenced in the legacy SQL:
Only proceed to intermediate/mart layers after all dependencies exist.
# models/staging/sources.yml
version: 2
sources:
- name: raw_database
schema: raw_schema
tables:
- name: orders
description: Raw orders from source system
- name: customers
description: Raw customer records
One staging model per source table. Follow existing project naming conventions.
Build before proceeding:
dbt build --select <staging_model>
Extract complex joins/logic into intermediate models.
Build incrementally:
dbt build --select <intermediate_model>
Final business-facing model with aggregations.
# Build entire lineage
dbt build --select +<final_model>
dbt show --select <final_model>
{{ config(materialized='ephemeral') }}{{ var("name") }}npx claudepluginhub altimateai/data-engineering-skillsProvides dbt patterns for model organization in staging, intermediate, and marts layers, including project structure, sources, configs, SQL examples, and testing setups. Useful for data transformation projects.
Safely refactors dbt models with downstream impact analysis. Extracts CTEs to intermediate models, creates macros, and renames columns while checking all downstream dependencies.
Provides dbt patterns for building staging, intermediate, and marts data models, incremental materializations, schema tests, and transformation pipelines in analytics engineering.