Skip to content

Commit a6ac76a

Browse files
author
bcode
committed
simplify: delete customize-opencode entirely, no env-var gate
Per user: env-var gate added unnecessary surface area. The skill teaches opencode.json schema authoring; for BrowserCode that's the wrong product surface, so don't ship it at all. Removes the const + import + registration block (about 17 lines), and the now-orphaned 377-line prompt body. Net diff: -388 lines.
1 parent dd1fab3 commit a6ac76a

2 files changed

Lines changed: 6 additions & 408 deletions

File tree

packages/opencode/src/skill/index.ts

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { Glob } from "@opencode-ai/core/util/glob"
1616
import * as Log from "@opencode-ai/core/util/log"
1717
import { Skills as BcodeSkills } from "@browser-use/bcode-browser/skills"
1818
import { Discovery } from "./discovery"
19-
import CUSTOMIZE_OPENCODE_SKILL_BODY from "./prompt/customize-opencode.md" with { type: "text" }
2019
import { isRecord } from "@/util/record"
2120

2221
const log = Log.create({ service: "skill" })
@@ -26,15 +25,6 @@ const EXTERNAL_SKILL_PATTERN = "skills/**/SKILL.md"
2625
const OPENCODE_SKILL_PATTERN = "{skill,skills}/**/SKILL.md"
2726
const SKILL_PATTERN = "**/SKILL.md"
2827

29-
// Built-in skill that ships with opencode. The model's intuition for what an
30-
// opencode.json should look like is often wrong, and opencode hard-fails on
31-
// invalid config, so users hit cryptic startup errors. Loading this skill
32-
// when the model is asked to touch opencode's own config files gives it the
33-
// actual schemas instead of guesses.
34-
const CUSTOMIZE_OPENCODE_SKILL_NAME = "customize-opencode"
35-
const CUSTOMIZE_OPENCODE_SKILL_DESCRIPTION =
36-
"Use ONLY when the user is editing or creating opencode's own configuration: opencode.json, opencode.jsonc, files under .opencode/, or files under ~/.config/opencode/. Also use when creating or fixing opencode agents, subagents, skills, plugins, MCP servers, or permission rules. Do not use for the user's own application code, or for any project that is not configuring opencode itself."
37-
3828
export const Info = Schema.Struct({
3929
name: Schema.String,
4030
description: Schema.optional(Schema.String),
@@ -269,27 +259,12 @@ export const layer = Layer.effect(
269259
const state = yield* InstanceState.make(
270260
Effect.fn("Skill.state")(function* () {
271261
const s: State = { skills: {}, dirs: new Set() }
272-
// BrowserCode gate: the upstream `customize-opencode` built-in is
273-
// off-by-default in BrowserCode. The skill describes opencode.json,
274-
// opencode plugins, opencode agents — not useful for browser-driving
275-
// sessions, and registering it unconditionally pollutes the system
276-
// prompt with negative-signal content (eval data showed a measurable
277-
// regression on browser-task scores when this skill was forced on).
278-
// Set BCODE_ENABLE_CUSTOMIZE_OPENCODE=1 to opt back in for sessions
279-
// where the user is actually editing bcode.json or agent configs.
280-
// Skipped registration happens BEFORE disk discovery, so a user-disk
281-
// skill named `customize-opencode` still loads normally.
282-
const customizeEnabled =
283-
process.env.BCODE_ENABLE_CUSTOMIZE_OPENCODE === "1" ||
284-
process.env.BCODE_ENABLE_CUSTOMIZE_OPENCODE?.toLowerCase() === "true"
285-
if (customizeEnabled) {
286-
s.skills[CUSTOMIZE_OPENCODE_SKILL_NAME] = {
287-
name: CUSTOMIZE_OPENCODE_SKILL_NAME,
288-
description: CUSTOMIZE_OPENCODE_SKILL_DESCRIPTION,
289-
location: "<built-in>",
290-
content: CUSTOMIZE_OPENCODE_SKILL_BODY,
291-
}
292-
}
262+
// BrowserCode-specific: the upstream `customize-opencode` built-in
263+
// registration was removed here. The skill teaches the model
264+
// opencode.json / opencode plugin authoring and is irrelevant to
265+
// browser-driving workflows; eval traces showed it correlated with
266+
// a score regression. A user-disk skill of the same name still
267+
// loads normally through the regular discovery path.
293268
yield* loadSkills(s, yield* InstanceState.get(discovered), bus)
294269
return s
295270
}),

0 commit comments

Comments
 (0)