Skip to content
Back to skills

Dbt Best Practices

ASecurity

dbt best practices for SQL modeling, testing, and analytics engineering workflows

  • 43 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
documentationsqltestingdocumentation

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add baekenough/oh-my-customcode --skill dbt-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dbt Best Practices?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dbt Best Practices
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/baekenough-dbt-best-practices/badge)](https://www.skillsdirectory.com/skills/baekenough-dbt-best-practices)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dbt-best-practices
description: dbt best practices for SQL modeling, testing, and analytics engineering workflows
scope: core
user-invocable: false
---

# dbt Best Practices

## Project Structure

### Layer Organization (CRITICAL)
- **Staging**: 1:1 with source tables (`stg_{source}__{entity}`)
- **Intermediate**: Business logic composition (`int_{entity}_{verb}`)
- **Marts**: Final consumption models (`fct_{entity}`, `dim_{entity}`)

### Materialization Strategy
- Staging: `view` (lightweight, always fresh)
- Intermediate: `ephemeral` or `view`
- Marts: `table` or `incremental`

## Modeling Patterns

### Naming Conventions
- Staging: `stg_source__table`
- Intermediate: `int_entity_verb`
- Facts: `fct_entity`
- Dimensions: `dim_entity`

### Incremental Models
- Use `is_incremental()` macro
- Define `unique_key` for merge strategy
- Choose strategy: append, merge, delete+insert

## Testing

### Schema Tests
- `unique`, `not_null` for primary keys
- `relationships` for foreign keys
- `accepted_values` for enums
- Custom data tests

### Source Freshness
- Configure `loaded_at_field`
- Set freshness thresholds

## Documentation

- Add descriptions to models
- Document column definitions
- Use `doc` blocks for reusable text
- Generate and host dbt docs

## Version

- **dbt-core**: 1.11+ (includes Fusion engine for faster parallel model execution)
- Fusion engine is enabled by default in dbt-core 1.11 — no configuration required

## References
- [dbt Best Practices](https://docs.getdbt.com/guides/best-practices)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…