ServicesAboutNotesContact Get in touch →
EN FR
Note

Why a dbt Documentation Style Guide Matters More Than Effort

The case for writing a documentation style guide for your dbt project — why inconsistency is the root problem, not effort, and how style guides serve both humans and AI tools

Planted
dbtdata qualityai

The primary problem with dbt documentation in most projects is inconsistency, not effort. Teams write descriptions at different levels of detail, for different imagined audiences, with no shared standard. A style guide fixes the consistency problem: what a description must contain, how long it should be, and what belongs in description versus meta.

Inconsistency without a standard

Compare these two descriptions of the same model:

# Written without a style guide
- name: mrt__marketing__customer_ltv
description: "Customer LTV table"
# Written with one
- name: mrt__marketing__customer_ltv
description: >
Customer lifetime value calculations using a 3-year rolling window
and discounted cash flow methodology (10% annual discount rate).
One row per customer. Excludes customers with no completed orders.
Sources: Shopify orders via base__shopify__orders and Stripe
payments via base__stripe__payments.

The first description conveys nothing beyond the model name. The second tells an analyst whether this model answers their question, without reading SQL. Both authors expended effort; only one had a template defining what to include.

Once a model description is required to answer four questions — business concept, grain, exclusions, data sources — review criteria become concrete. A description missing the grain fails review on a specific, articulable ground. Template-driven writing is also faster: answering “what’s the grain?” takes seconds; answering “write a good description” does not.

Style guides as AI steering

A second function of style guides, relevant as of 2024–2025: AI tools.

dbt Cloud’s Copilot, dbt-osmosis, and custom LLM pipelines all generate documentation. Without a style guide, they produce generic output — column names rephrased into sentences, SQL transformations described mechanically — that misses what the team needs to know. A style guide gives the AI a template to fill rather than an open-ended prompt.

dbt Cloud takes this a step further. It supports a dbt-styleguide.md file in your project root that the Copilot reads as context when generating documentation. The style guide you write for human engineers doubles as instructions for AI generation. Your conventions propagate automatically: if you specify that model descriptions should include grain with the “one row per” pattern, Copilot will include that pattern.

A well-structured style guide acts as a system prompt for AI generation, steering output toward project-specific patterns. The same document serves human engineers (faster reviews, consistent onboarding) and AI tools (structured generation context).

What Belongs in a Style Guide

A useful style guide for dbt documentation doesn’t need to be long. It should be short enough that a new team member can read it in five minutes. What it must cover:

Model descriptions: What four questions should every model description answer? What’s the expected length? How should you handle models that serve multiple audiences?

Column descriptions: When are column descriptions required (mart models, primary/foreign keys) versus optional (staging columns that map directly to source fields)? What information is mandatory for numeric columns (units, currency)? For timestamps (timezone)?

Description vs meta: What belongs in description (human-readable prose) versus meta (structured key-value pairs for tooling)? Ownership, PII flags, and SLAs in meta; business purpose, grain, and exclusions in description.

YAML formatting: Which scalar style to use in which situation. A consistent house style (e.g., folded scalars for model descriptions, inline for short column descriptions) prevents formatting debates.

Doc blocks: When to create a doc block versus writing inline. The naming convention your project uses.

The style guide itself should live in your dbt project repo — a CONTRIBUTING.md or a dbt-styleguide.md in the root. The latter has the advantage of being read automatically by dbt Cloud’s Copilot. Either way, it belongs in version control alongside the code it governs.

Enforcement

A style guide requires two things to stick: examples and automation.

Examples — before/after comparisons showing what the template looks like in practice — are more effective than abstract guidance. Two or three annotated model descriptions teach the pattern faster than paragraphs of explanation.

Automation turns the standard into a requirement. CI enforcement tools, particularly pre-commit hooks from dbt-checkpoint, block commits that violate the standard. The rollout sequence matters: enforcing everything at once creates resistance; starting with model descriptions only, then extending to column descriptions for mart models, is a pace most teams sustain.