creating-dbt-models

For creating dbt models following project conventions. Use when creating new models (any layer), when tasks mention “create/build/add/write/new/implement” related to model/table/SQL, when modifying existing model logic/columns/joins/transforms, or when implementing models to meet schema.yml or expected outputs. Discover and follow project conventions before authoring; run dbt build to validate.

Last repository push
GitHub Stars
137
Forks
13
Issues / PRs
5

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "creating-dbt-models" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-21e05c0ffe194d45a22182b7a1e43478c77d30a35525ee280c74c55a3cad820b. Verify the upstream source and version against https://github.com/AltimateAI/data-engineering-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

For creating dbt models following project conventions. Use when creating new models (any layer), when tasks mention “create/build/add/write/new/implement” related to model/table/SQL, when modifying existing model logic/columns/joins/transforms, or when implementing models to meet schema.yml or expected outputs. Discover and follow project conventions before authoring; run dbt build to validate.

0 Downloads

Introduction source: third_party · AltimateAI · 0.0.1 Reference

SkillPi interpretation

Tasks
Read before you write. Build after you write. Verify your output.**
Inputs and outputs
Build success does NOT mean correct output.** ```bash
Software, accounts and paid services
What columns are needed? List them explicitly. What is the grain of the table (one row per what)? What calculations or aggregations are required?
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: creating-dbt-models
description: |
  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) Modifying existing model logic, columns, joins, or transformations
  (4) Implementing a model from schema.yml specs or expected output requirements
  Discovers project conventions before writing. Runs dbt build (not just compile) to verify.

dbt Model Development

Read before you write. Build after you write. Verify your output.

Critical Rules

  1. ALWAYS run dbt build after creating/modifying models - compile is NOT enough
  2. ALWAYS verify output after build using dbt show - don't assume success
  3. If build fails 3+ times, stop and reassess your entire approach

Workflow

1. Understand the Task Requirements

  • What columns are needed? List them explicitly.
  • What is the grain of the table (one row per what)?
  • What calculations or aggregations are required?

2. Discover Project Conventions

cat dbt_project.yml
find models/ -name "*.sql" | head -20

Read 2-3 existing models to learn naming, config, and SQL patterns.

3. Find Similar Models

# Find models with similar purpose
find models/ -name "*agg*.sql" -o -name "*fct_*.sql" | head -5

Learn from existing models: join types, aggregation patterns, NULL handling.

4. Check Upstream Data

# Preview upstream data if needed
dbt show --select <upstream_model> --limit 10

5. Write the Model

Follow discovered conventions. Match the required columns exactly.

6. Compile (Syntax Check)

dbt compile --select <model_name>

7. BUILD - MANDATORY

This step is REQUIRED. Do NOT skip it.

dbt build --select <model_name>

If build fails:

  1. Read the error carefully
  2. Fix the specific issue
  3. Run build again
  4. If fails 3+ times, step back and reassess approach

8. Verify Output (CRITICAL)

Build success does NOT mean correct output.

# Check the table was created and preview data
dbt show --select <model_name> --limit 10

Verify:

  • Column names match requirements exactly
  • Row count is reasonable
  • Data values look correct
  • No unexpected NULLs

9. Verify Calculations Against Sample Data

For models with calculations, verify correctness manually:

# Pick a specific row and verify calculation by hand
dbt show --inline "
  select *
  from {{ ref('model_name') }}
  where <primary_key> = '<known_value>'
" --limit 1

# Cross-check aggregations
dbt show --inline "
  select count(*), sum(<column>)
  from {{ ref('model_name') }}
"

For example, if calculating total_revenue = quantity * price:

  1. Pick one row from output
  2. Look up the source quantity and price
  3. Manually calculate: does it match?

10. Re-review Against Requirements

Before declaring done, re-read the original request:

  • Did you implement what was asked, not what you assumed?
  • Are column names exactly as specified?
  • Is the calculation logic correct per the requirements?
  • Does the grain (one row per what?) match what was requested?

Anti-Patterns

  • Declaring done after compile without running build
  • Not verifying output data after build
  • Getting stuck in compile/build error loops
  • Assuming table exists just because model file exists
  • Writing SQL without checking existing model patterns first

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供端到端 dbt 模型开发工作流,覆盖从需求理解到输出验证全流程
  • 针对数据工程高频场景,具有明确实用价值和广泛适用性
Trigger Precision90/100

Highlights

  • 触发词精准覆盖模型创建、修改、实现等核心场景
  • 条件边界清晰,有效避免误触或漏触
Structure and Standards95/100

Highlights

  • Phase 划分清晰,步骤完整且有明确出口条件
  • frontmatter 完整,文档结构规范,示例充分
Execution Reliability90/100

Highlights

  • 工具命令来源明确,参数正确
  • 覆盖主要异常场景,不可逆操作有充分确认机制
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

What columns are needed? List them explicitly. What is the grain of the table (one row per what)? What calculations or aggregations are required?

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.