auditing-skills
Use when checking skills for security or quality issues, reviewing audit results from skills.sh or Tessl, or remediating findings…
Use when creating or modifying dbt Semantic Layer components — semantic models, metrics, dimensions, entities, measures, or time spines. Covers MetricFlow configuration, metric types (simple, derived, cumulative, ratio, conversion), and validation for both latest and legacy YAML
Claude Code
$ npx -y skills add dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer --agent claude-code
Codex
$ npx skills add dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer -a codex -y
Cursor
$ npx skills add dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer -a cursor -y
Gemini CLI
$ npx skills add dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer -a gemini-cli -y
GitHub Copilot
$ npx skills add dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer -a github-copilot -y
OpenCode
$ npx skills add dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer -a opencode -y
Windsurf
$ npx skills add dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer -a windsurf -y
name: building-dbt-semantic-layer description: Use when creating or modifying dbt Semantic Layer components — semantic models, metrics, dimensions, entities, measures, or time spines. Covers MetricFlow configuration, metric types (simple, derived, cumulative, ratio, conversion), and validation for both latest and legacy YAML specs. user-invocable: false metadata: author: dbt-labs
This skill guides the creation and modification of dbt Semantic Layer components: semantic models, entities, dimensions, and metrics.
There are two versions of the Semantic Layer YAML spec:
Look for existing semantic layer configuration in the project:
**If semantic layer already exists:**
1. Determine which spec is currently in use (legacy or latest) 2. Check dbt version for compatibility:
**If no semantic layer exists:**
1. **Core 1.12+ or Fusion** → Use [latest spec guide](references/latest-spec.md) (no need to ask). 2. **Core 1.6-1.11** → Ask if they want to upgrade to Core 1.12+ for the easier authoring experience. If yes, help upgrade. If no, use [legacy spec guide](references/legacy-spec.md).
Once you know which spec to use, follow the corresponding guide's implementation workflow (Steps 1-4) for all YAML authoring. The guides are self-contained with full examples.
**Minimal latest spec example** (dbt Core 1.12+ / Fusion) — use this as your starting point to avoid guessing the structure:
# models/fct_orders.yml
models:
- name: fct_orders
semantic_model:
enabled: true
agg_time_dimension: order_date
columns:
- name: order_id
entity:
type: primary
name: order
- name: customer_id
entity:
type: foreign
name: customer
- name: order_date
granularity: day
dimension:
type: time
- name: status
dimension:
type: categorical
metrics:
- name: total_revenue
type: simple
label: Total Revenue
agg: sum
expr: amount**Minimal legacy spec example** (dbt Core 1.6–1.11) — use this if the project is on an older version:
# models/sem_orders.yml
semantic_models:
- name: orders
model: ref('fct_orders')
defaults:
agg_time_dimension: order_date
entities:
- name: order
type: primary
expr: order_id
dimensions:
- name: order_date
type: time
type_params:
time_granularity: day
measures:
- name: revenue
agg: sum
expr: amount
metrics:
- name: total_revenue
type: simple
label: Total Revenue
type_params:
measure: revenueUsers may ask questions related to building metrics with the semantic layer in a few different ways. Here are the common entry points to look out for:
When the user describes a metric or analysis need (e.g., "I need to track customer lifetime value by segment"):
1. Search project models or existing semantic models by name, description, and column names for relevant candidates 2. Present top matches with brief context (model name, description, key columns) 3. User confirms which model(s) / semantic models to build on / extend / update 4. Work backwards from users need to define entities, dimensions, and metrics
When the user specifies a model to expose (e.g., "Add semantic layer to `customers` model"):
1. Read the model SQL and existing YAML config 2. Identify the grain (primary key / entity) 3. Suggest dimensions based on column types and names 4. Ask what metrics the user wants to define
Both paths converge on the same implementation workflow.
User asks to build the semantic layer for a project or models that are not specified. ("Build the semantic layer for my project")
1. Identify high importanc
A curated collection of Agent Skills for working with dbt. These skills help AI agents understand and execute dbt workflows more effectively.
Use when checking skills for security or quality issues, reviewing audit results from skills.sh or Tessl, or remediating findings…
Generates a Mermaid flowchart diagram of dbt model lineage using MCP tools, manifest.json, or direct code parsing as fallbacks.…
Use when a user needs help triaging dbt-core to dbt v2 migration errors. Runs dbt-autofix first, then classifies remaining errors…
Use when migrating a dbt project from one data platform or data warehouse to another (e.g., Snowflake to Databricks, Databricks…
Use when a user wants to upgrade, update, or migrate a dbt project to the latest version — e.g. "upgrade my dbt project,"…
Creates unit test YAML definitions that mock upstream model inputs and validate expected outputs. Use when adding unit tests for…
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…