GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(skill): add per-agent filtering to skill tool description by malhashemi · Pull Request #6000 · anomalyco/opencode

Conversation

@malhashemi

@malhashemi malhashemi commented Dec 23, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Implements per-agent skill filtering in the <available_skills> tool description, completing the feature originally proposed in #5930.

After #5930 was merged, the maintainer simplified it by removing per-agent filtering from the tool description (permissions were only checked at execution time). This PR adds the infrastructure to pass agent context to tool initialization, enabling the skill tool to filter its description based on agent permissions.

Problem

Without this change, agents see ALL skills in <available_skills>, including ones they can't use (permission = deny). This leads to:

  • Wasted tokens listing inaccessible skills
  • Agent confusion when it tries to load a denied skill
  • Poor UX when certain skills should be hidden from certain agents

Solution

Pass agent context through the tool initialization chain so the skill tool can filter <available_skills> by permissions.

Changes

Infrastructure (tool.ts, registry.ts, prompt.ts)

  • Add InitContext interface with optional agent field to Tool namespace
  • Update Tool.Info.init signature to accept (ctx?: InitContext)
  • Update ToolRegistry.tools() to accept optional agent and pass it to each tool's init()
  • Pass agent from SessionPrompt.resolveTools() to ToolRegistry.tools()

Skill Tool (tool/skill.ts)

  • Rewrite using explicit Tool.Info<typeof parameters> typing
  • Filter accessibleSkills by agent permissions in init(ctx)
  • Only skills where Wildcard.all(skill.name, permissions) !== "deny" appear in <available_skills>

Skill Registry (skill/skill.ts)

  • Add duplicate skill name detection with warning log

Behavior

With config:

{
  "permission": {
    "skill": {
      "documents-*": "deny",
      "experimental-*": "ask",
      "*": "allow"
    }
  }
}
Skill In <available_skills>? On Execute
documents-* ❌ Hidden Rejected
experimental-* ✅ Shown Prompts user
Others ✅ Shown Loads immediately

Agent-specific overrides work as expected:

# In agent frontmatter
permission:
  skill:
    "documents-*": "allow"  # This agent CAN see and use documents-* skills

Testing

  • ✅ bun run typecheck passes
  • ✅ bun test passes (320 pass, 1 skip)
  • ✅ Manually tested with multiple agents and permission patterns
  • Backwards compatible: existing tools without init(ctx) usage are unaffected

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@malhashemi
feat(skill): add per-agent filtering to skill tool description
565c46a
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 anomalyco#5930 per maintainer feedback.
@malhashemi
malhashemi marked this pull request as draft December 23, 2025 00:32
@malhashemi malhashemi mentioned this pull request Dec 23, 2025
feat: add native skill tool with permission system #5930
Merged
@malhashemi
docs(skills): add permission system documentation
8d216cb
- Update intro to mention on-demand loading via skill tool
- Add 'Configure permissions' section with pattern examples
- Add 'Override per agent' section for agent-specific permissions
- Add 'Disable the skill tool' section
- Update troubleshooting to include permission checks
@malhashemi
malhashemi marked this pull request as ready for review December 23, 2025 00:52
@thdxr
thdxr merged commit 3a54ab6 into anomalyco:dev Dec 23, 2025
@airtonix airtonix mentioned this pull request Dec 23, 2025
feat(agent): add per-agent skills filtering #5987
Closed
malhashemi added a commit to malhashemi/opencode-skills that referenced this pull request Dec 23, 2025
@malhashemi
docs!: deprecate plugin - skills now native in OpenCode v1.0.190+
396332a
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:
- anomalyco/opencode#5930 (v1.0.190)
- anomalyco/opencode#6000 (v1.0.191)
@malhashemi malhashemi mentioned this pull request Dec 23, 2025
v1.0.0: Deprecate plugin - skills now native in OpenCode malhashemi/opencode-skills#54
Merged
malhashemi added a commit to malhashemi/opencode-skills that referenced this pull request Dec 23, 2025
@malhashemi
docs!: deprecate plugin - skills now native in OpenCode v1.0.190+
0b8cfbc
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:
- anomalyco/opencode#5930 (v1.0.190)
- anomalyco/opencode#6000 (v1.0.191)
malhashemi added a commit to malhashemi/opencode-skills that referenced this pull request Dec 23, 2025
@malhashemi
docs!: deprecate plugin - skills now native in OpenCode v1.0.190+ (#54)
fa75b67
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:
- anomalyco/opencode#5930 (v1.0.190)
- anomalyco/opencode#6000 (v1.0.191)
@taqtiqa-mark taqtiqa-mark mentioned this pull request Dec 23, 2025
Support for "Skills" #3235
Closed
@malhashemi
malhashemi deleted the feat/skill-per-agent-filtering branch December 23, 2025 22:42
rekram1-node pushed a commit that referenced this pull request Dec 27, 2025
@malhashemi @rekram1-node
feat(skill): add per-agent filtering to skill tool description (#6000)
30e6af1
@zikajk zikajk mentioned this pull request Dec 30, 2025
Support skills editor-code-assistant/eca#241
Closed
@marcusquinn marcusquinn mentioned this pull request Feb 25, 2026
feat(agent): add subagents config for per-agent task tool filtering #7271
Closed
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
@malhashemi
feat(skill): add per-agent filtering to skill tool description (anoma…
eda7169
…lyco#6000)
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
@malhashemi
feat(skill): add per-agent filtering to skill tool description (anoma…
b488dd8
…lyco#6000)
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
@malhashemi
feat(skill): add per-agent filtering to skill tool description (anoma…
0f755f5
…lyco#6000)
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
@malhashemi
feat(skill): add per-agent filtering to skill tool description (#6000)
fdf5645
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
@malhashemi
feat(skill): add per-agent filtering to skill tool description (anoma…
3d2d86b
…lyco#6000)
androidand pushed a commit to androidand/opencode-skein that referenced this pull request Sep 19, 2026
@malhashemi @rekram1-node
feat(skill): add per-agent filtering to skill tool description (anoma…
7d265f0
…lyco#6000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@malhashemi @thdxr
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.