github / github/copilot-cli

Support `@include` / `extends` in instruction files to reference external URLs or repos

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

描述

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

Instruction files are currently static and self-contained. There is no way to share common conventions across repos or teams without duplicating files — either manually copying them into every repo or requiring each contributor to set up `~/.copilot/instructions/` locally.

### Proposed solution

Introduce an `extends` or `@include` directive in instruction files (similar to Renovate's extends or ESLint's extends) that allows referencing external instruction files by URL or GitHub path:

```yaml
---
extends:
- "github:mu88/dotfiles/.copilot/instructions/dotnet.instructions.md"
- "https://raw.githubusercontent.com/org/shared/.github/instructions/security.instructions.md"
applyTo: "**/*.cs"
---
```

### Example prompts or workflows

1. A maintainer publishes shared .NET conventions in a dotfiles repo — every project references them with one line, zero duplication.
2. A new contributor clones a repo and immediately gets all team conventions — no local setup required.
3. An org updates shared security guidelines in one place; all repos pick up the change automatically.

### Additional context

`COPILOT_CUSTOM_INSTRUCTIONS_DIRS` already allows pointing to external directories, but requires manual per-machine setup. A declarative `extends` in the instruction file itself would be zero-config for contributors and composable by design.

Note: Organization-level instructions already exist for GitHub organizations. This request addresses the gap for personal account repositories and zero-config contributor onboarding.

贡献指南

打开贡献指南

调研方向

Start by reviewing the existing instruction-file handling and the COPILOT_CUSTOM_INSTRUCTIONS_DIRS behavior mentioned in the issue. Define how the listed GitHub paths and URLs are resolved and verify that referenced instructions are applied alongside local files, including the YAML front matter examples shown here.

由索引模型根据 Issue 内容生成。

评估

技术栈
github, markdown, yaml
领域
developer-experience, tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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