Your dbt models work fine but your YAMLs are empty or meant only for humans. AI can’t use either without the other.
By Alejandro Aboy
Published: 2026-04-28
URL: https://thepipeandtheline.substack.com/p/how-to-make-your-dbt-models-ai-ready
Hi there! Alejandro here 😊
Subscribe if you like to read about technical data & AI learnings, deep dives!
Enjoy the reading and let me know in the comments what you think about it 👨🏻💻
📝 TL;DR
- Your
\_marts.ymlhas column names and zero useful descriptions that will break AI consumption.
- dbt Agent Skills already encode the right philosophy: never restate the column name, inspect the data before documenting, and more.
- A custom
metadata-ai-readinessskill ties the loop together: audit what’s missing against dbt Skills standards, query the database via Postgres MCP to discover edge cases, write fixes back to YAML, and flag what it can’t fix.
This article is sponsored by OpenXData
If you’re a data engineer figuring out how your pipelines, models, and metadata actually serve AI systems in production, OpenXData is running a free virtual conference built around exactly that.
April 29, 9am–3pm PT.
Technical sessions and workshops that go beyond design slides to what holds up in production. From engineers at Uber, Meta, Booking, Snowflake, Anthropic and many others.
The kind of problems we talk about here every week, discussed by the teams solving them at scale.
🧩 The Gap Between Models and Metadata
In previous articles I covered both sides of the agentic data modeling workflow:
- Claude Code For Data Engineers - Data Modeling with dbt Skills & MCPs: from a business PRD to implemented dbt models in one Claude Code session
- End To End Agentic Data Modeling - Using AI and OpenMetadata MCP: connecting OpenMetadata for lineage, impact analysis, and governance
Both assume your schema YAMLs are useful by default. Most of the time, the documented column-schema descriptions are still expecting humans on the other side, not token predictors.
The typical \_marts.yml has one-liners like “Total revenue from conversions” with zero context about edge cases, grain, or what the data actually looks like.
As we discussed in Data Engineers Are Becoming MetadataOps Engineers (And You Don’t Even Know It Yet), every description you write is now a prompt. Vague metadata becomes input for hallucinations.
For this one we will use the same companion repo and dbt project. But instead of building new models, we’re enriching the ones that already exist.
🔄 The AI Readiness Skill
The metadata-ai-readiness skill automates two dbt Agent Skills reference guides: writing-documentation (”never generate documentation which simply restates the entity’s name”) and discovering-data (a 6-step methodology for profiling data before writing anything).
It turns both into a single automated loop that runs through three steps.
\Triggering the ai-readiness SKILL through Claude Code to inspect dbt models.\
Step 1: Audit the YAML
The skill reads \_marts.yml and the corresponding SQL files.
Checks:
- Does the model have a description?
- Are all SQL columns present in the YAML? Do descriptions say something beyond the column name?
- Do grain columns have
not\_nullanduniquetests?
Here’s what writing-documentation considers a fail vs a pass when it comes to dbt documentation through this skill:
# Fail: restates the column name
- name: roas
description: Return on ad spend (revenue / spend)
# Pass: tells you what the values mean and what to watch for
- name: roas
description: | [Business Purpose] Return on ad spend: total_revenue divided by spend. Values above 1.0 mean the campaign generates more revenue than it costs. Primary profitability signal. [Known Issues / Caveats] Returns 0 when spend is 0 (denominator guard). Current range: 0.07 to 6.20.
The second version uses plain text with bracketed headers ([Business Purpose], [Known Issues / Caveats]) because dbt YAML renders plain text.
And out of that audit we get a report, which considering the way this synthetic data was generated through the project, makes sense to have some failure points:
\AI Readiness report with proposal of enrichment.\
Thanks for reading The Pipe & The Line! This post is public so feel free to share it.
Step 2: Query the database
Instead of running through discovering-data‘s 6-step methodology table by table, the skill executes the profiling queries for you via Postgres MCP: grain validation, column profiling, edge case discovery.
This is gold. Let AI explore the data with the agenda the dbt model descriptions provide and self improve through discovery. Every failed attempt is an opportunity to enrich the documentation.
\Database discovery through MCP.\
In this particular example there was a great finding: 2 models with same metric concept but opposite null-handling. So next time there’s no need to debug for a while to figure this out since it will be documented.
Step 3: Report and fix
The skill produces a pass/fail checklist, then with your approval edits \_marts.yml directly: enriches descriptions with [Business Purpose] and [Known Issues / Caveats] based on what it found in the data, and flags what it can’t fix (like missing dbt tests) with the snippet for you to review.
The full audit report and YAML diff are in PR #2.
\Summary with proposal of enrichment.\
🔮 What This Changes
You run a skill. It queries the actual data, finds the gaps gaps and inconsistent patterns across models and get descriptions that capture all of it and tells you what else needs attention.
One Claude Code session instead of a sprint-long initiative where you need to remember in which Slack channel someone mentioned the backend sends an empty string instead of a null when data is not set explicitly.
Good metadata eliminates the recurring edge-case explanation. That’s the work worth doing after the models are built.
Companion repo: claude-code-data-engineers-data-modeling. PR #2 includes themetadata-ai-readinessskill alongside the existingprd-to-dbtskill. The dbt Agent Skills are installed separately as official Claude Code skills from dbt Labs.
Going further: If you want to push enriched descriptions into a metadata catalog for lineage, impact analysis, and governance, the agentic-data-modeling repo adds OpenMetadata MCP on top of this same dbt foundation.
If you enjoyed the content, hit the like ❤️ button, share, comment, repost, and all those nice things people do when like stuff these days. Glad to know you made it to this part!

Hi, I am Alejandro Aboy. I am currently working as a Data Engineer. I started in digital marketing at 19. I gained experience in website tracking, advertising, and analytics. I also founded my agency. In 2021, I found my passion for data engineering. So, I shifted my career focus, despite lacking a CS degree. I’m now pursuing this path, leveraging my diverse experience and willingness to learn.
