feat(agent/agentcontextconfig): discover skills from ~/.coder/skills (#25271)

The default skills lookup only scanned the project-relative
.agents/skills directory, so personal skills had to be repeated
per project or wired in via CODER_AGENT_EXP_SKILLS_DIRS. Now the
default is the comma-separated list ~/.coder/skills,.agents/skills,
which lets discoverSkills's existing first-occurrence-wins policy
prefer home-scoped skills over project ones with the same name.

The change is additive when ~/.coder/skills is absent
(missing directories are silently skipped in discoverSkills) and
unaffects users who set the env var explicitly.

Closes CODAGT-403
This commit is contained in:
Mathias Fredriksson
2026-05-13 12:56:24 +03:00
committed by GitHub
parent fb3aef1883
commit 5b87d7b74f
2 changed files with 36 additions and 1 deletions
+5 -1
View File
@@ -60,10 +60,14 @@ var skillNamePattern = regexp.MustCompile(
// Default values for agent-internal configuration. These are
// used when the corresponding env vars are unset.
//
// DefaultSkillsDir is a comma-separated list so home-scoped
// skills override project-scoped ones with the same name
// (discoverSkills picks the first occurrence per skill name).
const (
DefaultInstructionsDir = "~/.coder"
DefaultInstructionsFile = "AGENTS.md"
DefaultSkillsDir = ".agents/skills"
DefaultSkillsDir = "~/.coder/skills,.agents/skills"
DefaultSkillMetaFile = "SKILL.md"
DefaultMCPConfigFile = ".mcp.json"
)