Imported from borghei/claude-skills (
engineering/snowflake-development/SKILL.md). Install upstream withnpx skills add borghei/claude-skills --skill snowflake-development. Copyright stays with the author (MIT + Commons Clause).
Snowflake Development
Category: Engineering Domain: Data Warehouse
Overview
The Snowflake Development skill provides tools for analyzing and optimizing Snowflake SQL queries, recommending warehouse sizing, and enforcing Snowflake-specific best practices. Helps data engineers reduce costs and improve query performance.
Clarify First
Before analyzing or sizing, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- Action: analyze / optimize / warehouse-sizing (
--action; selects the workflow). - SQL file or query: the specific query(ies) to optimize (
--file; the subject of the analysis). - Workload type & data volume: ETL / BI / ad-hoc and the GB scale (
--workload/--data-volume; drives the warehouse recommendation).
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
Quick Start
# Analyze a Snowflake SQL file for optimization opportunities
python scripts/snowflake_query_helper.py --file queries.sql --action analyze
# Get warehouse sizing recommendations
python scripts/snowflake_query_helper.py --action warehouse-sizing --workload "etl" --data-volume "500GB"
# Optimize a specific query
python scripts/snowflake_query_helper.py --file slow_query.sql --action optimize
Tools Overview
| Tool | Purpose | Key Flags |
|---|---|---|
snowflake_query_helper.py |
Analyze, optimize Snowflake SQL and recommend warehouse sizes | --file, --action, --workload, --data-volume |
Workflows
Query Performance Optimization
- Collect slow queries from query history
- Run analyzer to identify optimization opportunities
- Apply recommended changes
- Compare before/after execution plans
Warehouse Right-Sizing
- Identify workload type (ETL, BI, ad-hoc, etc.)
- Run warehouse-sizing with data volume
- Review recommendations
- Implement multi-cluster settings if applicable
Scope & Limitations
In Scope:
- Rule-based review of Snowflake SQL from a file or
--sqltext withsnowflake_query_helper.py --action analyzeoroptimize, with a complexity score and a suggested warehouse size per query. - Warehouse sizing for five workload types (etl, bi, ad-hoc, data-science, ingest) from a data volume, with credits per hour, an estimated daily cost and a
CREATE WAREHOUSEstatement. - Query, warehouse, cost and data modeling practices in
references/snowflake-best-practices.md.
Out of Scope:
- Connecting to Snowflake, reading query history or query profiles, or running any statement.
- SQL work for other databases (see
engineering/sql-database-assistant/). - Building and orchestrating data pipelines (see
engineering/senior-data-engineer/). - Access control, governance and data sharing setup.
Important Caveats:
- Analysis matches patterns in SQL text. It does not see execution plans, table sizes or clustering, so it misses issues that only show at run time.
- Sizing comes from a fixed table of data volume and concurrency limits. It is a starting point to adjust with observed query performance.
- Cost figures assume 8 hours a day at $2 per credit. Credit prices depend on edition, region and contract, and Snowflake features and pricing change over time.
Reference Documentation
- Snowflake Best Practices - Query patterns, warehouse management, cost optimization
Common Patterns
Cost Reduction
- Right-size warehouses (don't use XL for small queries)
- Set auto-suspend to 60 seconds for ad-hoc warehouses
- Use materialized views for frequently accessed aggregations
- Partition large tables with clustering keys
- Avoid SELECT * in production queries
