用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/UitbreidenOS/UitKit --skill dbt命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Guidelines and instructions for Agent execution state rollback rules
Guidelines and instructions for Agent execution step counters limits
Guidelines and instructions for Agent execution timeout limits setups
基于 SOC 职业分类
| name | dbt |
| description | dbt models, sources, tests, macros, incremental models, documentation, CI integration, Jinja patterns |
Always separate models into three layers:
models/
├── staging/ ← 1:1 with source tables. Light cleaning only. No joins.
│ ├── stg_orders.sql
│ └── stg_customers.sql
├── intermediate/ ← Business logic. Joins allowed. Not exposed to BI tools.
│ └── int_orders_with_customers.sql
└── marts/ ← Final business entities. Exposed to BI. Aggregations live here.
├── finance/
│ └── fct_revenue.sql
└── marketing/
└── dim_customers.sql
Staging rules:
stg_Mart rules:
fct_ prefix for fact tables (events, transactions)dim_ prefix for dimension tables (customers, products)-- models/marts/finance/fct_revenue.sql
{{
config(
materialized='incremental',
unique_key='order_id',
on_schema_change='fail'
)
}}
with orders as (
select * from {{ ref('int_orders_with_customers') }}
{% if is_incremental() %}
where created_at > (select max(created_at) from {{ this }})
{% endif %}
)
select
order_id,
customer_id,
amount,
created_at
from orders
Materialization choices:
view: default — good for staging and intermediate modelstable: for expensive queries queried frequentlyincremental: for large fact tables that grow over timeephemeral: CTEs, not materialized — use for simple transformations called once# models/marts/finance/schema.yml
version: 2
models:
- name: fct_revenue
description: "One row per completed order"
columns:
- name: order_id
description: "Primary key"
tests:
- unique
- not_null
- name: customer_id
tests:
- not_null
- relationships:
to: ref('dim_customers')
field: customer_id
- name: amount
tests:
- not_null
- dbt_utils.accepted_range:
min_value: 0
Minimum tests on every mart model: unique + not_null on primary key, not_null on critical foreign keys.
# models/staging/sources.yml
version: 2
sources:
- name: raw_stripe
database: raw
schema: stripe
freshness:
warn_after: {count: 12, period: hour}
error_after: {count: 24, period: hour}
loaded_at_field: _ingested_at
tables:
- name: charges
description: "Raw Stripe charges from Fivetran"
Always set freshness on sources — stale source data is a silent failure.
-- macros/cents_to_dollars.sql
{% macro cents_to_dollars(column_name) %}
({{ column_name }} / 100.0)::numeric(10, 2)
{% endmacro %}
-- Usage in model
select
{{ cents_to_dollars('amount_cents') }} as amount_dollars
from orders
User: Create staging and mart models for Stripe payments data (charges, refunds) with tests and freshness checks.
Expected output:
models/staging/stripe/sources.yml — source with freshness check on _ingested_atmodels/staging/stripe/stg_stripe_charges.sql — rename, cast, no joinsmodels/staging/stripe/stg_stripe_refunds.sql — same patternmodels/marts/finance/fct_payments.sql — join charges + refunds, net amount, incremental materializationmodels/marts/finance/schema.yml — unique + not_null on charge_id, relationship test on customer_id