fix(skill-loader): discover skills from parent config dir when using profiles

OPENCODE_CONFIG_DIR pointing to profiles/ subdirectory caused skills at
~/.config/opencode/skills/ to be invisible. Added getOpenCodeSkillDirs()
with the same parent-dir fallback that getOpenCodeCommandDirs() uses.
This commit is contained in:
YeonGyu-Kim
2026-03-12 19:53:30 +09:00
parent c85b6adb7d
commit 55b80fb7cd
3 changed files with 89 additions and 7 deletions
+12
View File
@@ -22,3 +22,15 @@ export function getOpenCodeCommandDirs(options: OpenCodeConfigDirOptions): strin
])
)
}
export function getOpenCodeSkillDirs(options: OpenCodeConfigDirOptions): string[] {
const configDir = getOpenCodeConfigDir(options)
const parentConfigDir = getParentOpencodeConfigDir(configDir)
return Array.from(
new Set([
join(configDir, "skills"),
...(parentConfigDir ? [join(parentConfigDir, "skills")] : []),
])
)
}