分析团队常常苦于数据模型不一致和文档缺失。本技能提供了经过验证的 dbt 项目组织模式,包含完善的测试、文档和增量处理机制。
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "dbt-transformation-patterns". 为 Stripe 支付源创建 staging 模型
Résultat attendu:
- 包含支付表模式和测试的源定义 YAML
- 使用基于 CTE 的转换的 stg_stripe__payments.sql
- 遵循命名约定的列重命名(id 到 payment_id,amount in cents 到 dollars)
- 带有 unique_key 和 updated_at 过滤器的增量配置
Utilisation de "dbt-transformation-patterns". 构建带有支付指标的客户维度表
Résultat attendu:
- 连接客户和支付中间模型的 dim_customers.sql
- 使用 dbt_utils 生成代理键
- 基于生命周期价值的客户层级细分逻辑
- 带有列描述和测试的 YAML 文档
Audit de sécurité
SûrThis skill is safe for publication. Static analysis detected 70 patterns that are all false positives - the flagged content consists of SQL/YAML code examples in markdown documentation, not executable code. The skill provides reference patterns for dbt (data build tool) analytics engineering workflows.
Score de qualité
Ce que vous pouvez construire
分析工程师构建转换流水线
从第一天起就建立具有正确模型组织、测试和文档的新 dbt 项目。
数据团队提升模型质量
为现有的 dbt 模型添加全面的测试、文档和新鲜度监控。
工程团队优化增量加载
为大型事实表实施高效的增量策略,降低计算成本。
Essayez ces prompts
为 [source_name] [table_name] 表创建一个 dbt staging 模型。包含带有列描述的源定义、具有正确重命名约定的 staging SQL 模型,以及用于主键和非空约束的基本测试。
创建一个名为 fct_[name] 的 dbt 增量事实表模型,用于跟踪 [business_process]。将其配置为使用 [strategy] 的增量物化,定义 unique_key,并使用 is_incremental() 包含增量过滤逻辑。
审查此 dbt 模型 SQL 并生成相应的 YAML 文档文件。根据存在的列,包含模型描述、列描述和适当的测试(unique、not_null、relationships、accepted_values)。
为 [domain] 分析工作流设计 dbt 模型结构。定义为 [sources] 所需的 staging 模型、用于业务逻辑的 intermediate 模型,以及用于最终输出的 mart 模型(维度和事实)。包含每一层的命名约定和物化策略。
Bonnes pratiques
- 对所有源数据使用 staging 层 - 清洗一次,随处复用
- 对所有键 aggressively 使用 not_null、unique 和 relationship 测试
- 为下游用户记录每个模型和列的业务上下文
Éviter
- 跳过 staging 层并在 marts 中直接查询源会产生技术债务
- 硬编码日期或值而不是使用 dbt 变量进行配置
- 在多个模型中重复业务逻辑而不是提取到可复用的宏中
Foire aux questions
什么是 dbt 中的 medallion 架构?
何时应该使用增量物化?
应该为我的模型添加哪些测试?
如何在 delete+insert 和 merge 增量策略之间选择?
临时模型的用途是什么?
如何有效地记录我的 dbt 项目?
Détails du développeur
Auteur
sickn33Licence
MIT
Dépôt
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/dbt-transformation-patternsRéf
main
Structure de fichiers