cortex-code
БесплатноЗапускает вложенные скриптыНе проверенRoutes Snowflake-related operations to Cortex Code CLI for specialized Snowflake expertise. Use when user asks about Snowflake databases, data warehouses, SQL…
от Snowflake-Labs★ 65 звёзд на GitHubОб этом скилле
Cortex Code Integration Skill
Install
# Install via npm skills ecosystem (works with Claude Code, Cursor, Codex, and 40+ agents)
npx skills add snowflake-labs/subagent-cortex-code --copy
# Prerequisite: Cortex Code CLI must be installed and configured
# See: https://docs.snowflake.com/en/user-guide/cortex-code
which cortex # verify installation
This skill enables your coding agent to leverage Cortex Code's specialized Snowflake expertise by intelligently routing Snowflake-related operations to Cortex Code CLI in headless mode.
Architecture Overview
Routing Principle: ONLY Snowflake operations → Cortex Code. Everything else → your coding agent.
Key Components:
- Dynamic skill discovery at session initialization
- LLM-based semantic routing (not keyword matching)
- Security wrapper with approval modes (prompt/auto/envelope_only)
- Stateless Cortex execution with context enrichment
- Hybrid memory management
- Audit logging for compliance
Security
The skill includes a security wrapper around Cortex execution with three approval modes:
Approval Modes
prompt (default): High security
- User shown approval prompt with predicted tools and confidence
- User must approve before execution
- No audit logging required
- Best for: Interactive sessions, untrusted prompts, production
auto: Medium security
- All operations auto-approved
- Mandatory audit logging
- Envelopes still enforced
- Best for: Automated workflows, trusted environments
envelope_only: Medium security
- No tool prediction (faster)
- Auto-approved with audit logging
- Relies on envelope blocklist only
- Best for: Trusted environments, low latency needs
Configuration: Set in config.yaml in the skill's install directory, or via organization policy.
IMPORTANT —
config.yamlis optional. The skill ships onlyconfig.yaml.exampleas a template. If noconfig.yamlexists, the Python scripts apply safe defaults (approval_mode: prompt,default_envelope: RO). Do not search, glob, orlsforconfig.yamlbefore executing —ConfigManagerhandles this internally. Only read/createconfig.yamlif the user explicitly asks to change settings.
Built-in Protections
- Prompt Sanitization: Automatic PII removal and injection detection
- Credential Blocking: Prevents routing when credential paths detected
- Secure Caching: SHA256-validated cache in
~/.cache/cortex-skill/ - Audit Logging: Structured JSONL logs (mandatory for auto/envelope_only)
- Organization Policy: Enterprise override via
~/.snowflake/cortex/claude-skill-policy.yaml
Fast Path for Repeat Queries
Session state is cached — do not re-run initialization steps on every query.
Skip the following steps if they've already run in the current session:
discover_cortex.py— output cached to~/.cache/cortex-skill/cortex-capabilities.jsonroute_request.py— for obvious Snowflake queries (user says "Snowflake", "Cortex", "databases", "warehouse", etc.), you can skip routing and go straight to executioncortex connections list— the active connection doesn't change within a session; reuse it- Any
config.yaml/ org-policy inspection —ConfigManagerhandles this (see note above)
Minimal flow for a follow-up Snowflake query (after the first query in a session):
- (If
approval_mode: prompt) ask user for approval - Call
execute_cortex.pywith the enriched prompt and envelope - Return results
That's it. Three steps — no re-discovery, no re-routing, no config inspection.
Session Initialization
When this skill is first loaded:
Step 1: Discover Cortex Capabilities
PYTHON=$(command -v python3 2>/dev/null || command -v python 2>/dev/null || echo python3)
$PYTHON scripts/discover_cortex.py
This script:
- Runs
cortex skill listto enumerate all available Cortex skills - Reads each skill's SKILL.md frontmatter and trigger patterns
- Caches capabilities with
CacheManagerin the configured cache directory - Returns structured data about what Cortex can handle
Expected output: JSON mapping of skill names to their trigger patterns and capabilities.
Step 2: Load Routing Context
The discovered capabilities are loaded into memory to inform routing decisions throughout the session.
Workflow: Handling User Requests
Step 1: Analyze Request with LLM-Based Routing
Before taking any action, analyze the user's request:
PYTHON=$(command -v python3 2>/dev/null || command -v python 2>/dev/null || echo python3)
$PYTHON scripts/route_request.py --prompt "USER_PROMPT_HERE"
This script:
- Loads Cortex capabilities from cache
- Uses LLM reasoning to classify the request
- Returns routing decision with confidence score
Routing Logic:
- Route to Cortex if request involves:
- Snowflake databases, warehouses, schemas, tables
- SQL queries specifically for Snowflake
- Cortex AI fea
Установить cortex-code в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл cortex-code?
Routes Snowflake-related operations to Cortex Code CLI for specialized Snowflake expertise. Use when user asks about Snowflake databases, data warehouses, SQL queries on Snowflake, Cortex AI features, Snowpark, dynamic tables, data governance in Snowflake, Snowflake security, or mentions "Cortex" explicitly. Do NOT use for general programming, local file operations, non-Snowflake databases, web development, or infrastructure tasks unrelated to Snowflake.
Как установить скилл cortex-code?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cortex-code запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic