[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F0EJZHM6DP34ACYQ97GQDB":3,"skill-same:01M7F0EJZHM6DP34ACYQ97GQDB":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7F0EJZHM6DP34ACYQ97GQDB","dbt-transformation-patterns",null,"Write and test dbt models in SQL, with sources and freshness, staging, intermediate and mart layers, incremental and microbatch models, data tests, unit tests and macros, in YAML that is valid for dbt Core 1.10+ and dbt v2. Use when the task is a dbt project or a SQL transformation that runs inside the warehouse. For scheduling dbt runs use airflow-dag-patterns; for Great Expectations or data contracts use data-quality-frameworks.","shotcowboystyle\u002Fag-skills","shotcowboystyle","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F62471?v=4","01M7EZTCFCZJ6K3MYW8BPM4X6R","Curtis Blanton","01M7EZTCG1S5M04J90A931X9BX",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdata-engineering\u002Fskills\u002Fdbt-transformation-patterns\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: dbt-transformation-patterns\ndescription: Write and test dbt models in SQL, with sources and freshness, staging, intermediate and mart layers, incremental and microbatch models, data tests, unit tests and macros, in YAML that is valid for dbt Core 1.10+ and dbt v2. Use when the task is a dbt project or a SQL transformation that runs inside the warehouse. For scheduling dbt runs use airflow-dag-patterns; for Great Expectations or data contracts use data-quality-frameworks.\nlast_verified: 2026-10-27\n---\n\n# dbt Transformation Patterns\n\nBuild dbt models that are layered, tested and cheap to rebuild. Examples are checked against\ndbt Core 1.12 with dbt-duckdb.\n\n## Procedure\n\n1. **Check the version.** Run `dbt --version`, then `dbt parse`. Fix every deprecation warning\n   it prints: dbt v2 turns them into errors. The YAML here uses the 1.10+ forms: `data_tests:`\n   instead of `tests:`, generic test arguments under `arguments:`, and `freshness`, `meta` and\n   `tags` under `config:`. Use `--select`; `--models` and `-m` are gone in v2.\n2. **Declare every raw table as a source** with a `loaded_at_field` and `freshness`. Models\n   read raw data only through `{{ source() }}`, and everything else through `{{ ref() }}`.\n3. **Staging:** one `stg_\u003Csource>__\u003Ctable>` model per source table. Rename, cast, convert units\n   and nothing else: no joins, no filters that drop business rows. Materialize as views.\n4. **Intermediate:** `int_` models hold joins and business logic shared by more than one mart.\n   Skip the layer when a mart is the only consumer.\n5. **Marts:** `fct_` tables hold one row per event and `dim_` tables one row per entity. State\n   the grain in the model description and test it with `unique` on the key.\n6. **Go incremental only when a full rebuild is too slow or costly**, measured on the real\n   table. Pick a `unique_key`, reprocess a lookback window for late rows, and set\n   `incremental_strategy` explicitly, since the default differs by adapter. For large event\n   tables on dbt 1.9+, prefer `incremental_strategy='microbatch'`.\n7. **Test every model:** `unique` and `not_null` on its key, `relationships` on foreign keys,\n   `accepted_values` on status columns. Add a unit test for any CASE, window or date logic.\n8. **Build and verify:** run `dbt build --select \u003Cmodel>+` in a dev target, then rebuild an\n   incremental model with `--full-refresh` and compare row counts with the incremental result.\n9. **Stop when** `dbt build` passes with no warnings, every model has a key test, and source\n   freshness passes with `dbt source freshness`.\n\nReport back with the models added or changed and their materialization, the tests on each, and\nthe build commands with their results.\n\n## Layers\n\ndbt's own convention is staging, intermediate and marts, a split by purpose. Medallion\n(bronze, silver, gold) is a Databricks lakehouse convention for storage zones, and the two\ndon't map one to one: a raw source loaded by Fivetran is closest to bronze, and staging models\nare views over it, not a cleaned copy. Name layers the way the project already does and don't\nrelabel one as the other.\n\n```\nsources (raw, loaded by EL tools)\n  └─ staging\u002F       stg_stripe__payments       view, 1:1 with a source table\n       └─ intermediate\u002F  int_customer_payments  joins and shared logic\n            └─ marts\u002F    fct_payments, dim_customers   tables for BI and consumers\n```\n\n## Quick Start\n\n```yaml\n# dbt_project.yml\nname: analytics\nversion: \"1.0.0\"\nprofile: analytics\n\nmodels:\n  analytics:\n    staging:\n      +materialized: view\n    intermediate:\n      +materialized: view\n    marts:\n      +materialized: table\n```\n\n```\nmodels\u002F\n├── staging\u002Fstripe\u002F\n│   ├── _stripe__sources.yml\n│   ├── _stripe__models.yml\n│   ├── stg_stripe__customers.sql\n│   └── stg_stripe__payments.sql\n├── intermediate\u002F\n│   └── int_customer_payments.sql\n└── marts\u002F\n    ├── _marts__models.yml\n    ├── dim_customers.sql\n    └── fct_payments.sql\n```\n\n```sql\n-- models\u002Fstaging\u002Fstripe\u002Fstg_stripe__payments.sql\nwith source as (\n    select * from {{ source('stripe', 'payments') }}\n)\n\nselect\n    id as payment_id,\n    customer_id,\n    cast(amount as numeric(18, 2)) \u002F 100 as amount,\n    status as payment_status,\n    cast(created as timestamp) as created_at,\n    _loaded_at\nfrom source\n```\n\n## Best practices\n\n- **One source of truth per concept.** If two marts compute revenue, move the logic into one\n  intermediate model.\n- **Keep business logic out of staging.** Staging that filters or joins hides data from every\n  downstream model.\n- **Use `{{ var() }}` or the run's context for dates**, never a hardcoded date in a model.\n- **Limit dev builds**, for example with a `target.name == 'dev'` filter on large sources.\n- **Don't test in production.** Build in a dev schema and use `--defer --state` to read\n  unchanged parents from production.\n\n## References\n\n- `references\u002Fdetails.md`: sources with freshness, the staging, intermediate and mart models of\n  the example project, tests and unit tests in 1.10+ YAML, macros, incremental strategies\n  and microbatch, and the command reference.\n","# dbt Transformation Patterns\n\nBuild dbt models that are layered, tested and cheap to rebuild. Examples are checked against\ndbt Core 1.12 with dbt-duckdb.\n\n## Procedure\n\n1. **Check the version.** Run `dbt --version`, then `dbt parse`. Fix every deprecation warning\n   it prints: dbt v2 turns them into errors. The YAML here uses the 1.10+ forms: `data_tests:`\n   instead of `tests:`, generic test arguments under `arguments:`, and `freshness`, `meta` and\n   `tags` under `config:`. Use `--select`; `--models` and `-m` are gone in v2.\n2. **Declare every raw table as a source** with a `loaded_at_field` and `freshness`. Models\n   read raw data only through `{{ source() }}`, and everything else through `{{ ref() }}`.\n3. **Staging:** one `stg_\u003Csource>__\u003Ctable>` model per source table. Rename, cast, convert units\n   and nothing else: no joins, no filters that drop business rows. Materialize as views.\n4. **Intermediate:** `int_` models hold joins and business logic shared by more than one mart.\n   Skip the layer when a mart is the only consumer.\n5. **Marts:** `fct_` tables hold one row per event and `dim_` tables one row per entity. State\n   the grain in the model description and test it with `unique` on the key.\n6. **Go incremental only when a full rebuild is too slow or costly**, measured on the real\n   table. Pick a `unique_key`, reprocess a lookback window for late rows, and set\n   `incremental_strategy` explicitly, since the default differs by adapter. For large event\n   tables on dbt 1.9+, prefer `incremental_strategy='microbatch'`.\n7. **Test every model:** `unique` and `not_null` on its key, `relationships` on foreign keys,\n   `accepted_values` on status columns. Add a unit test for any CASE, window or date logic.\n8. **Build and verify:** run `dbt build --select \u003Cmodel>+` in a dev target, then rebuild an\n   incremental model with `--full-refresh` and compare row counts with the incremental result.\n9. **Stop when** `dbt build` passes with no warnings, every model has a key test, and source\n   freshness passes with `dbt source freshness`.\n\nReport back with the models added or changed and their materialization, the tests on each, and\nthe build commands with their results.\n\n## Layers\n\ndbt's own convention is staging, intermediate and marts, a split by purpose. Medallion\n(bronze, silver, gold) is a Databricks lakehouse convention for storage zones, and the two\ndon't map one to one: a raw source loaded by Fivetran is closest to bronze, and staging models\nare views over it, not a cleaned copy. Name layers the way the project already does and don't\nrelabel one as the other.\n\n```\nsources (raw, loaded by EL tools)\n  └─ staging\u002F       stg_stripe__payments       view, 1:1 with a source table\n       └─ intermediate\u002F  int_customer_payments  joins and shared logic\n            └─ marts\u002F    fct_payments, dim_customers   tables for BI and consumers\n```\n\n## Quick Start\n\n```yaml\n# dbt_project.yml\nname: analytics\nversion: \"1.0.0\"\nprofile: analytics\n\nmodels:\n  analytics:\n    staging:\n      +materialized: view\n    intermediate:\n      +materialized: view\n    marts:\n      +materialized: table\n```\n\n```\nmodels\u002F\n├── staging\u002Fstripe\u002F\n│   ├── _stripe__sources.yml\n│   ├── _stripe__models.yml\n│   ├── stg_stripe__customers.sql\n│   └── stg_stripe__payments.sql\n├── intermediate\u002F\n│   └── int_customer_payments.sql\n└── marts\u002F\n    ├── _marts__models.yml\n    ├── dim_customers.sql\n    └── fct_payments.sql\n```\n\n```sql\n-- models\u002Fstaging\u002Fstripe\u002Fstg_stripe__payments.sql\nwith source as (\n    select * from {{ source('stripe', 'payments') }}\n)\n\nselect\n    id as payment_id,\n    customer_id,\n    cast(amount as numeric(18, 2)) \u002F 100 as amount,\n    status as payment_status,\n    cast(created as timestamp) as created_at,\n    _loaded_at\nfrom source\n```\n\n## Best practices\n\n- **One source of truth per concept.** If two marts compute revenue, move the logic into one\n  intermediate model.\n- **Keep business logic out of staging.** Staging that filters or joins hides data from every\n  downstream model.\n- **Use `{{ var() }}` or the run's context for dates**, never a hardcoded date in a model.\n- **Limit dev builds**, for example with a `target.name == 'dev'` filter on large sources.\n- **Don't test in production.** Build in a dev schema and use `--defer --state` to read\n  unchanged parents from production.\n\n## References\n\n- `references\u002Fdetails.md`: sources with freshness, the staging, intermediate and mart models of\n  the example project, tests and unit tests in 1.10+ YAML, macros, incremental strategies\n  and microbatch, and the command reference.\n",{"name":5,"description":7,"last_verified":24},1793059200000,"main","f846d9a97082ff30d613b55a085cef425d822473","plugins\u002Fdata-engineering\u002Fskills\u002Fdbt-transformation-patterns","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle","https:\u002F\u002Fshotcowboystyle.github.io","Building smarter with AI, automation & modern tools. Exploring how far one person can go without a big team using today’s AI.","2026-11-10 04:58:27",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add shotcowboystyle\u002Fag-skills --skill dbt-transformation-patterns",{"tool":39,"command":40},"bunx","bunx skills add shotcowboystyle\u002Fag-skills --skill dbt-transformation-patterns",{"tool":42,"command":43},"pnpm","pnpm dlx skills add shotcowboystyle\u002Fag-skills --skill dbt-transformation-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdata-engineering\u002Fskills\u002Fdbt-transformation-patterns\u002FSKILL.md",true,[47],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fdetails.md","REFERENCE","参考文档",8527,"https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fdata-engineering\u002Fskills\u002Fdbt-transformation-patterns\u002Freferences\u002Fdetails.md",[54,60,67,74,81,88],{"skillNo":55,"name":56,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7F1YRY5S5QRJ1V0BJS130QX","no-description","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fno-description\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7F1Y9BV2FJNQJ3NB32JS5CM","good-skill","Fixture skill that satisfies every rule.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7F1XXBQ3NQRXZSS0KAGAR9V","broken-link","Links to a reference file that does not exist.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbroken-link\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7F1XBX4R46NR9W0HXQ7XCDX","Bad_Name","Name violates the kebab-case rule and does not match the directory.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad-name\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7F1WNAF8WNEQ7S5HKT5VK0D","skill-authoring","Write, review, and validate portable agent skills in SKILL.md format. Use when creating a new skill, editing an existing one, or asked whether a skill follows the Agent Skills spec.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fskills\u002Fskill-authoring\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7F1W30TC0XFNSF7YBRGETK2","weigh-bags","Record scale readings for each bag — empty (tare), outbound, current, final — and reconcile them against the itemised inventory to find unaccounted weight. Use when the user gives a bag weight, says how heavy something is, weighs their luggage, or asks how close to the limit they are. Appends to bags.yaml and runs scripts\u002Freconcile.py.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftravel-packing-assistant\u002Fskills\u002Fweigh-bags\u002FSKILL.md",[],[]]