creating-dbt-models

creating-dbt-models is a skill for Claude Code from AltimateAI/data-engineering-skills. It costs 122 tokens per session (875 once invoked), scanned A, original, MIT.

A guide for creating and changing dbt models, which are SQL-defined tables or views managed by dbt. It emphasizes learning the project's conventions before writing code and checking the built result afterward.

In plain words
What is it for?
Use it to create or modify dbt models, tables, or SQL logic, including choosing columns, defining the row meaning, checking upstream data, and verifying the result.
Why use it?
A model can compile successfully yet still produce incorrect data or violate project conventions. The guide requires building the model and inspecting its output.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dbt-skills plugin — 7 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/altimateai/data-engineering-skills/creating-dbt-models
Any agent
npx skills add AltimateAI/data-engineering-skills --skill creating-dbt-models
Clone the repo
git clone --depth 1 https://github.com/AltimateAI/data-engineering-skills

Made for: Claude Code.

Or install dbt-skills, the plugin that ships this one along with the rest of its 7 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for creating-dbt-models

README.md
[![agentmods](https://agentmods.dev/badge/skills/altimateai/data-engineering-skills/creating-dbt-models.svg)](https://agentmods.dev/skills/altimateai/data-engineering-skills/creating-dbt-models)
Your own site
<a href="https://agentmods.dev/skills/altimateai/data-engineering-skills/creating-dbt-models"><img src="https://agentmods.dev/badge/skills/altimateai/data-engineering-skills/creating-dbt-models.svg" alt="Measured on agentmods" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 875 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00122 $0.00875
Opus 5 $0.00061 $0.00438
Sonnet 5 $0.00024 $0.00175
Haiku 4.5 $0.00012 $0.00088

Measured 6d ago against content hash 601c707bdd0a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

creating-dbt-models scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/dbt/creating-dbt-models/SKILL.md · 133 lines

How it starts

The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.

dbt Model Development

Read before you write. Build after you write. Verify your output.

Critical Rules

  1. ALWAYS run dbt build after creating/modifying models - compile is NOT enough
  2. ALWAYS verify output after build using dbt show - don't assume success
  3. If build fails 3+ times, stop and reassess your entire approach

Workflow

1. Understand the Task Requirements

  • What columns are needed? List them explicitly.
  • What is the grain of the table (one row per what)?
  • What calculations or aggregations are required?

2. Discover Project Conventions

cat dbt_project.yml
find models/ -name "*.sql" | head -20

Read 2-3 existing models to learn naming, config, and SQL patterns.

3. Find Similar Models

# 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.

4. Check Upstream Data

# Preview upstream data if needed
dbt show --select <upstream_model> --limit 10

5. Write the Model

Follow discovered conventions. Match the required columns exactly.

6. Compile (Syntax Check)

dbt compile --select <model_name>

7. BUILD - MANDATORY

This step is REQUIRED. Do NOT skip it.

dbt build --select <model_name>

If build fails:

  1. Read the error carefully
  2. Fix the specific issue
  3. Run build again
  4. If fails 3+ times, step back and reassess approach

8. Verify Output (CRITICAL)

Build success does NOT mean correct output.

# Check the table was created and preview data
dbt show --select <model_name> --limit 10

Verify:

  • Column names match requirements exactly
  • Row count is reasonable
  • Data values look correct
  • No unexpected NULLs

9. Verify Calculations Against Sample Data

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') }}
"

Read the full file on GitHub · 133 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 133 lines · 122 tokens per session scan A 601c707bdd0a

Subscribe to this mod's changes

creating-dbt-models is a skill published in the GitHub repository AltimateAI/data-engineering-skills (122 stars, last pushed 1mo ago), licensed MIT. It adds 122 tokens to every session and 875 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

explain-sql

Explain complex SQL queries in plain English with Mermaid data flow diagrams, performance annotations, and anti-pattern detection. Use when the user pastes a SQL query and asks "what does this do?", "explain this query", or needs to understand inherited SQL, CTEs, window functions, recursive queries, or dbt model…

adityawrk/analytics-with-claude-code · 72 tokens

sql-optimizer

Analyze and optimize slow SQL queries. Use when the user says a query is slow, asks to optimize or speed up SQL, wants to find anti-patterns, needs index recommendations, or asks for a query rewrite. Also use when EXPLAIN output shows full table scans or poor join strategies.

adityawrk/analytics-with-claude-code · 63 tokens

backend-patterns

Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.

Methasit-Pun/data_engineer_claude_skills · 31 tokens

dbt-patterns

The most important design decision in a dbt project is how to organize model layers. A clear layer structure means every model has exactly one place it belongs, and anyone reading the project can understand what each model does.

Methasit-Pun/data_engineer_claude_skills · 143 tokens

data-migration

Moving data between systems safely — cutover planning, backfill strategies, dual-write patterns, validation, rollback procedures, and zero-downtime migration techniques. Use this skill whenever the team is migrating from one database or warehouse to another (MySQL → Snowflake, Redshift → BigQuery, on-prem → cloud)…

Methasit-Pun/data_engineer_claude_skills · 160 tokens

schema-design

Data modeling for analytical workloads — star schema, snowflake schema, one big table (OBT), slowly changing dimensions (SCD), normalization tradeoffs, grain definition, and surrogate key strategies. Use this skill whenever the user is designing or reviewing a data warehouse schema, planning a fact/dimension table…

Methasit-Pun/data_engineer_claude_skills · 143 tokens