Here's my AI-enabled dbt project structure
Optimizing AI performance on dbt projects requires exposing conventions, command workflows, and linting rules directly in the repository via configuration files.
Original article
🔥 Here's my AI-enabled dbt project structure. I kept asking Claude to help with my dbt project. It would write decent SQL, but miss our naming conventions, generate YAML that didn't match our style, and have no idea how our CI pipeline worked.
The problem — my repo was a mess, so I restructured it:
🔹 Added AI-specific files
- CLAUDE .md — the brain. What this project is, how it's organized, what matters.
- .claude/commands/ — project slash commands. /explain-model, /run-full-refresh, /generate-yaml. The AI knows what tools it has.
- .claude/skills/ — reusable AI behaviors. A dbt-specific code reviewer that knows our standards.
🔹 Added more context (loaded on demand) about my development process
- docs/SQL_CONVENTIONS.md
- docs/DBT_CONVENTIONS.md
- docs/YAML_STYLE.md
🔹 Guardrails that run regardless of who (or what) wrote the code
- .sqlfluff
- .pre-commit-hooks.yml
The rest is just a standard dbt project. The only thing that changed: I told the AI where to look, what rules to follow, and what it can do. Now it writes models that fit our conventions on the first try. Add those step-by-step and watch the output improve.
Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi