dbt-architect
Architect-level dbt project design — project and package structure, sources and staging conventions, incremental models and their keys, tests and contracts, exposures and lineage, CI with state comparison, and the selector strategy for large projects. Use when transformations run in dbt.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- dbt-architect
- license
- MIT
- metadata
- { "crusor-path": "data-engineering-architect/transform-architect/dbt-architect", "crusor-domain": "data-engineering-architect", "crusor-origin": "original", "crusor-sources": "docs.getdbt.com/docs/build/incremental-models; docs.getdbt.com/docs/collaborate/state; docs.getdbt.com/best-practices", "crusor-triggers": "dbt, dbt project, incremental model, dbt test, dbt sources, dbt exposures, slim ci, dbt selectors, packages.yml", "crusor-verified-on": "2026-10-30" }
- description
- Architect-level dbt project design — project and package structure, sources and staging conventions, incremental models and their keys, tests and contracts, exposures and lineage, CI with state comparison, and the selector strategy for large projects. Use when transformations run in dbt.
- compatibility
- dbt Core/Cloud, SQLMesh; Snowflake/BigQuery/Databricks/Postgres
03 SKILL.md 正文
dbt Architect
dbt is a compiler and a DAG for SQL. The project structure decides whether that DAG is understandable at 300 models.
When to use
- SQL transformations run on a warehouse.
- A dbt project has grown past the point of comprehension.
- Setting up CI and environments for transformations.
When NOT to use
- Transformations need Python/heavy compute — use a Spark/notebook pipeline.
- A handful of queries with one consumer.
Decision 1 — Structure
models/
staging/<source>/stg_<source>__<entity>.sql rename, cast, dedupe only
intermediate/ int_<domain>__<verb>.sql joins, business logic
marts/<domain>/ fct_/dim_/rpt_<entity>.sql consumed, documented, tested
sources.yml one per source system, freshness configured
exposures.yml dashboards/ML/APIs that read marts
- Staging models are 1:1 with source tables; no joins.
- Intermediate models keep marts thin and readable; mark private.
- Marts are contracts: documented, tested, owned.
Decision 2 — Materialisation
| Model | Materialisation |
|---|---|
| staging | view |
| intermediate | ephemeral (or view if reused widely) |
| dimension | table |
| large fact | incremental with unique_key + merge |
| small mart | table |
- Incremental requires a unique key, a
is_incremental()filter, and a late-data strategy; without all three it accumulates duplicates. - Full refresh is a tool, not a schedule — make it possible, not routine.
- Snapshots for slowly changing dimensions, with a defined
updated_at.
Decision 3 — Tests and contracts
- Sources: freshness +
not_null/uniqueon keys. - Marts: uniqueness, relationships, accepted values, and at least one business rule.
- Model contracts (
contract: enforced: true) for marts consumed outside the project. - Tests are code: review them, and delete ones that can never fail.
Decision 4 — CI and environments
- Dev/prod targets in separate schemas or databases; never test in prod.
- Slim CI:
state:modified+against the production manifest — only build what changed. dbt buildin CI (models + tests), plus linting (sqlfluff) and docs generation.- Artefacts (manifest, run results) persisted for lineage and state comparison.
Decision 5 — Scale
- Selectors and tags for domains (
+tag:finance) so runs are bounded. - Packages pinned by version; a floating package is an untested dependency upgrade.
- Model count discipline: deprecate aggressively, expose lineage via exposures.
- Keep run times within the orchestration window; a 3-hour nightly build is a design constraint, not a badge.
Failure modes at scale
- Every mart re-implements casts because staging was skipped.
- Incremental model with no unique key; duplicates grow silently.
- 400 models, one tag, full build on every PR.
- Tests written once at launch and never updated after schema changes.
- Package upgraded on a Friday; a macro change breaks 40 models.
Verification receipts
- Layer conventions documented and enforced with lint rules.
dbt buildgreen in CI with slim selection demonstrated.- Incremental model tested twice on the same window — no duplicates.
- Source freshness configured with an alert.
- Lineage graph showing exposures for the top marts.
04 同仓库更多 Skills
interaction-patterns-architect
Architect-level interaction design in code — choosing established patterns over invented ones, feedback and latency behaviour, destructive-action safeguards, navigation and overlay conventions, and the state model behind every interactive surface. Use when a screen has to behave, not just look.
design-system-ops-architect
Architect-level operation of a design system in code — token pipelines and versioning, component API and variant policy, the catalogue as the contract, adoption metrics, and the governance that stops a system from forking into three. Use when a component library must survive several teams.
design-handoff-architect
Architect-level design handoff — what must be specified before implementation starts, tokens over raw values, responsive and content-limit contracts, state matrices, and the review loop that catches drift between design and code. Use when a design is about to become code.
content-microcopy-architect
Architect-level UI content — where strings live, voice and terminology consistency, error and empty-state copy as part of the interface, translation-ready authoring, and the content model a product needs before it multiplies screens. Use when the words in the interface matter as much as the pixels.
ui-ux-implementation-architect
Architect-level direction for turning a design into working UI — the handoff contract, component ownership versus screen-level layout, interaction and state conventions, design QA gates, and the review habits that keep an implementation faithful without frozen pixels. Use before any specific UI implementation skill.
test-strategy-architect
Architect-level test strategy — allocating assertions across unit, integration, contract and end-to-end layers, designing for testability through dependency boundaries, fixture and data strategy, and the flake and coverage policies that keep a suite trustworthy. Use when defining how a codebase is tested.