cortex-router
Auto-routing skill loaded by the prompt filter hook. Routes Snowflake-related operations to Cortex Code CLI. Not for direct…
Run SQL queries against Snowflake through the Managed MCP Server. Use for data retrieval, aggregations, joins, semi-structured data, time travel, and any explicit SQL the user requests.
Claude Code
$ npx -y skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-query --agent claude-code
Codex
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-query -a codex -y
Cursor
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-query -a cursor -y
Gemini CLI
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-query -a gemini-cli -y
GitHub Copilot
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-query -a github-copilot -y
OpenCode
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-query -a opencode -y
Windsurf
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-query -a windsurf -y
name: snowflake-query description: >- Run SQL queries against Snowflake through the Managed MCP Server. Use for data retrieval, aggregations, joins, semi-structured data, time travel, and any explicit SQL the user requests.
Run SQL queries against Snowflake. Use this skill when the user asks to query data, run SQL, or retrieve specific results.
1. Identify the SQL. Use Snowflake dialect (ILIKE, TRY_CAST, FLATTEN, QUALIFY). 2. Send the query to the MCP server. With the default setup in this plugin's README, that's the `cortex_code_agent` tool. If the server exposes a dedicated SQL execution tool, use that instead. 3. Summarize results. For large sets, show a sample and total count.
**Simple count:**
SELECT COUNT(*) AS row_count FROM my_db.my_schema.orders;
**Top-N with aggregation:**
SELECT customer_name, SUM(amount) AS total_revenue FROM orders GROUP BY customer_name ORDER BY total_revenue DESC LIMIT 10;
**Join with filter:**
SELECT o.order_id, c.name, o.amount FROM orders o JOIN customers c ON o.customer_id = c.id WHERE o.created_at >= DATEADD(day, -30, CURRENT_DATE()) ORDER BY o.amount DESC LIMIT 20;
**Semi-structured (VARIANT/JSON):**
SELECT raw:event_type::STRING AS event_type, raw:user.name::STRING AS user_name, raw:timestamp::TIMESTAMP AS event_time FROM events WHERE raw:event_type::STRING ILIKE '%purchase%' LIMIT 10;
**Flatten arrays:**
SELECT t.order_id, f.value:product_name::STRING AS product FROM orders t, LATERAL FLATTEN(input => t.items) f LIMIT 20;
**Time travel:**
SELECT * FROM orders AT(TIMESTAMP => '2025-01-15 10:00:00'::TIMESTAMP) LIMIT 10;
**Window function with QUALIFY:**
SELECT customer_id, order_date, amount FROM orders QUALIFY ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) = 1;
Connect your AI coding agent to Snowflake. Plugins for Claude Code and OpenAI Codex that automatically detect Snowflake prompts and route them to Cortex Code — where 55+ built-in skills handle SQL, data governance, dynamic tables, ML, and more.
Auto-routing skill loaded by the prompt filter hook. Routes Snowflake-related operations to Cortex Code CLI. Not for direct…
ONLY load this skill when the user explicitly types $cortex-run or /cortex-run. NEVER load this skill from auto-routing hooks or…
Install Snowflake CLI and Cortex Code CLI. Use when cortex is not installed, when the user asks to set up Cortex Code, or when…
Use Cortex AI services — Cortex Analyst for natural-language-to-SQL through semantic views, Cortex Search for semantic search,…
Manage Database Change Management (DCM) projects in Snowflake. DCM is infrastructure-as-code for Snowflake objects — databases,…
Discover databases, schemas, tables, views, and columns in Snowflake. Use when the user wants to understand what data is…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.