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.
What this skill does
# 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
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.