Agent skill

Migrating SQL To Dbt

by AltimateAI in AltimateAI/data-engineering-skills

Converts legacy SQL to modular dbt models. An agent skill from AltimateAI/data-engineering-skills.

MITAuto-check passedData & Analytics

Install Migrating SQL To Dbt

skills CLI
$ npx skills add AltimateAI/data-engineering-skills --skill migrating-sql-to-dbt -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AltimateAI/data-engineering-skills migrating-sql-to-dbt --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AltimateAI/data-engineering-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dbt/migrating-sql-to-dbt .claude/skills/migrating-sql-to-dbt && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
migrating-sql-to-dbt
GitHub stars
128
Token cost
~762 tokens
SKILL.md length
227 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Converts legacy SQL to modular dbt models. An agent skill from AltimateAI/data-engineering-skills.

  • Works in 7 steps: Analyze Legacy SQL → Check What Already Exists → Create Missing Sources → …
  • Migrating SQL to dbt for:
  • SKILL.md covers Workflow, Migration Checklist, Common Migration Patterns and Anti-Patterns
  • Calls dbt

What it does

Migrating SQL To Dbt is an agent skill from AltimateAI/data-engineering-skills. 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.

Its SKILL.md is about 760 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Data & Analytics, covering Data pipelines and ETL and SQL. It works with dbt and SQL. The repository describes itself as: Skills related to Data Engineering Work for Claude Code. The licence is MIT.

When your agent uses it

  • Migrating SQL to dbt for:
  • Converting stored procedures
  • Raw SQL files to dbt models
  • Task mentions migrate

Example prompts

  • “migrate”
  • “convert”
  • “legacy SQL”
  • “/migrating-sql-to-dbt”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Analyze Legacy SQL
  2. Check What Already Exists
  3. Create Missing Sources
  4. Build Staging Layer
  5. Build Intermediate Layer (if needed)
  6. Build Mart Layer
  7. Validate Migration

What it can do on your machine

Read from SKILL.md and the folder at commit 705c68b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dbt

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Migrating SQL To Dbt loads about 762 tokens when it runs. Until then it costs about 120 tokens; SKILL.md has 227 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~120
When it runs · the whole SKILL.md, loaded when a task matches
~762

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from AltimateAI/data-engineering-skills at commit 705c68b, republished under its MIT licence (© AltimateAI). 227 words, ~762 tokens.

