Skip to content

Add Snowflake cursor rules for data engineering, Cortex AI, and Snowpark/dbt#200

Open
jamescha-earley wants to merge 2 commits intoPatrickJS:mainfrom
jamescha-earley:add-snowflake-rules
Open

Add Snowflake cursor rules for data engineering, Cortex AI, and Snowpark/dbt#200
jamescha-earley wants to merge 2 commits intoPatrickJS:mainfrom
jamescha-earley:add-snowflake-rules

Conversation

@jamescha-earley
Copy link

@jamescha-earley jamescha-earley commented Mar 20, 2026

Summary

  • Adds 3 Snowflake cursor rules to the Database and API section — the first data warehouse/data platform rules in the repository.
  • Snowflake Data Engineering: SQL best practices, data pipelines (Dynamic Tables, Streams, Tasks, Snowpipe), semi-structured data (VARIANT/FLATTEN), Snowflake Postgres, Time Travel, cost optimization, RBAC.
  • Snowflake Cortex AI: All 14 Cortex AI Functions (AI_COMPLETE, AI_CLASSIFY, AI_EXTRACT, AI_EMBED, etc.) plus Cortex Search for hybrid vector+keyword search and RAG applications.
  • Snowflake Snowpark Python & dbt: Snowpark server-side DataFrames, scalar/vectorized UDFs, UDTFs, stored procedures, plus dbt-snowflake adapter with dynamic table materialization, incremental models, and Snowflake-specific configs.

All content is grounded in official Snowflake documentation.

Checklist

  • Each rule is in its own rules/{name}-cursorrules-prompt-file/ directory
  • Each directory contains .cursorrules and README.md
  • Main README.md updated with entries in the "Database and API" section

Summary by CodeRabbit

  • Documentation
    • Updated README “Database and API” section with links to three new cursor-rules entries.
    • Added Snowflake Data Engineering cursor rules with guidance on SQL best practices, pipelines, performance, and cost.
    • Added Snowflake Cortex AI cursor rules covering Cortex AI functions and Cortex Search usage.
    • Added Snowflake Snowpark Python & dbt cursor rules for Snowpark/dbt development patterns and examples.

…wpark/dbt

Add Snowflake-specific cursor rules covering:
- Data Engineering: SQL best practices, data pipelines (Dynamic Tables, Streams,
  Tasks, Snowpipe), semi-structured data, Snowflake Postgres, cost optimization
- Cortex AI: AI Functions (AI_COMPLETE, AI_CLASSIFY, AI_EXTRACT, etc.) and
  Cortex Search for hybrid vector+keyword search and RAG applications
- Snowpark Python & dbt: server-side DataFrames, UDFs, UDTFs, stored procedures,
  and dbt-snowflake adapter with dynamic table materialization

All rules grounded in official Snowflake documentation.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8b4b590d-a8a8-42b0-a936-caddfec38e9b

📥 Commits

Reviewing files that changed from the base of the PR and between 0790dc7 and f38a28c.

📒 Files selected for processing (5)
  • README.md
  • rules/snowflake-cortex-ai-cursorrules-prompt-file/README.md
  • rules/snowflake-data-engineering-cursorrules-prompt-file/README.md
  • rules/snowflake-snowpark-dbt-cursorrules-prompt-file/.cursorrules
  • rules/snowflake-snowpark-dbt-cursorrules-prompt-file/README.md
✅ Files skipped from review due to trivial changes (4)
  • rules/snowflake-data-engineering-cursorrules-prompt-file/README.md
  • rules/snowflake-snowpark-dbt-cursorrules-prompt-file/README.md
  • rules/snowflake-cortex-ai-cursorrules-prompt-file/README.md
  • rules/snowflake-snowpark-dbt-cursorrules-prompt-file/.cursorrules

📝 Walkthrough

Walkthrough

Added three new Snowflake cursor rule sets (Cortex AI, Data Engineering, Snowpark Python & dbt): each includes a .cursorrules file and a README; the repository root README was updated with links to these new rule sets.

Changes

