Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,23 @@ See [`integrations/claude-code/README.md`](integrations/claude-code/README.md) f
npx skills add snowflake-labs/subagent-cortex-code --copy --global
```

This installs `skills/cortex-code/` to `~/.cursor/skills/cortex-code/`.
This installs `skills/cortex-code/` to the universal skills directory at `~/.agents/skills/cortex-code/`.

**Step 2 — Activate the auto-routing rule:**
```bash
mkdir -p ~/.cursor/rules
cp ~/.cursor/skills/cortex-code/cortex-snowflake-routing.mdc ~/.cursor/rules/
cp ~/.agents/skills/cortex-code/cortex-snowflake-routing.mdc ~/.cursor/rules/
```

If you installed from a local clone with `bash integrations/cursor/install.sh`, copy the rule from `~/.cursor/skills/cortex-code/` instead.

**Step 3 — Restart Cursor.**

Without the routing rule you type `/cortex-code your question`. With it, Cursor detects Snowflake queries automatically and invokes the skill.

**Verify:**
```bash
ls ~/.cursor/skills/cortex-code/SKILL.md
ls ~/.agents/skills/cortex-code/SKILL.md
ls ~/.cursor/rules/cortex-snowflake-routing.mdc
```

Expand Down Expand Up @@ -391,7 +393,8 @@ cortex connections create # to add one
**Skill not loading (Claude Code / Cursor):**
```bash
ls ~/.claude/skills/cortex-code/SKILL.md # Claude Code
ls ~/.cursor/skills/cortex-code/SKILL.md # Cursor
ls ~/.agents/skills/cortex-code/SKILL.md # Cursor via npx
ls ~/.cursor/skills/cortex-code/SKILL.md # Cursor via local install script
ls ~/.codeium/windsurf/skills/cortex-code/SKILL.md # Windsurf
# If missing, re-run: npx skills add snowflake-labs/subagent-cortex-code --copy --global
```
Expand Down
18 changes: 16 additions & 2 deletions integrations/cursor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,27 @@ Recommended from a local clone:
bash integrations/cursor/install.sh
```

This installs the skill to `~/.cursor/skills/cortex-code/`.

Or install the packaged skill via `npx`:

```bash
npx skills add snowflake-labs/subagent-cortex-code --copy --global
```

Both paths install the skill to `~/.cursor/skills/cortex-code/`.
This installs the skill to the universal skills directory at `~/.agents/skills/cortex-code/`.

**Step 2 — Activate the Cursor routing rule:**

If you installed via `npx`:

```bash
mkdir -p ~/.cursor/rules
cp ~/.agents/skills/cortex-code/cortex-snowflake-routing.mdc ~/.cursor/rules/
```

If you installed from a local clone with `integrations/cursor/install.sh`:

```bash
mkdir -p ~/.cursor/rules
cp ~/.cursor/skills/cortex-code/cortex-snowflake-routing.mdc ~/.cursor/rules/
Expand Down Expand Up @@ -122,7 +133,10 @@ Handle normally without skill:
## Verify installation

```bash
# Skill installed
# Skill installed via npx
ls ~/.agents/skills/cortex-code/SKILL.md

# Skill installed via integrations/cursor/install.sh
ls ~/.cursor/skills/cortex-code/SKILL.md

# Routing rule active
Expand Down
20 changes: 20 additions & 0 deletions tests/integrations/cursor/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,29 @@ def test_cursor_placeholder_replacement():
replaced = test_content.replace("__CODING_AGENT__", "cursor")
assert replaced == expected


@pytest.mark.integration
def test_cursor_skill_does_not_force_auto_approval():
"""Cursor skill examples should not hardcode auto approval mode."""
skill_text = Path("integrations/cursor/SKILL.md").read_text()
assert '--approval-mode "auto"' not in skill_text
assert "Approval mode**: auto" not in skill_text


@pytest.mark.integration
def test_cursor_docs_use_npx_universal_skill_path():
"""npx install docs should copy the routing rule from the universal skills path."""
root_readme = Path("README.md").read_text()
cursor_readme = Path("integrations/cursor/README.md").read_text()

npx_rule_copy = (
"cp ~/.agents/skills/cortex-code/cortex-snowflake-routing.mdc "
"~/.cursor/rules/"
)

assert npx_rule_copy in root_readme
assert npx_rule_copy in cursor_readme
assert (
"Both paths install the skill to `~/.cursor/skills/cortex-code/`"
not in cursor_readme
)