Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计提醒

dbt-migration-snowflakeDBT 迁移 Snowflake

Agent Skill

dbt-migration-snowflake 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

212

周安装

9

GitHub Stars

31

下载量

74
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dbt-migration-snowflake(DBT 迁移 Snowflake)
来源仓库:https://github.com/sfc-gh-dflippo/snowflake-dbt-demo
仓库路径:skills/dbt-migration-snowflake
安装命令:
npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill dbt-migration-snowflake
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill dbt-migration-snowflake

简介

dbt-migration-snowflake 将 Snowflake DDL 转换为符合 dbt 规范的模型文件,保留原有业务逻辑。

  • 支持视图、表与存储过程迁移,自动生成 schema.yml 与测试用例,现代化遗留 SQL。
  • 适用于从传统数仓向 dbt 平台迁移,降低技术债务与提升可维护性。
  • 转换前需审核原逻辑准确性,避免因语法差异导致语义偏移;建议分阶段验证小批量数据。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Snowflake to dbt Model Conversion

Purpose

Transform Snowflake DDL (views, tables, stored procedures) into production-quality dbt models, maintaining the same business logic and data transformation steps while following dbt best practices.

When to Use This Skill

Activate this skill when users ask about:

  • Converting Snowflake views or tables to dbt models
  • Migrating Snowflake stored procedures to dbt
  • Generating schema.yml files with tests and documentation
  • Modernizing existing Snowflake SQL to follow dbt best practices

Task Description

You are a database engineer working for a hospital system. You need to convert Snowflake DDL to equivalent dbt code, maintaining the same business logic and data transformation steps while following dbt best practices.

Input Requirements

I will provide you the Snowflake DDL to convert.

Audience

The code will be executed by data engineers who are learning Snowflake and dbt.

Output Requirements

Generate the following:

  1. One or more dbt models with complete SQL for every column
  2. A corresponding schema.yml file with appropriate tests and documentation
  3. A config block with materialization strategy
  4. Explanation of key changes and architectural decisions
  5. Inline comments highlighting any syntax that was converted

Conversion Guidelines

General Principles

  • Replace procedural logic with declarative SQL where possible
  • Break down complex procedures into multiple modular dbt models
  • Implement appropriate incremental processing strategies
  • Maintain data quality checks through dbt tests
  • Use Snowflake SQL functions rather than macros whenever possible

Sample Response Format

-- dbt model: models/[domain]/[target_schema_name]/model_name.sql
{{ config(materialized='view') }}

/* Original Object: [database].[schema].[object_name]
   Source Platform: Snowflake
   Purpose: [brief description]
   Conversion Notes: [key changes]
   Description: [SQL logic description] */

WITH source_data AS (
    SELECT
        customer_id::INTEGER AS customer_id,
        customer_name::VARCHAR(100) AS customer_name,
        account_balance::NUMBER(18,2) AS account_balance,
        created_date::DATE AS created_date
    FROM {{ ref('upstream_model') }}
),

transformed_data AS (
    SELECT
        customer_id,
        UPPER(customer_name)::VARCHAR(100) AS customer_name_upper,
        account_balance,
        created_date,
        CURRENT_TIMESTAMP()::TIMESTAMP_NTZ AS loaded_at
    FROM source_data
)

SELECT
    customer_id,
    customer_name_upper,
    account_balance,
    created_date,
    loaded_at
FROM transformed_data
## models/[domain]/[target_schema_name]/_models.yml
version: 2

models:
  - name: model_name
    description: "Table description; converted from Snowflake [Original object name]"
    columns:
      - name: customer_id
        description: "Primary key - unique customer identifier"
        tests:
          - unique
          - not_null
      - name: customer_name_upper
        description: "Customer name in uppercase"
      - name: account_balance
        description: "Current account balance; Foreign key to OTHER_TABLE"
        tests:
          - relationships:
              to: ref('OTHER_TABLE')
              field: OTHER_TABLE_KEY
      - name: created_date
        description: "Date the customer record was created"
      - name: loaded_at
        description: "Timestamp when the record was loaded by dbt"
## dbt_project.yml (excerpt)
models:
  my_project:
    +materialized: view
    domain_name:
      +schema: target_schema_name

Specific Translation Rules

