Skip to content

fix(opencode): include skill files when invoking via slash command - #37044

Closed
SakshamKapoor2911 wants to merge 1 commit into
anomalyco:devfrom
SakshamKapoor2911:fix-skill-command-files
Closed

fix(opencode): include skill files when invoking via slash command#37044
SakshamKapoor2911 wants to merge 1 commit into
anomalyco:devfrom
SakshamKapoor2911:fix-skill-command-files

Conversation

@SakshamKapoor2911

@SakshamKapoor2911SakshamKapoor2911 commented Jul 15, 2026

Copy link
Copy Markdown

Closes#24831

Type of change

  • Bug fix

What does this PR do?

/skill-name slash commands only injected the skill markdown body as prompt text, without the <skill_files> section that the skill tool provides. This meant referenced files (scripts, reference docs) in the skill directory were not discoverable by the model when using the slash command shortcut.

This fix scans the skill directory for files (excluding SKILL.md, up to 10) and appends a <skill_files> section to the command template, matching the format used by the skill tool (tool/skill.ts). Built-in skills with <built-in> location are unchanged.

Note: PR #35522 addresses the same issue. This implementation uses Glob.scanSync for a synchronous approach that doesn't require the template getter to return a Promise, and uses **/* to include files in subdirectories.

How did you verify your code works?

  • Typecheck in packages/opencode passes with no new errors
  • Output format matches the <skill_files> layout from tool/skill.ts
  • Uses Glob.scanSync so works inside the template getter

Screenshots / recordings

No UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actionsgithub-actionsBot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 15, 2026
@github-actions

github-actionsBot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Duplicate PR Found

PR #35522: fix(opencode): include skill files when invoking via slash command

This appears to be a duplicate of the current PR #37044. Both PRs have the identical title and address the same issue—including skill files when invoking via slash commands. PR #35522 likely covers the same bug fix regarding the <skill_files> section injection that the skill tool provides.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actionsgithub-actionsBot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 15, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/skill-name doesn’t invoke full skill system

1 participant

@SakshamKapoor2911