---
name: "dbt-core-incremental-models-snowflake"
description: "Transform enterprise data warehouses efficiently using dbt Core incremental materializations."
metadata:
  author: "dbt Labs"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write dbt incremental model"
  - "configure dbt unique_key merge"
  - "handle late arriving data dbt"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# dbt Core Incremental Models & Window Partitions

Develops dbt models: configuring incremental materializations with merge strategies (unique_key, incremental_strategy='merge'), handling late-arriving records with lookback windows, and optimizing warehouse compute costs.

## When to Invoke
Invoke this skill whenever you need to:
- write dbt incremental model
- configure dbt unique_key merge
- handle late arriving data dbt

## Execution SOP & Rules
1. Configure model header: {{ config(materialized='incremental', unique_key='event_id', incremental_strategy='merge') }}.
2. Add filter block: {% if is_incremental() %} WHERE updated_at >= (SELECT MAX(updated_at) - INTERVAL '3 DAYS' FROM {{ this }}) {% endif %}.
3. Execute targeted model runs: dbt run --select path.to.model+ to build the model and downstream dependents.
4. Run dbt test to verify unique constraints and referential integrity.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
