Repository navigation
Description
Problem
When launching OpenCode with a specific agent, all skills are loaded into context, even those unrelated to the agent's purpose. There's no way for an agent to declare which skills it needs.
This matters because:
- Context budget is finite. Loading irrelevant skill descriptions wastes tokens.
- Auto-invocation noise: The model may consider skills that are irrelevant to the agent's domain.
- Plugin authors building multi-domain plugins (SRE + backend + frontend) can't scope skills per agent.
Current state
OpenCode supports per-agent tool permissions (allow/deny/ask with wildcards), which is great for controlling tool access. However, this doesn't extend to skill loading — all discovered skills are loaded into context regardless of which agent is active.
Proposed solution
Allow agents to declare which skills they need via a skills field in their frontmatter. When an agent is active, only those skills' descriptions are loaded into context.
Agent declares its skills
# .opencode/agents/sre.md
---
description: "SRE agent for incident response and infrastructure tasks"
skills: ["sre-runbook", "kubernetes", "incident-response"]
---
You are an SRE agent...# .opencode/agents/backend-developer.md
---
description: "Backend development agent"
skills: ["api-scaffold", "db-migration", "code-review"]
---
You are a backend development agent...Behavior
- Agent with
skills: [...]→ only loads descriptions for those skills - Agent without
skillsfield → current behavior, loads all skill descriptions - Skills not in the list are not loaded into context and cannot be invoked
Alternative: skill tags
If a skills array feels too rigid, agents could declare tags instead:
# .opencode/agents/sre.md
---
description: "SRE agent"
skill-tags: ["sre", "infra"]
---# .opencode/skills/sre-runbook/SKILL.md
---
name: sre-runbook
tags: ["sre"]
---Skills matching any of the agent's skill-tags would be loaded.
Use case
Multi-domain engineering plugins with agents and skills for different domains (SRE, backend, frontend). When an SRE agent is active, backend scaffolding skills shouldn't consume context budget. Today there's no way to scope this — all skills load regardless of which agent is active.
Activity
github-actions commentedon Mar 26, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:(all caps) to match the required format.Please edit this issue to address the above within 2 hours, or it will be automatically closed.
If you believe this was flagged incorrectly, please let a maintainer know.