github / github/copilot-cli

Agent profiles and namespacing for user-level custom agents

未關閉
#2,898 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area:agents area:configuration
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Describe the feature or problem you'd like to solve

User-level Copilot custom agents in ~/.copilot/agents/ have two compounding issues at scale:

1. **No namespacing.** The .agent.md filename is the agent's identity and the key for dedupe across the documented scope chain (system > repository > organization). When multiple teams independently publish an agent named, e.g., code-reviewer.agent.md, installing more than one into ~/.copilot/agents/ causes overwrites on disk. There is no way to distinguish "Team A's code-reviewer" from "Team B's code-reviewer."

2. **No user-level scoping.** Every agent in ~/.copilot/agents/ is available in every copilot session regardless of the current repo or task. /agents and --agent name space become long and noisy, and subagent routing has more candidates to disambiguate than necessary. There is no per-session or per-context filter that scales beyond manually curating the directory.

### Proposed solution

1. **Namespacing.** Add a namespace (or publisher) field to the agent YAML frontmatter, producing qualified identifiers like teamA/code-reviewer. The namespace participates in identity, dedupe, invocation (copilot --agent teamA/code-reviewer), and display. Unqualified names still work for back-compat but emit a warning on collision.

2. **Agent profiles.** Named profiles (e.g., work-backend, personal) that specify which user-level agents are active. The active profile could be selected via slash command (/profile work-backend), CLI flag (copilot --profile work-backend), config.json under COPILOT_HOME, and optionally auto-selected based on CWD or repo. Only agents in the active profile appear in /agents, resolve via --agent, or participate in subagent routing. All installed agents remain on disk.
Namespacing fixes identity; profiles fix relevance. Together they give organizations a practical path at scale.

### Alternatives considered

1. Rename-on-install (e.g., teamA-code-reviewer.agent.md) — works today but is ad-hoc, breaks author-intended names, and has no tooling support.
2. Per-repo installs in .github/agents/ — requires copying into every repo and doesn't fit agents that are genuinely user-scoped.
3. Org-level agents — helpful for canonical agents but doesn't address intentional diversity across teams or personal use.

### Example prompts or workflows

### Additional context

Related FR issue for VSCode GitHub Copilot: https://github.com/microsoft/vscode/issues/311920

貢獻指南

開啟貢獻指南

研究方向

Start with the existing ~/.copilot/agents/ discovery and the /agents, --agent, and subagent-routing entry points; the issue names no implementation files or tests. Trace how config.json under COPILOT_HOME is loaded before assessing namespace identity and profile selection. Done would include a maintainer-approved design and coverage for collision handling, qualified invocation, and profile filtering.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
shell
領域
cli, developer-experience
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
冷清
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。