@@ -5,7 +5,6 @@ import { NamedError } from "@opencode-ai/core/util/error"
55import type { Agent } from "@/agent/agent"
66import { Bus } from "@/bus"
77import { InstanceState } from "@/effect/instance-state"
8- import { Flag } from "@opencode-ai/core/flag/flag"
98import { Global } from "@opencode-ai/core/global"
109import { Permission } from "@/permission"
1110import { AppFileSystem } from "@opencode-ai/core/filesystem"
@@ -14,7 +13,6 @@ import { ConfigMarkdown } from "@/config/markdown"
1413import { RuntimeFlags } from "@/effect/runtime-flags"
1514import { Glob } from "@opencode-ai/core/util/glob"
1615import * as Log from "@opencode-ai/core/util/log"
17- import { Plugin } from "@/plugin"
1816import { Discovery } from "./discovery"
1917import CUSTOMIZE_OPENCODE_SKILL_BODY from "./prompt/customize-opencode.md" with { type : "text" }
2018import { isRecord } from "@/util/record"
@@ -167,14 +165,15 @@ const discoverSkills = Effect.fnUntraced(function* (
167165 discovery : Discovery . Interface ,
168166 fsys : AppFileSystem . Interface ,
169167 global : Global . Interface ,
168+ disableExternalSkills : boolean ,
170169 disableClaudeCodeSkills : boolean ,
171170 directory : string ,
172171 worktree : string ,
173172) {
174173 const state : ScanState = { matches : new Set ( ) , dirs : new Set ( ) }
175174
176175 const externalDirs : string [ ] = [ ]
177- if ( ! Flag . OPENCODE_DISABLE_EXTERNAL_SKILLS ) {
176+ if ( ! disableExternalSkills ) {
178177 if ( ! disableClaudeCodeSkills ) externalDirs . push ( CLAUDE_EXTERNAL_DIR )
179178 externalDirs . push ( AGENTS_EXTERNAL_DIR )
180179
@@ -242,18 +241,19 @@ export const layer = Layer.effect(
242241 const bus = yield * Bus . Service
243242 const fsys = yield * AppFileSystem . Service
244243 const global = yield * Global . Service
245- const flags = yield * RuntimeFlags . Service
246- const discovered = yield * InstanceState . make (
247- Effect . fn ( "Skill.discovery" ) ( function * ( ctx ) {
248- return yield * discoverSkills (
249- config ,
250- discovery ,
251- fsys ,
252- global ,
253- flags . disableClaudeCodeSkills ,
254- ctx . directory ,
255- ctx . worktree ,
256- )
244+ const flags = yield * RuntimeFlags . Service
245+ const discovered = yield * InstanceState . make (
246+ Effect . fn ( "Skill.discovery" ) ( function * ( ctx ) {
247+ return yield * discoverSkills (
248+ config ,
249+ discovery ,
250+ fsys ,
251+ global ,
252+ flags . disableExternalSkills ,
253+ flags . disableClaudeCodeSkills ,
254+ ctx . directory ,
255+ ctx . worktree ,
256+ )
257257 } ) ,
258258 )
259259 const state = yield * InstanceState . make (
@@ -299,7 +299,6 @@ const flags = yield* RuntimeFlags.Service
299299
300300export const defaultLayer = layer . pipe (
301301 Layer . provide ( Discovery . defaultLayer ) ,
302- Layer . provide ( Plugin . defaultLayer ) ,
303302 Layer . provide ( Config . defaultLayer ) ,
304303 Layer . provide ( Bus . layer ) ,
305304 Layer . provide ( AppFileSystem . defaultLayer ) ,
0 commit comments