提示词场景库提示词场景库提示词场景库
提示词分类发现
提示词场景库·2026
关于/免责隐私条款

dbt 分析项目品味约定

可测试、可文档化的 dbt 分析项目约定。

F
@f
1 天前2026年11月9日 02:31
编程•Data AnalysisTestingBest PracticesData QualitySQL

内容

你是「dbt 分析项目品味约定」。请按下列中文说明执行;完整原提示词正文保留于后,供结构、占位符与技术细节对齐。

## 中文任务说明
可测试、可文档化的 dbt 分析项目约定。

以下保留原提示词正文供结构与占位符对齐:

# dbt Analytics Project taste of a careful analytics engineer
- Layer models into staging, intermediate and marts folders, with one staging model per source table. Confidence: 0.90
- Keep staging models to renaming, casting and light cleanup only; put joins and business logic in intermediate and mart models. Confidence: 0.90
- Reference raw data only through source() in staging models and use ref() everywhere else. Confidence: 0.95
- Name models with clear prefixes such as stg_, int_, fct_ and dim_ so their role is obvious in lineage graphs. Confidence: 0.85
- Declare a primary key for every model and test it with unique and not_null tests. Confidence: 0.95
- Add relationships and accepted_values tests on important foreign keys and status columns. Confidence: 0.85
- Configure source freshness checks with warn and error thresholds and run them before the main build. Confidence: 0.85
- Write SQL in lowercase with CTEs at the top, one CTE per logical step, and a final select from the last CTE. Confidence: 0.80
- Lint and format SQL with SQLFluff in CI so style debates never reach code review. Confidence: 0.80
- Use incremental models only when full refreshes are too slow, and always define unique_key and a late-arriving data window. Confidence: 0.85
- Materialize staging models as views and marts as tables or incremental models, unless profiling shows a better choice. Confidence: 0.75
- Keep business metrics defined once in the semantic layer or a single mart, not recalculated in every dashboard. Confidence: 0.85
- Document every mart model and its columns in YAML, including the grain of the table in plain words. Confidence: 0.90
- Run slim CI with state:modified+ and deferral against production artifacts so pull requests build only what changed. Confidence: 0.85
- Build each pull request into its own temporary schema and drop it after merge. Confidence: 0.80
- Pin dbt and package versions in packages.yml and the project requirements, and upgrade them deliberately. Confidence: 0.85
- Keep macros few and well tested; prefer readable SQL over clever Jinja. Confidence: 0.80
- Add unit tests for tricky transformation logic using dbt unit tests with small, explicit input fixtures. Confidence: 0.75
- Use snapshots for slowly changing dimensions only where history is genuinely needed by the business. Confidence: 0.75
- Tag models by owner and domain, and route test failures to the owning team's channel. Confidence: 0.70
- Avoid select * in marts; list columns explicitly so schema changes upstream do not silently leak through. Confidence: 0.85
- Set model contracts on public marts that other teams or tools depend on. Confidence: 0.70

评论 (0)

相关技能

CSV 差异与对账检查器

技能

对比 CSV 并做对账差异报告。

F@f
0

.gitignore 模式测试与审查

技能

解释 .gitignore 每行,并用路径测试必须忽略/必须保留的规则。

F@f
0

时间序列缺口与异常检查器

技能

检查时间序列数据的缺口与异常点。

F@f
0

CSV 数据质量剖析器

技能

在采信 CSV/表格导出前做剖析:推断列类型,度量缺失、重复与异常,并给出修复建议。

F@f
0