cortex-router
Auto-routing skill loaded by the prompt filter hook. Routes Snowflake-related operations to Cortex Code CLI. Not for direct…
Create, inspect, and manage semantic views in Snowflake. Semantic views define the governed data model (entities, dimensions, metrics, relationships) that Cortex Analyst queries through.
Claude Code
$ npx -y skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-semantic-views --agent claude-code
Codex
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-semantic-views -a codex -y
Cursor
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-semantic-views -a cursor -y
Gemini CLI
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-semantic-views -a gemini-cli -y
GitHub Copilot
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-semantic-views -a github-copilot -y
OpenCode
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-semantic-views -a opencode -y
Windsurf
$ npx skills add Snowflake-Labs/snowflake-ai-kit --skill snowflake-semantic-views -a windsurf -y
name: snowflake-semantic-views description: >- Create, inspect, and manage semantic views in Snowflake. Semantic views define the governed data model (entities, dimensions, metrics, relationships) that Cortex Analyst queries through.
Semantic views are the governed data model layer in Snowflake. They define entities, dimensions, metrics, time dimensions, and relationships over physical tables. Cortex Analyst generates SQL through these models.
**List semantic views:**
SHOW SEMANTIC VIEWS IN ACCOUNT; -- or scoped: SHOW SEMANTIC VIEWS IN SCHEMA my_db.my_schema;
**Describe a semantic view:**
DESCRIBE SEMANTIC VIEW my_db.my_schema.revenue_model;
Semantic views are defined in YAML and created with SQL:
CREATE OR REPLACE SEMANTIC VIEW my_db.my_schema.revenue_model AS $$
name: Revenue Model
tables:
- name: ORDERS
base_table:
database: MY_DB
schema: MY_SCHEMA
table: ORDERS
dimensions:
- name: ORDER_ID
expr: ORDER_ID
data_type: NUMBER
- name: CUSTOMER_NAME
expr: CUSTOMER_NAME
data_type: VARCHAR
- name: REGION
expr: REGION
data_type: VARCHAR
time_dimensions:
- name: ORDER_DATE
expr: ORDER_DATE
data_type: DATE
metrics:
- name: TOTAL_REVENUE
expr: SUM(AMOUNT)
data_type: NUMBER
description: Total revenue from orders
- name: ORDER_COUNT
expr: COUNT(*)
data_type: NUMBER
description: Number of orders
$$;VQRs teach Cortex Analyst the correct SQL for specific questions:
verified_queries:
- name: monthly_revenue
question: "What is the monthly revenue?"
verified_query: >-
SELECT DATE_TRUNC('month', ORDER_DATE) AS month,
SUM(AMOUNT) AS revenue
FROM MY_DB.MY_SCHEMA.ORDERS
GROUP BY month
ORDER BY monthrelationships:
- name: orders_to_customers
left_table: ORDERS
right_table: CUSTOMERS
join_type: many_to_one
relationship_columns:
- left_column: CUSTOMER_ID
right_column: IDAfter creating a semantic view: 1. `DESCRIBE SEMANTIC VIEW <name>` — verify it parsed correctly 2. Test through Cortex Analyst — ask a question that should hit the model 3. Compare the generated SQL against expected patterns 4. Add verified queries for important business questions
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.