Home › dbt › dbt analytics engineering AGENTS.md

dbt analytics engineering AGENTS.md

AGENTS.md for dbt projects (dbt Core / Fusion 1.9+): staging/marts layering, tests, docs, and selective runs.

AGENTS.mddbt

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

AGENTS.mdDownload  
# AGENTS.md: dbt project

## Commands
- `dbt deps` · `dbt build --select state:modified+ --defer --state prod-artifacts/` (or `dbt build -s <model>+` locally)
- Lint SQL: `sqlfluff lint models/` (if configured)

## Layers
- `models/staging/<source>/stg_<source>__<table>.sql`: one per source table, rename/cast only, materialized as views.
- `models/intermediate/int_*.sql`: joins and business logic, not exposed.
- `models/marts/<domain>/fct_*.sql` and `dim_*.sql`: what BI tools read.
- Sources are declared in `_<source>__sources.yml` with freshness checks; reference with `{{ source() }}`, models with `{{ ref() }}`. Never hard-code schema names.

## SQL style
- CTEs at the top (`with orders as (select * from {{ ref('stg_shop__orders') }})`), one final `select`.
- Lowercase keywords, explicit column lists in marts, no `select *` in the final CTE.
- Large tables are `incremental` with a `unique_key` and an `is_incremental()` filter.

## Tests and docs
- Every model has a primary key with `unique` + `not_null` tests in its YAML.
- Add `relationships` and `accepted_values` tests where they apply; use unit tests (`unit_tests:`) for tricky logic.
- Every model and key column gets a `description`.

## Don't
Don't run `dbt run --full-refresh` on production or change a mart's grain without calling it out.

More: all dbt rules · all AGENTS.md rules

Related rules

CrewAI multi-agent AGENTS.md

AGENTS.md for CrewAI 1.x projects: YAML agents and tasks, crews and flows, tools, and cost-aware runs.

AGENTS.mdLLM apps & agents

LLM fine-tuning (TRL + PEFT) AGENTS.md

AGENTS.md for fine-tuning LLMs with Hugging Face TRL and PEFT (LoRA/QLoRA): data format, configs, evals, and safety.

AGENTS.mdHugging Face

LLM app (Python) AGENTS.md

AGENTS.md for Python apps that call LLM APIs (OpenAI, Anthropic, Gemini): prompts, structured output, evals, and cost.

AGENTS.mdLLM apps & agents

MCP server (TypeScript) AGENTS.md

AGENTS.md for building Model Context Protocol servers in TypeScript with clear tools, zod schemas and safe defaults.

AGENTS.mdMCP servers

Pinecone vector database AGENTS.md

AGENTS.md for apps using Pinecone serverless indexes: namespaces, metadata filters, upserts, and integrated embedding.

AGENTS.mdRAG & vector DBs

Streamlit app AGENTS.md

AGENTS.md for Streamlit data apps: the rerun model, caching, session state, forms and fragments, secrets, and testing.

AGENTS.mdPython Data & ML

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.