github / github/copilot-cli

Agent-scoped skills in plugins to prevent context bloat

未关闭
#2,207 0 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
area:agents area:context-memory area:plugins
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### 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)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。