DBT Transformation Patterns
Use when organizing dbt analytics projects, designing source/staging/intermediate/mart models, adding tests and documentation, building incremental models, or reviewing lineage and transformation risk.
Install
npx skills add sandbaseai/workbuddy-skill --skill dbt-transformation-patternsgit clone --depth 1 https://github.com/sandbaseai/workbuddy-skill.git /tmp/workbuddy-skill
mkdir -p ~/.claude/skills
cp -r /tmp/workbuddy-skill/skills/dbt-transformation-patterns ~/.claude/skills/dbt-transformation-patternsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# dbt Transformation Patterns
以可追溯分层、版本化契约和自动质量检查构建 dbt 转换。让 sources → staging → intermediate → marts 的责任清晰,控制增量边界、回溯成本、freshness、敏感数据和生产写入风险。
## 范围和安全边界
- 开始前确认 dbt 版本、adapter、项目/target、仓库提交、数据集/分区、所有者、SLA、成本预算和敏感级别。
- 默认只读审查 `dbt_project.yml`、models、sources、macros、tests、docs、manifest/catalog 和 CI 配置;验证优先使用 dev/CI target、合成或脱敏数据。
- 不在生产执行 `run`、`build`、`seed`、`snapshot`、`full-refresh`、回填、删除或权限/契约变更;这些是单独授权的外部副作用。
- SQL、样本、manifest、编译结果和日志不得包含 PII、secret、完整客户行或可还原标识;报告只保存聚合和脱敏证据。
## 模型分层与职责
采用适合项目的分层并记录偏离理由:
```text
sources/ 原始来源、freshness 与来源契约
↓
staging/ 与来源近似的一对一清洗、类型和命名规范化
↓
intermediate/ 可复用业务逻辑、连接、去重和聚合
↓
marts/ 面向分析/产品的稳定维度、事实和服务模型
```
Staging 不隐藏业务规则;intermediate 不成为无法复用的“垃圾抽屉”;marts 明确消费者、粒度、主键、更新频率和数据所有权。每个模型只承担一个清晰责任,重复逻辑提取为经测试的 macro,并考虑 adapter 方言差异。
## 命名、契约与来源
保持项目既有规则;无规则时可使用 `stg_<source>__<entity>`、`int_<purpose>`、`dim_<entity>`、`fct_<event>`,但需在项目文档确认。Source 定义记录表、列、加载时间、唯一标识、分区/时区、freshness、敏感级别和所有者。模型契约记录列类型、可空性、枚举/范围、粒度、关系、语义、版本和兼容策略;改变含义、删除/收窄字段或改变粒度必须有消费者影响与迁移计划。
## 测试和文档
关键模型至少检查 not-null、unique、accepted values、relationships、粒度/重复、跨字段一致性和业务关键不变量。测试写明适用分区、空集行为、严重性、抽样/全量范围和失败动作;避免只测 schema 而不测结果。模型和列文档说明来源、转换、粒度、更新时间、消费者和敏感性,生成的 lineage 必须能追溯到 source;不能从命名推断 lineage。
质量检查应结合 [Data Quality Frameworks](../data-quality-frameworks/) 的契约、基线和脱敏原则。Freshness 失败、新增 schema、模型测试失败、编译失败和验证器故障分别分类,不能把未执行当成通过。
## 增量模型与回溯Details
- Skill name
dbt-transformation-patterns- Repository
- sandbaseai/workbuddy-skill
- Path
skills/dbt-transformation-patterns/SKILL.md- License
- MIT
- Repo updated
- 8 September 2026
FAQ
What does the DBT Transformation Patterns skill do?
Use when organizing dbt analytics projects, designing source/staging/intermediate/mart models, adding tests and documentation, building incremental models, or reviewing lineage and transformation risk.
How do I install the DBT Transformation Patterns skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add sandbaseai/workbuddy-skill --skill dbt-transformation-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is DBT Transformation Patterns popular?
It lives in sandbaseai/workbuddy-skill, which has 9 GitHub stars and 3 forks.
Related skills
Access Control Security Best Practices
9sandbaseai/workbuddy-skill
Design, review, implement, and verify least-privilege access controls across users, services, tenants, resources, and administrative workflows.
Accessibility Review
9sandbaseai/workbuddy-skill
Use when reviewing a web interface or interaction for semantic, keyboard, focus, screen-reader, ARIA, and contrast accessibility risks.
Acquire Codebase Knowledge
9sandbaseai/workbuddy-skill
Use when the user asks to map, document, or onboard into an existing codebase and needs evidence-backed architecture, structure, conventions, integrations, testing, and concerns documentation.
Farm Stack
5Sagargupta16/claude-skills
Use when building or scaffolding FastAPI + React + MongoDB (FARM stack) applications. Covers project structure, async MongoDB with Motor, Pydantic v2 models, config patterns, Docker setup, and testing conventions.
DBT Patterns
9sandbaseai/workbuddy-skill
Use when designing, reviewing, or operating a dbt project; structure SQL transformations, tests, documentation, lineage, incremental models, and production workflows with explicit data contracts.
Mysql
9sandbaseai/workbuddy-skill
Use when inspecting a MySQL schema, writing or reviewing queries, diagnosing plans, designing indexes, or preparing database changes; default to read-only analysis and require explicit production mutation authority.
Browse the most popular Claude skills, all databases skills, or write your own with the skills generator.