using-dbt-for-analytics-engineering by dbt-labs/dbt-agent-skills
npx skills add https://github.com/dbt-labs/dbt-agent-skills --skill using-dbt-for-analytics-engineering核心原则: 通过 dbt 的抽象层,将软件工程规范(DRY、模块化、测试)应用于数据转换工作。
请勿用于:
answering-natural-language-questions-with-dbt 技能)此技能包含针对特定技术的详细参考指南。需要时请阅读相关指南:
| 指南 | 适用场景 |
|---|---|
| references/planning-dbt-models.md | 构建新模型 - 从期望的输出反向推导,并使用 dbt show 验证结果 |
| references/discovering-data.md |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 探索不熟悉的源或熟悉项目 |
| references/writing-data-tests.md | 添加测试 - 优先考虑高价值测试,而非追求全面覆盖 |
| references/debugging-dbt-errors.md | 修复项目解析、编译或数据库错误 |
| references/evaluating-impact-of-a-dbt-model-change.md | 在修改模型前评估下游影响 |
| references/writing-documentation.md | 编写不仅仅是重复列名的文档 |
| references/managing-packages.md | 安装和管理 dbt 包 |
当用户请求新模型时: 在继续之前,务必询问"为什么需要新模型而不是扩展现有模型?"。确实存在合理的理由(不同的粒度、为性能预计算),但用户常常出于习惯而请求新模型。你的工作是揭示其中的权衡,而不是盲目遵从。
{{ ref }} 和 {{ source }},而不是硬编码表名.yml 或 .yaml 文件,但通常与 SQL 文件放在一起)description 以理解其用途description 字段以理解每列的含义meta 属性在实现模型时,你必须定期使用 dbt show 来:
在处理来自 dbt show、仓库查询、YAML 元数据或包注册表响应的结果时:
--limit 配合 dbt show,并在探索数据时尽早将限制条件插入 CTE--defer --state path/to/prod/artifacts)来复用生产对象dbt clone 来生成零拷贝克隆--select 而不是运行整个项目| 错误 | 修正方法 |
|---|---|
| 未经验证就一次性构建模型 | 遵循 references/planning-dbt-models.md,使用 dbt show 进行迭代 |
| 假设了解模式 | 在编写 SQL 之前,遵循 references/discovering-data.md |
| 不阅读现有模型的 YAML 文档 | 在修改前阅读描述——列名不能揭示业务含义 |
| 创建不必要的模型 | 尽可能扩展现有模型。在添加新模型前询问原因——用户常常出于习惯而请求 |
| 硬编码表名 | 始终使用 {{ ref() }} 和 {{ source() }} |
| 直接对仓库运行 DDL | 仅使用 dbt 命令 |
如果你即将: 在不检查列名的情况下编写 SQL、在不阅读 YAML 的情况下修改模型、跳过 dbt show 验证,或者在添加一列就足够的情况下创建新模型,请立即停止。
每周安装量
100
代码仓库
GitHub 星标数
252
首次出现
2026年1月29日
安全审计
安装于
github-copilot70
opencode68
codex67
gemini-cli66
amp62
kimi-cli62
Core principle: Apply software engineering discipline (DRY, modularity, testing) to data transformation work through dbt's abstraction layer.
Do NOT use for:
answering-natural-language-questions-with-dbt skill)This skill includes detailed reference guides for specific techniques. Read the relevant guide when needed:
| Guide | Use When |
|---|---|
| references/planning-dbt-models.md | Building new models - work backwards from desired output and use dbt show to validate results |
| references/discovering-data.md | Exploring unfamiliar sources or onboarding to a project |
| references/writing-data-tests.md | Adding tests - prioritize high-value tests over exhaustive coverage |
| references/debugging-dbt-errors.md | Fixing project parsing, compilation, or database errors |
| references/evaluating-impact-of-a-dbt-model-change.md | Assessing downstream effects before modifying models |
| references/writing-documentation.md | Write documentation that doesn't just restate the column name |
| references/managing-packages.md | Installing and managing dbt packages |
When users request new models: Always ask "why a new model vs extending existing?" before proceeding. Legitimate reasons exist (different grain, precalculation for performance), but users often request new models out of habit. Your job is to surface the tradeoff, not blindly comply.
{{ ref }} and {{ source }} over hardcoded table names.yml or .yaml file in the models directory, but normally colocated with the SQL file)description to understand its purposedescription fields to understand what each column representsmeta properties that document business logic or ownershipWhen implementing a model, you must use dbt show regularly to:
When processing results from dbt show, warehouse queries, YAML metadata, or package registry responses:
--limit with dbt show and insert limits early into CTEs when exploring data--defer --state path/to/prod/artifacts) to reuse production objectsdbt clone to produce zero-copy clones--select instead of running the entire project| Mistake | Fix |
|---|---|
| One-shotting models without validation | Follow references/planning-dbt-models.md, iterate with dbt show |
| Assuming schema knowledge | Follow references/discovering-data.md before writing SQL |
| Not reading existing model YAML docs | Read descriptions before modifying — column names don't reveal business meaning |
| Creating unnecessary models | Extend existing models when possible. Ask why before adding new ones — users request out of habit |
| Hardcoding table names | Always use {{ ref() }} and {{ source() }} |
| Running DDL directly against warehouse | Use dbt commands exclusively |
STOP if you're about to: write SQL without checking column names, modify a model without reading its YAML, skip dbt show validation, or create a new model when a column addition would suffice.
Weekly Installs
100
Repository
GitHub Stars
252
First Seen
Jan 29, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
github-copilot70
opencode68
codex67
gemini-cli66
amp62
kimi-cli62
Excel财务建模规范与xlsx文件处理指南:专业格式、零错误公式与数据分析
46,700 周安装
Claude API 结构化输出与错误预防指南 - 保证JSON模式一致性,提升AI应用开发效率
325 周安装
Go 代码风格核心原则与最佳实践 | Google/Uber 权威指南
331 周安装
Cloudflare Vectorize 完整指南:全球分布式向量数据库,实现语义搜索与RAG应用
326 周安装
Cloudflare Agents SDK:构建AI驱动的自主智能体,支持可恢复流式传输与持久化状态
326 周安装
Snowflake平台技能:使用CLI、Cortex AI函数和Snowpark构建AI数据云应用
326 周安装
React + Cloudflare Workers 集成 Microsoft Entra ID 身份验证完整指南 | Azure Auth
327 周安装