Skip to content

Agent-scoped skills in plugins to prevent context bloat #2207

@mdi1984

Description

@mdi1984

Describe the feature or problem you'd like to solve

When a plugin defines skills, all of those skills are injected into every session's context — regardless of whether any of the plugin's custom agents are active.

Proposed solution

Option 1 — agents field in SKILL.md frontmatter

Extend the SKILL.md frontmatter spec with an optional agents field (an array of agent names). If present, the skill is only activated when one of the listed agents is running. If omitted, the skill behaves as today (always available).

 name: deploy
 description: Deploy the current project to the staging environment.
 agents: [acme-devops]
 ---

 Instructions for the skill...

Option 2 — Skill-to-agent mapping in plugin.json

Alternatively (or additionally), allow the skills field in plugin.json to support an extended object syntax:

{
   "name": "my-company-plugin",
   "skills": [
     {
       "path": "skills/deploy",
       "agents": ["acme-devops"]
     },
     {
       "path": "skills/standards-audit",
       "agents": ["acme-maintain"]
     }
   ]
 }

Example prompts or workflows

No response

Additional context

There is currently no way for a plugin author to declare that a skill should only be available (i.e., injected into context) when a specific custom agent from that same plugin is in use.

This is particularly relevant for teams building company-internal plugins for GitHub Copilot CLI. Such a plugin might bundle:

  • A code review agent with skills for internal review checklists
  • A deployment agent with skills for internal CI/CD pipelines
  • A documentation agent with skills for internal writing standards
  • A maintenance agent with skills for internal package update policies

These are all legitimately part of one plugin — they share a common marketplace, versioning, and distribution mechanism. But they serve completely different use cases, and having all of their skills present in every session defeats the purpose of skills being "just-in-time" context (as described in the official docs: "Avoid overloading Copilot's context window with instructions that are not relevant to the current task").

Without agent-scoped skills, teams are forced to choose between:

  • One big plugin (convenient to install, but bloated context)
  • Many small plugins (clean context, but management overhead per user)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions