dbt-modeling

Create dbt models with CTE patterns and ref/source macros.

34|13|Updated Feb 1, 2022
One-click install
npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill dbt-modeling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dbt-modeling
Source: https://github.com/sfc-gh-dflippo/snowflake-dbt-demo/tree/main/.claude/skills/dbt-modeling
Command: npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill dbt-modeling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates guesswork and inconsistency in dbt model development by providing structured templates and best practices for creating production-quality data models.

Core Features & Use Cases

  • CTE Pattern Implementation: Enforces consistent SQL structure with import, logical, and final CTEs for readability and maintainability.
  • Layer-Specific Templates: Provides ready-to-use patterns for bronze (staging), silver (intermediate), and gold (dimension/fact) models.
  • Use Case: Imagine you need to create a customer segmentation model. Use this Skill to structure it with proper CTEs, implement RFM scoring, and create a dimension table ready for BI tools.

Quick Start

Use the dbt-modeling skill to help me write a staging model for my salesforce accounts table that includes data cleaning and standardization.

Frequently Asked Questions about dbt-modeling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure dbt models with CTEs for better SQL readability?

CTE patterns organize dbt models into import, logical, and final sections for clarity and maintainability. This structure separates data sourcing, business logic, and output formatting, making models easier to debug, test, and refactor across bronze, silver, and gold layers.

What's the difference between bronze, silver, and gold models in dbt?

Bronze (staging) models clean and standardize raw source data. Silver (intermediate) models apply business logic and transformations. Gold (dimension/fact) models create analytics-ready tables for BI tools. Each layer builds on the previous one with increasing refinement.

How do I convert existing SQL into production-quality dbt models?

Convert SQL to dbt templates by replacing hardcoded table names with {{ source() }} and {{ ref() }} macros, organizing logic into CTEs, adding explicit data type casts, and including metadata columns like dbt_loaded_at and dbt_updated_at for lineage and audit trails.

Can I use dbt models for customer segmentation and RFM scoring?

Yes. dbt models support complex analytics like RFM scoring and customer segmentation by organizing calculations in silver-layer intermediate models, then materializing results as gold-layer dimension tables ready for BI consumption and reporting.

What column naming and metadata standards should I follow in dbt?

Standardize column naming conventions across models, use explicit data type casts for consistency, and include system metadata columns (dbt_loaded_at, dbt_updated_at) to track data freshness and lineage. This ensures maintainability and reduces downstream analytics errors.

Do dbt models work with Snowflake data warehouses?

Yes. dbt models are compatible with Snowflake and integrate seamlessly with its SQL engine. Use {{ ref() }} and {{ source() }} to manage dependencies, apply CTE patterns for Snowflake's query optimization, and leverage Snowflake-specific features within your dbt project.