skills/dbt/creating-dbt-models/SKILL.md
Creates dbt models following project conventions. Use when working with dbt models for: (1) Creating new models (any layer - discovers project's naming conventions first) (2) Task mentions "create", "build", "add", "write", "new", or "implement" with model, table, or SQL (3) Modifying existing model logic, columns, joins, or transformations (4) Implementing a model from schema.yml specs or expected output requirements Discovers project conventions before writing. Runs dbt build (not just compile) to verify.
npx skillsauth add altimateai/data-engineering-skills creating-dbt-modelsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Read before you write. Build after you write. Verify your output.
dbt build after creating/modifying models - compile is NOT enoughdbt show - don't assume successcat dbt_project.yml
find models/ -name "*.sql" | head -20
Read 2-3 existing models to learn naming, config, and SQL patterns.
# Find models with similar purpose
find models/ -name "*agg*.sql" -o -name "*fct_*.sql" | head -5
Learn from existing models: join types, aggregation patterns, NULL handling.
# Preview upstream data if needed
dbt show --select <upstream_model> --limit 10
Follow discovered conventions. Match the required columns exactly.
dbt compile --select <model_name>
This step is REQUIRED. Do NOT skip it.
dbt build --select <model_name>
If build fails:
Build success does NOT mean correct output.
# Check the table was created and preview data
dbt show --select <model_name> --limit 10
Verify:
For models with calculations, verify correctness manually:
# Pick a specific row and verify calculation by hand
dbt show --inline "
select *
from {{ ref('model_name') }}
where <primary_key> = '<known_value>'
" --limit 1
# Cross-check aggregations
dbt show --inline "
select count(*), sum(<column>)
from {{ ref('model_name') }}
"
For example, if calculating total_revenue = quantity * price:
Before declaring done, re-read the original request:
tools
Delegates data engineering tasks to altimate-code, a specialized CLI agent with 100+ purpose-built data tools — SQL analysis, column-level lineage, dbt build/test/run, warehouse profiling, FinOps, and connectivity to Snowflake, BigQuery, Redshift, Databricks, Postgres, MySQL, DuckDB. Use this skill when the task needs live warehouse access, column lineage, multi-step data exploration, dbt builds against a real warehouse, or when the user explicitly invokes "altimate", "altimate-code", or "the data agent".
testing
Optimizes Snowflake SQL query performance from provided query text. Use when optimizing Snowflake SQL for: (1) User provides or pastes a SQL query and asks to optimize, tune, or improve it (2) Task mentions "slow query", "make faster", "improve performance", "optimize SQL", or "query tuning" (3) Reviewing SQL for performance anti-patterns (function on filter column, implicit joins, etc.) (4) User asks why a query is slow or how to speed it up
development
Optimizes Snowflake query performance using query ID from history. Use when optimizing Snowflake queries for: (1) User provides a Snowflake query_id (UUID format) to analyze or optimize (2) Task mentions "slow query", "optimize", "query history", or "query profile" with a query ID (3) Analyzing query performance metrics - bytes scanned, spillage, partition pruning (4) User references a previously run query that needs optimization Fetches query profile, identifies bottlenecks, returns optimized SQL with expected improvements.
data-ai
Finds and ranks expensive Snowflake queries by cost, time, or data scanned. Use when: (1) User asks to find slow, expensive, or problematic queries (2) Task mentions "query history", "top queries", "most expensive", or "slowest queries" (3) Analyzing warehouse costs or identifying optimization candidates (4) Finding queries that scan the most data or have the most spillage Returns ranked list of queries with metrics and optimization recommendations.