Skip to content

Commit e2927e4

Browse files
authored
Add Cursor as a skill-supporting client (#4762)
1 parent 729d11f commit e2927e4

3 files changed

Lines changed: 38 additions & 11 deletions

File tree

pkg/client/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ var supportedClientIntegrations = []clientAppConfig{
313313
types.TransportTypeSSE: "url",
314314
types.TransportTypeStreamableHTTP: "url",
315315
},
316+
SupportsSkills: true,
317+
SkillsGlobalPath: []string{".cursor", "skills"},
318+
SkillsProjectPath: []string{".cursor", "skills"},
316319
},
317320
{
318321
ClientType: ClaudeCode,

pkg/client/discovery_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,14 @@ func TestGetClientStatus(t *testing.T) {
111111
SupportsSkills: true,
112112
},
113113
{
114-
ClientType: Cursor,
115-
Description: "Cursor editor (Test)",
116-
SettingsFile: "mcp.json",
117-
RelPath: []string{".cursor"}, // Check .cursor directory
118-
Extension: JSON,
114+
ClientType: Cursor,
115+
Description: "Cursor editor (Test)",
116+
SettingsFile: "mcp.json",
117+
RelPath: []string{".cursor"}, // Check .cursor directory
118+
Extension: JSON,
119+
SupportsSkills: true,
120+
SkillsGlobalPath: []string{".cursor", "skills"},
121+
SkillsProjectPath: []string{".cursor", "skills"},
119122
},
120123
{
121124
ClientType: VSCode,
@@ -148,7 +151,7 @@ func TestGetClientStatus(t *testing.T) {
148151
assert.True(t, exists)
149152
assert.True(t, cursorStatus.Installed)
150153
assert.False(t, cursorStatus.Registered)
151-
assert.False(t, cursorStatus.SupportsSkills)
154+
assert.True(t, cursorStatus.SupportsSkills)
152155

153156
vscodeStatus, exists := statusMap[VSCode]
154157
assert.True(t, exists)

pkg/client/skills_test.go

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ func testSkillClientIntegrations() []clientAppConfig {
4141
},
4242
},
4343
{
44-
ClientType: Cursor,
44+
ClientType: Cursor,
45+
SupportsSkills: true,
46+
SkillsGlobalPath: []string{".cursor", "skills"},
47+
SkillsProjectPath: []string{".cursor", "skills"},
48+
},
49+
{
50+
ClientType: VSCode,
4551
// SupportsSkills defaults to false
4652
},
4753
{
@@ -70,7 +76,7 @@ func TestSupportsSkills(t *testing.T) {
7076
{name: "ClaudeCode supports skills", client: ClaudeCode, expected: true},
7177
{name: "Codex supports skills", client: Codex, expected: true},
7278
{name: "OpenCode supports skills", client: OpenCode, expected: true},
73-
{name: "Cursor does not support skills", client: Cursor, expected: false},
79+
{name: "Cursor supports skills", client: Cursor, expected: true},
7480
{name: "unknown client returns false", client: ClientApp("nonexistent"), expected: false},
7581
}
7682

@@ -87,8 +93,8 @@ func TestListSkillSupportingClients(t *testing.T) {
8793
cm := newTestSkillManager()
8894
clients := cm.ListSkillSupportingClients()
8995

90-
// Should include ClaudeCode, Codex, OpenCode, and our test-only no-paths-client
91-
require.Len(t, clients, 4, "unexpected number of skill-supporting clients: %v", clients)
96+
// Should include ClaudeCode, Codex, Cursor, OpenCode, and our test-only no-paths-client
97+
require.Len(t, clients, 5, "unexpected number of skill-supporting clients: %v", clients)
9298

9399
// Verify sorted order
94100
for i := 1; i < len(clients); i++ {
@@ -186,10 +192,25 @@ func TestGetSkillPath(t *testing.T) {
186192
wantErr: ErrUnsupportedClientType,
187193
},
188194
{
189-
name: "client that does not support skills",
195+
name: "ScopeUser Cursor",
190196
client: Cursor,
191197
skillName: "my-skill",
192198
scope: skills.ScopeUser,
199+
wantPath: filepath.Join(testHomeDir, ".cursor", "skills", "my-skill"),
200+
},
201+
{
202+
name: "ScopeProject Cursor with explicit root",
203+
client: Cursor,
204+
skillName: "my-skill",
205+
scope: skills.ScopeProject,
206+
projectRoot: "/tmp/myproject",
207+
wantPath: filepath.Join("/tmp/myproject", ".cursor", "skills", "my-skill"),
208+
},
209+
{
210+
name: "client that does not support skills",
211+
client: VSCode,
212+
skillName: "my-skill",
213+
scope: skills.ScopeUser,
193214
wantErr: ErrSkillsNotSupported,
194215
},
195216
{

0 commit comments

Comments
 (0)