feat(skill): add hidden frontmatter field to skills#29193
Open
phalla-doll wants to merge 2 commits into
Open
Conversation
Add a hidden boolean field to skill frontmatter, mirroring the existing AgentConfig.hidden field. Skills with hidden: true are excluded from the LLM tool description (available_skills) but remain accessible via the /skills dialog and the skill tool for manual invocation. Closes anomalyco#29189
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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
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.
Issue for this PR
Closes #29189
Type of change
What does this PR do?
Adds a
hiddenboolean field to skill frontmatter, mirroring the existingAgentConfig.hiddenfield for agents.Users with many project skills see all of them surfaced in the LLM tool description (
<available_skills>) on every turn. This clutters context and wastes tokens for skills that should only be invoked manually.hidden: truekeeps the skill registered and loadable by name, just not proactively suggested.Changes in
packages/opencode/src/skill/index.ts:Infoschema — addedhidden: Schema.optional(Schema.Boolean)isSkillFrontmatterguard — acceptshidden?: booleanadd()function — storeshiddenfrom parsed frontmatteravailable()method — filters out skills wherehidden === trueHow did you verify your code works?
Verified manually by reviewing the code paths:
skill.available()(used by tool description) now filters hidden skillsskill.all()(used by/skillsdialog and server API) remains unchanged — hidden skills are still browseableskill.require()(used byskilltool) remains unchanged — hidden skills are still loadable by name/autocomplete already skips skills (unrelated to this change)Full typecheck requires the project tsgo toolchain which is not available outside the CI environment.
Screenshots / recordings
N/A — no UI changes.
Checklist