Skill Discovery Only Checks skills/ Directory, Ignoring skill/ Path #5010

Closed
opened 2026-02-16 17:47:39 -05:00 by yindo · 0 comments
Owner

Originally created by @aforthwith on GitHub (Jan 12, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Summary

The OpenCode skill discovery logic only searches in ~/.config/opencode/skills/ (plural) directories but ignores ~/.config/opencode/skill/ (singular), despite the documentation claiming both paths are valid discovery locations.

Impact

Users following the documented path (skill/ singular) will have their skills silently ignored with no error message, leading to confusion about why their skills aren't loading.

Root Cause

The glob pattern {skill,skills}/**/SKILL.md in Bun's Glob implementation was not correctly matching the skill/ (singular) directory path.

Fix Applied

Changed the glob pattern in packages/opencode/src/skill/skill.ts:39 from:

const OPENCODE_SKILL_GLOB = new Bun.Glob("{skill,skills}/**/SKILL.md")

To:

const OPENCODE_SKILL_GLOB = [new Bun.Glob("skill/**/SKILL.md"), new Bun.Glob("skills/**/SKILL.md")]

And updated the scanning loop to iterate over both glob patterns.

Files Changed

  • packages/opencode/src/skill/skill.ts

Test Case

mkdir -p ~/.config/opencode/skill/test-skill
cat > ~/.config/opencode/skill/test-skill/SKILL.md << 'EOF'
---
name: test-skill
description: A test skill
---
# Test Skill
This is a test.
EOF

opencode debug skill  # Should now show test-skill

Severity

Medium - Documentation/code inconsistency causing silent failures for users following official documentation.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @aforthwith on GitHub (Jan 12, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ## Summary The OpenCode skill discovery logic only searches in `~/.config/opencode/skills/` (plural) directories but ignores `~/.config/opencode/skill/` (singular), despite the documentation claiming both paths are valid discovery locations. ## Impact Users following the documented path (`skill/` singular) will have their skills silently ignored with no error message, leading to confusion about why their skills aren't loading. ## Root Cause The glob pattern `{skill,skills}/**/SKILL.md` in Bun's Glob implementation was not correctly matching the `skill/` (singular) directory path. ## Fix Applied Changed the glob pattern in `packages/opencode/src/skill/skill.ts:39` from: ```typescript const OPENCODE_SKILL_GLOB = new Bun.Glob("{skill,skills}/**/SKILL.md") ``` To: ```typescript const OPENCODE_SKILL_GLOB = [new Bun.Glob("skill/**/SKILL.md"), new Bun.Glob("skills/**/SKILL.md")] ``` And updated the scanning loop to iterate over both glob patterns. ## Files Changed - `packages/opencode/src/skill/skill.ts` ## Test Case ```bash mkdir -p ~/.config/opencode/skill/test-skill cat > ~/.config/opencode/skill/test-skill/SKILL.md << 'EOF' --- name: test-skill description: A test skill --- # Test Skill This is a test. EOF opencode debug skill # Should now show test-skill ``` ## Severity Medium - Documentation/code inconsistency causing silent failures for users following official documentation. ### Plugins _No response_ ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 17:47:39 -05:00
yindo closed this issue 2026-02-16 17:47:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#5010