packtpublishing/advanced-data-engineering-with-snowflake/dbt-multi-source-merge
Claude Code and agent skill by packtpublishing/advanced-data-engineering-with-snowflake
- community
Checking that the SKILL.md file is still in the repository.
Generate dbt incremental models on Snowflake that MERGE one keyed grain from two or more upstream relations. Combines a dimension with an aggregated fact without overwriting unchanged keys.
Install
npx vskill@latest install packtpublishing/advanced-data-engineering-with-snowflake/dbt-multi-source-mergeSKILL.md
When to Use
Use when a single output row is assembled from more than one upstream relation and the result must be merged incrementally on a shared key, for example joining the cleaned silver_customers dimension to the gold_db.transactions.fact_transactions fact to produce gold_customer_value. Prefer this over the change-hash incremental skill when the driver of change is new rows in a second source (transactions) rather than attribute drift in one source.
What This Skill Provides
- A
{{ config() }}block withincremental_strategy='merge',unique_keyon the shared grain, andon_schema_change='append_new_columns' - A join across two declared upstreams: a
ref()to the silver dimension and asource()to the gold fact - A changed-key
is_incremental()filter that re-aggregates each affected key's FULL history, so a cumulative measure is never clobbered by a partial time slice - A matching YAML file with
unique+not_nullon the merge key
Instructions
- Ask for: model name, the shared grain column(s), the dimension
ref(), the factsource()/ref(), and the measures to aggregate. - Place the SQL under the layer that owns the output grain (
models/gold/...for a customer-grain rollup like this one). - Configure
materialized='incremental',schema='customers',unique_key='<grain>',incremental_strategy='merge',on_schema_change='append_new_columns'. - Reference every upstream explicitly:
{{ ref('silver_customers') }}for owned models,{{ source('gold_transactions', 'fact_transactions') }}for inputs the project does not own. Never reference a relation withoutref()/source(), and neverSELECT *. - For a cumulative measure, scope the
is_incremental()rebuild to which keys changed (keys with a transaction newer thanMAX(last_transaction_ts)in{{ this }}), then let the unfiltered join re-aggregate each of those keys' full history. Do not filter to only the new rows. - Generate the YAML test file alongside the SQL with
unique+not_nullon the merge key, and arelationshipstest from the fact key back to the dimension.
Example
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingchapters/chapter6/dbt/techflow_warehouse/.cortex/skills/dbt-multi-source-merge/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/packtpublishing/advanced-data-engineering-with-snowflake/dbt-multi-source-merge)