-
Notifications
You must be signed in to change notification settings - Fork 5.8k
feat: add native skill tool with permission system #5930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add skill tool for loading skill content on-demand - Support pattern-based skill permissions (allow/deny/ask) - Enable agent-specific permission overrides - Support nested skills with path-based IDs (e.g., prompter/skill-creator) - Filter available_skills in system prompt by agent permissions - Preserve skill tool responses during compaction pruning
Contributor
Author
|
@thdxr done boss |
67ca7cf to
b5a710c
Compare
malhashemi
added a commit
to malhashemi/opencode
that referenced
this pull request
Dec 23, 2025
Pass agent context through tool initialization chain so the skill tool can filter available_skills by agent permissions. Skills with 'deny' permission are hidden from the tool description, preventing agents from seeing skills they cannot access. Changes: - Add InitContext interface with optional agent to Tool namespace - Update ToolRegistry.tools() to accept and pass agent to init() - Filter skills in SkillTool.init() based on agent permissions - Add duplicate skill name warning in Skill.all() Follow-up to sst#5930 per maintainer feedback.
|
omg, i've been waiting for this feature so long and @malhashemi you implemented exactly how i wished. thank you so much!!! |
malhashemi
added a commit
to malhashemi/opencode-skills
that referenced
this pull request
Dec 23, 2025
BREAKING CHANGE: This plugin is deprecated. Skills functionality is now built into OpenCode natively. - Add graduation banner and migration guide - Document directory change (.opencode/skills/ → skill/) - Document config migration (tools → permission.skill) - Add Thank You section acknowledging community support - Promote opencode-sessions as the next plugin to try - Move original README to collapsed Historical Documentation section Native implementation PRs: - sst/opencode#5930 (v1.0.190) - sst/opencode#6000 (v1.0.191)
malhashemi
added a commit
to malhashemi/opencode-skills
that referenced
this pull request
Dec 23, 2025
BREAKING CHANGE: This plugin is deprecated. Skills functionality is now built into OpenCode natively. - Add graduation banner and migration guide - Document directory change (.opencode/skills/ → skill/) - Document config migration (tools → permission.skill) - Add Thank You section acknowledging community support - Promote opencode-sessions as the next plugin to try - Move original README to collapsed Historical Documentation section Native implementation PRs: - sst/opencode#5930 (v1.0.190) - sst/opencode#6000 (v1.0.191)
malhashemi
added a commit
to malhashemi/opencode-skills
that referenced
this pull request
Dec 23, 2025
BREAKING CHANGE: This plugin is deprecated. Skills functionality is now built into OpenCode natively. - Add graduation banner and migration guide - Document directory change (.opencode/skills/ → skill/) - Document config migration (tools → permission.skill) - Add Thank You section acknowledging community support - Promote opencode-sessions as the next plugin to try - Move original README to collapsed Historical Documentation section Native implementation PRs: - sst/opencode#5930 (v1.0.190) - sst/opencode#6000 (v1.0.191)
Closed
iljod
pushed a commit
to iljod/opencode
that referenced
this pull request
Dec 23, 2025
Co-authored-by: Dax Raad <[email protected]>
rekram1-node
pushed a commit
that referenced
this pull request
Dec 27, 2025
Co-authored-by: Dax Raad <[email protected]>
anntnzrb
pushed a commit
to anntnzrb/opencode-1
that referenced
this pull request
Dec 29, 2025
Co-authored-by: Dax Raad <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
skilltool for on-demand skill loading with pattern-based access controlFeatures
Skill Tool
Skills are now loaded on-demand via the native
skilltool. The agent sees available skills listed in<available_skills>and can load the full content when needed:Skill Permissions
Control which skills agents can access using pattern-based permissions in
opencode.json:{ "permission": { "skill": { "pr-review": "allow", "internal-*": "deny", "experimental-*": "ask", "*": "allow" } } }allowdenyaskPatterns support wildcards:
category-*matches all skills with that prefix.Agent-Specific Overrides
Override global permissions for specific agents. Useful for giving specialized agents access to restricted skills.
For custom agents (in agent frontmatter):
For built-in agents (in
opencode.json):{ "agent": { "plan": { "permission": { "skill": { "internal-*": "allow" } } } } }Disabling the Skill Tool
Completely disable the skill tool for agents that shouldn't use skills:
For custom agents:
For built-in agents:
{ "agent": { "plan": { "tools": { "skill": false } } } }When disabled, the
<available_skills>section is omitted from the system prompt entirely.Note: Skill tool responses are whitelisted from session compaction pruning to ensure loaded skill content remains available throughout the conversation.
Edited: Post-Merge Changes by Maintainer
The maintainer simplified the original implementation before merging:
Removed per-agent filtering from
<available_skills>: The original PR filtered skills in the tool description based on agent permissions. This was removed—all skills now appear in<available_skills>regardless of permissions.Permission checks remain at execution time only: Skills with
denypermission are rejected when the agent tries to load them, but they still appear in the skill list.Skill IDs changed to names: Skills are now identified by their
namefield from frontmatter, not path-based IDs. Skill names must be unique.Follow-up PR #6000 implements the per-agent filtering in the tool description by passing agent context to tool initialization.