Skip to content

Commit a2a5678

Browse files
committed
Move MCP conflict check to unconditional prerequisite section in setup skill
1 parent afca934 commit a2a5678

1 file changed

Lines changed: 20 additions & 23 deletions

File tree

  • plugins/cortex-code/skills/cortex-setup

plugins/cortex-code/skills/cortex-setup/SKILL.md

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,10 @@ license: Proprietary. See LICENSE-SKILLS.md for complete terms
88

99
Install Snowflake CLI (`snow`) and Cortex Code CLI (`cortex`) using the appropriate installer for the current OS.
1010

11-
## When to use
12-
13-
- Cortex Code CLI is not found on PATH
14-
- User asks to set up or install Cortex Code
15-
- Routing failed because `cortex` binary is missing
11+
## Prerequisite — ALWAYS run this FIRST, unconditionally
1612

17-
## Steps
13+
Before doing ANYTHING else in this skill, you MUST run this check. This is not optional. Do not skip it even if the CLIs are already installed.
1814

19-
**MANDATORY: Step 1 MUST be completed before ANY other steps. Do not skip.**
20-
21-
### 1. Check for Snowflake MCP Server conflict (REQUIRED FIRST)
22-
23-
The Snowflake MCP Server and this plugin both handle Snowflake operations. If both are active, they will conflict. Check if the MCP server is configured:
24-
25-
**macOS / Linux:**
2615
```bash
2716
cat ~/.claude/settings.json 2>/dev/null | python3 -c "
2817
import sys, json
@@ -32,14 +21,14 @@ try:
3221
for name, cfg in servers.items():
3322
cmd = cfg.get('command', '') + ' ' + ' '.join(cfg.get('args', []))
3423
if 'snowflake' in name.lower() or 'snowflake' in cmd.lower():
35-
print(f'FOUND: {name}')
24+
print(f'CONFLICT: {name}')
3625
sys.exit(1)
3726
except: pass
3827
print('OK: No Snowflake MCP server found')
3928
"
4029
```
4130

42-
**If a Snowflake MCP server is found**, tell the user:
31+
**If exit code is 1 (conflict found)**, STOP IMMEDIATELY and tell the user:
4332

4433
> ⚠️ **Snowflake MCP Server detected.** The Cortex Code plugin replaces the Snowflake MCP server with more capabilities (security envelopes, session management, multi-turn). Please disable the MCP server before continuing:
4534
>
@@ -49,17 +38,25 @@ print('OK: No Snowflake MCP server found')
4938
>
5039
> Then re-run this setup.
5140
52-
**Do NOT proceed with installation until the MCP server is removed.**
41+
**Do NOT proceed. Do NOT check CLI versions. Do NOT install anything. STOP HERE.**
5342

54-
### 2. Detect operating system
43+
---
44+
45+
## When to use
46+
47+
- Cortex Code CLI is not found on PATH
48+
- User asks to set up or install Cortex Code
49+
- Routing failed because `cortex` binary is missing
50+
51+
## Steps
52+
53+
### 1. Detect OS and check current state
5554

5655
```python
5756
import platform
5857
print(platform.system()) # "Windows", "Darwin", or "Linux"
5958
```
6059

61-
### 3. Check current state
62-
6360
**Windows (Command Prompt or PowerShell):**
6461
```cmd
6562
where cortex 2>nul && cortex --version || echo "cortex not installed"
@@ -72,7 +69,7 @@ which cortex 2>/dev/null && cortex --version || echo "cortex not installed"
7269
which snow 2>/dev/null && snow --version || echo "snow not installed"
7370
```
7471

75-
### 4. Install Cortex Code CLI
72+
### 2. Install Cortex Code CLI
7673

7774
The installer is bundled with the snowflake-ai-kit repo. Find and run it:
7875

@@ -108,7 +105,7 @@ bash snowflake-ai-kit/install.sh
108105

109106
The installer handles Snowflake CLI, Cortex Code CLI, and connection verification.
110107

111-
### 5. Verify installation
108+
### 3. Verify installation
112109

113110
**Windows:**
114111
```cmd
@@ -124,7 +121,7 @@ which snow && snow --version
124121

125122
Both commands should return version numbers.
126123

127-
### 6. Set up Snowflake connection
124+
### 4. Set up Snowflake connection
128125

129126
Check if a connection exists:
130127

@@ -140,7 +137,7 @@ snow connection add
140137

141138
This is interactive — the user will need to provide their Snowflake account URL, username, and authentication method.
142139

143-
### 7. Confirm routing works
140+
### 5. Confirm routing works
144141

145142
After setup, the cortex-router skill should work. Tell the user to try their original Snowflake prompt again.
146143

0 commit comments

Comments
 (0)