skill can't find scripts path #4204

Closed
opened 2026-02-16 17:43:01 -05:00 by yindo · 8 comments
Owner

Originally created by @sunjiawe on GitHub (Jan 4, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

I only use the following relative paths relative to the skill's directory in the Claude code skill declaration, and Claude skills can execute scripts correctly.

uv run scripts/tasks.py list

However, using opencode does not execute the command correctly; it thinks the script does not exist.
I have a solution: change the relative path to be relative to the project root directory, but I think this is not friendly for skill portability.

Plugins

No response

OpenCode version

1.1.1

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @sunjiawe on GitHub (Jan 4, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description I only use the following relative paths relative to the skill's directory in the Claude code skill declaration, and Claude skills can execute scripts correctly. ``` uv run scripts/tasks.py list ``` However, using opencode does not execute the command correctly; it thinks the script does not exist. I have a solution: change the relative path to be relative to the project root directory, but I think this is not friendly for skill portability. ### Plugins _No response_ ### OpenCode version 1.1.1 ### 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:43:01 -05:00
yindo closed this issue 2026-02-16 17:43:01 -05:00
Author
Owner

@louis-marchant commented on GitHub (Jan 5, 2026):

It seems to me that references made in the SKILL.md confuse the agent, and often the agent 'expects' that the references (in your case scripts/tasks.py) is relative to the repo, not to where the SKILL.md is.

On top of that, the agent by default has to ask to access files that are outside the workspace (which ~/.config/opencode/skill/* is). I'm not sure if that makes the model less inclined to pick it up, or what, but for me the model basically 'never' reads referenced information, only the skill itself, unless I explicitly ask it to read all referenced files.

@louis-marchant commented on GitHub (Jan 5, 2026): It seems to me that references made in the `SKILL.md` confuse the agent, and often the agent 'expects' that the references (in your case `scripts/tasks.py`) is relative to the repo, not to where the SKILL.md is. On top of that, the agent by default has to ask to access files that are outside the workspace (which `~/.config/opencode/skill/*` is). I'm not sure if that makes the model less inclined to pick it up, or what, but for me the model basically 'never' reads referenced information, only the skill itself, unless I explicitly ask it to read all referenced files.
Author
Owner

@neominik commented on GitHub (Jan 13, 2026):

The specification actually specifies quite clearly that files should be referenced with paths relative to the skill root. However, I'm not sure if it is the task of the harness (opencode) or the skills system prompt to enable this.

@neominik commented on GitHub (Jan 13, 2026): The [specification](https://agentskills.io/specification#file-references) actually specifies quite clearly that files should be referenced with paths relative to the skill root. However, I'm not sure if it is the task of the harness (opencode) or the skills system prompt to enable this.
Author
Owner

@WangBiaoxuan commented on GitHub (Jan 22, 2026):

Same problem,Can anyone solve this problem?

@WangBiaoxuan commented on GitHub (Jan 22, 2026): Same problem,Can anyone solve this problem?
Author
Owner

@samholder commented on GitHub (Jan 31, 2026):

A similar problem in that files found in the references folder for the skill are not always loaded when the skill is in the global config folders.

In my skill I try to be explicit to say that the agent should load the references from the same directory as the skill, which helps, but its doesn't always load the referenced files

@samholder commented on GitHub (Jan 31, 2026): A similar problem in that files found in the references folder for the skill are not always loaded when the skill is in the global config folders. In my skill I try to be explicit to say that the agent should load the references from the same directory as the skill, which helps, but its doesn't always load the referenced files
Author
Owner

@bakaburg1 commented on GitHub (Feb 2, 2026):

same here

@bakaburg1 commented on GitHub (Feb 2, 2026): same here
Author
Owner

@adampoit commented on GitHub (Feb 2, 2026):

On top of that, the agent by default has to ask to access files that are outside the workspace (which ~/.config/opencode/skill/* is).

I was able to get around this by adding the following to my config:

  "permission": {
    "external_directory": {
      "/Users/.../.config/opencode/skill/**": "allow"
    }
  },

It would be very nice if this directory were auto-allowed though.

@adampoit commented on GitHub (Feb 2, 2026): > On top of that, the agent by default has to ask to access files that are outside the workspace (which `~/.config/opencode/skill/*` is). I was able to get around this by adding the following to my config: ``` "permission": { "external_directory": { "/Users/.../.config/opencode/skill/**": "allow" } }, ``` It would be very nice if this directory were auto-allowed though.
Author
Owner

@rekram1-node commented on GitHub (Feb 3, 2026):

Our skill support is poor, i'm going to do a pass on it:

  • auto approve permission for the skill dirs
  • adjust prompting so it is more clear to agent where resources/scripts/etc live and can be invoked from

These are the main 2 but it just needs a pass it is lacking significantly

@rekram1-node commented on GitHub (Feb 3, 2026): Our skill support is poor, i'm going to do a pass on it: - auto approve permission for the skill dirs - adjust prompting so it is more clear to agent where resources/scripts/etc live and can be invoked from These are the main 2 but it just needs a pass it is lacking significantly
Author
Owner

@louis-marchant commented on GitHub (Feb 3, 2026):

Would you add read permission or write as well? I can see both pros and cons on being able to always create/edit a skill without permission checks regardless of where you are using opencode.

@louis-marchant commented on GitHub (Feb 3, 2026): Would you add read permission or write as well? I can see both pros and cons on being able to always create/edit a skill without permission checks regardless of where you are using opencode.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4204