Skip to content

Conversation

@malhashemi
Copy link
Contributor

@malhashemi malhashemi commented Jan 6, 2026

Summary

Restores the ability to filter skills based on agent permission rules, which was broken after the permission system overhaul in PR #6319.

  • Pass agent to ToolRegistry.tools() when building the tool registry
  • Filter skills using PermissionNext.evaluate() before generating the skill tool description
  • Only show skills that are not explicitly denied by the agent's permission rules

Example Usage

Agents can now control which skills are visible via frontmatter:

permission:
  read: allow
  skill:
    "*": deny
    "code-review": allow
    "skill-creator": allow

This will only show code-review and skill-creator in that agent's available skills.

Changes

  • packages/opencode/src/session/prompt.ts: Pass agent to ToolRegistry.tools()
  • packages/opencode/src/tool/skill.ts: Filter skills using PermissionNext.evaluate()

Closes #6857

Skills are now filtered based on agent permission rules when generating
the tool description. This restores the ability to customize which skills
are visible to each agent via frontmatter permissions.

Changes:
- Pass agent to ToolRegistry.tools() in session/prompt.ts
- Filter skills using PermissionNext.evaluate() in skill.ts
- Only show skills that are not explicitly denied

Closes anomalyco#6857
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

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

Results

I found one potentially related PR:

Related PR:

Conclusion:

No actual duplicates found. The current PR (#7042) is a fix for broken functionality rather than a duplicate effort. The only related PR is the earlier implementation (#5987) which this PR builds upon.

@malhashemi
Copy link
Contributor Author

@rekram1-node for your review 🙏

@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

lgtm

@rekram1-node rekram1-node merged commit 485aadc into anomalyco:dev Jan 6, 2026
3 checks passed
ruuxi pushed a commit to ruuxi/ngmicode that referenced this pull request Jan 7, 2026
@malhashemi malhashemi deleted the fix/skill-filtering-permissions branch January 7, 2026 03:17
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]: Bring back frontmatter-based skill filtering

2 participants