Skip to content
Back to skills

Cursor

ASecurity

Routes Snowflake-related operations to Cortex Code agent for specialized Snowflake expertise. Use when querying databases, checking data quality, or asking about Snowflake features.

  • 58 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 28, 2026
developmentpythongobashsqldatabasesecurity

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned May 28, 2026

npx -y skills add Snowflake-Labs/subagent-cortex-code --skill cursor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cursor?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cursor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/snowflake-labs-cursor/badge)](https://www.skillsdirectory.com/skills/snowflake-labs-cursor)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cortex-code
description: Routes Snowflake-related operations to Cortex Code agent for specialized Snowflake expertise. Use when querying databases, checking data quality, or asking about Snowflake features.
license: Proprietary. See LICENSE for complete terms
---

# Cortex Code Integration

Routes Snowflake queries to Cortex Code agent with conversation context enrichment.

## When to Use

Use this skill when the user asks about:
- Snowflake databases, warehouses, schemas, tables, views
- SQL queries for Snowflake data ("How many databases?", "Show top customers")
- Data quality checks, validation, profiling
- Cortex AI features (Cortex Search, Cortex Analyst, ML functions)
- Semantic views, data modeling
- Snowpark, dynamic tables, streams, tasks
- Snowflake security, roles, policies, governance

## Instructions

### Step 1: Build Enriched Context

Before executing, build an enriched prompt that includes:

1. **Conversation Context** (if relevant):
   - Previous 2-3 exchanges from this conversation
   - Any Snowflake-specific details already discussed
   - User's stated goals or requirements

2. **User's Question**:
   - The current query being asked

### Step 2: Execute with Context

Pass the enriched context to Cortex Code:

```bash
python3 scripts/execute_cortex.py \
  --prompt "# Conversation Context
[relevant prior exchanges if any]

# Current Question
[USER'S QUESTION]" \
  --envelope "RO"
```

### Example with Context

If user previously asked "Which databases have stock data?" and now asks "Show me the schema for the main table":

```bash
python3 scripts/execute_cortex.py \
  --prompt "# Recent Context
User previously identified databases with stock data: DB_STOCK, FINANCE__ECONOMICS

# Current Question
Show me the schema for the main table in DB_STOCK" \
  --envelope "RO"
```

### Example without Context

For standalone questions:

```bash
python3 scripts/execute_cortex.py \
  --prompt "How many databases do I have in Snowflake?" \
  --envelope "RO"
```

## How It Works

1. Agent builds enriched prompt with conversation context
2. Routes to Cortex Code agent (headless execution)
3. Cortex executes `cortex` CLI with stream-json format
4. Runs SQL queries via `snowflake_sql_execute` tool
5. Returns formatted results with analysis

## Configuration

- **Approval mode**: prompt by default; request user approval before execution
- **Security envelope**: RO for reads; RW only for approved writes
- **Connection**: Uses default Snowflake connection from cortex CLI

Files in this skill

  • .cursorrules.template1.6 KB
  • README.md4.4 KB
  • SKILL.md2.5 KB
  • install.sh1.8 KB
  • uninstall.sh670 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.