snowflake-data-engineering-cursorrules-prompt-file

snowflake-data-engineering-cursorrules-prompt-file is a cursor rule for coding agents from PatrickJS/awesome-cursorrules. It costs 1,680 tokens per session, scanned A, original, CC0-1.0.

Coding guidance for Snowflake SQL and data engineering. It covers querying structured and semi-structured data, building pipelines with Snowflake features, and managing warehouse costs.

In plain words
What is it for?
Use it to query JSON and other nested data, build scheduled or streaming pipelines, use Snowflake tables and tasks, and review cost-related design choices.
Why use it?
It helps avoid common SQL and pipeline mistakes while keeping data transformations and Snowflake usage organized.

Cursor rule

About the project

PatrickJS/awesome-cursorrules is a collection of Markdown rule files that give Cursor AI editor project-specific instructions about code, frameworks, workflows, and standards. Developers use it to find reusable guidance for shaping Cursor’s behavior in different kinds of software projects.

PatrickJS/awesome-cursorrules · 40,725 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/patrickjs/awesome-cursorrules/snowflake-data-engineering-cursorrules-prompt-file
Clone the repo
git clone --depth 1 https://github.com/PatrickJS/awesome-cursorrules

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for snowflake-data-engineering-cursorrules-prompt-file

README.md
[![agentmods](https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/snowflake-data-engineering-cursorrules-prompt-file.svg)](https://agentmods.dev/rules/patrickjs/awesome-cursorrules/snowflake-data-engineering-cursorrules-prompt-file)
Your own site
<a href="https://agentmods.dev/rules/patrickjs/awesome-cursorrules/snowflake-data-engineering-cursorrules-prompt-file"><img src="https://agentmods.dev/badge/rules/patrickjs/awesome-cursorrules/snowflake-data-engineering-cursorrules-prompt-file.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,680 This file is loaded in full into every session.
When invoked 1,680 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01680 $0.01680
Opus 5 $0.00840 $0.00840
Sonnet 5 $0.00336 $0.00336
Haiku 4.5 $0.00168 $0.00168

Measured 2d ago against content hash f353064cefd9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

snowflake-data-engineering-cursorrules-prompt-file scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/snowflake-data-engineering-cursorrules-prompt-file.mdc · 157 lines

How it starts

The opening of the file, as written. The whole thing — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.

// Snowflake Data Engineering // Comprehensive guidance for SQL, data pipelines, and platform best practices on Snowflake

You are an expert Snowflake data engineer with deep knowledge of the entire platform: SQL, data pipelines (Dynamic Tables, Streams, Tasks, Snowpipe), semi-structured data, Snowflake Postgres, and cost optimization.

// Architecture // Snowflake separates storage (columnar micro-partitions), compute (elastic virtual warehouses), and services (metadata, security, optimization).

// ═══════════════════════════════════════════ // SQL AND SEMI-STRUCTURED DATA // ═══════════════════════════════════════════

// Use VARIANT, OBJECT, and ARRAY types for JSON, Avro, Parquet, ORC. // Access nested fields with colon notation: src:customer.name::STRING // Cast explicitly: src:price::NUMBER(10,2), src:created_at::TIMESTAMP_NTZ // Flatten arrays: // SELECT f.value:name::STRING AS name // FROM my_table, LATERAL FLATTEN(input => src:items) f; // Flatten semi-structured into relational columns when data contains dates, numbers as strings, or arrays. // Avoid mixed types in the same VARIANT field — prevents subcolumnarization. // VARIANT null vs SQL NULL: JSON null stored as string "null". Use STRIP_NULL_VALUES => TRUE on load.

// SQL Coding Standards // - snake_case for all identifiers. Avoid quoted identifiers. // - CTEs over nested subqueries. CREATE OR REPLACE for idempotent DDL. // - COPY INTO for bulk loading, not INSERT. MERGE for upserts: // MERGE INTO target t USING source s ON t.id = s.id // WHEN MATCHED THEN UPDATE SET t.name = s.name // WHEN NOT MATCHED THEN INSERT (id, name) VALUES (s.id, s.name);

// Stored Procedures — prefix variables with colon : inside SQL statements: // CREATE PROCEDURE my_proc(p_id INT) RETURNS STRING LANGUAGE SQL AS // BEGIN // LET result STRING; // SELECT name INTO :result FROM users WHERE id = :p_id; // RETURN result; // END;

// ═══════════════════════════════════════════ // PERFORMANCE OPTIMIZATION // ═══════════════════════════════════════════

// Cluster keys: for very large tables (multi-TB), on WHERE/JOIN/GROUP BY columns. // ALTER TABLE large_events CLUSTER BY (event_date, region); // Search Optimization Service: point lookups on high-cardinality columns, substring/regex. // ALTER TABLE logs ADD SEARCH OPTIMIZATION ON EQUALITY(sender_ip), SUBSTRING(error_message); // Materialized Views: pre-compute expensive aggregations (single table only). // Use RESULT_SCAN(LAST_QUERY_ID()) to reuse results. Query tags for attribution: // ALTER SESSION SET QUERY_TAG = 'etl_daily_load';

// ═══════════════════════════════════════════ // DATA PIPELINES // ═══════════════════════════════════════════

// Choose Your Approach: // Dynamic Tables — Declarative. Define the query, Snowflake handles refresh. Best for most pipelines. // Streams + Tasks — Imperative CDC + scheduling. Best for procedural logic, stored procedure calls. // Snowpipe — Continuous file loading from S3/GCS/Azure. // Snowpipe Streaming — Low-latency row-level ingestion via SDK (Java, Python).

// Dynamic Tables CREATE OR REPLACE DYNAMIC TABLE cleaned_events TARGET_LAG = '5 minutes' WAREHOUSE = transform_wh AS SELECT event_id, event_type, user_id, event_data:page::STRING AS page, event_timestamp FROM raw_events WHERE event_type IS NOT NULL;

// Chain for multi-step pipelines: CREATE OR REPLACE DYNAMIC TABLE user_sessions TARGET_LAG = '10 minutes' WAREHOUSE = transform_wh AS SELECT user_id, MIN(event_timestamp) AS session_start, MAX(event_timestamp) AS session_end, COUNT(*) AS event_count FROM cleaned_events GROUP BY user_id;

// TARGET_LAG: freshness target. REFRESH_MODE: AUTO, FULL, or INCREMENTAL. // Manage: ALTER DYNAMIC TABLE ... SET TARGET_LAG / REFRESH / SUSPEND / RESUME.

// Streams (CDC) CREATE OR REPLACE STREAM raw_events_stream ON TABLE raw_events; // Columns added: METADATA$ACTION, METADATA$ISUPDATE, METADATA$ROW_ID // APPEND_ONLY = TRUE for insert-only sources (lower overhead).

Read the full file on GitHub · 157 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 157 lines · 1,680 tokens per session scan A f353064cefd9

Subscribe to this mod's changes

snowflake-data-engineering-cursorrules-prompt-file is a cursor rule published in the GitHub repository PatrickJS/awesome-cursorrules (40,725 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 1,680 tokens to every session, about $0.0084 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.