Skip to content

Install the skill where opencode actually looks - #624

Merged
jeremy merged 1 commit into
mainfrom
fix/opencode-skill-path
Aug 5, 2026
Merged

Install the skill where opencode actually looks#624
jeremy merged 1 commit into
mainfrom
fix/opencode-skill-path

Conversation

@jeremy

@jeremy jeremy commented Aug 5, 2026

Copy link
Copy Markdown
Member

Closes part of #617.

skillLocations offered OpenCode targets at skill/, singular. opencode reads skills/, plural — it has never read either path we wrote.

{Name: "OpenCode (Global)",  Path: "~/.config/opencode/skill/basecamp/SKILL.md"},
{Name: "OpenCode (Project)", Path: ".opencode/skill/basecamp/SKILL.md"},

Why this failed silently, twice

That list is both the wizard's install targets and the refresh set, so one typo broke two things:

  • The wizard. Picking "OpenCode (Global)" in basecamp skill wrote a file opencode would never load, then reported success.
  • The refresh loop. refreshAllInstalledSkills only visits paths in this list and skips ones that don't exist. An opencode user who put the skill at the plural path by hand never got it refreshed on upgrade.

Verification

Real binaries, temp HOME, stale SKILL.md pre-placed at ~/.config/opencode/skills/basecamp/:

Build That file after a run
origin/main still reads STALE
this branch byte-identical to the embedded skill

~/.agents/skills/basecamp/SKILL.md is refreshed by both, which is the next point.

The skill already worked in opencode

opencode also searches ~/.agents/skills/<name>/SKILL.md — the canonical target installSkillFiles has always written. So this fixes the wizard and the refresh loop, not first-run coverage. Nobody was unable to use the skill in opencode; some people were told they'd installed it somewhere it wasn't.

About the test

The existing refresh test built its opencode path from the same wrong spelling the code used, so it asserted the bug was working. The new TestSkillLocationsMatchAgentSearchPaths pins the literals instead of deriving them, so a test can't mirror the typo again.

Not in this PR

#617 also raises opencode plugin parity with what Codex got in #550 — hooks, not just a skill. opencode plugins are JS/TS modules in .opencode/plugins/ or npm packages named in opencode.json: a different mechanism from both existing manifests, and a new artifact for this repo to build, version-stamp and ship. That wants a decision before it wants code, so it stays out of here. The path fix may well be all #617 actually needs.

Frontmatter needs no change — opencode wants name + description with name matching the directory, which skills/basecamp/SKILL.md already satisfies.

Search paths confirmed at https://opencode.ai/docs/skills/. bin/ci green.


Summary by cubic

Fixes the OpenCode skill install and refresh paths to use skills/ so OpenCode actually loads the file; the wizard and refresh loop now work as expected. Part of #617.

  • Bug Fixes
    • Update skillLocations for OpenCode (Global/Project) from skill/ to skills/.
    • Add TestSkillLocationsMatchAgentSearchPaths to pin literal paths.
    • Update the refresh test to use the plural OpenCode path.

Written for commit 3176e94. Summary will update on new commits.

Review in cubic

skillLocations offered "OpenCode (Global)" and "OpenCode (Project)" at
`skill/`, singular. opencode reads `skills/`, plural. It has never read
either path we wrote.

That list is both the wizard's install targets and the refresh set, so the
typo failed in both directions and silently in both. Picking OpenCode in
`basecamp skill` wrote a file opencode would never load, and reported
success. An opencode user who installed the skill the plural way by hand
then never got it refreshed on upgrade, because the refresh loop only
visits paths in this list and skips ones that don't exist.

Verified against real binaries into a temp HOME, with a stale SKILL.md
pre-placed at ~/.config/opencode/skills/basecamp/: the pre-fix build leaves
it reading "STALE", this build rewrites it byte-identical to the embedded
skill.

Worth recording: the skill already worked in opencode regardless, because
opencode also searches ~/.agents/skills/<name>/SKILL.md, which is the
canonical target `installSkillFiles` has always written. So this fixes the
wizard and the refresh loop, not first-run coverage.

The new test pins the literal paths instead of deriving them. The existing
refresh test built its opencode path from the same wrong spelling the code
had, so it asserted the bug was working.

Search paths: https://opencode.ai/docs/skills/
Copilot AI balanced review requested due to automatic review settings August 5, 2026 08:31
@github-actions github-actions Bot added commands CLI command implementations tests Tests (unit and e2e) labels Aug 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jeremy
jeremy merged commit 7aac5fd into main Aug 5, 2026
24 of 25 checks passed
@jeremy
jeremy deleted the fix/opencode-skill-path branch August 5, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants