dbt-architecture
БесплатноБез исполняемых скриптовНе проверенdbt project structure using medallion architecture (bronze/silver/gold layers). Use this skill when planning project organization, establishing folder…
от sfc-gh-dflippo★ 35 звёзд на GitHubОб этом скилле
dbt Architecture
Purpose
Transform AI agents into experts on dbt project architecture and medallion layer patterns, providing guidance on structuring production-grade dbt projects with proper layer separation, naming conventions, and configuration strategies.
When to Use This Skill
Activate this skill when users ask about:
- Planning dbt project structure and folder organization
- Implementing medallion architecture (bronze/silver/gold)
- Establishing naming conventions for models and columns
- Configuring folder-level settings in dbt_project.yml
- Ensuring proper model dependencies and data flow
- Understanding layer separation and architectural patterns
- Setting up tag inheritance strategies
Core Philosophy: Medallion Architecture + Best Practices Integration
Medallion architecture demonstrates how dbt best practices seamlessly integrate with a layered data approach:
- Bronze Layer = Staging Models (
stg_) - One-to-one source relationships - Silver Layer = Intermediate Models (
int_) - Business logic transformations - Gold Layer = Marts (
dim_,fct_) - Business-ready data products
Every recommendation follows both architectural principles and dbt best practices simultaneously.
Medallion Architecture Quick Reference
Three Layers
Bronze (Staging):
- Naming:
stg_{source}__{table} - Materialization:
ephemeral - Purpose: One-to-one source cleaning
- Rules: No joins, no business logic
Silver (Intermediate):
- Naming:
int_{entity}__{description} - Materialization:
ephemeralortable - Purpose: Business logic, enrichment
- Rules: No direct source references
Gold (Marts):
- Naming:
dim_{entity}orfct_{process} - Materialization:
tableorincremental - Purpose: Business-ready data products
- Rules: Fully tested, documented, optimized
Critical Architectural Rules
Always enforce these patterns:
- ✅ No Direct Joins to Source - Models reference staging (
ref('stg_*')), neversource()directly - ✅ One-to-One Staging - Each source table has exactly ONE staging model
- ✅ Proper Layering - Clear flow: staging → intermediate → marts
- ✅ Standardized Naming - Consistent
stg_,int_,dim_,fct_prefixes - ✅ Use ref() and source() - No hard-coded table references
- ✅ Folder-Level Configuration - Set common settings in dbt_project.yml
Official dbt Documentation: How we structure our dbt projects
Bronze Layer: Staging Models
Purpose: One-to-one relationship with source tables. Light cleaning and standardization only.
Materialization: ephemeral (compiled as CTEs)
Naming: stg_{source}__{table}.sql
Bronze Template
-- models/bronze/stg_tpc_h__customers.sql
{{ config(materialized='ephemeral') }}
select
-- Primary key (renamed)
c_custkey as customer_id,
-- Attributes (cast and renamed)
c_name as customer_name,
c_address as customer_address,
c_phone as phone_number,
c_acctbal as account_balance,
-- Metadata
current_timestamp() as dbt_loaded_at
from {{ source('tpc_h', 'customer') }}
Bronze Rules
✅ DO:
- One source table → One staging model
- Reference sources using
{{ source() }} - Rename columns to standard naming
- Cast data types
- Basic cleaning (trim, upper/lower)
❌ DON'T:
- Join between sources
- Add business logic
- Aggregate data
- Hard-code table names
Silver Layer: Intermediate Models
Purpose: Reusable business logic and complex transformations. Sits between staging and marts.
Materialization: ephemeral (reusable logic) or table (complex computations)
Naming: int_{entity}__{description}.sql
Silver Template
-- models/silver/int_customers__with_orders.sql
{{ config(materialized='ephemeral') }}
with customers as (
select * from {{ ref('stg_tpc_h__customers') }}
),
orders as (
select * from {{ ref('stg_tpc_h__orders') }}
),
customer_metrics as (
select
customer_id,
count(*) as total_orders,
sum(order_total) as lifetime_value,
min(order_date) as first_order_date
from orders
group by customer_id
)
select
c.customer_id,
c.customer_name,
coalesce(m.total_orders, 0) as total_orders,
coalesce(m.lifetime_value, 0) as lifetime_value,
m.first_order_date
from customers c
left join customer_metrics m on c.customer_id = m.customer_id
Silver Rules
✅ DO:
- Reference staging + other intermediate models
- Add business logic and aggregations
- Create reusable components
- Use CTEs for clarity
❌ DON'T:
- Reference sources directly
- Add final presentation logic
- Create one-time-use models
Gold Layer: Marts Models
Purpose: Business-ready data products optimized for BI tools and end users.
Materialization: table (dimensions) or incremental (large fa
Установить dbt-architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл dbt-architecture?
dbt project structure using medallion architecture (bronze/silver/gold layers). Use this skill when planning project organization, establishing folder structure, defining naming conventions, implementing layer-based configuration, or ensuring proper model dependencies and architectural patterns.
Как установить скилл dbt-architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dbt-architecture запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic