Skip to content

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

Open
0xSkybreaker wants to merge 1 commit into
anomalyco:devfrom
0xSkybreaker:fix/skill-command-files
Open

fix(opencode): include skill files when invoking via slash command#35522
0xSkybreaker wants to merge 1 commit into
anomalyco:devfrom
0xSkybreaker:fix/skill-command-files

Conversation

@0xSkybreaker

Copy link
Copy Markdown

Issue for this PR

Closes #24831

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

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

The fix makes the skill command template include sampled files (up to 10) from the skill directory, matching the behavior of the skill tool (tool/skill.ts).

The change is in command/index.ts: for skills with a real location, the template now uses Glob.scan to list files and appends a <skill_files> section, same format as the skill tool output.

How did you verify your code works?

  • Verified TypeScript compiles cleanly in packages/opencode
  • The output format matches the existing <skill_files> format from tool/skill.ts
  • Built-in skills (with <built-in> location) are unchanged — they still return just the content

Screenshots / recordings

No UI change.

Checklist

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

Sign up for free to 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