askill
dbt-skill

dbt-skillSafety 100Repository

Use when working with dbt (data build tool) - creating models, writing tests, CI/CD pipelines, materializations, sources, staging/intermediate/marts layers, Snowflake/BigQuery warehouse configuration, incremental strategies, Jinja macros, data quality, semantic layer, or making analytics engineering decisions

1 stars
1.2k downloads
Updated 2/22/2026

Package Files

Loading files...
SKILL.md

dbt Skill for Claude

Comprehensive dbt guidance: project structure, modeling, testing, CI/CD, production patterns. Targets Snowflake and BigQuery. Beginner-friendly with progressive scaling.

When to Use

Activate when: creating/modifying dbt models, choosing materializations, structuring layers, setting up tests, implementing CI/CD, configuring sources/freshness, writing Jinja macros, reviewing dbt projects, making analytics engineering decisions.

Skip when: basic SQL syntax, warehouse admin, raw pipeline config (Fivetran/Airbyte), BI tool config.

Core Principles

  1. DRY via ref()/source() -- never hardcode table names
  2. Single Source of Truth -- each concept defined once; staging = entry point, marts = consumer interface
  3. Idempotent Transformations -- dbt run twice produces identical results
  4. Test Everything -- every model has at minimum PK uniqueness and not-null tests
  5. Progressive Complexity -- start with views/tables, add complexity when volume demands it

Project Structure

dbt_project/
├── dbt_project.yml
├── packages.yml
├── profiles.yml                 # local only, not committed
├── models/
│   ├── staging/                 # 1:1 with source tables
│   │   └── <source>/
│   │       ├── _<source>__models.yml
│   │       ├── _<source>__sources.yml
│   │       └── stg_<source>__<entity>.sql
│   ├── intermediate/            # business logic, joins, pivots
│   │   └── <domain>/
│   └── marts/                   # business-facing tables
│       └── <domain>/
│           ├── _<domain>__models.yml
│           ├── fct_<entity>.sql
│           └── dim_<entity>.sql
├── macros/
├── tests/
│   └── generic/
├── seeds/
├── snapshots/
└── analyses/

Layer Decision Matrix

LayerMaterializationPurposeNamingTests
StagingviewClean/rename raw data, 1:1 with sourcestg_<source>__<entity>not_null, unique on PK
IntermediateephemeralBusiness logic, joins, pivotsint_<entity>_<verb>edTested via downstream
Martstable/incrementalBusiness-facing facts and dimensionsfct_<entity>, dim_<entity>Full coverage

Materialization Decision Matrix

SituationMaterializationWhy
Staging modelsviewAlways fresh, minimal storage
Intermediate logicephemeralZero cost, inlined as CTE
Marts < 100M rowstableSimple, fast reads
Marts > 100M rowsincrementalProcess only new/changed data
SCD Type 2snapshotTrack historical changes

ref() and source() Rules

  1. source() only in staging -- staging is the sole gateway to raw data
  2. ref() everywhere else
  3. Never skip layers -- marts must not ref() staging directly
  4. Never hardcode schema names

SQL Style

  • Leading commas, lowercase keywords, CTEs over subqueries
  • Explicit columns in marts (no select *), final CTE named final
  • 4-space indentation, one column per line

Source Configuration

Define sources in _<source>__sources.yml with loaded_at_field and freshness thresholds. Configure warn_after and error_after per table.

ConceptSnowflakeBigQuery
Top-level containerDatabaseProject
Schema groupingSchemaDataset

Warehouse Quick Reference

ConfigSnowflakeBigQuery
Profile typesnowflakebigquery
AuthUser/password or key-pairOAuth or service account
Schema gendatabase.schema.modelproject.dataset.model
Incremental defaultmergemerge
PartitioningAutomatic micro-partitionspartition_by required for large tables
Clusteringcluster_by (automatic)cluster_by (manual)
Cost modelCredits (compute time)Bytes scanned / Slots

Common Commands

CommandPurpose
dbt buildRun + test in DAG order (recommended)
dbt build --select +modelBuild model and all ancestors
dbt build --select model+Build model and all descendants
dbt build --select tag:financeAll models tagged finance
dbt build --select state:modified+Modified + descendants (Slim CI)
dbt source freshnessCheck source freshness
dbt depsInstall packages
dbt docs generate && dbt docs serveDocumentation site

Reference Files

Load on demand when detailed guidance is needed:

ReferenceTopics
Testing & QualitySchema/generic/singular/unit tests, dbt-expectations, layer strategy
CI/CD & DeploymentSlim CI, GitHub Actions, dbt Cloud, environments, blue/green, SQLFluff
Jinja, Macros & PackagesJinja fundamentals, custom macros, packages, debugging
Incremental & PerformanceMicrobatch, merge, delete+insert, insert_overwrite, warehouse tuning
Data Quality & ObservabilitySource freshness, Elementary, anomaly detection, alerting, incidents
Semantic Layer & GovernanceMetricFlow, contracts, versions, access controls, dbt Mesh

License

Apache License 2.0. See LICENSE file for full terms.

Copyright 2026 Daniel Song

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/24/2026

Comprehensive dbt skill with excellent structure, clear when-to-use guidance, multiple decision matrices, warehouse comparisons, and reference files. Well-organized with tables, tree structures, and practical commands. Not internal-only - general dbt guidance applicable to any project. Minor gap: lacks step-by-step walkthroughs but reference files compensate. High actionability, reusability, and clarity.

100
95
95
95
90

Metadata

Licenseunknown
Version-
Updated2/22/2026
Publisherdtsong

Tags

ci-cddatabasegithubgithub-actionsllmsecuritytesting