{"meta":{"title":"Copilot自定义备忘单","intro":"比较 GitHub Copilot 的不同自定义选项。","product":"GitHub Copilot","breadcrumbs":[{"href":"/zh/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/zh/enterprise-cloud@latest/copilot/reference","title":"参考资料"},{"href":"/zh/enterprise-cloud@latest/copilot/reference/customization-cheat-sheet","title":"自定义备忘单"}],"documentType":"article"},"body":"# Copilot自定义备忘单\n\n比较 GitHub Copilot 的不同自定义选项。\n\nGitHub Copilot 提供了多种自定义功能，使你可以根据工作流、团队的标准和项目需求定制其行为。 使用下表查找适合你的使用场景的表格。\n\n## 功能概述\n\n此表显示了每个自定义功能及其所在位置。\n\n| 功能 / 特点                                                                                                                                                                                                                 | 介绍                             | 文件名和位置                        |\n| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ----------------------------- |\n| [自定义指令](/zh/enterprise-cloud@latest/copilot/concepts/prompting/response-customization)                                                                                                                                  | 始终在线的上下文，自动应用于其定义范围内的每个交互      |                               |\n| `.github/copilot-instructions.md`（存储库范围）、`.github/instructions/*.instructions.md`（路径特定）、`AGENTS.md`（第三方智能体），或通过 GitHub 上的 UI 设置个人/组织                                                                                    |                                |                               |\n| [提示文件](/zh/enterprise-cloud@latest/copilot/concepts/prompting/response-customization?tool=vscode#about-prompt-files)                                                                                                    | 使用输入变量的可重用独立提示模板               | `.github/prompts/*.prompt.md` |\n| [Custom agents](/zh/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent/about-custom-agents)                                                                                                                    | 具有自己的说明、工具限制和上下文的专家角色          |                               |\n| `.github/agents/AGENT-NAME.md`（存储库）、组织的 `.github` 或 `.github-private` 存储库中的 `/agents/AGENT-NAME.md`（组织级别）、指定的 `.github-private` 存储库中的 `/agents/AGENT-NAME.md`（企业级）或用户配置文件                                               |                                |                               |\n| [Subagents](/zh/enterprise-cloud@latest/copilot/how-tos/chat-with-copilot/chat-in-ide#using-subagents)                                                                                                                  | 由主代理创建的独立代理在隔离的上下文中处理委托工作      | N/A （运行时进程，而不是用户配置的文件）        |\n| [代理技能](/zh/enterprise-cloud@latest/copilot/concepts/agents/about-agent-skills)                                                                                                                                          | 在与任务相关时 Copilot 加载的指令、脚本和资源文件夹 |                               |\n| `.github/skills/<skill-name>/SKILL.md`、 `.claude/skills/<skill-name>/SKILL.md`、或 `.agents/skills/<skill-name>/SKILL.md` （项目）; `~/.copilot/skills/<skill-name>/SKILL.md` 或 `~/.agents/skills/<skill-name>/SKILL.md` （个人） |                                |                               |\n| [挂钩](/zh/enterprise-cloud@latest/copilot/concepts/agents/hooks)                                                                                                                                                         | 在代理工作流中的特定点执行确定性的自定义 shell 命令  | `.github/hooks/*.json`        |\n| [MCP 服务器](/zh/enterprise-cloud@latest/copilot/concepts/context/mcp)                                                                                                                                                     | 连接到外部系统、API 和数据库               |                               |\n| `mcp.json`（路径因 IDE 而异）、GitHub 上的存储库 MCP 设置（适用于 cloud agent 和 Copilot code review），或 `mcp-servers` 配置中的 custom agent 属性                                                                                                  |                                |                               |\n\n## 使用情况比较\n\n此表可帮助你确定要使用的自定义功能。\n\n| 功能 / 特点                                                                                                              | 如何触发                                                    | 最适用于                    | 示例用例：                                                  |\n| -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ----------------------- | ------------------------------------------------------ |\n| [自定义指令](/zh/enterprise-cloud@latest/copilot/concepts/prompting/response-customization)                               | 自动                                                      | 在上下文中广泛应用的标准、准则或期望      | 强制实施编码标准、访问性规则、评审清单                                    |\n| [提示文件](/zh/enterprise-cloud@latest/copilot/concepts/prompting/response-customization?tool=vscode#about-prompt-files) | 手动：直接在聊天中引用或使用提示文件选取器                                   | 每次使用不同的输入运行一次专注的单个任务    | 生成单元测试，运行代码评审清单                                        |\n| [Custom agents](/zh/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent/about-custom-agents)                 | 手动：从您的 IDE 中的代理下拉列表中选择，或在 GitHub 上选择，或在 Copilot CLI 中选择 | 具有不同阶段且需专用能力或严格交接的流程或项目 | React 审阅者代理，只读审核代理                                     |\n| [Subagents](/zh/enterprise-cloud@latest/copilot/how-tos/chat-with-copilot/chat-in-ide#using-subagents)               | 自动化，或直接在提示中引用subagent                                   | 应独立于主代理运行的复杂子任务         | 代码库研究，运行测试套件                                           |\n| [代理技能](/zh/enterprise-cloud@latest/copilot/concepts/agents/about-agent-skills)                                       | 自动选择：由Copilot在与提示相关时选择                                  | 包含捆绑资产的多步骤工作流，应根据需要加载   |                                                        |\n| GitHub Actions 失败调试， 部署过程， 发行说明起草                                                                                    |                                                         |                         |                                                        |\n| [挂钩](/zh/enterprise-cloud@latest/copilot/concepts/agents/hooks)                                                      | 自动：在配置的生命周期事件中执行                                        | 需要在特定代理生命周期中运行的任务，并保证执行 | 在每次文件编辑后运行格式化程序，批准或拒绝工具执行，以及防止凭据泄漏 secret scanning     |\n| [MCP 服务器](/zh/enterprise-cloud@latest/copilot/concepts/context/mcp)                                                  | 自动或按名称请求特定工具                                            | 需要访问外部工具或实时数据的任务        | 管理问题和拉取请求（GitHub MCP 服务器）、自动化浏览器测试（Playwright MCP 服务器） |\n\n## IDE 和图面支持\n\n此表显示了每个 IDE 和图面支持哪些自定义功能。 有关完整 Copilot 特征矩阵，请参阅 [Copilot特征矩阵](/zh/enterprise-cloud@latest/copilot/reference/copilot-feature-matrix#features-by-ide)。\n\nGitHub 建议使用最新的稳定 IDE Copilot CLI和 Copilot 扩展版本来获得最佳 Copilot 体验。\n\n**关键：**\n\n* • = 支持\n* ✗ = 不支持\n* P = 预览版\n\n\\| 功能 / 特点 | VS Code | Visual Studio | JetBrains IDE | Eclipse | Xcode |\nGitHub .com | Copilot CLI |\n\\|---------|:-------:|:-------------:|:---------:|:-------:|:-----:|:-------:|:---:|\n\\| 自定义指令 | ✓ | ✓ | P | P | P | ✓ | ✓ |\n\\| 提示文件 | ✓ | ✓ | P | ✗ | P | ✗ | ✗ |\n\\| Custom agents | ✓ | ✓ | P | P | P | ✓ | ✓ |\n\\| Subagents | ✓ | ✗ | P | P | P | ✗ | ✓ |\n\\| 代理技能 | ✓ | ✓ | P | ✗ | ✗ | ✓ | ✓ |\n\\| 钩子 | P | ✗ | ✗ | ✗ | ✗ | ✓ | ✓ |\n\\| MCP 服务器 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |\n\n有关每个 IDE 和图面支持哪种类型的自定义指令的详细细分，请参阅 [支持不同类型的自定义说明](/zh/enterprise-cloud@latest/copilot/reference/custom-instructions-support)。\n\n## JetBrains IDE 中的代理自定义编辑器\n\n在 JetBrains IDE 中，可以使用代理自定义编辑器从一个位置管理多个 Copilot 自定义项。 在GitHub Copilot Chat面板中，单击右上角的设置图标，然后单击 **“自定义”。**\n\n在编辑器中，可以：\n\n* 查看和编辑 custom agents\n* 管理可重用技能\n* 配置工作区或个人指令\n* 管理提示文件\n* 选择适用于当前项目的**工作区**自定义，或可在不同项目中沿用的**个人**自定义\n\n有关在 JetBrains IDE 中创建存储库说明和提示文件的步骤，请参阅 [在 IDE 中添加 GitHub Copilot 的存储库自定义说明](/zh/enterprise-cloud@latest/copilot/how-tos/configure-custom-instructions-in-your-ide/add-repository-instructions-in-your-ide)。\n\n## 延伸阅读\n\n* [定制化库](/zh/enterprise-cloud@latest/copilot/tutorials/customization-library) — 精选的示例集合"}