원클릭으로
dbt-model-scaffolder
Generate dbt model boilerplate with tests, documentation, and best practices
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Generate dbt model boilerplate with tests, documentation, and best practices
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Generate comprehensive PR descriptions from project context and git changes
Framework for when to use Skills, Agents, or Patterns for organizing knowledge in the ADLC platform with decision criteria and migration strategies
Validate documentation completeness and quality before project completion
Initialize new ADLC project with standard directory structure, documentation templates, and git branch
Complete reference for MCP tool integration across specialist and role agents including server inventory, tool recommendations, and security protocols
Cross-Tool Integration Pattern: AWS Infrastructure + Documentation
| name | dbt-model-scaffolder |
| description | Generate dbt model boilerplate with tests, documentation, and best practices |
| version | 1.0.0 |
Automatically generates dbt model files with proper structure, tests, documentation, and metadata.
Save 15-20 minutes per model by:
This skill is invoked when creating new dbt models.
Trigger phrases:
Required inputs:
model_name: Model name (lowercase_snake_case)model_layer: Layer (staging, intermediate, mart)source_table: Source table or upstream model (if staging)description: Brief model descriptionbusiness_owner: (optional) Team or person responsibleAsk user if not provided:
I need information about the dbt model:
- Model name (e.g., stg_salesforce__accounts):
- Layer (staging/intermediate/mart):
- Source or upstream model:
- Brief description:
By layer:
Staging (stg_):
Intermediate (int_):
Mart (mart_) or Dimension/Fact (dim_/fct_):
Template selection based on layer:
templates/staging_model.sqltemplates/intermediate_model.sqltemplates/mart_model.sqlFile location:
models/{layer}/{model_name}.sql
Template variables:
{model_name}{source_or_ref} - Source table or ref() to upstream model{description}{materialization} - table, view, incremental, ephemeralCreate or append to models/{layer}/schema.yml
Structure:
version: 2
models:
- name: {model_name}
description: {description}
config:
materialized: {materialization}
tags: [{layer}, {tags}]
meta:
owner: {business_owner}
layer: {layer}
columns:
{column_definitions}
By layer:
Staging models:
unique, not_nullnot_null for required fieldsIntermediate models:
not_null on join keysMart models:
Extract from source (if staging):
-- Query source for column names
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = '{source_table}'
Generate column entries:
columns:
- name: {column_name}
description: {description or TBD}
tests:
- {appropriate tests}
Common configs by layer:
Staging:
config:
materialized: view
tags: ['staging', 'source:{source_system}']
Intermediate:
config:
materialized: ephemeral # or table for large models
tags: ['intermediate']
Mart:
config:
materialized: table
tags: ['mart', '{domain}']
partition_by: {date_column} # if applicable
cluster_by: [{key_columns}] # if applicable
Staging model template:
{{
config(
materialized='view',
tags=['staging']
)
}}
with source as (
select * from {{ source('{source}', '{table}') }}
),
renamed as (
select
-- IDs
id as {model}_id,
-- Strings
name,
-- Numerics
amount,
-- Booleans
is_active,
-- Dates
created_at,
updated_at,
-- Metadata
_fivetran_synced as source_synced_at
from source
)
select * from renamed
Intermediate model template:
{{
config(
materialized='ephemeral',
tags=['intermediate']
)
}}
with model_a as (
select * from {{ ref('stg_source__table_a') }}
),
model_b as (
select * from {{ ref('stg_source__table_b') }}
),
joined as (
select
model_a.*,
model_b.additional_field
from model_a
left join model_b
on model_a.join_key = model_b.join_key
),
final as (
select
-- Add business logic here
from joined
)
select * from final
Mart model template:
{{
config(
materialized='table',
tags=['mart']
)
}}
with upstream as (
select * from {{ ref('int_model') }}
),
aggregated as (
select
dimension_column,
count(*) as record_count,
sum(metric_column) as total_metric
from upstream
group by 1
),
final as (
select
-- Final transformations
from aggregated
)
select * from final
Display to user:
✅ dbt Model Scaffolded: {model_name}
📁 Files created/updated:
- models/{layer}/{model_name}.sql
- models/{layer}/schema.yml
📋 Next steps:
1. Review and customize SQL logic in {model_name}.sql
2. Update column descriptions in schema.yml
3. Add business-specific tests if needed
4. Run: dbt run --select {model_name}
5. Run: dbt test --select {model_name}
🧪 Standard tests included:
- Primary key validation (unique + not_null)
- Required field checks
{additional layer-specific tests}
📚 Documentation template added - update with business context
Check: File models/{layer}/{model_name}.sql exists
Action: Ask user to confirm overwrite or choose different name
Check: Layer is one of: staging, intermediate, mart Action: Ask user to select valid layer
Check: Source exists in sources.yml (for staging models) Action: Warn user and include TODO in generated SQL
Check: Model already in schema.yml Action: Update existing entry or create new if not found
Every generated model must:
-- Naming: stg_{source}__{table}
-- Purpose: 1:1 with source, light transformations only
-- Materialization: view
-- Tests: Primary key, not_null on required fields
-- Naming: int_{entity}_{verb}
-- Purpose: Business logic, joins, calculations
-- Materialization: ephemeral or table (if large)
-- Tests: Grain, referential integrity
-- Naming: mart_{domain}_{entity} or dim_/fct_
-- Purpose: Final analytics layer, BI-ready
-- Materialization: table (with partitioning if large)
-- Tests: Comprehensive data quality
analytics-engineer: "Need new staging model for Salesforce accounts"
→ Invokes dbt-model-scaffolder skill
→ Gathers requirements
→ Generates model files
→ Returns summary
User: "Create dbt staging model for stg_salesforce__accounts"
→ Invokes dbt-model-scaffolder skill
→ Generates files
→ User customizes generated code
stg_{source}__{table} (double underscore)int_{entity}_{verb} (e.g., int_customers_joined){dim|fct}_{entity} or mart_{domain}_{entity}finalselect * from finalTime savings: 15-20 minutes per model Consistency: 100% models follow style guide Quality: All models have tests and documentation from start
Version: 1.0.0 Last Updated: 2025-10-21 Maintainer: ADLC Platform Team