github / github/copilot-cli

Add `.agents` discovery for instructions, agents, and hooks in any opened folder

未關閉
#4,204 2 則留言 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
Copilot CLI already uses `.agents/skills`; please extend the same `.agents` convention to instructions, agents, and hooks in any opened folder, not just Git repos.

### Proposed solution
This would let users standardize Copilot customizations under one root, `.agents/`, for any opened workspace/folder, whether or not it is a Git repository, instead of splitting them across `.github/`, `.claude/`, and `~/.copilot/`.

This request is specifically about the `.agents/` directory tree, not the root `AGENTS.md` file.

Requested default discovery additions:
- `/.agents/instructions/**/*.instructions.md`
- `/.agents/agents/*.agent.md` or the equivalent agent-file convention already used by the product
- `/.agents/hooks/**/*.json` (or the equivalent hook-file convention already used by the product)
- `~/.agents/instructions/**/*.instructions.md`
- `~/.agents/agents/*.agent.md` or the equivalent agent-file convention already used by the product
- `~/.agents/hooks/**/*.json` (or the equivalent hook-file convention already used by the product)

Note: `COPILOT_CUSTOM_INSTRUCTIONS_DIRS` already allows additional instruction directories today; this request is to make `.agents/instructions` a zero-config default. If user-level custom agents or hooks are not already supported, those would be new capability, but the request is still to make `.agents` the canonical root.

Behavioral expectations:
- Works for any opened folder/workspace, including folders that are not Git repositories
- Works consistently with `COPILOT_HOME`
- Discovery is documented and deterministic
- No silent partial loading for a path family
- `/help` and docs reflect the exact supported `.agents` locations

### Example prompts or workflows
1. "Load the repo's coding rules from `.agents/instructions` automatically."
2. "Use the release-notes agent from `.agents/agents`."
3. "Run the startup hook from `.agents/hooks` when I open a plain folder like D:\work\MyProjectOutsideGit."
4. "Keep my user-level instruction files under `~/.agents/` instead of splitting them across `.copilot/` and `.github/`."

### Additional context
Related but distinct: github/copilot-cli#2504 (cwd vs. git-root discovery within Git repos) and github/copilot-cli#1506 (configurable agents folder support). This request is about zero-config `.agents` defaults for any opened folder, Git or not.
This is additive parity, not a migration away from `.copilot` or `.github`.
If it is easier to triage, this could be split into separate issues for instructions / agents / hooks.

貢獻指南

開啟貢獻指南

研究方向

首先追蹤現有的 .agents/skills 探索機制,以及目前的 instruction、agent 和 hook loader,包括 COPILOT_HOME 的處理和 /help 輸出。接著,驗證一般資料夾和使用者層級路徑的探索情況,然後記錄確切支援的位置,以及在路徑族內不進行部分載入的決定性行為。

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

評估

技術堆疊
github, shell
領域
cli, developer-experience
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
活躍
描述清晰度
基本清楚
新手友好度
52/100

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

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