building-dbt-semantic-layer

building-dbt-semantic-layer is a skill for Claude Code from dbt-labs/dbt-agent-skills. It costs 62 tokens per session (2,467 once invoked), scanned A, original, Apache-2.0.

A guide for defining dbt Semantic Layer metadata: business concepts, entities, dimensions, measures, and metrics. The Semantic Layer gives different users and tools a shared definition of calculations such as revenue or order count.

In plain words
What is it for?
Use it to create or change semantic models, metrics, dimensions, entities, measures, time spines, and their YAML configuration.
Why use it?
It prevents teams from calculating the same business measure in inconsistent ways and provides rules for connecting and grouping data.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the dbt plugin — 12 skills shipped together

Good fit Use it to create or change semantic models, metrics, dimensions, entities, measures, time spines, and their YAML configuration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dbt-labs/dbt-agent-skills/building-dbt-semantic-layer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer
Clone the repo
git clone --depth 1 https://github.com/dbt-labs/dbt-agent-skills

Made for: Claude Code.

Or install dbt, the plugin that ships this one along with the rest of its 12 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for building-dbt-semantic-layer

README.md
[![agentmods](https://agentmods.dev/badge/skills/dbt-labs/dbt-agent-skills/building-dbt-semantic-layer/github.svg)](https://agentmods.dev/skills/dbt-labs/dbt-agent-skills/building-dbt-semantic-layer)
Your own site
<a href="https://agentmods.dev/skills/dbt-labs/dbt-agent-skills/building-dbt-semantic-layer"><img src="https://agentmods.dev/badge/skills/dbt-labs/dbt-agent-skills/building-dbt-semantic-layer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for building-dbt-semantic-layer

Your own site · 80×15
<a href="https://agentmods.dev/skills/dbt-labs/dbt-agent-skills/building-dbt-semantic-layer"><img src="https://agentmods.dev/badge/skills/dbt-labs/dbt-agent-skills/building-dbt-semantic-layer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,467 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 14 Sept 2026
  • Snyk pass 14 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 45
    uvx/uv tool run commands without ==version create a rug-pull risk.
    Fix: Pin the version: uvx package-name==1.2.3
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.02467
Opus 5.5 $0.00025 $0.00987
Sonnet 5.5 $0.00012 $0.00493
Haiku 4.5 $0.00006 $0.00247

Measured 3mo ago against content hash d45338208eb4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

building-dbt-semantic-layer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/dbt/skills/building-dbt-semantic-layer/SKILL.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Building the dbt Semantic Layer

This skill guides the creation and modification of dbt Semantic Layer components: semantic models, entities, dimensions, and metrics.

  • Semantic models - Metadata configurations that define how dbt models map to business concepts
  • Entities - Keys that identify the grain of your data and enable joins between semantic models
  • Dimensions - Attributes used to filter or group metrics (categorical or time-based)
  • Metrics - Business calculations defined on top of semantic models (e.g., revenue, order count)

Additional Resources

Determine Which Spec to Use

There are two versions of the Semantic Layer YAML spec:

  • Latest spec - Semantic models are configured as metadata on dbt models. Simpler authoring. Supported by dbt Core 1.12+ and Fusion.
  • Legacy spec - Semantic models are defined as separate top-level resources. Uses measures as building blocks for metrics. Supported by dbt Core 1.6 through 1.11. Also supported by Core 1.12+ for backwards compatibility.

Step 1: Check for Existing Semantic Layer Config

Look for existing semantic layer configuration in the project:

  • Top-level semantic_models: key in YAML files → legacy spec
  • semantic_model: block nested under a model → latest spec

Step 2: Route Based on What You Found

If semantic layer already exists:

  1. Determine which spec is currently in use (legacy or latest)
  2. Check dbt version for compatibility:
    • Legacy spec + Core 1.6-1.11 → Compatible. Use legacy spec guide.
    • Legacy spec + Core 1.12+ or Fusion → Compatible, but offer to upgrade first using uvx dbt-autofix deprecations --semantic-layer or the migration guide. They don't have to upgrade; continuing with legacy is fine.
    • Latest spec + Core 1.12+ or Fusion → Compatible. Use latest spec guide.
    • Latest spec + Core <1.12 → Incompatible. Help them upgrade to dbt Core 1.12+.

Read the full file on GitHub · 248 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 248 lines · 62 tokens per session scan A d45338208eb4

Subscribe to this mod's changes

building-dbt-semantic-layer is a skill published in the GitHub repository dbt-labs/dbt-agent-skills (774 stars, last pushed 24d ago), licensed Apache-2.0. It adds 62 tokens to every session and 2,467 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

building-dbt-semantic-layer compared with skills from other repositories

building-dbt-semantic-layer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
building-dbt-semantic-layerdbt-labs/dbt-agent-skillsSkill77424d agoApache-2.0A62Claude Code
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code