diff --git a/libs/aitools/agents/agents.go b/libs/aitools/agents/agents.go index 91f82f368d9..27a8ef02eeb 100644 --- a/libs/aitools/agents/agents.go +++ b/libs/aitools/agents/agents.go @@ -97,9 +97,11 @@ var Registry = []Agent{ ConfigDir: homeSubdir(".config", "opencode"), }, { - Name: "copilot", - DisplayName: "GitHub Copilot", - ConfigDir: homeSubdir(".copilot"), + Name: "copilot", + DisplayName: "GitHub Copilot", + ConfigDir: homeSubdir(".copilot"), + SupportsProjectScope: true, + ProjectConfigDir: ".github", }, { Name: "antigravity", diff --git a/libs/aitools/installer/installer_test.go b/libs/aitools/installer/installer_test.go index ad7c1810e98..06e698a9911 100644 --- a/libs/aitools/installer/installer_test.go +++ b/libs/aitools/installer/installer_test.go @@ -892,7 +892,7 @@ func TestSupportsProjectScopeSetCorrectly(t *testing.T) { "cursor": true, "codex": false, "opencode": false, - "copilot": false, + "copilot": true, "antigravity": false, } @@ -903,6 +903,24 @@ func TestSupportsProjectScopeSetCorrectly(t *testing.T) { } } +func TestProjectScopeAgentDirectoriesSetCorrectly(t *testing.T) { + cwd := filepath.Join("tmp", "project") + expected := map[string]string{ + "claude-code": filepath.Join(cwd, ".claude", "skills"), + "cursor": filepath.Join(cwd, ".cursor", "skills"), + "copilot": filepath.Join(cwd, ".github", "skills"), + } + + for _, agent := range agents.Registry { + want, ok := expected[agent.Name] + if !ok { + continue + } + require.True(t, agent.SupportsProjectScope, "%s should support project scope", agent.Name) + assert.Equal(t, want, agent.ProjectSkillsDir(cwd), "project skills dir for %s", agent.Name) + } +} + func TestGetSkillsRefResolvesFromManifest(t *testing.T) { // Pre-populate the cache so FetchManifest returns from tier 1 (local cache) // without hitting the network. The embedded manifest fallback is tested