Skip to content

Conversation

@kvnwolf
Copy link

@kvnwolf kvnwolf commented Jan 17, 2026

Summary

Allows plugins to bundle and expose skills by declaring paths in their return type:

export const MyPlugin: Plugin = async () => ({
  skill: ['./skills/pdf', './skills/docs/*']
})

This addresses a gap where plugins can export tool but not skill, making it difficult to distribute complete packages.

Changes

  • Added skill?: string[] to the Hooks interface in @opencode-ai/plugin
  • Created SkillRegistry to track skill paths from plugins
  • Modified Skill.state() to load skills from the registry with proper precedence:
    1. Global ~/.config/opencode/skill/ (lowest priority)
    2. Plugin skills
    3. Project .claude/skills/
    4. Project .opencode/skill/ (highest priority)
  • Added tests for plugin skill loading
  • Updated documentation

Related Issues

Why this approach?

As discussed in the issues, instead of creating a separate Skill Registry system or directory hooks, this leverages the existing plugin mechanism. Benefits:

  • No new infrastructure - npm remains the distribution mechanism
  • Consistent model - plugins can now bundle skills + tools + hooks together
  • Simple API - just an array of relative paths with glob support

Testing

bun test packages/opencode/test/skill/plugin-skill.test.ts

All 10 skill tests pass (6 existing + 4 new).

@github-actions
Copy link
Contributor

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

Based on my search results, I found one potentially related PR that addresses a similar feature:

Related PR:

The PR #9010 (current PR) appears to be the primary implementation for plugin skill support. While #8543 addresses a related feature around skill directories, it's a different approach than bundling skills through plugins. They may work together but don't appear to be duplicates—rather, they're complementary features.

Allow plugins to package and expose skills by declaring paths in their hooks:

  export const MyPlugin: Plugin = async () => ({
    skill: ['./skills/pdf', './skills/docs/*']
  })

Skills are resolved relative to the plugin file and loaded with proper
precedence (project skills override plugin skills override global skills).

Includes tests for the new functionality.
Users can now distribute reusable instructions (skills) alongside their plugins,
making it easier to share complete packages with tools and guidance together.
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.

[FEATURE]: Add Skill Configuration to Config Type

1 participant