dbt Specific Requirements

  • If the source is a view, use a view materialization in dbt
  • Include appropriate dbt model configuration (materialization type)
  • Add documentation blocks for a schema.yml
  • Add descriptions for tables and columns
  • Include relevant tests
  • Define primary keys and relationships
  • Assume that upstream objects are models
  • Comprehensively provide all the columns in the output
  • Break complex procedures into multiple models if needed
  • Implement appropriate incremental strategies for large tables
  • Use Snowflake SQL functions rather than macros whenever possible
  • Always cast columns with explicit precision/scale using ::TYPE syntax (e.g., column_name::VARCHAR(100), amount::NUMBER(18,2)) to ensure output matches expected data types
  • Always provide explicit column aliases for clarity and documentation

Performance Optimization

  • Suggest clustering keys if needed
  • Recommend materialization strategy (view vs table)
  • Identify potential performance improvements

Snowflake to dbt Conversion Patterns

Since the source is Snowflake, focus on converting to dbt best practices:

Snowflake Objectdbt EquivalentMaterialization
VIEWdbt modelview
TABLE (static)dbt modeltable
TABLE (append)dbt modelincremental (append)
TABLE (merge)dbt modelincremental (merge)
DYNAMIC TABLEdbt modelincremental or table
MATERIALIZED VIEWdbt modeltable with scheduling
STORED PROCEDUREdbt model(s)Break into CTEs/models
STREAM + TASKdbt modelincremental with is_incremental()

Key Conversion Examples

-- Snowflake VIEW → dbt view model
CREATE VIEW schema.my_view AS SELECT ... →
{{ config(materialized='view') }}
SELECT ...

-- Snowflake TABLE with CTAS → dbt table model
CREATE TABLE schema.my_table AS SELECT ... →
{{ config(materialized='table') }}
SELECT ...

-- Snowflake MERGE pattern → dbt incremental
MERGE INTO target USING source ON ... →
{{ config(
    materialized='incremental',
    unique_key='id',
    merge_update_columns=['col1', 'col2']
) }}
SELECT ... FROM {{ ref('source_model') }}
{% if is_incremental() %}
WHERE updated_at > (SELECT MAX(updated_at) FROM {{ this }})
{% endif %}

-- Snowflake STREAM/TASK → dbt incremental
CREATE STREAM my_stream ON TABLE source;
CREATE TASK my_task ... INSERT INTO target SELECT * FROM my_stream →
{{ config(materialized='incremental', unique_key='id') }}
SELECT * FROM {{ ref('source') }}
{% if is_incremental() %}
WHERE _metadata_timestamp > (SELECT MAX(_metadata_timestamp) FROM {{ this }})
{% endif %}

-- Stored procedure logic → CTE pattern
BEGIN ... multiple statements ... END →
WITH step1 AS (...), step2 AS (...), step3 AS (...)
SELECT * FROM step3

Snowflake-Specific Features in dbt

-- Clustering keys
{{ config(
    materialized='table',
    cluster_by=['date_col', 'category']
) }}

-- Transient tables (no Time Travel/Fail-safe)
{{ config(
    materialized='table',
    transient=true
) }}

-- Copy grants
{{ config(copy_grants=true) }}

-- Query tags
{{ config(query_tag='dbt_model_name') }}

Data Type Handling

Snowflake data types map directly - no conversion needed.

Dependencies

  • List any upstream dependencies
  • Suggest model organization in dbt project

Validation Checklist

  • [] Every DDL statement has been accounted for in the dbt models
  • [] SQL in models is compatible with Snowflake (already native)
  • [] All business logic preserved
  • [] All columns included in output
  • [] Data types correctly mapped
  • [] Functions translated to Snowflake equivalents
  • [] Materialization strategy selected
  • [] Tests added
  • [] SQL logic description complete
  • [] Table descriptions added
  • [] Column descriptions added
  • [] Dependencies correctly mapped
  • [] Incremental logic (if applicable) verified
  • [] Inline comments added for converted syntax

Related Skills

  • $dbt-migration - For the complete migration workflow (discovery, planning, placeholder models, testing, deployment)
  • $dbt-modeling - For CTE patterns and SQL structure guidance
  • $dbt-testing - For implementing comprehensive dbt tests
  • $dbt-architecture - For project organization and folder structure
  • $dbt-materializations - For choosing materialization strategies (view, table, incremental, snapshots)
  • $dbt-performance - For clustering keys, warehouse sizing, and query optimization
  • $dbt-commands - For running dbt commands and model selection syntax
  • $dbt-core - For dbt installation, configuration, and package management
  • $snowflake-cli - For executing SQL and managing Snowflake objects

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.82%
按下载量换算29

Claude

28.81%
按下载量换算21

Cursor

20%
按下载量换算15

Gemini CLI

9.82%
按下载量换算7

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills