creating-dbt-models

用于根据项目规范创建 dbt 模型。适用于创建新模型(任何层级)、在任务中提到“create/build/add/write/new/implement”且与 model/table/SQL 相关的情况、修改现有模型的逻辑/列/连接/转换,以及根据 schema.yml 或预期输出实现模型。编写前发现并遵循项目规范;建议运行 dbt build 进行验证。

仓库最近推送
GitHub Stars
137
Forks
13
Issues / PRs
5

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "creating-dbt-models":https://skillpi.com/zh/skills/deepskill-21e05c0ffe194d45a22182b7a1e43478c77d30a35525ee280c74c55a3cad820b。安装前核对上游来源和版本:https://github.com/AltimateAI/data-engineering-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于根据项目规范创建 dbt 模型。适用于创建新模型(任何层级)、在任务中提到“create/build/add/write/new/implement”且与 model/table/SQL 相关的情况、修改现有模型的逻辑/列/连接/转换,以及根据 schema.yml 或预期输出实现模型。编写前发现并遵循项目规范;建议运行 dbt build 进行验证。

0 下载

介绍来源: third_party · AltimateAI · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
输入和输出
翻译待完成,请参阅来源文档。
软件、账号及付费要求
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
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

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

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

亮点

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

亮点

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

亮点

  • 工具命令来源明确,参数正确
  • 覆盖主要异常场景,不可逆操作有充分确认机制
证据可验 (前四项均值)90/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

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

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

翻译待完成,请参阅来源文档。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。