From 650661c10f322d7457b1cf5e58b70a2466f31cc7 Mon Sep 17 00:00:00 2001 From: charliechen Date: Mon, 1 Jun 2026 22:39:50 -0700 Subject: [PATCH] docs: fix Cursor npx install path --- README.md | 11 +++++++---- integrations/cursor/README.md | 18 ++++++++++++++++-- tests/integrations/cursor/test_install.py | 20 ++++++++++++++++++++ 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3dbabef..d549a55 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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 ``` diff --git a/integrations/cursor/README.md b/integrations/cursor/README.md index 14d7a54..c53cc95 100644 --- a/integrations/cursor/README.md +++ b/integrations/cursor/README.md @@ -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/ @@ -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 diff --git a/tests/integrations/cursor/test_install.py b/tests/integrations/cursor/test_install.py index e08bba8..1717d69 100644 --- a/tests/integrations/cursor/test_install.py +++ b/tests/integrations/cursor/test_install.py @@ -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 + )