- Home
- Skills
- Data & Databases
- AI Data Modelling Architect
AI Data Modelling Architect
by Partha Basak
Analytics engineering requires more than just writing SQL; it demands rigorous dimensional modeling and testable data products.
Free
AI Data Modelling Architect
Example session with this skill installed
Design a dbt model for subscription payments. Sources are 'raw_payments' and 'raw_plans'. I need to track status changes over time and handle late-arriving refunds.
- Read your context and instructions
- Compiled the ai data modelling
I have designed the subscription payments model using an accumulating snapshot pattern for the fact table and SCD Type 2 logic for status tracking.
Subscription Payments Architecture
-- marts/fct_subscription_payments.sql
{{
config(
materialized='incremental',
unique_key='payment_hk',
incremental_strategy='merge',
cluster_by=['created_at_date']
)
}}
WITH source_data AS (
SELECT * FROM {{ ref('stg_payments') }}
{% if is_incremental() %}
WHERE updated_at >= (SELECT MAX(updated_at) FROM {{ this }})
{% endif %}
),
final AS (
SELECT
-- Surrogate Key: Hash of business key + source system
{{ dbt_utils.generate_surrogate_key(['payment_id', "'stripe'"]) }} as payment_hk,
payment_id,
plan_id,
amount_cents,
currency,
status,
-- Grain: One row per payment attempt/event
created_at,
updated_at,
COALESCE(refunded_at, '9999-12-31') as refunded_at
FROM source_data
)
SELECT * FROM final
| Component | Logic |
|---|---|
| Grain | One record per unique payment transaction ID. |
| Key Logic | MD5 hash of payment_id normalized to string to prevent null collisions. |
| SCD Logic | Uses valid_from and valid_to half-open intervals for plan history. |
| Incremental | Merge strategy on payment_hk to handle status updates and late refunds. |
Next steps
- Review the
stg_paymentsYAML to ensurepayment_idis flagged as a non-null unique key. - Run
dbt test --select fct_subscription_paymentsto verify no grain fan-out occurred during the join to plans. - Deploy the provided SCD2 macro to the
macros/folder to handle interval overlaps.
Connects securely to your tools. The creator never sees your data.
About this skill
Analytics engineering requires more than just writing SQL; it demands rigorous dimensional modeling and testable data products. This skill transforms raw requirements into production-ready dbt models, Snowflake architectures, and hardened data pipelines.
What it does
- Dimensional modeling designs transaction, periodic snapshot, and accumulating snapshot facts with explicit grain definitions.
- SCD management implements Type 2 slowly changing dimensions using half-open intervals and robust history rebuild logic.
- Key engineering generates deterministic surrogate keys using canonicalized hashing and source-system scoping.
- Incremental processing builds dbt strategies for deduplication, late-arrival handling, and idempotent merges.
- Data reconciliation creates test suites for financial control totals, relationship integrity, and source-to-target counts.
How it works
- Source analysis maps business processes to source entities, identifying ingestion patterns and CDC behavior.
- Design phase defines the grain for facts and classifies measures as additive, semi-additive, or non-additive.
- Implementation writes dbt models across staging, intermediate, and marts layers with explicit unique keys.
- Validation executes a test matrix covering uniqueness, SCD overlaps, and incremental equivalence.
Frameworks & tools
This skill is optimized for dbt Core and Snowflake. It utilizes dimensional modeling principles (Kimball), SQL, and YAML for dbt configurations and tests.
Why this beats prompting it yourself
Generic prompts often produce SQL that fails on edge cases like late-arriving facts or overlapping SCD intervals. This skill enforces strict grain isolation and deterministic hashing, preventing the common "fan-out" join errors that break financial reporting.
Use cases
- Migrating raw staging tables into a star schema for BI tools like Looker or Tableau.
- Designing a financial reconciliation model to track authorized vs. settled payments.
- Refactoring legacy SQL into modular dbt models with proper testing and documentation.
- Implementing an SCD Type 2 pipeline to track historical changes in customer attributes.
Known limitations
Does not perform live warehouse execution or production deployments. It provides code and commands, but requires a local dbt environment or Snowflake instance to run.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Frequently Asked Questions
New in Data & Databases
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.