Loading...
Loading...
Converts legacy SQL to modular dbt models. Use when migrating SQL to dbt for: (1) Converting stored procedures, views, or raw SQL files to dbt models (2) Task mentions "migrate", "convert", "legacy SQL", "transform to dbt", or "modernize" (3) Breaking monolithic queries into modular layers (discovers project conventions first) (4) Porting existing data pipelines or ETL to dbt patterns Checks for existing models/sources, builds and validates layer by layer.
npx skill4agent add altimateai/data-engineering-skills migrating-sql-to-dbtcat <legacy_sql_file># 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>"# 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 recordsdbt build --select <staging_model>dbt build --select <intermediate_model># Build entire lineage
dbt build --select +<final_model>
dbt show --select <final_model>{{ config(materialized='ephemeral') }}{{ var("name") }}