DM
dbt Model Spec
🔵 Stable🕐 updated 2026-06-28
🔷 SkillSpec L3
pm-dataeng
Spec a dbt model — its grain, sources, transformations, tests, and materialization. Use when asked to design a dbt model, plan a data transformation, write a staging/intermediate/mart model spec, or define dbt tests for a table. Produces a model spec — purpose & grain, lineage (sources → refs), the transformation logic, column definitions, dbt tests, materialization choice, and the skeleton SQL/YAML.
What to give it
▸What the model represents — and its grain (one row per ___ — the single most important decision).
▸Layer — staging, intermediate, or mart (dimension/fact). Conventions differ per layer.
▸Sources / upstream refs — the raw tables or models it builds on.
▸The business logic — joins, filters, aggregations, and any business rules.
✅ The bar it holds itself to
Every skill in this library self-verifies — these are this skill's own quality checks, straight from its definition.
✓The grain is stated as "one row per ___" and the key is tested unique + not_null
✓Sources/refs use `source()`/`ref()`, not hard-coded table names
✓Every column has a type and description (the schema contract)
✓Tests cover the grain key, FKs (relationships), and enum columns
✓Materialization is justified; incremental models declare a unique_key and is_incremental() logic
✓Fan-out joins that could break the grain are flagged
⚠️ What it refuses to do
Do not leave the grain ambiguous — an untested, unclear grain is how duplicate rows and wrong metrics happen
Do not hard-code upstream table names — use ref()/source() so lineage and environments work
Do not ship a model with no tests — untested models silently rot; the grain key at minimum must be tested
Do not default everything to a table — pick the materialization the use justifies (views for light, incremental for large append-only)
Do not bury business logic without comments — the next analyst must understand the rules
Install
npx pm-claude-skills add --agent claude # or codex · cursor · gemini · hermes
# or one-line MCP (every skill, any client):
claude mcp add pm-skills -- npx -y pm-claude-skills-mcp
Related skills
🔌 Embed this skill
Drop this on your blog, docs, or site — it renders a "Run this skill" card:
<div data-pm-skill="dbt-model-spec"></div>
<script src="https://mohitagw15856.github.io/pm-claude-skills/embed.js" async></script>
💬 Discussion
dbt Model Spec is one of 599 open-source professional AI agent skills — all SkillSpec L3.
Try them all in the browser · ⭐ Star on GitHub · Browse the full catalog