snowflake-reference-architecture
Implement Snowflake reference architecture with medallion pattern and Snowflake-native design. Use when designing a new Snowflake data platform, setting up bronze/silver/gold layers, or establishing architecture standards for a Snowflake deployment. Trigger with phrases like "snowflake architecture", "snowflake medallion", "snowflake best practices layout", "snowflake data platform design".
Best use case
snowflake-reference-architecture is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Implement Snowflake reference architecture with medallion pattern and Snowflake-native design. Use when designing a new Snowflake data platform, setting up bronze/silver/gold layers, or establishing architecture standards for a Snowflake deployment. Trigger with phrases like "snowflake architecture", "snowflake medallion", "snowflake best practices layout", "snowflake data platform design".
Teams using snowflake-reference-architecture should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/snowflake-reference-architecture/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How snowflake-reference-architecture Compares
| Feature / Agent | snowflake-reference-architecture | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Implement Snowflake reference architecture with medallion pattern and Snowflake-native design. Use when designing a new Snowflake data platform, setting up bronze/silver/gold layers, or establishing architecture standards for a Snowflake deployment. Trigger with phrases like "snowflake architecture", "snowflake medallion", "snowflake best practices layout", "snowflake data platform design".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Snowflake Reference Architecture
## Overview
Production-ready Snowflake architecture using the medallion pattern (bronze/silver/gold), role-based access, and workload-isolated warehouses.
## Architecture Overview
```
┌──────────────────────┐
│ Data Sources │
│ (S3, APIs, DBs, SaaS) │
└──────────┬───────────┘
│
┌──────────▼───────────┐
│ BRONZE (Raw) │
│ Snowpipe / COPY │
│ VARIANT columns │
└──────────┬───────────┘
│ Streams + Tasks
┌──────────▼───────────┐
│ SILVER (Cleansed) │
│ Typed columns │
│ Deduped, validated │
└──────────┬───────────┘
│ Dynamic Tables
┌──────────▼───────────┐
│ GOLD (Business) │
│ Aggregated │
│ Analytics-ready │
└──────────┬───────────┘
│
┌──────────▼───────────┐
│ Consumers │
│ BI tools, APIs, │
│ Data Sharing │
└──────────────────────┘
```
## Database Layout
```sql
-- One database per environment, schemas per layer
CREATE DATABASE PROD_DW;
-- Bronze: Raw ingested data (append-only, VARIANT columns)
CREATE SCHEMA PROD_DW.BRONZE;
-- Silver: Cleansed, typed, deduplicated
CREATE SCHEMA PROD_DW.SILVER;
-- Gold: Business-level aggregations and dimensions
CREATE SCHEMA PROD_DW.GOLD;
-- Staging: Temporary tables for ETL processing
CREATE SCHEMA PROD_DW.STAGING;
-- Utility: Stored procedures, UDFs, file formats
CREATE SCHEMA PROD_DW.UTILITY;
```
## Instructions
### Step 1: Bronze Layer (Raw Ingestion)
```sql
-- Store raw data as VARIANT for schema-on-read
CREATE TABLE PROD_DW.BRONZE.RAW_EVENTS (
ingestion_time TIMESTAMP_NTZ DEFAULT CURRENT_TIMESTAMP(),
source_file VARCHAR(500),
raw_data VARIANT
);
-- File format for JSON ingestion
CREATE FILE FORMAT PROD_DW.UTILITY.JSON_INGEST
TYPE = 'JSON' STRIP_OUTER_ARRAY = TRUE;
-- Stage for S3 source
CREATE STAGE PROD_DW.UTILITY.S3_EVENTS_STAGE
STORAGE_INTEGRATION = s3_integration
URL = 's3://data-lake/events/'
FILE_FORMAT = PROD_DW.UTILITY.JSON_INGEST;
-- Snowpipe for continuous ingestion
CREATE PIPE PROD_DW.BRONZE.EVENTS_PIPE
AUTO_INGEST = TRUE
AS
COPY INTO PROD_DW.BRONZE.RAW_EVENTS (source_file, raw_data)
FROM (SELECT METADATA$FILENAME, $1 FROM @PROD_DW.UTILITY.S3_EVENTS_STAGE);
```
### Step 2: Silver Layer (Cleansing)
```sql
-- Stream on bronze table
CREATE STREAM PROD_DW.BRONZE.EVENTS_STREAM
ON TABLE PROD_DW.BRONZE.RAW_EVENTS APPEND_ONLY = TRUE;
-- Silver table with typed columns
CREATE TABLE PROD_DW.SILVER.EVENTS (
event_id VARCHAR(36) NOT NULL,
event_type VARCHAR(50) NOT NULL,
user_id INTEGER,
event_data VARIANT,
event_timestamp TIMESTAMP_NTZ NOT NULL,
processed_at TIMESTAMP_NTZ DEFAULT CURRENT_TIMESTAMP(),
CONSTRAINT pk_events PRIMARY KEY (event_id)
);
-- Task to transform bronze → silver
CREATE TASK PROD_DW.SILVER.TRANSFORM_EVENTS
WAREHOUSE = ETL_WH
SCHEDULE = '5 MINUTE'
WHEN SYSTEM$STREAM_HAS_DATA('PROD_DW.BRONZE.EVENTS_STREAM')
AS
INSERT INTO PROD_DW.SILVER.EVENTS (event_id, event_type, user_id, event_data, event_timestamp)
SELECT
raw_data:id::VARCHAR AS event_id,
raw_data:type::VARCHAR AS event_type,
raw_data:user_id::INTEGER AS user_id,
raw_data:data AS event_data,
raw_data:timestamp::TIMESTAMP_NTZ AS event_timestamp
FROM PROD_DW.BRONZE.EVENTS_STREAM
WHERE raw_data:id IS NOT NULL
AND raw_data:type IS NOT NULL
AND raw_data:timestamp IS NOT NULL;
ALTER TASK PROD_DW.SILVER.TRANSFORM_EVENTS RESUME;
```
### Step 3: Gold Layer (Business Aggregations)
```sql
-- Dynamic table for real-time aggregation
CREATE DYNAMIC TABLE PROD_DW.GOLD.USER_ACTIVITY_SUMMARY
TARGET_LAG = '30 minutes'
WAREHOUSE = ANALYTICS_WH
AS
SELECT
user_id,
COUNT(*) AS total_events,
COUNT(DISTINCT event_type) AS unique_event_types,
MIN(event_timestamp) AS first_seen,
MAX(event_timestamp) AS last_seen,
COUNT_IF(event_type = 'purchase') AS purchase_count,
SUM(CASE WHEN event_type = 'purchase'
THEN event_data:amount::DECIMAL(12,2) ELSE 0 END) AS total_spend
FROM PROD_DW.SILVER.EVENTS
GROUP BY user_id;
-- Materialized view for frequently-queried metrics
CREATE MATERIALIZED VIEW PROD_DW.GOLD.DAILY_METRICS AS
SELECT
DATE_TRUNC('day', event_timestamp) AS metric_date,
event_type,
COUNT(*) AS event_count,
COUNT(DISTINCT user_id) AS unique_users
FROM PROD_DW.SILVER.EVENTS
GROUP BY metric_date, event_type;
```
### Step 4: Warehouse Strategy
```sql
-- Workload-isolated warehouses
CREATE WAREHOUSE ETL_WH
WAREHOUSE_SIZE = 'LARGE' AUTO_SUSPEND = 120 AUTO_RESUME = TRUE
COMMENT = 'Bronze→Silver→Gold transformations';
CREATE WAREHOUSE ANALYTICS_WH
WAREHOUSE_SIZE = 'MEDIUM'
MIN_CLUSTER_COUNT = 1 MAX_CLUSTER_COUNT = 3
SCALING_POLICY = 'STANDARD'
AUTO_SUSPEND = 300 AUTO_RESUME = TRUE
COMMENT = 'BI tools, ad-hoc analytics';
CREATE WAREHOUSE DASHBOARD_WH
WAREHOUSE_SIZE = 'SMALL' AUTO_SUSPEND = 60 AUTO_RESUME = TRUE
COMMENT = 'Dashboard refresh queries';
CREATE WAREHOUSE DEV_WH
WAREHOUSE_SIZE = 'XSMALL' AUTO_SUSPEND = 60 AUTO_RESUME = TRUE
COMMENT = 'Development and testing';
```
### Step 5: Role Hierarchy
```sql
-- Custom roles following Snowflake best practices
CREATE ROLE DATA_ENGINEER; -- Full access to bronze/silver
CREATE ROLE DATA_ANALYST; -- Read silver/gold, write gold
CREATE ROLE BI_VIEWER; -- Read-only gold layer
CREATE ROLE SVC_ETL; -- Service account for pipelines
-- Hierarchy: custom roles → SYSADMIN
GRANT ROLE DATA_ENGINEER TO ROLE SYSADMIN;
GRANT ROLE DATA_ANALYST TO ROLE SYSADMIN;
GRANT ROLE BI_VIEWER TO ROLE DATA_ANALYST;
GRANT ROLE SVC_ETL TO ROLE DATA_ENGINEER;
-- Warehouse grants
GRANT USAGE ON WAREHOUSE ETL_WH TO ROLE DATA_ENGINEER;
GRANT USAGE ON WAREHOUSE ANALYTICS_WH TO ROLE DATA_ANALYST;
GRANT USAGE ON WAREHOUSE DASHBOARD_WH TO ROLE BI_VIEWER;
-- Schema grants
GRANT ALL ON SCHEMA PROD_DW.BRONZE TO ROLE DATA_ENGINEER;
GRANT ALL ON SCHEMA PROD_DW.SILVER TO ROLE DATA_ENGINEER;
GRANT SELECT ON ALL TABLES IN SCHEMA PROD_DW.SILVER TO ROLE DATA_ANALYST;
GRANT SELECT ON ALL TABLES IN SCHEMA PROD_DW.GOLD TO ROLE DATA_ANALYST;
GRANT SELECT ON ALL TABLES IN SCHEMA PROD_DW.GOLD TO ROLE BI_VIEWER;
```
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| Bronze data quality issues | Bad source data | Add validation in silver transform |
| Silver transform fails | Schema drift in source | Use TRY_CAST and COALESCE |
| Gold table stale | Dynamic table lag too high | Reduce TARGET_LAG or investigate |
| Warehouse contention | Shared warehouse | Separate workloads into dedicated warehouses |
## Resources
- [Snowflake Architecture](https://docs.snowflake.com/en/user-guide/intro-supported-features)
- [Dynamic Tables](https://docs.snowflake.com/en/user-guide/dynamic-tables-about)
- [Access Control Best Practices](https://docs.snowflake.com/en/user-guide/security-access-control-considerations)
## Next Steps
For multi-environment setup, see `snowflake-multi-env-setup`.Related Skills
workhuman-reference-architecture
Workhuman reference architecture for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman reference architecture".
wispr-reference-architecture
Wispr Flow reference architecture for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr reference architecture".
windsurf-reference-architecture
Implement Windsurf reference architecture with optimal project structure and AI configuration. Use when designing workspace configuration for Windsurf, setting up team standards, or establishing architecture patterns that maximize Cascade effectiveness. Trigger with phrases like "windsurf architecture", "windsurf project structure", "windsurf best practices", "windsurf team setup", "optimize for cascade".
windsurf-architecture-variants
Choose workspace architectures for different project scales in Windsurf. Use when deciding how to structure Windsurf workspaces for monorepos, multi-service setups, or polyglot codebases. Trigger with phrases like "windsurf workspace strategy", "windsurf monorepo", "windsurf project layout", "windsurf multi-service", "windsurf workspace size".
webflow-reference-architecture
Implement Webflow reference architecture — layered project structure, client wrapper, CMS sync service, webhook handlers, and caching layer for production integrations. Trigger with phrases like "webflow architecture", "webflow project structure", "how to organize webflow", "webflow integration design", "webflow best practices".
vercel-reference-architecture
Implement a Vercel reference architecture with layered project structure and best practices. Use when designing new Vercel projects, reviewing project structure, or establishing architecture standards for Vercel applications. Trigger with phrases like "vercel architecture", "vercel project structure", "vercel best practices layout", "how to organize vercel project".
vercel-architecture-variants
Choose and implement Vercel architecture blueprints for different scales and use cases. Use when designing new Vercel projects, choosing between static, serverless, and edge architectures, or planning how to structure a multi-project Vercel deployment. Trigger with phrases like "vercel architecture", "vercel blueprint", "how to structure vercel", "vercel monorepo", "vercel multi-project".
veeva-reference-architecture
Veeva Vault reference architecture for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva reference architecture".
vastai-reference-architecture
Implement Vast.ai reference architecture for GPU compute workflows. Use when designing ML training pipelines, structuring GPU orchestration, or establishing architecture patterns for Vast.ai applications. Trigger with phrases like "vastai architecture", "vastai design pattern", "vastai project structure", "vastai ml pipeline".
twinmind-reference-architecture
Production architecture for meeting AI systems using TwinMind: transcription pipeline, memory vault, action item workflow, and calendar integration. Use when implementing reference architecture, or managing TwinMind meeting AI operations. Trigger with phrases like "twinmind reference architecture", "twinmind reference architecture".
together-reference-architecture
Together AI reference architecture for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together reference architecture".
techsmith-reference-architecture
TechSmith reference architecture for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith reference architecture".