diff options
| author | Aiden Cline <[email protected]> | 2026-04-30 11:15:53 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-30 11:15:53 -0500 |
| commit | ffe0314c47302cbb4aac505e5fe2b36472f6f68e (patch) | |
| tree | 7fb06082880ddb41316537e6c70326182e791591 /packages | |
| parent | 375444a149780c7121bd8964685c4bfe8edd1870 (diff) | |
| download | opencode-ffe0314c47302cbb4aac505e5fe2b36472f6f68e.tar.gz opencode-ffe0314c47302cbb4aac505e5fe2b36472f6f68e.zip | |
fix: ensure disabling OPENCODE_DISABLE_CLAUDE_CODE_SKILLS doesnt disable external skills too (#25123)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/core/src/flag/flag.ts | 2 | ||||
| -rw-r--r-- | packages/opencode/src/skill/index.ts | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/packages/core/src/flag/flag.ts b/packages/core/src/flag/flag.ts index 72c8931f5..a3b8133b6 100644 --- a/packages/core/src/flag/flag.ts +++ b/packages/core/src/flag/flag.ts @@ -47,7 +47,7 @@ export const Flag = { OPENCODE_DISABLE_CLAUDE_CODE, OPENCODE_DISABLE_CLAUDE_CODE_PROMPT: OPENCODE_DISABLE_CLAUDE_CODE || truthy("OPENCODE_DISABLE_CLAUDE_CODE_PROMPT"), OPENCODE_DISABLE_CLAUDE_CODE_SKILLS, - OPENCODE_DISABLE_EXTERNAL_SKILLS: OPENCODE_DISABLE_CLAUDE_CODE_SKILLS || truthy("OPENCODE_DISABLE_EXTERNAL_SKILLS"), + OPENCODE_DISABLE_EXTERNAL_SKILLS: truthy("OPENCODE_DISABLE_EXTERNAL_SKILLS"), OPENCODE_FAKE_VCS: process.env["OPENCODE_FAKE_VCS"], OPENCODE_SERVER_PASSWORD: process.env["OPENCODE_SERVER_PASSWORD"], OPENCODE_SERVER_USERNAME: process.env["OPENCODE_SERVER_USERNAME"], diff --git a/packages/opencode/src/skill/index.ts b/packages/opencode/src/skill/index.ts index 701ecaba8..9750742f9 100644 --- a/packages/opencode/src/skill/index.ts +++ b/packages/opencode/src/skill/index.ts @@ -20,7 +20,8 @@ import * as Log from "@opencode-ai/core/util/log" import { Discovery } from "./discovery" const log = Log.create({ service: "skill" }) -const EXTERNAL_DIRS = [".claude", ".agents"] +const CLAUDE_EXTERNAL_DIR = ".claude" +const AGENTS_EXTERNAL_DIR = ".agents" const EXTERNAL_SKILL_PATTERN = "skills/**/SKILL.md" const OPENCODE_SKILL_PATTERN = "{skill,skills}/**/SKILL.md" const SKILL_PATTERN = "**/SKILL.md" @@ -152,15 +153,19 @@ const discoverSkills = Effect.fnUntraced(function* ( ) { const state: ScanState = { matches: new Set(), dirs: new Set() } + const externalDirs: string[] = [] if (!Flag.OPENCODE_DISABLE_EXTERNAL_SKILLS) { - for (const dir of EXTERNAL_DIRS) { + if (!Flag.OPENCODE_DISABLE_CLAUDE_CODE_SKILLS) externalDirs.push(CLAUDE_EXTERNAL_DIR) + externalDirs.push(AGENTS_EXTERNAL_DIR) + + for (const dir of externalDirs) { const root = path.join(Global.Path.home, dir) if (!(yield* fsys.isDir(root))) continue yield* scan(state, root, EXTERNAL_SKILL_PATTERN, { dot: true, scope: "global" }) } const upDirs = yield* fsys - .up({ targets: EXTERNAL_DIRS, start: directory, stop: worktree }) + .up({ targets: externalDirs, start: directory, stop: worktree }) .pipe(Effect.catch(() => Effect.succeed([] as string[]))) for (const root of upDirs) { |
