@@ -20,7 +20,8 @@ import * as Log from "@opencode-ai/core/util/log"
2020import { Discovery } from "./discovery"
2121
2222const log = Log . create ( { service : "skill" } )
23- const EXTERNAL_DIRS = [ ".claude" , ".agents" ]
23+ const CLAUDE_EXTERNAL_DIR = ".claude"
24+ const AGENTS_EXTERNAL_DIR = ".agents"
2425const EXTERNAL_SKILL_PATTERN = "skills/**/SKILL.md"
2526const OPENCODE_SKILL_PATTERN = "{skill,skills}/**/SKILL.md"
2627const SKILL_PATTERN = "**/SKILL.md"
@@ -152,15 +153,19 @@ const discoverSkills = Effect.fnUntraced(function* (
152153) {
153154 const state : ScanState = { matches : new Set ( ) , dirs : new Set ( ) }
154155
156+ const externalDirs : string [ ] = [ ]
155157 if ( ! Flag . OPENCODE_DISABLE_EXTERNAL_SKILLS ) {
156- for ( const dir of EXTERNAL_DIRS ) {
158+ if ( ! Flag . OPENCODE_DISABLE_CLAUDE_CODE_SKILLS ) externalDirs . push ( CLAUDE_EXTERNAL_DIR )
159+ externalDirs . push ( AGENTS_EXTERNAL_DIR )
160+
161+ for ( const dir of externalDirs ) {
157162 const root = path . join ( Global . Path . home , dir )
158163 if ( ! ( yield * fsys . isDir ( root ) ) ) continue
159164 yield * scan ( state , root , EXTERNAL_SKILL_PATTERN , { dot : true , scope : "global" } )
160165 }
161166
162167 const upDirs = yield * fsys
163- . up ( { targets : EXTERNAL_DIRS , start : directory , stop : worktree } )
168+ . up ( { targets : externalDirs , start : directory , stop : worktree } )
164169 . pipe ( Effect . catch ( ( ) => Effect . succeed ( [ ] as string [ ] ) ) )
165170
166171 for ( const root of upDirs ) {
0 commit comments