Cohort / File(s) Summary
Root Documentation
README.md
Inserted three new bullet links under "Database and API" pointing to the new Snowflake cursor rules: Cortex AI, Data Engineering, and Snowpark Python & dbt.
Snowflake Cortex AI Rules
rules/snowflake-cortex-ai-cursorrules-prompt-file/.cursorrules, rules/snowflake-cortex-ai-cursorrules-prompt-file/README.md
Added a .cursorrules and README detailing Cortex AI Functions (AI_COMPLETE, AI_CLASSIFY, AI_EMBED, etc.), Cortex Search service creation (single/multi-index), example SQL/Python/REST queries, filter/scoring syntax, and best-practices/anti-patterns for RAG-style apps.
Snowflake Data Engineering Rules
rules/snowflake-data-engineering-cursorrules-prompt-file/.cursorrules, rules/snowflake-data-engineering-cursorrules-prompt-file/README.md
Added comprehensive data engineering rules covering SQL/VARIANT usage, CTEs, idempotent DDL, pipeline patterns (Dynamic Tables, Streams+Tasks, Snowpipe), performance tuning (clustering, materialized views), time travel, RBAC, cost/warehouse guidance, and anti-pattern checklist.
Snowflake Snowpark & dbt Rules
rules/snowflake-snowpark-dbt-cursorrules-prompt-file/.cursorrules, rules/snowflake-snowpark-dbt-cursorrules-prompt-file/README.md
Added Snowpark/dbt guidance including Snowpark Session/DataFrame patterns, scalar/vectorized UDFs, UDTFs, stored procedures, dbt-snowflake profile and incremental model examples, Snowflake-specific dbt options, macros, and best-practices/anti-patterns.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested reviewers

  • PatrickJS

Poem

🐰 Three scrolls unfurled for Snowflake's field so wide,
Cortex, pipelines, Snowpark stride side by side.
Cursor rules penned, small hops turn into art,
Engineers cheer as best practices start. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding three Snowflake cursor rules for data engineering, Cortex AI, and Snowpark/dbt, which aligns with the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 187-191: Reorder the new README entries so the list remains
alphabetically sorted within the category: move "Snowflake Cortex AI",
"Snowflake Data Engineering", and "Snowflake Snowpark Python & dbt" to their
correct positions among existing items so they appear in alphabetical order
relative to "GraphQL (Apollo Client)" and "TypeScript (Axios)"; update the
bullet sequence for the list containing "GraphQL (Apollo Client)" and
"TypeScript (Axios)" to place the three Snowflake entries where their titles fit
alphabetically.

In `@rules/snowflake-cortex-ai-cursorrules-prompt-file/README.md`:
- Around line 1-18: The README is missing source-author attribution required by
folder guidelines; add a short "Author" or "Source" credit and one-sentence
description of the .cursorrules purpose to this README.md (the file shown) so it
aligns with the .cursorrules folder policy. Specifically, update the top of
README.md (near the title or Usage section) to include an "Author: <name or
org>" line and a one-line summary like "This .cursorrules file defines Cortex AI
function usage and examples for Snowflake projects" so the file contains both
author credit and a brief purpose statement.

In `@rules/snowflake-data-engineering-cursorrules-prompt-file/README.md`:
- Around line 1-16: Add an "Author" or "Credits" section to this README
(Snowflake Data Engineering Cursor Rules) that attributes the original author of
the .cursorrules file and gives a one-line description of the file's purpose;
update the top/bottom of README.md to include a short credit line like "Original
author: <Name> — .cursorrules provides rules for Snowflake SQL and data pipeline
best practices" and mention the associated .cursorrules filename so anyone can
locate the ruleset.

In `@rules/snowflake-snowpark-dbt-cursorrules-prompt-file/.cursorrules`:
- Around line 14-18: The snippet hardcodes credentials in the
Session.builder.configs call (the session variable created via
Session.builder...create()), which is insecure; replace the literal
"user"/"password"/"account" values with secure retrieval (e.g., read from
environment variables or use Snowflake key-pair or OAuth credentials) and update
the configs expression to consume those secure values instead of plaintext;
ensure any example demonstrates using a secret source (env vars, vault, or
key-pair/OAuth) and removes the plaintext password from the
Session.builder.configs call.

In `@rules/snowflake-snowpark-dbt-cursorrules-prompt-file/README.md`:
- Around line 1-16: Add an "Original author" credit section to the README.md for
this .cursorrules set: include the original author's name (and optionally email
or GitHub handle), a one-line attribution sentence describing the .cursorrules
purpose, and a source or license link if available; place this new "Original
author" or "Credits" subsection near the top under the title or at the bottom
after "Rules Summary" in README.md so it's clearly associated with the
.cursorrules file.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 39acb62b-7e3e-4db0-b969-6f202800dee5

📥 Commits

Reviewing files that changed from the base of the PR and between fc2ce04 and 0790dc7.

📒 Files selected for processing (7)
  • README.md
  • rules/snowflake-cortex-ai-cursorrules-prompt-file/.cursorrules
  • rules/snowflake-cortex-ai-cursorrules-prompt-file/README.md
  • rules/snowflake-data-engineering-cursorrules-prompt-file/.cursorrules
  • rules/snowflake-data-engineering-cursorrules-prompt-file/README.md
  • rules/snowflake-snowpark-dbt-cursorrules-prompt-file/.cursorrules
  • rules/snowflake-snowpark-dbt-cursorrules-prompt-file/README.md

- Sort README entries alphabetically within Database and API section
- Add author attribution (Snowflake DevRel) to all 3 rule README files
- Replace hardcoded credentials with env vars in Snowpark session example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant