Unable to recognize skills in the custom configuration folder #4792

Closed
opened 2026-02-16 17:45:27 -05:00 by yindo · 3 comments
Owner

Originally created by @wiskewu on GitHub (Jan 11, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Unable to recognize skills in the custom configuration folder
无法识别自定义配置文件夹下的skills

I set the environment variable OPENCODE_CONFIG_DIR according to the documentation and launched OpenCode, but the slash command cannot recognize the skills in this directory.
我根据文档设置环境变量OPENCODE_CONFIG_DIR,并启动opencode,但通过斜杠命令无法识别这个目录下的skills

So I pulled the source code and added two lines of debugging code at https://github.com/anomalyco/opencode/blob/68ed664a3f08c64061af0781bbcc345ebd245f5a/packages/opencode/src/skill/skill.ts#L106.
于是我拉取了源代码,并在https://github.com/anomalyco/opencode/blob/68ed664a3f08c64061af0781bbcc345ebd245f5a/packages/opencode/src/skill/skill.ts#L106处增加了两行调试代码:

 // Scan .opencode/skill/ directories
    console.log('Config.directories:', await Config.directories())
    for (const dir of await Config.directories()) {
      console.log('Scanning for skills in directory:', dir);
      for await (const match of OPENCODE_SKILL_GLOB.scan({
        cwd: dir,
        absolute: true,
        onlyFiles: true,
        followSymlinks: true,
      })) {
        await addSkill(match)
      }
    }

Then run bun dev debug skill, and below is its output.
然后运行bun dev debug skill,下面是他的输出:

Scanning for skills in directory: C:\Users\DELL\.config\opencode
Scanning for skills in directory: E:\ghcodes\opencode\.opencode
Scanning for skills in directory: E:/AI-projects/opencodecfg/ocfg
[
  {
    "name": "test-skill",
    "description": "use this when asked to test skill",
    "location": "E:\\ghcodes\\opencode\\.opencode\\skill\\test-skill\\SKILL.md"
  },
  {
    "name": "ui-ux-pro-max",
    "description": "UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.",
    "location": "E:\\AI-projects\\opencodecfg\\ocfg\\skill\\ui-ux-pro-max\\SKILL.md"
  },
  {
    "name": "smart-docs",
    "description": "AI-powered comprehensive codebase documentation generator. Analyzes project structure, identifies architecture patterns, creates C4 model diagrams, and generates professional technical documentation. Use when users need to document codebases, understand software architecture, create technical specs, or generate developer guides. Supports all programming languages. Alternative to Litho/deepwiki-rs that uses Claude Code subscription without external API costs.",
    "location": "E:\\AI-projects\\opencodecfg\\ocfg\\skill\\smart-docs\\SKILL.md"
  },
  // ...other skills, too long to display.
]

As you can see, the code can read the skills in the custom configuration directory, but it cannot read these skills by using OpenCode's forward slash or by asking the AI.
可以看到代码是可以读取到自定义配置目录下的skills的,但通过opencode的斜杠或者询问AI,却无法读取到这些skills。

Plugins

oh-my-opencode

OpenCode version

1.1.8

Steps to reproduce

  1. open windows terminal, and run $env:OPENCODE_CONFIG_DIR="E:/AI-projects/opencodecfg/ocfg"; opencode
  2. when opencode starts, run / or askwhat skills do you have?

Screenshot and/or share link

my custom config dir:

Image

debug output:

Image

slash / command did not list my skills:

Image

AI's answer to what skills do you have?:

Image

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @wiskewu on GitHub (Jan 11, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Unable to recognize skills in the custom configuration folder 无法识别自定义配置文件夹下的skills I set the environment variable OPENCODE_CONFIG_DIR according to the documentation and launched OpenCode, but the slash command cannot recognize the skills in this directory. 我根据文档设置环境变量OPENCODE_CONFIG_DIR,并启动opencode,但通过斜杠命令无法识别这个目录下的skills So I pulled the source code and added two lines of debugging code at <https://github.com/anomalyco/opencode/blob/68ed664a3f08c64061af0781bbcc345ebd245f5a/packages/opencode/src/skill/skill.ts#L106>. 于是我拉取了源代码,并在<https://github.com/anomalyco/opencode/blob/68ed664a3f08c64061af0781bbcc345ebd245f5a/packages/opencode/src/skill/skill.ts#L106>处增加了两行调试代码: ```ts // Scan .opencode/skill/ directories console.log('Config.directories:', await Config.directories()) for (const dir of await Config.directories()) { console.log('Scanning for skills in directory:', dir); for await (const match of OPENCODE_SKILL_GLOB.scan({ cwd: dir, absolute: true, onlyFiles: true, followSymlinks: true, })) { await addSkill(match) } } ``` Then run `bun dev debug skill`, and below is its output. 然后运行`bun dev debug skill`,下面是他的输出: ```txt Scanning for skills in directory: C:\Users\DELL\.config\opencode Scanning for skills in directory: E:\ghcodes\opencode\.opencode Scanning for skills in directory: E:/AI-projects/opencodecfg/ocfg [ { "name": "test-skill", "description": "use this when asked to test skill", "location": "E:\\ghcodes\\opencode\\.opencode\\skill\\test-skill\\SKILL.md" }, { "name": "ui-ux-pro-max", "description": "UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient.", "location": "E:\\AI-projects\\opencodecfg\\ocfg\\skill\\ui-ux-pro-max\\SKILL.md" }, { "name": "smart-docs", "description": "AI-powered comprehensive codebase documentation generator. Analyzes project structure, identifies architecture patterns, creates C4 model diagrams, and generates professional technical documentation. Use when users need to document codebases, understand software architecture, create technical specs, or generate developer guides. Supports all programming languages. Alternative to Litho/deepwiki-rs that uses Claude Code subscription without external API costs.", "location": "E:\\AI-projects\\opencodecfg\\ocfg\\skill\\smart-docs\\SKILL.md" }, // ...other skills, too long to display. ] ``` As you can see, the code can read the skills in the custom configuration directory, but it cannot read these skills by using OpenCode's forward slash or by asking the AI. 可以看到代码是可以读取到自定义配置目录下的skills的,但通过opencode的斜杠或者询问AI,却无法读取到这些skills。 ### Plugins oh-my-opencode ### OpenCode version 1.1.8 ### Steps to reproduce 1. open windows terminal, and run `$env:OPENCODE_CONFIG_DIR="E:/AI-projects/opencodecfg/ocfg"; opencode` 2. when opencode starts, run `/` or ask`what skills do you have?` ### Screenshot and/or share link my custom config dir: <img width="1244" height="941" alt="Image" src="https://github.com/user-attachments/assets/c47edbb3-8460-41fb-8a00-8a84f7f162ce" /> debug output: <img width="1918" height="1071" alt="Image" src="https://github.com/user-attachments/assets/8af8f2cb-9e02-4f2f-9e3d-94a5e45c6f1b" /> slash `/` command did not list my skills: <img width="1839" height="325" alt="Image" src="https://github.com/user-attachments/assets/aacb261f-3071-4d15-b485-e6eb1aef0b28" /> AI's answer to `what skills do you have?`: <img width="1903" height="1047" alt="Image" src="https://github.com/user-attachments/assets/f198ebf1-051d-4270-b71b-d650ef5a45cc" /> ### Operating System Windows 11 ### Terminal Windows Terminal
yindo added the windowsbug labels 2026-02-16 17:45:27 -05:00
yindo closed this issue 2026-02-16 17:45:27 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 11, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6266: Does opencode actually support finding skills at .claude/skills? (Questions about configuring skill directories)
  • #6551: opencode doesn't respect CLAUDE_CONFIG_DIR environment variable (Similar issue with custom config directory environment variables)
  • #7418: Opencode not detecting sending skills when mentioned (Skills not being recognized from custom config directories on Windows 11)
  • #3610: OPENCODE_CONFIG_DIR is broken since 0.15.30 when only world-readable (Environment variable configuration issues)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 11, 2026): This issue might be a duplicate of existing issues. Please check: - #6266: Does opencode actually support finding skills at `.claude/skills`? (Questions about configuring skill directories) - #6551: opencode doesn't respect CLAUDE_CONFIG_DIR environment variable (Similar issue with custom config directory environment variables) - #7418: Opencode not detecting sending skills when mentioned (Skills not being recognized from custom config directories on Windows 11) - #3610: OPENCODE_CONFIG_DIR is broken since 0.15.30 when only world-readable (Environment variable configuration issues) Feel free to ignore if none of these address your specific case.
Author
Owner

@wiskewu commented on GitHub (Jan 11, 2026):

other informations in case you may want to know about, my root config under ~/.config/opencode:

Image
@wiskewu commented on GitHub (Jan 11, 2026): other informations in case you may want to know about, my root config under `~/.config/opencode`: <img width="1920" height="1080" alt="Image" src="https://github.com/user-attachments/assets/9543e519-49a9-4124-a1f4-6829500774fd" />
Author
Owner

@wiskewu commented on GitHub (Jan 15, 2026):

@rekram1-node Through code debugging, I discovered that the oh-my-opencode plugin was affecting OpenCode's skill lookup. I'm sorry, this isn't an OpenCode issue; you can close this issue now. Thank you. I will resubmit this question in the oh-my-opencode project.
我通过代码调试发现是 oh-my-opencode 这个插件影响了 opencode 本身对skills的查找。很抱歉,这个并不是 opencode 的问题,你们可以关闭这个 issue 了,谢谢。我将会到 oh-my-opencode 那个项目中重新提这个问题。

After disabling the plugin, everything worked as predicted.
在关闭插件之后,一切都正常了。

Image Image
@wiskewu commented on GitHub (Jan 15, 2026): @rekram1-node Through code debugging, I discovered that the `oh-my-opencode` plugin was affecting `OpenCode`'s skill lookup. I'm sorry, this isn't an `OpenCode` issue; you can close this issue now. Thank you. I will resubmit this question in the `oh-my-opencode` project. 我通过代码调试发现是 oh-my-opencode 这个插件影响了 opencode 本身对skills的查找。很抱歉,这个并不是 opencode 的问题,你们可以关闭这个 issue 了,谢谢。我将会到 oh-my-opencode 那个项目中重新提这个问题。 After disabling the plugin, everything worked as predicted. 在关闭插件之后,一切都正常了。 <img width="503" height="131" alt="Image" src="https://github.com/user-attachments/assets/f25267f9-3a2b-42fb-90e8-7a2894b5e952" /> <img width="1878" height="850" alt="Image" src="https://github.com/user-attachments/assets/0da6180d-eaab-483f-b571-3f015df33753" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4792