data-warehouse-semantic-layer

Designs dbt dimensional models, data contracts, and MetricFlow semantic layer metrics.

1|Updated Jun 29, 2026
One-click install
npx skills add https://github.com/coreyone/software-maestro --skill data-warehouse-semantic-layer-coreyone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: data-warehouse-semantic-layer
Source: https://github.com/coreyone/software-maestro/tree/main/data-and-api/data-warehouse-semantic-layer
Command: npx skills add https://github.com/coreyone/software-maestro --skill data-warehouse-semantic-layer-coreyone

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Raw warehouse tables lack consistent structure, tested schemas, and governed metric definitions, causing broken dashboards and inconsistent KPIs. This Skill structures analytics engineering work into a disciplined 4-layer dbt pipeline with enforced data contracts and semantic metric definitions. ## Core Features & Use Cases - 4-Layer dbt Architecture: Structures models into staging (stg_), intermediate (int_), dimensions (dim_), and facts (fct_) with explicit grain declarations and surrogate keys. - Data Contracts & Testing: Enforces YAML schema contracts with column types, not_null constraints, and generic/singular dbt tests to protect downstream consumers. - Semantic Layer Metrics: Defines MetricFlow/Cube.js entities, measures, dimensions, and ratio metrics like average booking value. - Use Case: A marketplace team needs a bookings data mart. Use this Skill to generate stg_marketplace__bookings, fct_bookings with incremental merge materialization, an enforced YAML contract, and a MetricFlow definition for revenue and conversion metrics. ## Quick Start Design a dbt dimensional model for our bookings data with staging and fact layers, an enforced YAML data contract, and a MetricFlow metric for average booking value.

Frequently Asked Questions about data-warehouse-semantic-layer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a dbt dimensional model with staging and fact layers?▼

Structure dbt models into four layers: staging (`stg_`) for 1-to-1 source renaming and type casting, intermediate (`int_`) for joins and business logic, dimensions (`dim_`) for conformed entities, and facts (`fct_`) for transactions at an explicit grain. Generate surrogate keys with dbt_utils.generate_surrogate_key.

How to define metrics in the dbt Semantic Layer with MetricFlow?▼

Define a semantic model YAML referencing your fact table, then declare entities (primary and foreign keys), measures with aggregations like sum or count_distinct, and time dimensions with granularity. Create derived ratio metrics by specifying numerator and denominator measures.

What is a dbt data contract and how do I enforce it?▼

A dbt data contract is a YAML schema specification enforced at build time via `contract: {enforced: true}` in the model config. It declares explicit column data types and constraints like not_null and primary_key, preventing upstream schema changes from silently breaking downstream dashboards.

When should I use incremental materialization in dbt?▼

Use incremental materialization for high-volume fact tables where full refreshes are too slow or costly. Configure a unique_key and choose a strategy like merge for updates or insert_overwrite for partition replacements, filtering new rows with is_incremental() logic.

When should I not use dimensional modeling for my data?▼

Dimensional modeling fits analytical warehouse workloads, not application transactional schemas. Use standard relational design for PostgreSQL/MySQL application databases, and route client-side event tracking telemetry or infrastructure log aggregation to their dedicated tooling instead.