Skip to content
Skills Library
Data & analytics · Building & coding

model-builder

/model-builder

Creates dbt models with proper layering (staging, marts), incremental strategies, and documentation. Use when creating dbt models, organizing data transformations, or implementing incremental models.

Licence
MIT
Last repository change
27.07.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Creates dbt models with proper layering (staging, marts), incremental strategies, and documentation. Use when creating dbt models, organizing data transformations, or implementing incremental models.

Original author description

Creates dbt models with proper layering (staging, marts), incremental strategies, and documentation. Use when creating dbt models, organizing data transformations, or implementing incremental models.

How it works

  1. Quick Start
  2. Instructions
  3. Model Layering
  4. Best Practices
  5. Advanced
Original SKILL.md headings · 168 lines, 414 words
SKILL.md preview
---
name: model-builder
description: Creates dbt models with proper layering (staging, marts), incremental strategies, and documentation. Use when creating dbt models, organizing data transformations, or implementing incremental models.
---

# dbt Model Builder

## Quick Start

Create well-structured dbt models following best practices for staging, intermediate, and mart layers.

## Instructions

### Step 1: Create staging models

Staging models clean and standardize raw data:

```sql
-- models/staging/stg_orders.sql
with source as (
    select * from {{ source('raw', 'orders') }}
),

renamed as (
    select
        order_id,
        customer_id,
        order_date,
        order_total,
        order_status,
        created_at,
        updated_at
    from source
)

select * from renamed
```

**Add schema file:**
```yaml
# models/staging/schema.yml
version: 2

models:
  - name: stg_orders
    description: Cleaned and standardized orders from raw data
    columns:
      - name: order_id
        description: Unique order identifier
        tests:
          - unique
          - not_null
      - name: customer_id
        description: Customer who placed the order
        tests:
          - not_null
```

### Step 2: Create mart models

Mart models contain business logic:

```sql
-- models/marts/fct_orders.sql
with orders as (
    select * from {{ ref('stg_orders') }}
),

customers as (
    select * from {{ ref('stg_customers') }}
),

final as (
    select
        orders.order_id,
        orders.customer_id,
        customers.customer_name,
        orders.order_date,
        orders.order_total,
        orders.order_status
    from orders
    left join customers
        on orders.customer_id = customers.customer_id
)

select * from final
```

### Step 3: Create incremental models

For large datasets, use incremental models:

```sql
-- models/marts/fct_events.sql
{{
    config(
        materialized='incremental',
        unique_key='event_id',
        on_schema_change='fail'
    )
}}

with events as (
    select * from {{ source('raw', 'events') }}
    
    {% if is_incremental() %}
    where event_timestamp > (select max(event_timestamp) from {{ this }})
    {% endif %}
)

select * from events
```

### Step 4: Add documentation

```yaml
# models/marts/schema.yml
version: 2

models:
  - name: fct_orders
    description: Order facts with customer information
    columns:
      - name: order_id
        description: Unique order identifier
        tests:
          - unique
          - not_null
      - name: order_total
        description: Total order amount
        tests:
          - not_null
          - dbt_utils.accepted_range:
              min_value: 0
```

## Model Layering

**Staging (stg_):**
- Clean and standardize raw data
- One-to-one with source tables
- Minimal transformations
- Column renaming and type casting

**Intermediate (int_):**
- Complex transformations
- Join multiple staging models
- Not exposed to end users

**Marts (fct_, dim_):**
- Business logic
- Fact and dimension tables
- Exposed to end users

## Best Practices

1. Follow naming conventions (stg_, int_, fct_, dim_)
2. Use CTEs for readability
3. Document all models and columns
4. Add tests to all models
5. Use refs for dependencies
6. Implement incremental models for large datasets
7. Configure materialization appropriately
8. Use sources for raw data

## Advanced

For detailed information, see:
- [Staging Patterns](reference/staging-patterns.md) - Staging model best practices
- [Marts Patterns](reference/marts-patterns.md) - Fact and dimension table patterns
- [Incremental](reference/incremental.md) - Incremental model strategies
Files in this package (4)
  • SKILL.md 4 KB
  • reference/incremental.md 1 KB
  • reference/marts-patterns.md 1 KB
  • reference/staging-patterns.md 1 KB

Versions

The database has no other skills named model-builder.

Database snapshot: 13.11.2026 · package version 36966e32a342 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100building-dbt-models
    Build well-structured dbt models — staging/intermediate/marts layers, ref() and source(), materializations, and incremental models with the right strategy. Use when creating or refactoring dbt models, choosing table vs view vs incremental, structuring a dbt project, or writing incremental logic.
  • 100dbt-expert
    Expert-level dbt (data build tool), models, tests, documentation, incremental models, macros, and Jinja templating. Use when the user mentions analytics engineering, SQL, data transformation, Jinja, or testing, or when the task involves Project Structure and Configuration,…
  • 100dbt-models
    Lay out, write, test and document dbt models in staging, intermediate and mart layers, with incremental models that survive reruns, snapshots for history and tests on every key. Use it whenever you add or change a dbt model, source, test, macro or snapshot, or set up dbt in CI.
  • 100dbt-transformation-patterns
    Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or ...
  • 100dbt-transformation-patterns
    Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
  • 90dbt-and-analytics-engineering
    Guides agents through analytics engineering workflows with dbt. Use when building or modifying staging models, marts, tests, snapshots, documentation, exposures, or semantic-layer-facing models.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.