Skip to content
Skills Library
Data & analytics · Writing

documenting-dbt-models

/documenting-dbt-models

Documents dbt models and columns in schema.yml. Use when working with dbt documentation for: (1) Adding model descriptions or column definitions to schema.yml (2) Task mentions "document", "describe", "description", "dbt docs", or "schema.yml" (3) Explaining business context, grain, meaning of data, or business rules (4) Preparing dbt docs generate or improving model discoverability Matches existing project documentation style and conventions before writing.

Licence
MIT
Last repository change
15.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 15.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Documents dbt models and columns in schema.yml. Use when working with dbt documentation for: (1) Adding model descriptions or column definitions to schema.yml (2) Task mentions "document", "describe", "description", "dbt docs", or "schema.yml" (3) Explaining business context, grain, meaning of data, or business rules (4) Preparing dbt docs generate or improving model discoverability Matches existing project documentation style and conventions before writing.

Triggers from the description

documentdescribedescriptiondbt docsschema.yml
Original author description

Documents dbt models and columns in schema.yml. Use when working with dbt documentation for: (1) Adding model descriptions or column definitions to schema.yml (2) Task mentions "document", "describe", "description", "dbt docs", or "schema.yml" (3) Explaining business context, grain, meaning of data, or business rules (4) Preparing dbt docs generate or improving model discoverability Matches existing project documentation style and conventions before writing.

How it works

  1. Workflow
  2. Documentation Patterns
  3. Anti-Patterns
Original SKILL.md headings · 158 lines, 573 words
SKILL.md preview
---
name: documenting-dbt-models
description: |
  Documents dbt models and columns in schema.yml. Use when working with dbt documentation for:
  (1) Adding model descriptions or column definitions to schema.yml
  (2) Task mentions "document", "describe", "description", "dbt docs", or "schema.yml"
  (3) Explaining business context, grain, meaning of data, or business rules
  (4) Preparing dbt docs generate or improving model discoverability
  Matches existing project documentation style and conventions before writing.
---

# dbt Documentation

**Document the WHY, not just the WHAT. Include grain, business rules, and caveats.**

## Workflow

### 1. Study Existing Documentation Patterns

**CRITICAL: Match the project's documentation style before adding new docs.**

```bash
# Find all schema.yml files with documentation
find . -name "schema.yml" | head -5

# Read well-documented models to learn patterns
cat models/marts/schema.yml | head -150
cat models/staging/schema.yml | head -150
```

**Extract from existing documentation:**
- Description length (brief vs detailed)
- Formatting style (plain text vs markdown with headers)
- Information included (grain? business rules? caveats?)
- Column description depth (all columns vs key columns)
- Use of meta tags or custom properties

### 2. Read Model SQL

```bash
cat models/<path>/<model_name>.sql
```

Understand: transformations, business logic, joins, filters.

### 3. Check Existing Documentation for This Model

```bash
# Find existing schema.yml
find . -name "schema.yml" -exec grep -l "<model_name>" {} \;

# Read existing docs
cat models/<path>/schema.yml | grep -A 100 "<model_name>"
```

### 4. Identify Documentation Needs

For each model, document:
- **Model description**: Purpose, grain, key business rules
- **Column descriptions**: Business meaning, not just data type

For each column, consider:
- What business concept does this represent?
- Are there any caveats or special values?
- What is the source of this data?

### 5. Write Documentation

**Match the style discovered in step 1. Example format (adapt to project):**

```yaml
version: 2

models:
  - name: orders
    description: |
      Order transactions at the order line item grain.
      Each row represents one product in one order.

      **Business Rules:**
      - Revenue recognized on ship_date, not order_date
      - Cancelled orders excluded (status != 'cancelled')
      - Returns processed as negative line items

      **Grain:** One row per order_id + product_id combination

    columns:
      - name: order_id
        description: |
          Unique identifier for the order.
          Source: orders.id from Stripe webhook

      - name: customer_id
        description: |
          Foreign key to customers table.
          NULL for guest checkouts (pre-2023 only)

      - name: revenue
        description: |
          Net revenue for this line item in USD.
          Calculation: unit_price * quantity - discount_amount
          Excludes tax and shipping

      - name: order_status
        description: |
          Current status of the order.
          Values: pending, processing, shipped, delivered, cancelled, returned
```

### 6. Generate Docs

```bash
dbt docs generate
dbt docs serve  # Optional: preview locally
```

## Documentation Patterns

**Note: These are default templates. Always adapt to match project's existing style.**

### Model Description Template

```yaml
description: |
  [One sentence: what this model contains]

  **Grain:** [What does one row represent?]

  **Business Rules:**
  - [Key rule 1]
  - [Key rule 2]

  **Caveats:**
  - [Important limitation or edge case]
```

### Column Description Patterns

| Column Type | Documentation Focus |
|-------------|---------------------|
| Primary key | Source system, uniqueness guarantee |
| Foreign key | What it joins to, NULL handling |
| Metric | Calculation formula, units, exclusions |
| Date | Timezone, what event it represents |
| Status/Category | All possible values, business meaning |
| Boolean/Flag | What true/false means in business terms |

### Documenting Calculated Fields

```yaml
- name: gross_margin
  description: |
    Gross margin percentage.
    Calculation: (revenue - cogs) / revenue * 100
    NULL when revenue = 0 to avoid division by zero
```

## Anti-Patterns

- Adding documentation without checking existing project patterns
- Using different formatting style than existing documentation
- Describing WHAT (e.g., "The order ID") instead of WHY/context
- Missing grain documentation
- Not documenting NULL handling
- Leaving columns undocumented
- Copy-pasting column names as descriptions

Versions

RepositoryScoreLicence
This page · AltimateAI/data-engineering-skills100MIT
unknown-333/awesome-data-engineering-skills100Apache-2.0

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 52e031faad84 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100testing-dbt-models
    Adds schema tests and data quality validation to dbt models. Use when working with dbt tests for: (1) Adding or modifying tests in schema.yml files (2) Task mentions "test", "validate", "data quality", "unique", "not_null", or "accepted_values" (3) Ensuring data integrity -…
  • 100creating-dbt-models
    Creates dbt models following project conventions. Use when working with dbt models for: (1) Creating new models (any layer - discovers project's naming conventions first) (2) Task mentions "create", "build", "add", "write", "new", or "implement" with model, table, or SQL (3)…
  • 100reading-data-dict
    Read project data documentation (data dictionaries, dbt manifests, model docs, column descriptions, lineage, metric definitions) before writing analytics SQL. Use for mapping business and product terms to concrete models and columns.
  • 100maintaining-dbt-documentation
    Audits dbt documentation coverage and drafts missing model/column descriptions in the project's own house style, one folder at a time, for human review. Use when documenting undocumented models, backfilling missing YAML descriptions, auditing doc coverage, or keeping schema YAML…
  • 100dbt-setup
    Scaffolds a complete dbt-fabric project for a Fabric Data Warehouse: generates profiles.yml, dbt_project.yml, a column-rich _sources.yml (with data types for every table column, ready for dbt contracts), requirements.txt, and .gitignore, then writes them to the local filesystem.…
  • 100query
    Answer any dbt question from .dbt-wiki/: model structure, column lineage, config, schema.yml, refactor impact, ingested notes — before reading dbt/ files. Use for 'trace column', 'what feeds X', 'rename impact', '依賴什麼'. Setup→init, updates→rescan.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.