Repository navigation
Description
Summary
V2 (opencode2) does not load skills from the compatibility source ~/.agents/skills, while V1 does. opencode debug skill shows agy -> ~/.agents/skills/agy/SKILL.md, but opencode2 /api/skill (and filesystem watchers) only show built-ins + ~/.config/opencode/skills. V2 docs list ~/.agents/skills as a global compatibility source, so this is a regression / missing parity.
Environment
- opencode version: 1.18.18 (brew, stable) — loads
~/.agents/skills/agycorrectly - opencode2 version: 0.0.0-next-17403 (next channel,
~/.opencode/bin/opencode2) - OS: Darwin 25.6.0 (darwin arm64) —
Darwin UCB-PXWCWTM9N9 25.6.0 Darwin Kernel Version 25.6.0: Fri Jul 31 19:18:43 PDT 2026; root:xnu-12377.161.14~5/RELEASE_ARM64_T8112 arm64 - Terminal: ghostty 1.3.1 —
TERM=xterm-256color,TERM_PROGRAM=ghostty,COLORTERM=truecolor - Shell: /bin/zsh
- Install/channel: next (service:
~/.opencode/bin/opencode2 serve --servicepid 39922,update check: latest=0.0.0-beta-17728, auto-update skipped: installation method not found) - Active plugins:
~/.config/opencode/plugins/herdr-agent-state.js(fails to load in V2:Missing key at ["default"]—export const HerdrAgentStatePluginbut V2 expectsexport default)
Reproduction
- Have a skill at
~/.agents/skills/agy/SKILL.md:with frontmatter:~/.agents/skills/agy/SKILL.md ~/.agents/skills/agy/scripts/agy-run.sh ~/.agents/skills/agy/references/*.mdname: agy description: >- Delegate a task to the Antigravity CLI (agy) in headless print mode...
opencode debug skill(V1) -> showsagy -> /Users/java1127/.agents/skills/agy/SKILL.md(total 3: customize-opencode, agy, skill-creator)curl -u opencode:$PASS "http://127.0.0.1:49374/api/skill?directory=$HOME" -H "Accept: application/json" | jq(V2 service) ->["opencode","report","skill-creator"]— noagycurl -u ... "/api/config?directory=$HOME"->[{"type":"document","path":"~/.config/opencode/opencode.json"}, {"type":"directory","path":"~/.config/opencode"}, {"type":"directory","path":"~/.opencode"}]— notype:"agents"entry for~/.agents~/.local/share/opencode/log/opencode.logwatchers for V2 location~show subscriptions for~/.config/opencode/skill,~/.config/opencode/skills,~/.opencode/skill,~/.opencode/skillsonly — no~/.agents/skillswatcher (expected fromopencode.config.skillpluginf()mappingagentstype ->join(path,"skills")).
Consistently reproducible. Also tested OPENCODE_TEST_HOME=/tmp/fake/.agents/skills/hello/SKILL.md with opencode2 debug config — still no agents entry.
Expected Behavior
V2 should auto-discover skills from the compatibility sources documented at https://opencode.ai/v2/docs/skills:
| Scope | Sources |
| Global compatibility | ~/.claude/skills, ~/.agents/skills |
| Project compatibility | .claude/skills, .agents/skills |
Discovery section states project sources are searched upward and within each source *.md at root and **/SKILL.md at any depth are discovered. Precedence section lists ~/.agents/skills after .claude/skills.
~/.agents/skills/agy/SKILL.md should appear in V2 /api/skill and be watchable, matching V1 external auto-loaded behavior (packages/core/src/plugin/skill/customize-opencode.md external row + packages/core/src/skill/index.ts scan with CLAUDE_EXTERNAL_DIR=".claude", AGENTS_EXTERNAL_DIR=".agents", EXTERNAL_SKILL_PATTERN="skills/**/SKILL.md").
Actual Behavior
V2 next-17403 ignores ~/.agents/skills entirely. No error is logged at INFO level (file-skip would be DEBUG skill file skipped). The running binary (strings ~/.opencode/bin/opencode2) does contain the opencode.config.skill plugin with type==="agents" source construction (join(O,"skills") for agents/claude entries) and Config.discover creating type:"agents" entries from T.isDir(~/.agents), yet at runtime no agents entry or watcher materializes and no skill is registered.
Additional Context
- V1 docs (
opencode debug skillbuilt-incustomize-opencodeskill) explicitly listExternal skills (auto-loaded) | ~/.claude/skills/<name>/SKILL.md, ~/.agents/skills/<name>/SKILL.md. - V2 binary
Config.discover(extracted viastrings) includes:andj=b_.make(join(A.home,".agents")), F=b_.make(join(A.home,".claude")), h_=[...new Set([...T.isDir(j)?[j]:[], ...c.filter(basename===".agents")])].map(i=>new f9({type:"agents",path:b_.make(i)}))
ConfigSkillPluginf()does:So the running service should createh=entries.flatMap(O=>O.type==="claude"?[O.path]:[]), $=entries.flatMap(O=>O.type==="agents"?[O.path]:[]), for(O of[...h,...$]) k(DirectorySource({path:join(O,"skills")}))
~/.agents/skillssource — but watchers prove it doesn't. - Workaround: add explicit
skillsconfig (V2 native array form afterA1.normalize:T.skills=[...paths,...urls]):This bypasses the missing compatibility source.// ~/.config/opencode/opencode.json { "$schema":"https://opencode.ai/config.json", "skills":["~/.agents/skills"] }
- Related: second
Location services bootedfor~/Library/CloudStorage/.../GC_voxelshows the service hosts multiple locations; both locations lack the agents source. - Herdr plugin load failure in V2 is unrelated but noted for completeness.
- No
OPENCODE_DISABLE_EXTERNAL_SKILLS/OPENCODE_DISABLE_CLAUDE_CODE_SKILLSset (checkedenv | grep OPENCODE). update check: current=0.0.0-next-17403 latest=0.0.0-beta-17728— not yet on the newer beta where the fix may exist.
Config for reference:
// ~/.config/opencode/opencode.json
{ "$schema":"https://opencode.ai/config.json" }~/.agents/skills/agy was verified isDir true and contains a valid SKILL.md that V1 parses.
Activity
github-actions commentedon Aug 21, 2026
This issue might be a duplicate of an existing issue. Please check:
.claude/.agentsskill discovery silently finds nothing. That issue covers v1.18.15; your report covers v2 (opencode2 next-17403), but both describe the compatibility skill sources (~/.agents/skills) not being loaded despite the code path appearing to exist. The underlying cause may be the same or closely related.If you find your issue is covered by #41213, feel free to add a comment there with your v2-specific findings and we can close this one as a duplicate.
sebastianw commentedon Oct 15, 2026
Confirming this on the 2.0.29 GA release (Homebrew,
latestchannel), and adding what I think is the root cause — plus a caveat that the~-prefixed workaround in this issue's body doesn't actually hold up whenOPENCODE_TEST_HOMEis set (which is the default for anyone running opencode undernono, a growing install path now that thenono-sandboxplugin/skill ships in thenolabs-aiopencode pack).Root cause:
OPENCODE_TEST_HOMEshadowsHOMEfor~/expansion in theskillsarrayEnv trace from the failing session:
$HOMEis correct; onlyOPENCODE_TEST_HOMEdiffers. Yet"skills": ["~/.agents/skills"]resolves to<OPENCODE_TEST_HOME>/.agents/skills(=/Users/<user>/repositories/work/skills/.agents/skills, which does not exist) instead of/Users/<user>/.agents/skills. The source is then silently dropped.The asymmetry that makes this hard to debug: global config at
~/.config/opencode/opencode.jsoncis still read from the real home (theskillsarray itself is parsed correctly), but the~/paths inside it are subsequently resolved againstOPENCODE_TEST_HOME. The config is honoured; the paths vanish.This also explains why the auto compat-scan of
~/.agents/skills(the original symptom in this issue) fails to fire under nono — same tilde-redirection.The workaround in this issue's body breaks under nono
Adding
"skills": ["~/.agents/skills"](as suggested above) produces zero watchers, zero registered skills, zero log lines whenOPENCODE_TEST_HOMEis set. Verified across five consecutive server boots in~/.local/share/opencode/log/opencode.log— the only.agentswatcher ispath=<cwd>/.agents type=file(the project-level compat marker scan, unrelated to the home source). No watcher on the real~/.agents/skillsever appears.Working workaround: absolute path
Absolute paths skip tilde expansion, so
OPENCODE_TEST_HOMEcan't intercept. After this change +opencode service restart+ a fresh session, the source registers and skills load.Probe matrix (identical procedure before/after the absolute-path fix)
~/.agents/skills(relative)find-skills~/.agents/skills/Unable to load skill find-skillscode-review~/.agents/skills/Unable to load skill code-reviewimplement~/.agents/skills/Unable to load skill implement@implementnono-sandbox(control)~/.config/opencode/skills/After the fix, 16 of the 39 skills in
~/.agents/skills/appear in the model's advertised skill list (the remainder setopencode/autoinvoke: falseby author intent and load via@skill-id). Skill footers readBase directory for this skill: /Users/<user>/.agents/skills/<id>.Minimal env-only repro (no sandbox strictly required)
Suggestions
HOME(notOPENCODE_TEST_HOME) for~/expansion in theskillsarray to match the docs (opencode.ai/v2/docs/skills says~/resolves "from the current user's home directory"), or document thatOPENCODE_TEST_HOMEaffects~/resolution for skill sources and clarify the precedence.skillsentry resolves to a nonexistent path (especially after env-var substitution). The silent-drop failure mode is what made this take hours instead of minutes.nono(and potentially other sandboxes/tools that setOPENCODE_TEST_HOME). The nono base profile setsOPENCODE_TEST_HOME=$WORKDIRdeliberately, as a compatibility workaround to keep instruction-init probing inside the sandbox grant — so users can't just unset it without breaking other things. The absolute-path workaround is safe and doesn't disturb that env var.(Note: #41213 — the V1 version of this bug — was closed by @thdxr on Oct 11 with "OpenCode 2.0 is now out…reopen or open a new one with your 2.0 version." This comment serves that purpose by attaching to the existing V2-tracked issue.)
opencodejr commentedon Oct 28, 2026
Thanks for the detailed report! I couldn't reproduce this on the current release.
I couldn't install
0.0.0-next-17403because it's no longer published, so I tested@opencode/[email protected]with a clean home folder containing:~/.agents/skills/agy/SKILL.md(withname: agyand a description)~/.config/opencode/opencode.jsoncontaining only$schemaAfter
opencode service start,opencode api skill.list(both for$HOMEand for a project directory) returnedagyfrom~/.agents/skills/agy/SKILL.md, along with the built-ins and a skill in~/.config/opencode/skills. Right after the service starts, the first call can briefly return only the built-in skills, so give it a few seconds.Your build is an early pre-release, and skill discovery has changed a lot since. Could you upgrade to the latest 2.x (
@opencode/cli), restart the service (opencode service restart) and check again? Ifagyis still missing, please reply with:opencode --versionopencode api skill.list | jq '[.data[].id]'opencode debug config~/.agentsor~/.agents/skillsis a symlinkRelated issues:
~/.agents/skillswhile the service runs aren't picked up untilopencode reloadskills/being created after.agentsalready exists.agents/skillswatcher loops and uses CPUopencodejr commentedon Oct 31, 2026
Closing this for now, since we haven't heard back. When I tested
@opencode/[email protected], a skill in~/.agents/skills/agy/SKILL.mdshowed up inopencode api skill.list. I couldn't test your build (0.0.0-next-17403) because it's no longer published, and skill discovery has changed a lot since then.If
~/.agents/skillsstill isn't picked up after you upgrade to the latest 2.x and runopencode service restart, please reply here or open a new issue with the output ofopencode --version,opencode api skill.list | jq '[.data[].id]'andopencode debug config, and we'll take another look. Thanks for the detailed report!