refactor(flags): migrate claude code skills flag to RuntimeFlags (#27605)

This commit is contained in:
Shoubhit Dash
2026-05-15 02:47:26 +05:30
committed by GitHub
parent 83c145f889
commit cccdeef294
5 changed files with 102 additions and 5 deletions

View File

@@ -11,6 +11,7 @@ import { Permission } from "@/permission"
import { AppFileSystem } from "@opencode-ai/core/filesystem"
import { Config } from "@/config/config"
import { ConfigMarkdown } from "@/config/markdown"
import { RuntimeFlags } from "@/effect/runtime-flags"
import { Glob } from "@opencode-ai/core/util/glob"
import * as Log from "@opencode-ai/core/util/log"
import { Discovery } from "./discovery"
@@ -165,6 +166,7 @@ const discoverSkills = Effect.fnUntraced(function* (
discovery: Discovery.Interface,
fsys: AppFileSystem.Interface,
global: Global.Interface,
disableClaudeCodeSkills: boolean,
directory: string,
worktree: string,
) {
@@ -172,7 +174,7 @@ const discoverSkills = Effect.fnUntraced(function* (
const externalDirs: string[] = []
if (!Flag.OPENCODE_DISABLE_EXTERNAL_SKILLS) {
if (!Flag.OPENCODE_DISABLE_CLAUDE_CODE_SKILLS) externalDirs.push(CLAUDE_EXTERNAL_DIR)
if (!disableClaudeCodeSkills) externalDirs.push(CLAUDE_EXTERNAL_DIR)
externalDirs.push(AGENTS_EXTERNAL_DIR)
for (const dir of externalDirs) {
@@ -239,9 +241,18 @@ export const layer = Layer.effect(
const bus = yield* Bus.Service
const fsys = yield* AppFileSystem.Service
const global = yield* Global.Service
const flags = yield* RuntimeFlags.Service
const discovered = yield* InstanceState.make(
Effect.fn("Skill.discovery")(function* (ctx) {
return yield* discoverSkills(config, discovery, fsys, global, ctx.directory, ctx.worktree)
return yield* discoverSkills(
config,
discovery,
fsys,
global,
flags.disableClaudeCodeSkills,
ctx.directory,
ctx.worktree,
)
}),
)
const state = yield* InstanceState.make(
@@ -291,6 +302,7 @@ export const defaultLayer = layer.pipe(
Layer.provide(Bus.layer),
Layer.provide(AppFileSystem.defaultLayer),
Layer.provide(Global.layer),
Layer.provide(RuntimeFlags.defaultLayer),
)
export function fmt(list: Info[], opts: { verbose: boolean }) {