You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .opencode/skills/dbt-develop/SKILL.md
+46-9Lines changed: 46 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,28 +33,48 @@ Before writing any SQL:
33
33
- Read the task requirements carefully
34
34
- Identify which layer this model belongs to (staging, intermediate, mart)
35
35
- Check existing models for naming conventions and patterns
36
+
-**Check dependencies:** If `packages.yml` exists, check for `dbt_packages/` or `package-lock.yml`. Only run `dbt deps` if packages are declared but not yet installed.
36
37
37
38
```bash
38
39
altimate-dbt info # project name, adapter type
39
40
altimate-dbt parents --model <upstream># understand what feeds this model
40
41
altimate-dbt children --model <downstream># understand what consumes it
41
42
```
42
43
43
-
### 2. Discover — Know Your Data
44
+
### 2. Discover — Understand the Data Before Writing
44
45
45
-
Never write SQL without knowing the columns:
46
+
**Never write SQL without deeply understanding your data first.** The #1 cause of wrong results is writing SQL blind — assuming grain, relationships, column names, or values without checking.
47
+
48
+
**Step 2a: Read all documentation and schema definitions**
49
+
- Read `sources.yml`, `schema.yml`, and any YAML files that describe the source/parent models
50
+
- These contain column descriptions, data types, tests, and business context
51
+
- Pay special attention to: primary keys, unique constraints, relationships between tables, and what each column represents
52
+
53
+
**Step 2b: Understand the grain of each parent model/source**
54
+
- What does one row represent? (one customer? one event? one day per customer?)
55
+
- What are the primary/unique keys?
56
+
- This is critical for JOINs — joining on the wrong grain causes fan-out (too many rows) or missing rows
46
57
47
58
```bash
48
59
altimate-dbt columns --model <name># existing model columns
-`altimate_core_validate` — validates syntax and schema references
110
+
-`altimate_core_column_lineage` — traces how source columns flow to output columns. Use this to verify your SELECT is pulling the right columns from the right sources, especially for complex JOINs or multi-CTE models.
111
+
112
+
**Check downstream impact** (when modifying an existing model):
78
113
```bash
79
-
altimate-dbt build --model <name> --downstream
114
+
altimate-dbt children --model <name># who depends on this?
0 commit comments