building-dbt-semantic-layer

Create and validate dbt Semantic Layer components across YAML specs.

1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/pkoka888/server-infra-templates --skill building-dbt-semantic-layer-pkoka888
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-dbt-semantic-layer
Source: https://github.com/pkoka888/server-infra-templates/tree/main/.kilo/skills/marketplace/dbt/skills/building-dbt-semantic-layer
Command: npx skills add https://github.com/pkoka888/server-infra-templates --skill building-dbt-semantic-layer-pkoka888

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Helps data engineers and analytics engineers create, migrate, and maintain dbt Semantic Layer artifacts so metrics, entities, dimensions, and time-based analyses are correct and discoverable across projects.

Core Features & Use Cases

  • Spec-aware authoring: Detects and guides whether to use the latest model-annotated spec or the legacy top-level semantic_models spec and recommends upgrades when appropriate.
  • Metric and model design: Walks through semantic_model or semantic_models creation, primary entity selection, dimension discovery (including time dimensions), and simple/derived/cumulative/ratio/conversion metric authoring.
  • Validation and tooling: Requires running dbt parse or dbtf parse and then semantic validations (dbt sl validate or mf validate-configs), enforces time-spine requirements, and prevents common pitfalls like filtering on non-declared columns.
  • Use case: Add a semantic layer to an orders model, define the primary entity and time dimension, create order_count and total_revenue metrics, and validate with MetricFlow.

Quick Start

Enable or migrate the semantic layer for a model by adding semantic_model metadata, define the primary entity and time dimension, add simple metrics, then run dbt parse and mf validate-configs to validate.

Frequently Asked Questions about building-dbt-semantic-layer

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

FAQPage Schema
How do I create and validate dbt semantic models and metrics?

Create dbt semantic models by defining primary entities, dimensions, and measures in YAML, then validate them using dbt parse followed by dbt sl validate or mf validate-configs to ensure correct MetricFlow configuration.

What is the difference between legacy and latest dbt Semantic Layer YAML specs?

The latest dbt Semantic Layer spec uses model-annotated semantic_model blocks, while the legacy spec uses top-level semantic_models definitions. Upgrading to the latest spec is recommended for current dbt Core and Fusion versions.

Why does my dbt Semantic Layer validation fail when filtering on dimensions?

dbt Semantic Layer validation fails when filters reference non-declared columns. You must ensure that all filters in your metrics and semantic models explicitly reference declared dimensions and entities to pass validation.

How do I set up a time spine for dbt semantic models?

Setting up a time spine for dbt semantic models requires defining a time dimension in your semantic_model block. This enforces time-based analysis requirements and allows MetricFlow to properly resolve cumulative and time-based metrics.

Can I use dbt Semantic Layer with dbt Core 1.6?

Yes, the dbt Semantic Layer supports projects using dbt Core 1.6 through 1.12+ and Fusion. It detects your spec variant and guides authoring for semantic_model blocks, measures, and cross-model metrics across these versions.

What types of metrics can I build with the dbt Semantic Layer?

You can build simple, derived, cumulative, ratio, and conversion metrics with the dbt Semantic Layer. Author these metrics by referencing measures from semantic models and validating them using dbt sl validate or mf validate-configs.