Download SKILL.mdSave it as .claude/skills/migrating-sql-to-dbt/SKILL.md (or your agent's skills folder).
name
migrating-sql-to-dbt
description
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.

dbt Migration

Don't convert everything at once. Build and validate layer by layer.

Workflow

1. Analyze Legacy SQL
bash
cat <legacy_sql_file>

Identify all tables referenced in the query.

2. Check What Already Exists
bash
# 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:

  1. Check if an existing model already references this table
  2. Check if a source definition exists
  3. If neither exists, ask user: "Table X not found - should I create it as a source?"

Only proceed to intermediate/mart layers after all dependencies exist.

3. Create Missing Sources
yaml
# 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
4. Build Staging Layer

One staging model per source table. Follow existing project naming conventions.

Build before proceeding:

bash
dbt build --select <staging_model>
5. Build Intermediate Layer (if needed)

Extract complex joins/logic into intermediate models.

Build incrementally:

bash
dbt build --select <intermediate_model>
6. Build Mart Layer

Final business-facing model with aggregations.

7. Validate Migration
bash
# Build entire lineage
dbt build --select +<final_model>
dbt show --select <final_model>

Migration Checklist

  • All source tables identified and documented
  • Sources.yml created with descriptions
  • Staging models: 1:1 with sources, renamed columns
  • Intermediate models: business logic extracted
  • Mart models: final aggregations
  • Each layer compiles successfully
  • Each layer builds successfully
  • Row counts match original (manual validation)
  • Tests added for key constraints

Common Migration Patterns

  • Nested subqueries → Separate models (staging → intermediate → mart)
  • Temp tables → Ephemeral materialization {{ config(materialized='ephemeral') }}
  • Hardcoded values → Variables {{ var("name") }}

Anti-Patterns

  • Converting entire legacy query to single dbt model
  • Skipping the staging layer
  • Not validating each layer before proceeding
  • Keeping hardcoded values instead of using variables
  • Not documenting business logic during migration

© AltimateAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/dbt/migrating-sql-to-dbt of AltimateAI/data-engineering-skills.

Open the folder on GitHubat commit 705c68b

Compare with similar skills

Migrating SQL To Dbt next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Migrating SQL To Dbt compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Migrating SQL To Dbt this skillAltimateAI/data-engineering-skills128—~762Automated safety check: PassMIT
Analytics Engineerborghei/Claude-Skills881—~3.4kAutomated safety check: PassMIT
Databricks JobsKilo-Org/kilo-marketplace1901 repos~3.1kAutomated safety check: PassCustom licence
Monte Carlo Validation Notebooksickn33/agentic-awesome-skills47k1 repos~1.1kAutomated safety check: PassMIT
Monte Carlo Preventsickn33/agentic-awesome-skills47k1 repos~3.3kAutomated safety check: PassMIT
Data Quality Checksmohitagw15856/pm-claude-skills1.4k—~919Automated safety check: PassMIT

Similar skills

  • Analytics Engineer

    borghei/Claude-Skills

    Analytics engineering across data modeling, dbt, transformation, and semantic layers.

    881 GitHub stars~3.4k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed
  • Databricks Jobs

    Kilo-Org/kilo-marketplace

    Develop and deploy Lakeflow Jobs on Databricks via DABs, Python SDK, or the CLI.

    190 GitHub starsUsed in 1 repo~3.1k tokens
    Data & AnalyticsAuto-check passed
  • Monte Carlo Validation Notebook

    sickn33/agentic-awesome-skills

    Generates SQL validation notebooks for dbt PR changes with before/after comparison queries.

    47k GitHub starsUsed in 1 repo~1.1k tokens
    Data & AnalyticsAuto-check passed
  • Monte Carlo Prevent

    sickn33/agentic-awesome-skills

    Surfaces Monte Carlo data observability context (table health, alerts, lineage, blast radius) before SQL/dbt edits.

    47k GitHub starsUsed in 1 repo~3.3k tokens
    Data & AnalyticsAuto-check passed
  • Data Quality Checks

    mohitagw15856/pm-claude-skills

    Design the data quality checks for a table or pipeline across the standard dimensions.

    1.4k GitHub stars~919 tokensUpdated yesterday
    Data & AnalyticsAuto-check passed
  • Dbt Model Spec

    mohitagw15856/pm-claude-skills

    Spec a dbt model — its grain, sources, transformations, tests, and materialization.

    1.4k GitHub stars~939 tokensUpdated yesterday
    Data & AnalyticsAuto-check passed

More from AltimateAI/data-engineering-skills

All 12 skills in this repo
  • Altimate Data Warehouse Delegate

    AltimateAI/data-engineering-skills

    Delegates dbt and warehouse tasks such as lineage, migrations and cost attribution to the altimate-code CLI agent and relays its answer back.

    128 GitHub stars~1.4k tokensUpdated 6 days ago
    Auto-check passed
  • dbt Model Builder

    AltimateAI/data-engineering-skills

    Creates or modifies dbt models in line with a project's own conventions, then runs dbt build and dbt show to check the output instead of stopping at compile.

    128 GitHub stars~890 tokensUpdated 6 days ago
    Auto-check passed
  • dbt Error Debugging

    AltimateAI/data-engineering-skills

    Walks through fixing dbt compilation, database and test errors: read the full error, check upstream models, apply a fix, then verify with dbt build and a data preview.

    128 GitHub stars~1.1k tokensUpdated 6 days ago
    Auto-check passed
  • dbt Incremental Models

    AltimateAI/data-engineering-skills

    Helps choose an incremental strategy, design a reliable unique_key and debug failing dbt incremental models, and says when a plain table is the better choice.

    128 GitHub stars~2.3k tokensUpdated 6 days ago
    Auto-check passed
  • dbt Model Documentation

    AltimateAI/data-engineering-skills

    Writes model and column descriptions in dbt schema.yml files, matching the project's existing documentation style and recording grain, business rules and caveats.

    128 GitHub stars~1.2k tokensUpdated 6 days ago
    Auto-check passed
  • Expensive Snowflake Query Finder

    AltimateAI/data-engineering-skills

    Ranks the costliest, slowest or heaviest-scanning Snowflake queries from query history and suggests how to optimize them.

    128 GitHub stars~662 tokensUpdated 6 days ago
    Auto-check passed

Works with

Questions about Migrating SQL To Dbt

What does Migrating SQL To Dbt do?

Converts legacy SQL to modular dbt models. An agent skill from AltimateAI/data-engineering-skills. Migrating SQL To Dbt is an agent skill from AltimateAI/data-engineering-skills. Converts legacy SQL to modular dbt models.

When should I use Migrating SQL To Dbt?

Migrating SQL To Dbt fits situations like: migrating SQL to dbt for:; converting stored procedures; raw SQL files to dbt models; task mentions migrate.

How do I install Migrating SQL To Dbt in Claude Code?

Run `npx skills add AltimateAI/data-engineering-skills --skill migrating-sql-to-dbt -a claude-code`. Or copy the skill folder (skills/dbt/migrating-sql-to-dbt in AltimateAI/data-engineering-skills) into .claude/skills/migrating-sql-to-dbt in your project. Claude Code loads it when a task matches its description.

How do I install Migrating SQL To Dbt in Codex?

Run `npx skills add AltimateAI/data-engineering-skills --skill migrating-sql-to-dbt -a codex`. Or copy the skill folder (skills/dbt/migrating-sql-to-dbt in AltimateAI/data-engineering-skills) into .agents/skills/migrating-sql-to-dbt in your project. Codex loads it when a task matches its description.

Can I use Migrating SQL To Dbt in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AltimateAI/data-engineering-skills --skill migrating-sql-to-dbt -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/migrating-sql-to-dbt, .gemini/skills/migrating-sql-to-dbt, .github/skills/migrating-sql-to-dbt and .opencode/skills/migrating-sql-to-dbt in your project.

What does Migrating SQL To Dbt need to run?

Going by SKILL.md and its folder, Migrating SQL To Dbt needs the command-line tools its instructions call (dbt).

Does Migrating SQL To Dbt access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Migrating SQL To Dbt safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Migrating SQL To Dbt use?

Migrating SQL To Dbt is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Migrating SQL To Dbt use?

About 762 tokens (SKILL.md is roughly 3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Migrating SQL To Dbt?

Skills that share tags, products or a category with Migrating SQL To Dbt: Analytics Engineer (borghei/Claude-Skills, 881 stars), Databricks Jobs (Kilo-Org/kilo-marketplace, 190 stars), Monte Carlo Validation Notebook (sickn33/agentic-awesome-skills, 47k stars) and Monte Carlo Prevent (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Migrating SQL To Dbt?

AltimateAI (a GitHub organization) maintains it in AltimateAI/data-engineering-skills, which has 128 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 1, 2026.

Source: AltimateAI/data-engineering-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.