dbt-transformation-patterns – skill Dữ liệu & Khoa học cho agent AI
Thành thạo dbt (data build tool) cho analytics engineering với tổ chức model, kiểm thử, tài liệu và chiến lược incremental. Dùng khi xây dựng chuyển đổi dữ liệu, tạo data model hoặc áp dụng thực hành tốt nhất của analytics engineering.
Cài skill dbt-transformation-patterns bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbt-transformation-patterns-6893d.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /dbt-transformation-patterns – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbt-transformation-patterns-6893d.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $dbt-transformation-patterns – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbt-transformation-patterns-6893d.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /dbt-transformation-patterns – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/dbt-transformation-patterns-6893d.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /dbt-transformation-patterns – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
dbt Transformation Patterns
Production-ready patterns for dbt (data build tool) including model organization, testing strategies, documentation, and incremental processing.
When to Use This Skill
- Building data transformation pipelines with dbt
- Organizing models into staging, intermediate, and marts layers
- Implementing data quality tests
- Creating incremental models for large datasets
- Documenting data models and lineage
- Setting up dbt project structure
Core Concepts
1. Model Layers (Medallion Architecture)
sources/ Raw data definitions
↓
staging/ 1:1 with source, light cleaning
↓
intermediate/ Business logic, joins, aggregations
↓
marts/ Final analytics tables2. Naming Conventions
| Layer | Prefix | Example |
| ------------ | -------------- | ----------------------------- |
| Staging | stg_ | stg_stripe__payments |
| Intermediate | int_ | int_payments_pivoted |
| Marts | dim_, fct_ | dim_customers, fct_orders |
Quick Start
# dbt_project.yml
name: "analytics"
version: "1.0.0"
profile: "analytics"
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
vars:
start_date: "2020-01-01"
models:
analytics:
staging:
+materialized: view
+schema: staging
intermediate:
+materialized: ephemeral
marts:
+materialized: table
+schema: analytics# Project structure
models/
├── staging/
│ ├── stripe/
│ │ ├── _stripe__sources.yml
│ │ ├── _stripe__models.yml
│ │ ├── stg_stripe__customers.sql
│ │ └── stg_stripe__payments.sql
│ └── shopify/
│ ├── _shopify__sources.yml
│ └── stg_shopify__orders.sql
├── intermediate/
│ └── finance/
│ └── int_payments_pivoted.sql
└── marts/
├── core/
│ ├── _core__models.yml
│ ├── dim_customers.sql
│ └── fct_orders.sql
└── finance/
└── fct_revenue.sqlDetailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Best Practices
Do's
- Use staging layer - Clean data once, use everywhere
- Test aggressively - Not null, unique, relationships
- Document everything - Column descriptions, model descriptions
- Use incremental - For tables > 1M rows
- Version control - dbt project in Git
Don'ts
- Don't skip staging - Raw → mart is tech debt
- Don't hardcode dates - Use
{{ var('start_date') }} - Don't repeat logic - Extract to macros
- Don't test in prod - Use dev target
- Don't ignore freshness - Monitor source data
Skill liên quan
- dnanexus-integration – Xây dựng và vận hành khối lượng công việc genomics có thể tái lập trên DNAnexus với dx…
- announcement-board – Bảng thông báo: tác giả, danh mục, phòng ban, mức độ ưu tiên, đối tượng, ngày đăng và…
- anti-reversing-techniques – Phân tích kỹ thuật chống debug, obfuscation và anti-tamper trong quá trình phân tích nhị…
- business-investment-advisor – Cố vấn phân tích đầu tư doanh nghiệp và phân bổ vốn. Dùng khi đánh giá có nên đầu tư vào…
- customer-research – Khi người dùng muốn thực hiện, phân tích hoặc tổng hợp nghiên cứu khách hàng. Dùng khi…
- dependency-upgrade – Quản lý nâng cấp phiên bản dependency lớn với phân tích tương thích, triển khai theo…
- capa-officer – Quản lý hệ thống CAPA cho QMS thiết bị y tế. Bao gồm phân tích nguyên nhân gốc rễ, lập…
- comps-analysis – Xây dựng bảng tính định giá công ty so sánh (comparable-company) bằng Excel.