feat(skill): built-in opencode-meta skill#26617
Merged
Merged
Conversation
Loads automatically and gives the model the actual shape of opencode.json, agent/skill/plugin/MCP/permission definitions when it's asked to edit opencode's own config. Avoids the recurring failure mode where the model hallucinates a config shape and opencode hard-fails on startup. Override via shadowing on disk (drop a same-named SKILL.md). No env flag because skills as a category have no config-level disable today, so adding one only here would be inconsistent.
…ated fields - Rename skill from opencode-meta to customize-opencode (better matches user intent, 'customize' is the verb users actually type). - Rewrite the body in positive form: drop the wrong/right 'common shape mistakes' table, fold the disambiguation into a short list of positive shape statements per top-level field. - Drop deprecated surfaces from the documented shapes: the deprecated 'mode' alias for 'agent', and the deprecated per-agent 'tools' field. - Tighten prose throughout.
Default-on for dev/beta/local channels (mirrors the rollout pattern used by OPENCODE_EXPERIMENTAL_HTTPAPI before it graduated). Stable users opt in via the env var. Set =false to force off, =true to force on. Factor the channel-default check into an unstableDefault() helper so future experiments with the same rollout shape can reuse it.
The skill defaults ON for the 'local' channel (where CI runs), which made
disk-discovery tests off-by-one ('returns empty array when no skills
exist' returned 1, 'discovers N skills' returned N+1). Force the flag
off in preload so existing skill counts hold.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Users keep hitting
ConfigInvalidErrorstartup crashes because the model writes invalidopencode.jsonshapes when asked to edit opencode itself. opencode hard-fails on invalid config by design, so a hallucinated field name produces a cryptic error and a stuck session. Recent Discord example: askills:field written as an array of{name, path}objects instead of{paths: [...]}.This PR ships a built-in skill,
customize-opencode, that documents the actual schemas. The skill is registered before disk discovery so a user can shadow it by dropping a same-namedSKILL.md.Rollout: gated, default-on for unstable channels
Behind
OPENCODE_EXPERIMENTAL_CUSTOMIZE_SKILL. Defaults:dev,beta,local: ON. Internal users dogfood it.prod,latest: OFF. Stable users opt in.OPENCODE_EXPERIMENTAL_CUSTOMIZE_SKILL=falseforces off,=trueforces on.This mirrors the rollout pattern used by
OPENCODE_EXPERIMENTAL_HTTPAPIbefore it graduated. Factored into a smallunstableDefault()helper inflag.tsso future experiments with the same shape can reuse it.What's in the skill
V1 surface only (Dax's V2 work is not described):
opencode.jsontop-level shape with the only accepted formsskillsis an object withpathsand/orurls, not an array") so the model gets the disambiguation it needs without a wrong/right tableSKILL.md, frontmatter rules)type, thecommand: []requirementOPENCODE_DISABLE_PROJECT_CONFIGetc.) for when a user's config is broken and opencode won't startDeprecated surfaces are not documented (the
mode:alias foragent:, the per-agenttools:boolean map).Trigger description
Gated narrowly using the patterns Anthropic and the community have settled on (front-loaded keywords,
Use ONLY when…, explicit negative clause):Goal: the skill stays quiet when the user is doing normal coding work in their own project.
How it's wired
Skill.state, so user-disk skills with the same name override it.import CUSTOMIZE_OPENCODE_SKILL_BODY from \"./prompt/customize-opencode.md\" with { type: \"text\" }. Adds an ambient*.mddeclaration inpackages/opencode/src/markdown.d.tsfor tsgo.packages/opencode/src/skill/prompt/customize-opencode.md, mirroring how built-in agent prompts (agent/prompt/scout.txtetc.) are organized.Disable mechanism
OPENCODE_EXPERIMENTAL_CUSTOMIZE_SKILL=false.SKILL.md(built-in registers first, disk discovery overwrites).There is no config-level disable. Skills as a category have no
skill: { <name>: { disable: true } }mechanism today (only agents, mcp, formatter, lsp do). If/when that's added, this skill is disable-able for free along with every other built-in.Open questions for review
dev/beta/localdefault-on the right rollout shape, or do you want stable-channel users to also see it from day one?Test plan
bun run typecheckfrompackages/opencodecleanopencode.json, confirm it produces{paths: [...]}not the array-of-objects shapeOPENCODE_EXPERIMENTAL_CUSTOMIZE_SKILL=false, restart, confirm the skill does not appear